:root {
  --bg: #05070f;
  --panel: rgba(8, 14, 30, 0.78);
  --line: rgba(57, 243, 255, 0.35);
  --cyan: #39f3ff;
  --orange: #ff8a1f;
  --text: #d8f6ff;
  --dim: #7f9bb0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  -webkit-user-select: none;
  user-select: none;
}

#game { display: block; width: 100vw; height: 100vh; touch-action: none; }

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  width: min(340px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  backdrop-filter: blur(6px);
}

.title { font-weight: 700; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 10px; }
.title span { color: var(--dim); font-weight: 400; letter-spacing: 0.04em; }

#tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }

#tiers button {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: rgba(57, 243, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 4px;
  cursor: pointer;
  line-height: 1.2;
}
#tiers button b { display: block; font-size: 16px; color: var(--cyan); }
#tiers button.active { background: rgba(255, 138, 31, 0.18); border-color: var(--orange); }
#tiers button.active b { color: var(--orange); }

#notes { margin-top: 10px; font-size: 12.5px; }
#notes h3 { margin: 0 0 2px; font-size: 14px; color: var(--orange); }
#notes .era { color: var(--dim); margin-bottom: 6px; }
#notes ul { margin: 0; padding-left: 18px; }
#notes li { margin: 2px 0; }

#help {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--dim);
  text-align: right;
}
#help b { color: var(--text); font-weight: 600; }

#actions {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}
#actions button {
  font: 700 12px ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.08em;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 40px;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(6px);
}
#actions button.on { background: var(--orange); border-color: var(--orange); color: #1a0d00; }
#actions button[hidden] { display: none; }

#version {
  position: fixed;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--dim);
  opacity: 0.8;
  pointer-events: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #actions { top: auto; bottom: 150px; flex-direction: column; align-items: flex-end; }
}

#status {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  color: var(--cyan);
  font-size: 13px;
}

#touch { display: none; }

@media (pointer: coarse) {
  #help { display: none; }
  #touch { display: block; }
  #stick {
    position: fixed; left: 24px; bottom: 24px; width: 130px; height: 130px;
    border-radius: 50%; border: 2px solid var(--line); background: rgba(57, 243, 255, 0.06);
    touch-action: none;
  }
  #knob {
    position: absolute; left: 40px; top: 40px; width: 50px; height: 50px;
    border-radius: 50%; background: rgba(57, 243, 255, 0.45);
  }
  #jumpBtn {
    position: fixed; right: 24px; bottom: 40px; width: 92px; height: 92px; border-radius: 50%;
    border: 2px solid var(--orange); background: rgba(255, 138, 31, 0.2); color: var(--text);
    font: 700 14px ui-monospace, monospace; touch-action: none;
  }
  #hud { padding: 8px 10px; }
  #notes ul { display: none; }
}
