* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #1b0f2e; color: #fff8ec;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
canvas { display: block; width: 100%; height: 100%; }

#hud {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px;
  display: flex; justify-content: space-between; pointer-events: none;
}
.pill {
  background: rgba(0, 0, 0, .35); border-radius: 999px; padding: 6px 14px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px;
}
.pill .lbl { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; margin-right: 8px; }

.panel {
  position: fixed; inset: 0; margin: auto; width: min(92vw, 380px); height: fit-content;
  max-height: 92vh; overflow-y: auto;
  background: rgba(27, 15, 46, .92); border: 2px solid #f2b134; border-radius: 20px;
  padding: 24px 20px; text-align: center; backdrop-filter: blur(6px);
  transition: opacity .2s ease, transform .2s ease;
}
.panel.hidden { opacity: 0; transform: scale(.96); pointer-events: none; }
h1 { font-size: 34px; color: #f2b134; letter-spacing: .02em; }
h2 { font-size: 24px; color: #f2b134; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; opacity: .75; margin-bottom: 8px; }
.tag { margin: 8px 0 12px; opacity: .9; }
.hint { font-size: 14px; opacity: .75; margin-bottom: 18px; line-height: 1.4; }
kbd { background: #3a2560; border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.who, .status, .mine { font-size: 13px; opacity: .8; margin-top: 10px; min-height: 1em; }
.final { font-size: 48px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.final small { font-size: 14px; font-weight: 500; opacity: .7; margin-left: 6px; }

.btn {
  background: #f2b134; color: #1b0f2e; border: 0; border-radius: 999px;
  padding: 12px 36px; font-size: 18px; font-weight: 800; cursor: pointer;
  transition: transform .12s ease;
}
.btn:active { transform: scale(.96); }

.board { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 12px; margin: 14px 0 18px; text-align: left; }
.board ol { list-style: none; }
.board li {
  display: flex; gap: 10px; padding: 6px 4px; font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06); font-variant-numeric: tabular-nums;
}
.board li:last-child { border-bottom: 0; }
.board li .rk { width: 24px; opacity: .6; }
.board li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .sc { font-weight: 700; }
.board li.me { color: #f2b134; }
.board li.muted { opacity: .6; justify-content: center; }
