:root { --lime: #A2F61A; --dark: #172224; --mint: #81E7D4; --lilac: #D1A4EB; --yellow: #D2FC1B; }
html, body { margin: 0; height: 100%; background: #05090b; overflow: hidden; font-family: Manrope, system-ui, sans-serif; color: #F8F8F8; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; }
.logo { position: absolute; top: 18px; left: 22px; font-weight: 800; font-size: 20px; letter-spacing: 1px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.logo b { color: var(--lime); text-shadow: 0 0 16px rgba(162,246,26,.7); }
.top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.chip { background: rgba(10,18,20,.6); backdrop-filter: blur(8px); border-radius: 12px; padding: 6px 14px; display: flex; flex-direction: column; align-items: center; box-shadow: inset 0 0 0 1px rgba(162,246,26,.18); min-width: 64px; }
.chip span { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #9fb4b8; }
.chip b { font-size: 20px; font-weight: 800; color: var(--lime); font-variant-numeric: tabular-nums; }
.progress { position: absolute; right: 22px; top: 90px; bottom: 90px; width: 10px; }
.progress .track { position: absolute; inset: 0; border-radius: 6px; background: rgba(10,18,20,.55); box-shadow: inset 0 0 0 1px rgba(162,246,26,.18); }
.progress .dot { position: absolute; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,.5); transition: top .2s linear; }
.progress .dot.me { width: 18px; height: 18px; margin: -9px 0 0 -9px; box-shadow: 0 0 0 3px #fff, 0 0 14px var(--lime); z-index: 2; }
.banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-weight: 800; font-size: clamp(48px, 10vw, 130px); letter-spacing: -2px; color: #fff; text-shadow: 0 8px 40px rgba(0,0,0,.6), 0 0 40px rgba(162,246,26,.5); opacity: 0; transform: scale(.6); transition: opacity .25s, transform .25s cubic-bezier(.2,1.6,.4,1); }
.banner.on { opacity: 1; transform: scale(1); }
.banner small { display: block; font-size: .28em; letter-spacing: 1px; color: var(--lime); margin-top: 6px; }
.hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); background: rgba(10,18,20,.5); backdrop-filter: blur(8px); border-radius: 12px; padding: 8px 16px; font-size: 13px; color: #cfe; white-space: nowrap; }
kbd { background: rgba(255,255,255,.12); border-radius: 5px; padding: 1px 6px; font: 700 12px Manrope; color: #fff; }
.intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 14vh; transition: opacity 1s; }
.intro .t { font-size: clamp(48px, 9vw, 120px); font-weight: 800; letter-spacing: -2px; text-shadow: 0 6px 40px rgba(0,0,0,.6); }
.intro .t b { color: var(--lime); text-shadow: 0 0 40px rgba(162,246,26,.8); }
.intro .s { margin-top: 10px; font-weight: 700; color: #cfe; letter-spacing: 3px; text-transform: uppercase; font-size: 13px; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.intro.off { opacity: 0; }
.loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #05090b; font-weight: 700; color: var(--lime); letter-spacing: 2px; transition: opacity .6s; }
.loading.off { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity .6s, visibility 0s .6s; }
.results { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,10,12,.55); backdrop-filter: blur(6px); pointer-events: auto; transition: opacity .4s; }
.results.hidden { opacity: 0; pointer-events: none; }
.results .box { background: rgba(18,29,32,.92); border-radius: 22px; padding: 26px 30px; width: min(520px, 92vw); box-shadow: inset 0 0 0 1px rgba(162,246,26,.25), 0 30px 80px rgba(0,0,0,.6); }
.results h2 { margin: 0 0 4px; font-size: 34px; text-align: center; }
.results .sub { text-align: center; color: #9fb4b8; margin-bottom: 14px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 10px 0 16px; }
.podium div { width: 120px; text-align: center; border-radius: 12px 12px 0 0; padding: 10px 6px; font-weight: 800; background: rgba(162,246,26,.12); box-shadow: inset 0 0 0 1px rgba(162,246,26,.3); }
.podium .p1 { height: 110px; background: rgba(210,252,27,.22); }
.podium .p2 { height: 80px; }
.podium .p3 { height: 60px; }
.podium em { display: block; font-style: normal; font-size: 26px; color: var(--yellow); }
.rows { max-height: 32vh; overflow-y: auto; }
.rows .r { display: flex; gap: 10px; padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.rows .r b { width: 28px; color: var(--lime); }
.rows .r span { flex: 1; }
.rows .r.me { color: var(--lime); font-weight: 800; }
.rows .r i { font-style: normal; color: #9fb4b8; }
.btn { display: block; width: 100%; margin-top: 16px; border: 0; border-radius: 14px; padding: 14px; font: 800 17px Manrope; background: var(--lime); color: var(--dark); cursor: pointer; box-shadow: 0 0 24px rgba(162,246,26,.35); }
.btn:hover { background: var(--yellow); }

/* видимость по режимам */
.race-only { display: none; }
body.racing .race-only { display: flex; }
body.racing .progress.race-only { display: block; }
.touch-dev .desktop-only, body.screen .desktop-only { display: none; }
.hidden { display: none !important; }

/* меню */
.menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 50% at 50% 40%, rgba(23,34,36,.35), rgba(5,9,11,.85)); z-index: 5; padding: 16px; overflow-y: auto; }
.mbox { width: min(420px, 100%); background: rgba(18,29,32,.9); backdrop-filter: blur(10px); border-radius: 24px; padding: 24px; box-shadow: inset 0 0 0 1px rgba(162,246,26,.25), 0 30px 80px rgba(0,0,0,.6); }
.mbox h1 { margin: 0; font-size: 38px; letter-spacing: -1px; text-align: center; }
.mbox h1 b { color: var(--lime); text-shadow: 0 0 24px rgba(162,246,26,.6); }
.mbox .tag { text-align: center; color: #9fb4b8; margin: 4px 0 16px; }
.mbox label { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: #9fb4b8; margin: 12px 0 6px; }
.mbox input { width: 100%; box-sizing: border-box; border: 1.5px solid rgba(255,255,255,.14); background: rgba(0,0,0,.3); color: #fff; border-radius: 14px; padding: 12px 14px; font: 700 16px Manrope; outline: none; }
.mbox input:focus { border-color: var(--lime); }
.sw { display: flex; gap: 8px; flex-wrap: wrap; }
.sw button { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.3); }
.sw button.on { box-shadow: 0 0 0 3px #fff, 0 0 14px rgba(255,255,255,.5); }
.mbox .row { display: flex; gap: 8px; margin-top: 16px; }
.mbox .row input { flex: 1; text-transform: uppercase; letter-spacing: 6px; text-align: center; font-size: 20px; }
.btn2 { border: 0; border-radius: 14px; padding: 13px 16px; font: 800 16px Manrope; cursor: pointer; background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.14); }
.btn2.primary { background: var(--lime); color: var(--dark); box-shadow: 0 0 24px rgba(162,246,26,.35); width: 100%; }
.mbox .row .btn2.primary { width: auto; }
.btn2.ghost { background: transparent; width: 100%; margin-top: 8px; color: #cfe; }
.or { text-align: center; color: #6f8488; font-size: 12px; margin: 12px 0; }
.hintline { color: var(--lime); font-weight: 700; margin-top: 14px; text-align: center; }
.loading { z-index: 10; }

/* лобби */
.lobby { position: absolute; top: 64px; left: 18px; width: 260px; background: rgba(10,18,20,.72); backdrop-filter: blur(10px); border-radius: 18px; padding: 14px; pointer-events: auto; box-shadow: inset 0 0 0 1px rgba(162,246,26,.22); max-height: calc(100vh - 100px); overflow-y: auto; }
.lobby .code { display: flex; justify-content: space-between; align-items: baseline; }
.lobby .code span { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #9fb4b8; }
.lobby .code b { font-size: 34px; letter-spacing: 6px; color: var(--lime); text-shadow: 0 0 18px rgba(162,246,26,.6); }
.lobby .qr { width: 100%; border-radius: 12px; margin-top: 8px; background: #fff; display: block; }
.lobby .url { font-size: 12px; color: #cfe; text-align: center; margin: 6px 0 4px; word-break: break-all; }
.lobby .plist { margin: 10px 0; display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow-y: auto; }
.lobby .plist div { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.lobby .plist div.me { color: var(--lime); }
.lobby .plist i { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.lobby .muted { color: #9fb4b8; font-weight: 600; }
.lobby .bots { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #cfe; margin: 6px 0; }
.lobby .bots input { flex: 1; accent-color: #A2F61A; }
.lobby .wait { color: #cfe; font-size: 14px; text-align: center; margin-top: 6px; }
.lobby .wait small { color: #9fb4b8; }
.lobby.compact .qr, .lobby.compact .url { display: none; }
body.screen .lobby { width: 340px; }
body.screen .lobby .code b { font-size: 46px; }
body.screen.racing .lobby { top: auto; bottom: 18px; width: 220px; }

/* таблица на большом экране */
.standings { display: none; position: absolute; right: 50px; top: 90px; width: 240px; background: rgba(10,18,20,.6); backdrop-filter: blur(8px); border-radius: 16px; padding: 10px 14px; box-shadow: inset 0 0 0 1px rgba(162,246,26,.2); }
body.screen.racing .standings { display: block; }
.standings div { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; padding: 3px 0; }
.standings div b { width: 22px; color: var(--lime); }
.standings div i { width: 10px; height: 10px; border-radius: 50%; }
.standings div.f { color: var(--yellow); }

/* сенсорное управление */
.touch { position: absolute; inset: 0; display: none; }
.touch.on { display: block; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 55%; height: 65%; pointer-events: auto; touch-action: none; }
.stick-base { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); opacity: 0; left: 90px; top: calc(100% - 110px); transition: opacity .15s; }
.stick-base.on { opacity: 1; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(162,246,26,.75); box-shadow: 0 0 20px rgba(162,246,26,.6); }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border: 0; border-radius: 50%; font: 800 14px Manrope; color: var(--dark); user-select: none; -webkit-user-select: none; }
.tbtn.jump { right: 22px; bottom: 40px; width: 104px; height: 104px; background: rgba(162,246,26,.9); box-shadow: 0 0 26px rgba(162,246,26,.5); }
.tbtn.dive { right: 140px; bottom: 26px; width: 74px; height: 74px; background: rgba(209,164,235,.9); }
.tbtn.down { transform: scale(.92); filter: brightness(1.2); }

.toast { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.toast div { background: rgba(18,29,32,.95); padding: 9px 16px; border-radius: 12px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(162,246,26,.3); }

@media (max-width: 700px) {
  .logo { font-size: 15px; top: 12px; left: 14px; }
  .top { top: 38px; }
  .chip { padding: 3px 10px; min-width: 50px; }
  .chip b { font-size: 16px; }
  .lobby { top: auto; bottom: 150px; left: 10px; right: 10px; width: auto; max-height: 45vh; }
  .progress { right: 8px; top: 100px; bottom: 170px; width: 7px; }
  .banner { font-size: 64px; top: 22%; }
}
