/* NITRO STRIKERS — UI styling. Radial single-stage menus, springy overshoot,
   athletic italic type, team colors. */
:root {
  --blue: #3ec6ff;
  --orange: #ff7a2e;
  --ink: #070b12;
  --panel: rgba(10, 16, 26, 0.86);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: #e8eef6; user-select: none; -webkit-user-select: none;
}
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: fixed; inset: 0; pointer-events: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: auto;
  animation: screenIn 0.42s var(--spring) both;
}
@keyframes screenIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.screen-foot { position: absolute; bottom: 18px; font-size: 12px; letter-spacing: 0.14em;
  opacity: 0.55; text-transform: uppercase; }

/* Radial composition */
.radial-screen { justify-content: flex-start; padding-top: min(6vh, 60px); }
.radial-center { text-align: center; margin-bottom: clamp(24px, 6vh, 64px); }
.game-title {
  font-size: clamp(40px, 8vw, 92px); font-weight: 900; letter-spacing: 0.04em;
  font-style: italic; line-height: 0.95; text-shadow: 0 6px 30px rgba(62,198,255,.35);
}
.game-title span { color: #fff; } .game-title b { color: var(--orange); }
.tagline { letter-spacing: 0.5em; font-size: clamp(10px, 1.4vw, 15px); opacity: 0.75; margin-top: 10px; }
.emblem { position: relative; width: 120px; height: 120px; margin: 0 auto 18px; }
.ball-glyph {
  position: absolute; inset: 32px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #fff 0%, #d8dde4 45%, #7b828e 100%);
  box-shadow: 0 0 34px rgba(255,122,46,0.75);
}
.ball-glyph::after { content: ""; position: absolute; left: 0; right: 0; top: calc(50% - 3px);
  height: 6px; background: var(--orange); border-radius: 3px; }
.emblem-ring, .emblem-ring.r2 {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px dashed rgba(62,198,255,0.65); animation: spin 14s linear infinite;
}
.emblem-ring.r2 { inset: 12px; border-color: rgba(255,122,46,0.55); animation-duration: 9s; animation-direction: reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.radial-menu {
  display: grid; grid-template-columns: repeat(2, auto); gap: clamp(10px, 2.4vh, 22px)
    clamp(24px, 6vw, 90px); align-items: center; justify-items: center;
  pointer-events: auto;
}
.radial-item {
  position: relative; font-weight: 800; font-style: italic; letter-spacing: 0.18em;
  font-size: clamp(17px, 2.6vh, 26px); padding: 12px 26px; border-radius: 999px;
  color: #cfd9e6; transition: transform .28s var(--spring), color .18s ease,
    box-shadow .28s var(--spring), background .2s ease;
  transform-origin: center;
}
.radial-item::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px;
  border-radius: 50%; transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, var(--orange), transparent 72%);
  transition: transform .3s var(--spring);
}
.radial-item:hover::before { transform: translate(-50%, -50%) scale(1.1); }
.radial-item:hover { color: #fff; transform: scale(1.13) rotate(-1.2deg);
  text-shadow: 0 0 22px rgba(255,158,64,0.85); }
.radial-item.primary {
  color: #06121f; background: linear-gradient(120deg, var(--orange), #ffb054);
  box-shadow: 0 10px 38px rgba(255,122,46,0.5);
}
.radial-menu.small { margin-top: -2vh; }
.radial-item.primary:hover { filter: brightness(1.1); }

/* ---------- Panel screens (settings/controls) ---------- */
.panel-screen { background: rgba(4, 8, 14, 0.78); backdrop-filter: blur(6px); }
.panel-title {
  font-size: clamp(24px, 4vh, 40px); font-style: italic; font-weight: 900;
  letter-spacing: 0.14em; margin-bottom: 20px;
}
.panel-body { background: var(--panel); border: 1px solid rgba(120,170,220,0.14);
  border-radius: 18px; padding: clamp(16px, 3vh, 30px) clamp(20px, 4vw, 44px);
  max-width: min(720px, 94vw); max-height: 72vh; overflow-y: auto; }
