:root {
  --sky1: #0b1e3f;
  --sky2: #12408f;
  --cyan: #4fd1ff;
  --white: #f4f8ff;
  --gold: #ffd166;
  --red: #ff5d73;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--sky1); color: var(--white);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; touch-action: manipulation; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud { position: fixed; top: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 28px;
  font-weight: 800; font-size: clamp(18px, 3vw, 30px); pointer-events: none; text-shadow: 0 2px 8px #0008; }
#hud div { display: flex; flex-direction: column; align-items: center; }
#hud .label { font-size: 0.45em; letter-spacing: 2px; opacity: 0.7; }
#combo-box { border-radius: 12px; }
#combo-box.combo-up { color: var(--gold); text-shadow: 0 0 18px var(--gold); }
#mute { position: fixed; z-index: 5; top: 12px; right: 12px; min-height: 44px; padding: 8px 14px; font-size: 13px;
  letter-spacing: 1px; background: #0b1e3f; color: var(--white); border: 2px solid var(--cyan); box-shadow: none; }
#countdown { position: fixed; z-index: 4; inset: 0; display: grid; place-items: center; color: var(--gold);
  font-size: clamp(72px, 20vw, 180px); font-weight: 900; text-shadow: 0 4px 24px #000b; pointer-events: none; }

.panel { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 16px; text-align: center; background: radial-gradient(circle at 50% 30%, #12408fcc, #0b1e3ff0); }
h1 { font-size: clamp(42px, 9vw, 96px); letter-spacing: 6px; font-weight: 900; line-height: 1; }
h1 span { color: var(--cyan); }
h2 { font-size: 14px; letter-spacing: 3px; opacity: 0.8; margin-bottom: 6px; }
.tag { font-size: clamp(15px, 2.2vw, 22px); opacity: 0.9; }
.how { list-style: none; font-size: clamp(13px, 1.8vw, 17px); opacity: 0.85; line-height: 1.6; }
button { font: inherit; font-weight: 800; letter-spacing: 2px; font-size: clamp(18px, 2.6vw, 26px);
  padding: 14px 36px; border: none; border-radius: 40px; background: var(--cyan); color: var(--sky1); cursor: pointer;
  box-shadow: 0 6px 24px #4fd1ff66; }
button:active { transform: scale(0.97); }
button:focus-visible, #tag:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button.ghost { background: transparent; color: var(--white); border: 2px solid var(--white); box-shadow: none; }
button:hover { filter: brightness(1.08); }
.board-wrap { min-width: 240px; }
#board { list-style: none; font-family: Consolas, monospace; font-size: clamp(13px, 1.7vw, 17px); line-height: 1.5; }
#board li { display: flex; justify-content: space-between; gap: 24px; }
#board li:first-child { color: var(--gold); font-weight: 700; }
#attract { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: clamp(16px, 2.4vw, 24px); }
#attract-board { list-style: none; font-family: Consolas, monospace; font-size: clamp(18px, 2.6vw, 28px); line-height: 1.55; }
#attract-board li { display: flex; justify-content: space-between; gap: 32px; }
#attract-board li:first-child { color: var(--gold); font-weight: 800; }
.panel.attracting { background: radial-gradient(circle at 50% 35%, #12408f88, #0b1e3f99); justify-content: space-between; padding: 7vh 16px 3vh; }
.panel.attracting > .tag, .panel.attracting > .how, .panel.attracting > #play,
.panel.attracting > .board-wrap, .panel.attracting > #qr-wrap { display: none; }
.badge { border: 2px solid var(--gold); border-radius: 30px; padding: 6px 16px; color: var(--gold); font-weight: 900; letter-spacing: 3px; }
#qr-wrap { position: fixed; right: 18px; bottom: 18px; text-align: center; font-size: 12px; opacity: 0.9; }
#qr { background: #fff; padding: 6px; border-radius: 8px; display: inline-block; }
.big { font-size: clamp(56px, 12vw, 120px); font-weight: 900; color: var(--gold); line-height: 1; }
#stats, #rank { font-size: clamp(14px, 2vw, 20px); opacity: 0.9; }
#tag { font: inherit; font-weight: 800; font-size: 28px; width: 7ch; text-align: center; text-transform: uppercase;
  padding: 8px; border-radius: 10px; border: 2px solid var(--cyan); background: #0b1e3f; color: var(--white); }
#name-entry { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@media (max-width: 600px) {
  #qr-wrap { display: none; }
  .panel { overflow-y: auto; justify-content: flex-start; padding-top: 24px; padding-bottom: 24px; }
  .panel.attracting { justify-content: space-around; padding: 72px 16px 24px; }
  #mute { top: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
