@font-face {
  font-family: gloam;
  src: url(/assets/mono.woff) format("woff");
  font-weight: 800;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #b9b4c8;
  font-family: gloam, ui-monospace, monospace;
  font-weight: 800;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#tags { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  white-space: pre;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 0 3px #000, 0 0 2px #000;
}
.tag.me { color: #d8d2ff; }
.tag.foe { color: #b8ffd8; font-size: 10px; }
.tag .hpb { color: #ff5a4a; }
.dmg {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 13px;
  text-shadow: 0 0 3px #000;
  animation: rise 0.9s ease-out forwards;
}
@keyframes rise { to { margin-top: -34px; opacity: 0; } }
#hud { position: fixed; inset: 0; pointer-events: none; }
#stats {
  position: absolute;
  left: calc(10px + env(safe-area-inset-left));
  top: calc(8px + env(safe-area-inset-top));
  font-size: 12px;
  line-height: 1.35;
  background: #000a;
  padding: 6px 8px;
  border: 1px solid #2c2838;
}
#who { color: #d8d2ff; }
.bar span { color: #6d6880; margin-right: 6px; }
#hp { color: #e0473a; font-weight: 800; }
#mp { color: #6f7dff; font-weight: 800; }
#souls {
  position: absolute;
  right: calc(10px + env(safe-area-inset-right));
  top: calc(8px + env(safe-area-inset-top));
  font-size: 12px;
  color: #8affc1;
  background: #000a;
  padding: 6px 8px;
  border: 1px solid #2c2838;
}
#log {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #e8e0ff;
  text-align: center;
  text-shadow: 0 0 4px #000;
  white-space: pre;
}
#bar {
  position: absolute;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.slot {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid #3b3550;
  background: #07060cdd;
  color: #c9c2e6;
  font: inherit;
  font-size: 10px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  touch-action: none;
}
.slot .ico { display: block; font-size: 20px; line-height: 30px; margin-top: 6px; }
.slot .k { position: absolute; left: 4px; top: 2px; color: #6d6880; }
.slot .nm { display: block; color: #8d86a8; }
.slot .cd { position: absolute; left: 0; right: 0; bottom: 0; background: #000c; height: 0; }
.slot.low { color: #555; }
.slot.on { border-color: #b6a8ff; }
#stick {
  display: none;
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border: 1px dashed #4a4466;
  border-radius: 50%;
}
#knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1px solid #9a90c8;
  border-radius: 50%;
  background: #1a1630aa;
}
body.touch #bar {
  left: auto;
  right: calc(12px + env(safe-area-inset-right));
  transform: none;
  display: grid;
  grid-template-columns: 64px 64px;
  gap: 8px;
}
body.touch .slot { width: 64px; height: 64px; border-radius: 50%; }
body.touch .slot .k { display: none; }
#title {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(ellipse at center, #0008 0%, #000d 70%);
  padding: 16px;
  text-align: center;
}
#logo {
  margin: 0;
  color: #9a8cff;
  font-family: inherit;
  font-size: min(3.1vw, 15px);
  line-height: 1.05;
  text-shadow: 0 0 10px #5b46ff88;
}
.sub { margin: 0; color: #6d6880; font-size: 12px; }
.keys { margin: 0; color: #4f4a63; font-size: 11px; }
#start { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 8px; }
#name {
  font: inherit;
  font-size: 16px;
  background: #000;
  color: #e8e0ff;
  border: 1px solid #3b3550;
  padding: 8px 12px;
  width: 220px;
  text-align: center;
  outline: none;
}
#name:focus { border-color: #9a8cff; }
#start button {
  font: inherit;
  font-size: 15px;
  background: none;
  border: none;
  color: #c9bfff;
  cursor: pointer;
  padding: 6px;
}
#start button:hover, #start button:focus-visible { color: #fff; text-shadow: 0 0 8px #9a8cff; outline: none; }
#start button:disabled { color: #444; cursor: wait; }
#loading { margin: 0; color: #6d6880; font-size: 11px; }
