:root {
  --bg: #0e1018; --panel: #181c28; --line: #283044; --text: #eef2f9; --muted: #8b93a7;
  --lime: #c6ff3d; --cyan: #36f5ff; --good: #46e6a0; --warn: #ffd23f; --bad: #ff5d6c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(900px 600px at 50% -10%, #1a2030 0%, var(--bg) 60%);
  color: var(--text); font-family: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 1rem;
  overflow-x: hidden; user-select: none; touch-action: manipulation;
}
a { color: var(--lime); text-decoration: none; }
.wrap { width: 100%; max-width: 460px; flex: 1; display: flex; flex-direction: column; }

header.top { text-align: center; margin: 0.8rem 0 0.4rem; }
header.top h1 { font-size: 2rem; font-weight: 900; letter-spacing: -0.02em; }
header.top h1 b { color: var(--lime); text-shadow: 0 0 18px rgba(198,255,61,.4); }
header.top p { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }

section { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
section[hidden] { display: none; }

.lbl { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.choices { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.choice {
  cursor: pointer; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 14px; padding: 0.9rem 1.2rem; font-family: inherit; font-weight: 800; font-size: 1rem;
  transition: border-color .15s, background .15s, color .15s; min-width: 92px; text-align: center;
}
.choice .sub { display: block; font-size: 0.66rem; font-weight: 600; color: var(--muted); margin-top: 2px; letter-spacing: 0.06em; }
.choice:hover { border-color: #3c4862; }
.choice.sel { border-color: var(--lime); color: var(--lime); background: #1c2417; box-shadow: 0 0 16px -4px var(--lime); }
.choice.sel .sub { color: #9bb56a; }

.btn {
  cursor: pointer; border: none; border-radius: 14px; font-family: inherit; font-weight: 900; letter-spacing: 0.08em;
  font-size: 1.2rem; color: #11160a; padding: 1rem 2.6rem; background: linear-gradient(180deg, #d8ff6a, var(--lime));
  box-shadow: 0 10px 30px -8px rgba(198,255,61,.5), inset 0 -3px 0 rgba(0,0,0,.15);
  transition: filter .15s, transform .08s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); box-shadow: none; font-size: 0.95rem; padding: 0.7rem 1.4rem; letter-spacing: 0.04em; }
.best { color: var(--muted); font-size: 0.85rem; min-height: 1.2em; }
.best b { color: var(--warn); }

/* play */
.hud { display: flex; gap: 0.6rem; width: 100%; }
.stat { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.55rem; text-align: center; }
.stat .k { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.stat .v { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
#vTime { color: var(--cyan); } #vCps { color: var(--lime); } #vClicks { color: var(--text); }

.pad-wrap { position: relative; width: min(78vw, 300px); aspect-ratio: 1; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; overflow: visible; }
.ring .bg { fill: none; stroke: #232a3a; stroke-width: 8; }
.ring .fg { fill: none; stroke: var(--cyan); stroke-width: 8; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(54,245,255,.6)); }
.pad {
  width: 78%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; display: grid; place-items: center; text-align: center;
  background: radial-gradient(120px 120px at 50% 34%, #e8ffa0, var(--lime)); color: #14210a;
  box-shadow: 0 18px 50px -12px rgba(198,255,61,.55), inset 0 -8px 22px rgba(0,0,0,.18);
  transition: transform .06s ease; touch-action: manipulation;
}
.pad.pop { animation: pop .12s ease; }
@keyframes pop { 0% { transform: scale(.93); } 100% { transform: scale(1); } }
.pad .big { font-size: 3.6rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; }
.pad .small { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.04em; margin-top: 4px; opacity: .85; }
.hint { color: var(--muted); font-size: 0.9rem; min-height: 1.2em; text-align: center; }

/* results */
.final { font-size: 5rem; font-weight: 900; color: var(--lime); font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 30px rgba(198,255,61,.4); }
.final small { font-size: 1.1rem; color: var(--muted); font-weight: 800; }
.rating { font-size: 1.3rem; font-weight: 900; }
.summary { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.9rem; font-size: 0.85rem; font-weight: 700; }
.chip b { color: var(--cyan); }
.newbest { color: var(--warn); font-weight: 900; letter-spacing: 0.08em; min-height: 1.2em; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }

/* CPS-over-time line graph */
.graph { width: 100%; max-width: 340px; margin: 0.2rem auto 0; }
.graph .gtitle { font-size: 0.62rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 800; text-align: center; margin-bottom: 4px; }
.graph svg.lg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 6px rgba(198,255,61,.15)); }
.graph .lg-x { display: flex; justify-content: space-between; font-size: 0.58rem; color: var(--muted); margin-top: 1px; }
.graph .cap { text-align: center; font-size: 0.66rem; color: var(--muted); margin-top: 4px; }
.graph .cap b { color: var(--lime); font-weight: 800; font-variant-numeric: tabular-nums; }

.mute { position: fixed; bottom: 14px; right: 14px; z-index: 50; cursor: pointer; background: var(--panel); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 7px 10px; font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
