:root { --ice: #7fe3ff; --ink: #04102a; --gold: #ffe27a; --red: #ff4d6d; --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #020611; overflow: hidden; font-family: var(--font), sans-serif; color: #eef8ff; user-select: none; -webkit-user-select: none; touch-action: none; }
#stage { position: absolute; left: 50%; top: 50%; width: 1280px; height: 720px; transform-origin: center; transform: translate(-50%, -50%); overflow: hidden; }
#game { position: absolute; inset: 0; width: 1280px; height: 720px; display: block; }
#stage[data-screen="game"], #stage[data-screen="game"] #game { cursor: none; }
.overlay { position: absolute; inset: 0; }
.overlay[hidden] { display: none; }
h1 { margin: 0; font-size: 100px; font-weight: 900; letter-spacing: 4px; line-height: 1; font-style: italic; text-shadow: 0 6px 0 rgba(0,0,0,.25), 0 0 40px rgba(127,227,255,.35); }
h1 span { color: var(--ice); }
.kicker { font-size: 18px; letter-spacing: 6px; font-weight: 700; color: rgba(255,255,255,.75); }
.tag { font-size: 26px; margin: 10px 0 0; color: #d6efff; }
#title .brand { position: absolute; left: 80px; top: 110px; }
.trials { position: absolute; left: 80px; top: 370px; margin: 0; padding: 0; list-style: none; display: flex; gap: 16px; }
.trials li { width: 236px; padding: 16px 18px; border-radius: 14px; background: rgba(4,16,42,.55); border: 1px solid rgba(127,227,255,.35); backdrop-filter: blur(4px); }
.trials b { display: block; font-size: 24px; letter-spacing: 2px; color: var(--ice); }
.trials span { font-size: 17px; color: #e7f5ff; }
.cta { position: absolute; left: 80px; top: 540px; font-size: 40px; font-weight: 900; letter-spacing: 3px; color: #fff; text-shadow: 0 0 20px rgba(127,227,255,.6); }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
footer { position: absolute; left: 80px; bottom: 34px; font-size: 16px; color: rgba(255,255,255,.65); }
kbd { border: 1px solid rgba(255,255,255,.4); border-radius: 5px; padding: 1px 6px; font-family: inherit; }
.board { position: absolute; right: 70px; top: 110px; width: 300px; padding: 18px 22px; border-radius: 16px; background: rgba(4,16,42,.62); border: 1px solid rgba(127,227,255,.35); }
.board h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: 4px; color: var(--ice); }
.board ol { list-style: none; margin: 0; padding: 0; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; font-size: 24px; font-weight: 800; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-variant-numeric: tabular-nums; }
.board li.top { color: var(--gold); }
.board .pos { opacity: .6; }
.board .ini { letter-spacing: 4px; }
#attract .board { top: 120px; }
.demo-tag { position: absolute; left: 36px; top: 100px; padding: 6px 14px; border-radius: 8px; background: rgba(255,77,109,.85); font-weight: 900; letter-spacing: 4px; font-size: 18px; }
.attract-cta { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 40px; text-align: center; background: linear-gradient(transparent, rgba(2,6,20,.75)); padding-top: 40px; }
.attract-cta h1 { font-size: 72px; }
.attract-cta .cta { position: static; font-size: 34px; margin-top: 8px; }
.best { font-size: 20px; letter-spacing: 3px; color: var(--gold); margin-top: 6px; font-weight: 800; }
#results { background: radial-gradient(ellipse at 30% 40%, rgba(10,30,80,.55), rgba(2,6,20,.88)); }
.res-left { position: absolute; left: 70px; top: 80px; width: 470px; }
.big { font-size: 112px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 40px rgba(127,227,255,.4); }
.rank { font-size: 44px; font-weight: 900; font-style: italic; letter-spacing: 6px; color: var(--gold); margin-top: 6px; }
.stages { display: flex; gap: 18px; margin: 16px 0 10px; font-size: 16px; color: rgba(255,255,255,.75); letter-spacing: 2px; }
.stages b { color: #fff; font-size: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 0; }
.stats div { background: rgba(255,255,255,.06); border-radius: 12px; padding: 10px 12px; }
.stats dt { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.6); }
.stats dd { margin: 2px 0 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
#radar { position: absolute; left: 505px; top: 120px; width: 380px; height: 340px; }
.tip { position: absolute; left: 70px; right: 60px; bottom: 56px; padding: 18px 24px; border-radius: 16px; background: rgba(127,227,255,.1); border: 1px solid rgba(127,227,255,.35); font-size: 22px; display: flex; gap: 20px; align-items: center; }
.tip b { color: var(--ice); letter-spacing: 3px; font-size: 16px; white-space: nowrap; }
.res-right { position: absolute; right: 60px; top: 80px; width: 340px; text-align: center; }
#rPlace { font-size: 20px; margin: 0 0 14px; }
#initials { display: flex; justify-content: center; gap: 14px; margin-bottom: 18px; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slot button { font-family: inherit; color: #fff; border: 0; cursor: pointer; }
.slot .up, .slot .dn { width: 84px; height: 44px; border-radius: 10px; background: rgba(127,227,255,.18); font-size: 20px; }
.slot .ch { width: 84px; height: 100px; border-radius: 12px; background: rgba(4,16,42,.8); border: 3px solid rgba(255,255,255,.25); font-size: 64px; font-weight: 900; }
.slot.cur .ch { border-color: var(--ice); box-shadow: 0 0 24px rgba(127,227,255,.5); }
.btn { font-family: inherit; font-weight: 900; letter-spacing: 3px; border: 0; border-radius: 14px; padding: 16px 26px; font-size: 22px; cursor: pointer; color: var(--ink); }
.btn.primary { background: var(--ice); }
.btn.ghost { background: transparent; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.3); font-size: 16px; padding: 14px 18px; }
.big-btn { width: 100%; font-size: 28px; padding: 22px; margin-top: 14px; }
.hint { font-size: 14px; color: rgba(255,255,255,.55); }
.place { font-size: 64px; font-weight: 900; color: var(--gold); font-style: italic; }
.sub { font-size: 16px; color: rgba(255,255,255,.7); margin: 6px 0; }
#qr { width: 168px; height: 168px; border-radius: 10px; margin-top: 10px; image-rendering: pixelated; }
.auto { margin-top: 18px; font-size: 14px; color: rgba(255,255,255,.5); }
.chip { position: absolute; left: 14px; bottom: 12px; z-index: 5; font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 2px; color: #fff; background: rgba(4,16,42,.6); border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
#stage[data-screen="game"] .chip { opacity: .35; }
#staff { position: absolute; right: 0; top: 0; width: 60px; height: 60px; z-index: 6; }
#toast { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); z-index: 7; background: rgba(4,16,42,.9); border: 1px solid var(--ice); border-radius: 10px; padding: 10px 18px; font-weight: 700; }
#toast[hidden], #debug[hidden] { display: none; }
#debug { position: absolute; right: 10px; bottom: 8px; z-index: 7; font: 12px monospace; color: #9fe; }

/* ---- motion & juice ---- */
h1 span { background: linear-gradient(100deg, #7fe3ff 20%, #ffffff 40%, #7fe3ff 60%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 3.2s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
#title:not([hidden]) .brand { animation: dropIn .6s cubic-bezier(.2,1.4,.4,1) both; }
#title:not([hidden]) .trials li { animation: slideUp .5s cubic-bezier(.2,1.3,.4,1) both; }
#title:not([hidden]) .trials li:nth-child(2) { animation-delay: .08s; }
#title:not([hidden]) .trials li:nth-child(3) { animation-delay: .16s; }
.trials li { transition: transform .15s; }
.trials li:hover { transform: translateY(-4px) scale(1.03); border-color: #7fe3ff; }
#title:not([hidden]) .board, #attract:not([hidden]) .board { animation: slideLeft .55s cubic-bezier(.2,1.2,.4,1) .1s both; }
.cta.pulse { animation: ctaPulse 1.1s ease-in-out infinite; }
@keyframes ctaPulse { 50% { opacity: .55; transform: scale(1.04); text-shadow: 0 0 34px rgba(127,227,255,.9); } }
.cta { transform-origin: left center; }
.attract-cta .cta { transform-origin: center; }
#results:not([hidden]) .res-left > * { animation: slideUp .45s cubic-bezier(.2,1.3,.4,1) both; }
#results:not([hidden]) .res-left > *:nth-child(2) { animation-delay: .05s; }
#results:not([hidden]) .rank { animation: stamp .5s cubic-bezier(.2,1.6,.4,1) 1.3s both; }
#results:not([hidden]) .stats div { animation: pop .35s cubic-bezier(.2,1.6,.4,1) both; }
#results:not([hidden]) .stats div:nth-child(1) { animation-delay: .3s; } #results:not([hidden]) .stats div:nth-child(2) { animation-delay: .38s; }
#results:not([hidden]) .stats div:nth-child(3) { animation-delay: .46s; } #results:not([hidden]) .stats div:nth-child(4) { animation-delay: .54s; }
#results:not([hidden]) .stats div:nth-child(5) { animation-delay: .62s; } #results:not([hidden]) .stats div:nth-child(6) { animation-delay: .7s; }
#results:not([hidden]) #radar { animation: pop .6s cubic-bezier(.2,1.4,.4,1) .4s both; }
#results:not([hidden]) .tip { animation: slideUp .5s ease-out .9s both; }
#saved:not([hidden]) .place { animation: stamp .5s cubic-bezier(.2,1.6,.4,1) both; }
#saved:not([hidden]) #qr { animation: pop .4s ease-out .15s both; }
.btn { transition: transform .1s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(127,227,255,.4); }
.btn:active, .slot button:active { transform: scale(.94); }
.big-btn { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 36px rgba(127,227,255,.75); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-40px) scale(.96); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(28px); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(60px); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes stamp { from { opacity: 0; transform: scale(2.2) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
