:root {
  color-scheme: dark;
  --ink: #e7f6ff;
  --muted: #b7c9d6;
  --gold: #f0c36a;
  --panel: rgba(10, 28, 42, 0.92);
  --edge: rgba(120, 190, 220, 0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #071018; color: var(--ink); font-family: var(--font); }
body { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font-family: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#hud {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 4; pointer-events: none; flex-wrap: wrap; justify-content: center;
}
#hud[hidden] { display: none; }
#hud div {
  min-width: 86px; padding: 6px 10px; border-radius: 12px; text-align: center;
  background: rgba(6, 18, 30, 0.78); border: 1px solid var(--edge);
}
#hud span { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
#hud b { font-size: 16px; }
#topbar { position: fixed; top: 12px; left: 12px; display: flex; gap: 8px; z-index: 6; }
.icon {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--edge);
  background: rgba(6, 18, 30, 0.78); color: var(--ink); display: grid; place-items: center; padding: 0;
}
.icon svg { width: 20px; height: 20px; }
#muteBtn.muted .on, #muteBtn:not(.muted) .off { display: none; }
body:not(.playing) #pauseBtn { display: none; }
.overlay {
  position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(4, 10, 18, 0.45); overflow: auto;
}
.overlay[hidden] { display: none !important; }
.panel {
  width: min(460px, 100%); background: var(--panel); border: 1px solid var(--edge);
  border-radius: 22px; padding: 22px 22px 16px; text-align: center;
}
h1 {
  margin: 0; font-size: clamp(40px, 9vw, 62px); line-height: 0.95;
  background: linear-gradient(100deg, #d7f4ff, #7ec8e8 45%, #f0c36a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { margin: 0 0 6px; font-size: 28px; }
.tag, .sub { color: var(--muted); margin: 8px 0 14px; font-size: 15px; }
.btn { border: 0; border-radius: 999px; padding: 12px 18px; margin: 4px; font-weight: 800; font-size: 16px; }
.btn.primary { background: linear-gradient(100deg, #d7f4ff, #7ec8e8); color: #0c2433; min-width: 150px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--edge); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.card { background: rgba(215, 244, 255, 0.05); border: 1px solid var(--edge); border-radius: 12px; padding: 8px; }
.card .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.card .v { font-size: 18px; font-weight: 800; margin-top: 2px; }
.howto { list-style: none; padding: 0; margin: 12px 0 0; text-align: left; color: var(--muted); font-size: 13px; line-height: 1.55; }
.howto b { color: var(--ink); }
kbd { border: 1px solid var(--edge); border-radius: 5px; padding: 0 5px; font-size: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (max-width: 420px) {
  .panel { padding: 16px 14px; }
  .btn.primary, .btn.ghost { width: calc(100% - 8px); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
