@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&display=swap");

:root {
  --bg: #0c0716; --panel: #160d2b; --line: #2a1b4d;
  --cyan: #36f5ff; --mag: #ff3df0; --amber: #ffd23f; --good: #46e6a0; --text: #ece6ff; --muted: #9b8ec9;
}
* { 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%, #1b1140 0%, var(--bg) 60%);
  color: var(--text); font-family: "Orbitron", system-ui, sans-serif;
  min-height: 100%; display: flex; flex-direction: column; align-items: center;
  overflow: hidden; user-select: none; touch-action: none;
}

.stage { position: relative; width: 100%; max-width: 520px; flex: 1; display: flex; flex-direction: column; padding: 6px; }

/* HUD */
.hud { display: flex; gap: 6px; padding: 6px 4px 2px; }
.hud .cell { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 5px 6px; text-align: center; box-shadow: inset 0 0 18px rgba(54,245,255,0.06); }
.hud .lbl { font-size: 9px; letter-spacing: 2px; color: var(--muted); font-weight: 700; }
.hud .val { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }
#score { color: var(--cyan); text-shadow: 0 0 10px rgba(54,245,255,.5); }
#best  { color: var(--good); }
#mult  { color: var(--amber); }
#balls { color: var(--mag); }

.lamps { display: flex; gap: 6px; justify-content: center; padding: 4px 0 2px; min-height: 22px; }
.lamp { font-size: 10px; font-weight: 700; letter-spacing: 1px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); opacity: .5; transition: all .15s ease; }
.lamp.on { opacity: 1; }
.lamp.save.on { color: var(--good); border-color: var(--good); box-shadow: 0 0 10px rgba(70,230,160,.5); }
.lamp.mb.on   { color: var(--mag);  border-color: var(--mag);  box-shadow: 0 0 10px rgba(255,61,240,.5); }
.lamp.tilt.on { color: #ff5d6c; border-color: #ff5d6c; box-shadow: 0 0 10px rgba(255,93,108,.6); animation: tiltflash .25s steps(2) infinite; }
@keyframes tiltflash { 50% { opacity: .35; } }

.wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
canvas#pf { display: block; width: auto; height: 100%; max-width: 100%; border-radius: 14px;
  border: 1px solid var(--line); box-shadow: 0 0 40px rgba(54,245,255,.12), inset 0 0 60px rgba(0,0,0,.6); touch-action: none; }

/* event ticker */
#ticker { position: absolute; top: 14%; left: 0; right: 0; text-align: center; pointer-events: none;
  font-size: 30px; font-weight: 900; letter-spacing: 2px; color: var(--mag);
  text-shadow: 0 0 18px rgba(255,61,240,.7); opacity: 0; transition: opacity .15s ease; z-index: 4; }
#ticker.show { opacity: 1; animation: pop .4s ease; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 18px;
  background: radial-gradient(700px 500px at 50% 40%, rgba(40,20,80,.7), rgba(8,4,18,.94)); backdrop-filter: blur(4px); }
.overlay.hidden { display: none; }
.card { text-align: center; max-width: 440px; width: 100%; }
.title { font-size: clamp(34px, 11vw, 66px); font-weight: 900; letter-spacing: 3px; line-height: .95;
  background: linear-gradient(180deg, var(--cyan), var(--mag)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 50px rgba(255,61,240,.3); }
.sub { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 14px auto 18px; max-width: 360px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; color: var(--text); text-align: left; max-width: 320px; margin: 0 auto 20px; }
.keys b { color: var(--cyan); font-weight: 700; }
.modes { display: flex; flex-direction: column; gap: 9px; margin: 0 auto 12px; max-width: 380px; }
.mode-card { cursor: pointer; pointer-events: auto; text-align: left; background: rgba(255,255,255,.03);
  border: 1px solid var(--mc); border-radius: 12px; padding: 11px 14px; color: var(--text); font-family: inherit;
  box-shadow: 0 0 16px -6px var(--mc); transition: filter .15s ease, transform .08s ease, background .15s ease; }
.mode-card:hover { filter: brightness(1.12); background: rgba(255,255,255,.07); }
.mode-card:active { transform: scale(.985); }
.mc-name { display: block; font-weight: 900; letter-spacing: 1.5px; font-size: 15px; color: var(--mc); }
.mc-desc { display: block; font-size: 10.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.big { font-size: 14px; color: var(--muted); }
.final { font-size: 52px; font-weight: 900; color: var(--cyan); font-variant-numeric: tabular-nums; text-shadow: 0 0 20px rgba(54,245,255,.5); margin: 6px 0; }
.btn { cursor: pointer; pointer-events: auto; border: none; border-radius: 10px; font-family: inherit; font-weight: 900; letter-spacing: 2px;
  font-size: 17px; color: #08121a; padding: 14px 40px; background: linear-gradient(180deg, var(--cyan), #1aa6cf);
  box-shadow: 0 8px 26px rgba(54,245,255,.35), inset 0 -3px 0 rgba(0,0,0,.2); transition: filter .15s ease, transform .08s ease; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px) scale(.98); }

/* mobile launch button */
#launchBtn { position: absolute; bottom: 14px; right: 12px; z-index: 6; display: none;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--cyan); background: rgba(8,4,18,.7); color: var(--cyan);
  font-family: inherit; font-weight: 800; font-size: 13px; letter-spacing: 1px; box-shadow: 0 0 14px rgba(54,245,255,.35); }
@media (pointer: coarse) { #launchBtn.show { display: block; } }
.flip-hint { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); pointer-events: none; }

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