.panel-actions { margin-top: 24px; display: flex; gap: 18px; }
.btn-back, .btn-primary {
  padding: 12px 30px; border-radius: 999px; font-weight: 800; letter-spacing: 0.12em;
  font-style: italic; transition: transform .25s var(--spring), box-shadow .25s var(--spring);
}
.btn-back { background: rgba(140,180,220,0.12); }
.btn-primary { background: linear-gradient(120deg, var(--orange), #ffb054); color: #08131f;
  box-shadow: 0 8px 30px rgba(255,122,46,0.4); }
.btn-back:hover, .btn-primary:hover { transform: translateY(-3px) scale(1.04); }

.setting-row { display: flex; align-items: center; justify-content: space-between;
  gap: 26px; padding: 13px 4px; border-bottom: 1px solid rgba(130,170,210,0.09); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-size: 14px; letter-spacing: 0.16em; opacity: 0.8; }
.seg { display: flex; gap: 6px; }
.seg button {
  padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: rgba(130,170,210,0.1); transition: all .22s var(--spring);
}
.seg button.sel { background: linear-gradient(120deg, var(--orange), #ffb054); color: #071320;
  transform: scale(1.07); box-shadow: 0 6px 18px rgba(255,122,46,.4); }
.seg button:hover:not(.sel) { background: rgba(130,170,210,0.22); }
input[type="range"] { accent-color: var(--orange); width: 200px; }

/* Controls table */
.controls-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.controls-table th, .controls-table td { padding: 8px 12px; text-align: left; }
.controls-table th { letter-spacing: .12em; font-size: 12px; opacity: .65; }
.controls-table tr { border-bottom: 1px solid rgba(130,170,210,0.09); }
.controls-note { margin-top: 14px; font-size: 13px; opacity: 0.75; line-height: 1.5; }
kbd { background:#233043; border-radius:5px; padding:1px 7px; font-family:inherit; }

/* ---------- Garage ---------- */
.garage-screen { justify-content: space-between; padding: 3vh 0; flex-direction: row;
  flex-wrap: wrap; align-content: center; gap: 12px; }
.garage-head { position: absolute; top: 3vh; left: 0; right: 0; text-align: center; pointer-events: none; }
.garage-head h2 { font-size: clamp(26px, 4.4vh, 44px); font-style: italic; font-weight: 900;
  letter-spacing: .2em; }
.garage-head .hint { font-size: 12px; letter-spacing: .18em; opacity: .6; text-transform: uppercase; }
.garage-col { background: var(--panel); border-radius: 18px; padding: 18px 20px;
  border: 1px solid rgba(120,170,220,0.14); display: flex; flex-direction: column; gap: 10px;
  max-height: 62vh; overflow-y: auto; pointer-events: auto; }
.garage-col h3 { font-size: 12px; letter-spacing: .22em; opacity: .65; margin-top: 6px; }
.swatches { display: grid; grid-template-columns: repeat(5, 34px); gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 10px; border: 2px solid transparent;
  transition: transform .25s var(--spring), border-color .15s; }
.swatch:hover { transform: scale(1.18) rotate(-4deg); }
.swatch.sel { border-color: #fff; transform: scale(1.14); }
.chip-list { display: flex; flex-direction: column; gap: 6px; }
.chip { padding: 8px 14px; border-radius: 999px; background: rgba(130,170,210,0.1);
  font-size: 13px; font-weight: 700; letter-spacing: .06em; transition: all .22s var(--spring); }
.chip.sel { background: linear-gradient(120deg, var(--orange), #ffb054); color: #08131f;
  transform: translateX(-4px) scale(1.05); }
.chip .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle; }
.light-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.light-preset { padding: 10px 12px; border-radius: 12px; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(190,160,120,0.35); letter-spacing: .05em;
  transition: all .25s var(--spring); }
.light-preset.sel { transform: scale(1.06); border-color: #ffd9a0;
  box-shadow: inset 0 0 24px rgba(255, 190, 120, 0.22); }
.light-preset[data-id="ember"]    { background: linear-gradient(135deg,#3a2417,#59351f); color:#ffd9a8; }
.light-preset[data-id="sandstone"]{ background: linear-gradient(135deg,#3c3324,#6a5a41); color:#f3e6c8; }
.light-preset[data-id="olive"]    { background: linear-gradient(135deg,#27301e,#42502f); color:#dbe9bb; }
.light-preset[data-id="terracotta"]{background: linear-gradient(135deg,#39201a,#64372a); color:#ffc9a6; }
.garage-foot { position: absolute; bottom: 3vh; left: 0; right: 0; display: flex;
  justify-content: center; gap: 18px; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; pointer-events: none; }
#scoreboard { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5)); }
.team-plate {
  min-width: 74px; text-align: center; font-size: clamp(22px, 3.6vh, 34px); font-weight: 900;
  font-style: italic; padding: 4px 16px; color: #06111d;
}
.team-plate.blue { background: linear-gradient(115deg, #2aa8dd, #63d4ff);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
.team-plate.orange { background: linear-gradient(115deg, #ff8b42, #ffb163);
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%); }
#timer-box { background: rgba(6,12,20,0.88); padding: 2px 18px; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  border-top: 1px solid rgba(140,190,240,0.25); border-bottom: 1px solid rgba(140,190,240,0.25); }
#timer { font-size: clamp(18px, 3vh, 28px); font-weight: 800; letter-spacing: .08em;
  font-variant-numeric: tabular-nums; }
#timer.low { color: #ff5f52; animation: pulseT 1s infinite; }
@keyframes pulseT { 50% { opacity: .55; } }
#ot-chip, #zero-chip { font-size: 9px; letter-spacing: .14em; opacity: .9; color: #ffd166; white-space: nowrap; }
#zero-chip { color: #ff8b5e; animation: pulseT .7s infinite; }

#gauge-cluster { position: absolute; right: 26px; bottom: 22px; display: flex;
  align-items: flex-end; gap: 16px; }
#boost-dial { position: relative; width: clamp(76px, 12vh, 110px); height: auto; }
#boost-dial svg { width: 100%; transform: rotate(-90deg); }
.dial-bg { fill: rgba(8,14,22,0.72); stroke: rgba(150,190,230,0.16); stroke-width: 9; }
.dial-fg { fill: none; stroke: url(#none); stroke: #ffc14d; stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 314; stroke-dashoffset: 209; transition: stroke-dashoffset .12s linear; }
#boost-dial.full .dial-fg { stroke: #ffe58a; filter: drop-shadow(0 0 8px rgba(255,214,90,.8)); }
#boost-num { position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 900; font-style: italic; font-size: clamp(18px, 3.4vh, 30px); }
#speedo { background: rgba(8,14,22,0.72); border-radius: 12px; padding: 8px 14px;
  text-align: right; border: 1px solid rgba(140,190,240,0.16); }
#speed-num { font-size: clamp(20px, 3.6vh, 30px); font-weight: 900; font-variant-numeric: tabular-nums; }
#speedo small { display: block; font-size: 9px; letter-spacing: .3em; opacity: .6; }
#speedo.fast { border-color: rgba(255,140,60,.7); box-shadow: 0 0 18px rgba(255,120,40,.35); }

#announcer { position: absolute; top: 17%; left: 0; right: 0; display: flex;
  flex-direction: column; align-items: center; gap: 8px; }
.announce { font-size: clamp(26px, 6vh, 54px); font-weight: 900; font-style: italic;
  letter-spacing: .16em; padding: 6px 40px; background: rgba(5,10,17,0.82); border-radius: 14px;
  animation: announceIn .5s var(--spring) both, announceOut .5s ease-in 1.9s both;
  border: 1px solid rgba(150,200,250,0.2); }
.announce.team-blue { color: var(--blue); box-shadow: 0 0 44px rgba(62,198,255,0.35); }
.announce.team-orange { color: var(--orange); box-shadow: 0 0 44px rgba(255,122,46,0.35); }
.announce.big { font-size: clamp(34px, 8vh, 74px); }
@keyframes announceIn { from { transform: translateY(-26px) scale(.6); opacity: 0; }
  to { transform: none; opacity: 1; } }
@keyframes announceOut { to { transform: translateY(-14px); opacity: 0; } }

#countdown-number {
  position: absolute; top: 38%; left: 50%; transform: translateX(-50%);
  font-size: clamp(80px, 20vh, 170px); font-weight: 900; font-style: italic;
  color: #fff; text-shadow: 0 0 44px rgba(255,160,60,.9);
  animation: cdPop .95s var(--spring) both; pointer-events: none;
}
@keyframes cdPop { 0% { transform: translateX(-50%) scale(2.2); opacity: 0; }
  30% { transform: translateX(-50%) scale(1); opacity: 1; }
  80% { opacity: 1; } 100% { transform: translateX(-50%) scale(.86); opacity: 0; } }

#ballcam-chip { position: absolute; left: 26px; bottom: 26px; padding: 8px 16px;
  background: rgba(8,14,22,0.72); border-radius: 999px; font-size: 11px; letter-spacing: .2em;
  border: 1px solid rgba(140,190,240,0.18); }
#ballcam-chip.off { opacity: .45; }
#fps-meter { position: absolute; top: 14px; right: 16px; font-size: 12px; opacity: .7;
  font-variant-numeric: tabular-nums; background: rgba(8,14,22,.6); padding: 4px 10px; border-radius: 8px; }
#ball-arrow { position: absolute; font-size: 26px; color: #ffce6b; filter: drop-shadow(0 0 8px #ff9430);
  transform-origin: center; }
#touch-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .16em; opacity: .65; background: rgba(8,14,22,.6);
  padding: 5px 14px; border-radius: 999px; }

/* ---------- Pause & overlays ---------- */
.overlay-screen { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(3, 6, 11, 0.66); backdrop-filter: blur(5px); pointer-events: auto;
  animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.pause-card { text-align: center; background: var(--panel); border-radius: 22px;
  padding: 36px 48px; border: 1px solid rgba(140,190,240,0.14);
  animation: cardIn .4s var(--spring) both; }
@keyframes cardIn { from { transform: scale(.8) translateY(20px); opacity: 0; } }
.pause-card h2 { font-style: italic; letter-spacing: .2em; margin-bottom: 20px; font-size: 30px; }
.pause-btn { display: block; width: 240px; margin: 10px auto; padding: 12px;
  border-radius: 999px; font-weight: 800; letter-spacing: .1em; background: rgba(130,170,210,0.1);
  transition: transform .25s var(--spring), background .2s; }
.pause-btn:hover { transform: scale(1.05); background: rgba(130,170,210,0.22); }
.pause-btn.primary { background: linear-gradient(120deg, var(--orange), #ffb054); color: #08131f; }
.pause-btn.danger { color: #ff7d6e; }
.pause-note { font-size: 11px; opacity: .5; margin-top: 12px; letter-spacing: .14em; }

/* Results */
.results-center .radial-center-h { font-size: 12px; }
#result-headline { font-size: clamp(40px, 9vh, 84px); font-weight: 900; font-style: italic;
  letter-spacing: .08em; animation: resPop .7s var(--spring) both; }
@keyframes resPop { from { transform: scale(2.1) rotate(-3deg); opacity: 0; } }
#result-headline.win { color: #ffd254; text-shadow: 0 0 50px rgba(255,200,60,.5); }
#result-headline.loss { color: #8fa3ba; }
#result-score { font-size: clamp(30px, 6vh, 56px); font-weight: 900; margin: 6px 0;
  font-variant-numeric: tabular-nums; }
#result-sub { letter-spacing: .3em; font-size: 11px; opacity: .7; }
.stat-stripes { margin-top: 22px; display: flex; gap: 26px; justify-content: center;
  font-size: 14px; }
.stat-stripes .stat b { display: block; font-size: 26px; font-style: italic; }

@media (max-width: 760px) {
  .garage-col.left, .garage-col.right { position: relative; top: auto; left: auto; right: auto;
    max-width: 44vw; }
  .radial-menu { grid-template-columns: 1fr; gap: 8px; }
  #gauge-cluster { right: 12px; bottom: 12px; gap: 8px; }
  #scoreboard { transform: translateX(-50%) scale(.82); }
}
