/* Owner: Art (tokens, components) + Screens (layout). */
:root {
  --bg: #0d1230; --bg2: #070a1c; --fg: #eef1ff; --muted: #97a0cc; --accent: #5ce1ff; --accent2: #ff5d9e;
  --good: #8ce99a; --bad: #ff8787; --panel: rgba(18, 24, 58, 0.94); --line: rgba(140, 160, 255, 0.18);
  --r: 16px; --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg2); color: var(--fg); font-family: var(--font);
  overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) max(8px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  background: radial-gradient(120% 70% at 50% 0%, #1b2356 0%, var(--bg) 45%, var(--bg2) 100%); }

/* HUD */
#hud { display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 12px; flex: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,0.07);
  border: 1px solid var(--line); color: var(--fg); transition: transform .12s, background .12s; }
.icon-btn:active { transform: scale(0.92); background: rgba(255,255,255,0.14); }
.stat { display: flex; flex-direction: column; line-height: 1.05; min-width: 38px; }
.stat.grow { flex: 1; }
.lbl { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lives { display: flex; align-items: center; gap: 4px; min-width: 20px; justify-content: flex-end; }
.lives i { width: 11px; height: 11px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #a5d8ff 70%); box-shadow: 0 0 8px rgba(165,216,255,.7); }
.lives b { font-size: 15px; font-weight: 800; }

/* Stage */
#stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
#cv { display: block; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(0,0,0,.5); }
#effects { position: absolute; left: 50%; transform: translateX(-50%); bottom: 6px; display: flex; gap: 6px; pointer-events: none; flex-wrap: wrap; justify-content: center; max-width: 96%; }
.chip { position: relative; overflow: hidden; padding: 4px 9px 6px; border-radius: 999px; background: rgba(10,14,34,.8);
  border: 1px solid var(--c); font-size: 11px; font-weight: 800; color: var(--c); letter-spacing: .02em; }
.chip i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--c); transform-origin: left; }

/* Overlay screens */
#overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 8, 22, 0.58); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
#overlay.open { opacity: 1; }
.card-panel { width: min(360px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 20px 20px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transform: translateY(12px) scale(.98); transition: transform .25s cubic-bezier(.2,.9,.3,1.2); touch-action: pan-y; }
#overlay.open .card-panel { transform: none; }
.logo { margin: 0 0 4px; font-size: 44px; font-weight: 900; letter-spacing: .08em;
  background: linear-gradient(90deg, #ff5d73, #ffd43b, #51cf66, #22b8cf, #9775fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { margin: 0 0 6px; font-size: 26px; font-weight: 850; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 800; }
.bigtime { font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 4px 0; }
.sub { margin: 4px 0 14px; color: var(--muted); font-size: 14px; }
.meta { margin-top: 14px; color: var(--muted); font-size: 13px; }
.meta b { color: var(--fg); }
.badge { display: inline-block; margin: 2px 0 10px; padding: 5px 12px; border-radius: 999px; background: rgba(255,212,59,.16); color: #ffd43b; font-weight: 800; font-size: 13px; }
.section { margin: 18px 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 800; text-align: left; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px; border-radius: 14px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--line); font-weight: 750; font-size: 15px; transition: transform .1s, background .1s; }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(180deg, #7ce8ff, #22b8cf); color: #06172a; border: 0; box-shadow: 0 8px 24px rgba(34,184,207,.35); }
.btn.big { width: 100%; min-height: 56px; font-size: 18px; font-weight: 850; margin-top: 6px; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row .btn { flex: 1; }
.toggles { display: flex; gap: 8px; margin-top: 14px; }
.tog { flex: 1; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--muted); }
.tog[aria-pressed="true"] { color: var(--fg); background: rgba(92,225,255,.12); border-color: rgba(92,225,255,.45); }
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lvl { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.lvl b { font-size: 17px; font-weight: 850; }
.lvl small { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lvl:active { transform: scale(.95); }

/* Toast */
#toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 62px); transform: translate(-50%, -12px); z-index: 40;
  max-width: 88vw; padding: 10px 16px; border-radius: 14px; background: rgba(18,24,58,.96); border: 1px solid var(--line);
  font-size: 14px; font-weight: 650; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#version { position: fixed; right: calc(env(safe-area-inset-right) + 6px); bottom: calc(env(safe-area-inset-bottom) + 2px); z-index: 30;
  font-size: 10px; color: rgba(151,160,204,.55); font-variant-numeric: tabular-nums; pointer-events: none; }

/* Updater */
#updater { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,8,22,.9); opacity: 0; transition: opacity .25s; }
#updater.show { opacity: 1; }
.upd-box { text-align: center; width: min(300px, 80vw); }
.upd-logo { display: flex; justify-content: center; gap: 5px; margin-bottom: 16px; }
.upd-logo i { width: 34px; height: 14px; border-radius: 4px; background: #ff5d73; animation: bob 0.9s ease-in-out infinite; }
.upd-logo i:nth-child(2) { background: #ffd43b; animation-delay: .12s; }
.upd-logo i:nth-child(3) { background: #22b8cf; animation-delay: .24s; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.upd-title { font-size: 18px; font-weight: 800; }
.upd-notes { margin: 6px 0 16px; color: var(--muted); font-size: 14px; }
.upd-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.upd-fill { height: 100%; width: 0; background: linear-gradient(90deg, #5ce1ff, #9775fa); }
#updater.show .upd-fill { animation: fill 1.4s ease-in-out forwards; }
@keyframes fill { to { width: 100%; } }
.upd-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
