/* Moto Clash — HTML edition. Dark paddock design system. */
@font-face { font-family: 'Barlow'; src: url('../assets/fonts/Barlow-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url('../assets/fonts/Barlow-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('../assets/fonts/BarlowCondensed-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0c0e12;
  --bg2: #101318;
  --panel: #15181e;
  --panel2: #1c2027;
  --panel3: #232831;
  --line: #2a2e36;
  --line2: #363b45;
  --text: #f2f3f5;
  --muted: #9299a6;
  --red: #ff3c45;
  --red2: #d82a33;
  --accent: #39ff14;
  --accent2: #22c90a;
  --accent-rgb: 57, 255, 20;
  --on-accent: #07140a;
  --gold: #e9bc66;
  --green: #95d5a5;
  --blue: #78aaed;
  --purple: #b46cff;
  --focus: #39ff14;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Barlow', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* Camera cutout at the top. The Android app draws under it and sets this itself (main.js). */
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* No double-tap zoom of the whole app (iOS); elements with their own touch-action keep it. */
html, body { touch-action: manipulation; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 14px; -webkit-font-smoothing: antialiased; }
body { overflow: hidden; }
#app { height: 100%; padding-top: var(--safe-t); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2f38; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.display { font-family: var(--display); font-weight: 700; letter-spacing: 0.2px; line-height: 0.95; text-transform: none; margin: 0; }
h1.display { font-size: clamp(34px, 4.2vw, 46px); }
h2.display { font-size: 30px; }
.eyebrow { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 9px; }
.muted { color: var(--muted); }
.text-red { color: var(--red); } .text-gold { color: var(--gold); } .text-green { color: var(--green); } .text-blue { color: var(--blue); } .text-purple { color: #b46cff; }
.small { font-size: 12px; }
.tiny { font-size: 10.5px; letter-spacing: .6px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 16px; }
.hidden { display: none !important; }

/* ---------------------------------------------------------------- boot */
.boot { height: 100%; display: grid; place-items: center; align-content: center; gap: 22px; }
.boot-logo { font-family: var(--display); font-size: 44px; display: flex; align-items: center; gap: 12px; }
.boot-logo small { font-size: 14px; letter-spacing: 6px; color: var(--muted); }
.boot-mark { width: 20px; height: 34px; background: var(--accent); transform: skewX(-18deg); border-radius: 3px; }
.boot-brand-image { display: block; width: min(440px, 88vw); height: auto; object-fit: contain; }
.boot-bar { width: 200px; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--accent); animation: boot 1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
/* Full-screen wait while signing in and opening the saved team (authDialog.js). */
.signin-loading { position: fixed; inset: 0; z-index: 1000; height: auto; background: var(--bg); animation: pagein .2s ease-out; }
.signin-loading p { margin: 0; color: var(--muted); font-size: 14px; letter-spacing: 3px; text-transform: uppercase; }

/* ---------------------------------------------------------------- icons */
.icon-wrap { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico { display: block; }

/* ---------------------------------------------------------------- buttons */
.btn { --c: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 48px; padding: 0 22px; border-radius: 10px; border: 0; background: var(--c); color: var(--on-accent); font-weight: 600; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; transition: transform .15s, filter .15s, background .15s, box-shadow .2s; box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 30%, transparent); white-space: nowrap; position: relative; overflow: hidden; }
.btn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 45%, transparent 60%); transform: translateX(-120%); transition: transform .6s; }
.btn:hover:not(:disabled)::after { transform: translateX(120%); }
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { background: var(--panel3); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn.small { height: 38px; padding: 0 14px; font-size: 11.5px; letter-spacing: 1px; border-radius: 8px; }
.btn.secondary { color: var(--text); background: var(--panel2); border: 1px solid var(--line2); box-shadow: none; }
.btn.secondary:hover:not(:disabled) { border-color: var(--muted); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel2); }
.btn.gold { --c: var(--gold); color: #1a1408; }
.btn.blue { --c: #3d74c9; color: #fff; }
.btn.green { --c: #3e9a62; color: #fff; }
.btn.danger { --c: #c9242d; color: #fff; }
.btn.block { width: 100%; }
.btn.outline { background: transparent; border: 1px solid var(--line2); box-shadow: none; color: var(--text); }
.btn.outline:hover:not(:disabled) { border-color: var(--text); }
.link { background: none; border: 0; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 4px; }
.link:hover { color: var(--text); }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: inline-grid; place-items: center; transition: .15s; }
.iconbtn:hover { color: var(--text); background: var(--panel2); border-color: var(--line); }
.iconbtn.on { color: var(--text); background: var(--panel2); border-color: var(--line2); }

/* ---------------------------------------------------------------- surfaces */
.surface { background: linear-gradient(180deg, var(--panel), #13161b); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; }
.surface.nopad { padding: 0; overflow: hidden; }
.surface.clickable { cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.surface.clickable:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: var(--shadow); }
.tag { --c: var(--muted); width: fit-content; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); white-space: nowrap; }
.tag.solid { background: var(--c); color: #111; }
.meter { --c: var(--accent); height: 6px; background: rgba(255,255,255,.07); border-radius: 6px; overflow: hidden; }
.meter.thin { height: 4px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); border-radius: 6px; transition: width .35s ease; }
.statline { margin-bottom: 12px; }
.statline-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.statline-top b { color: var(--text); font-family: var(--display); font-size: 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.section-title h3 { margin: 0; font-size: 17px; font-weight: 600; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.centered { justify-content: center; }
.chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; transition: .15s; }
.chip:hover { color: var(--text); border-color: var(--line2); }
.chip.on { color: #fff; background: color-mix(in srgb, var(--c) 16%, var(--panel2)); border-color: var(--c); }
.flag { display: inline-block; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.12); flex: none; }
.flag svg { display: block; }
.tyre-badge { --c: #fff; display: inline-grid; place-items: center; border-radius: 50%; border: 3px solid var(--c); color: var(--c); font-weight: 700; font-family: var(--display); background: #101215; flex: none; }
.empty { display: grid; place-items: center; gap: 8px; padding: 36px; color: var(--muted); text-align: center; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
input.input, select.input, textarea.input { width: 100%; height: 48px; padding: 0 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; outline: none; transition: border-color .15s, box-shadow .15s; }
input.input:focus, select.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .15); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--muted); letter-spacing: .8px; text-transform: uppercase; font-weight: 600; }
.field .hint { font-size: 11px; color: var(--muted); }
.input-icon { position: relative; }
.input-icon .icon-wrap { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 42px; }
.range { width: 100%; accent-color: var(--accent); }

/* ---------------------------------------------------------------- portrait */
.portrait { width: 100%; height: 100%; background-size: cover; background-position: center top; position: relative; background-color: #1a1e25; }
.portrait.sheet { background-size: 200% auto; }
.portrait.generated { background: radial-gradient(circle at 70% 20%, color-mix(in srgb, var(--c) 40%, transparent), transparent 60%), linear-gradient(160deg, color-mix(in srgb, var(--c) 22%, var(--panel)), var(--panel)); display: grid; place-items: center; overflow: hidden; }
.portrait-num { position: absolute; right: 6px; top: -4px; font-family: var(--display); font-size: 92px; color: color-mix(in srgb, var(--c) 30%, transparent); line-height: 1; }
.portrait-helmet { color: color-mix(in srgb, var(--c) 80%, #fff); opacity: .85; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); }

/* ---------------------------------------------------------------- track map */
.trackmap { display: block; position: relative; min-height: 0; }
.trackmap svg { display: block; width: 100%; height: 100%; max-height: 100%; overflow: visible; }

/* ---------------------------------------------------------------- toasts / modals */
#toasts { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 300; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: rgba(28, 32, 39, .96); border: 1px solid var(--line2); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; transform: translateY(16px); opacity: 0; transition: .25s; max-width: min(92vw, 520px); backdrop-filter: blur(8px); }
.toast.in { transform: none; opacity: 1; }
.toast.success { border-color: rgba(149, 213, 165, .5); } .toast.success .toast-icon { color: var(--green); }
.toast.error { border-color: rgba(255, 60, 69, .5); } .toast.error .toast-icon { color: var(--red); }
.toast-icon { display: inline-flex; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 6, 8, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 18px; z-index: 200; opacity: 0; transition: opacity .2s; overflow-y: auto; }
/* Low graphics qualities (js/core/device.js): no blur behind bars and dialogs, it is redrawn every frame over the 3D. */
html.lite * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.modal-backdrop.in { opacity: 1; }
.modal-card { width: 100%; background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; box-shadow: 0 40px 100px rgba(0,0,0,.6); transform: translateY(14px) scale(.98); transition: transform .25s; max-height: calc(100vh - 36px); overflow-y: auto; }
.modal-backdrop.in .modal-card { transform: none; }
.dialog { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.dialog p { margin: 0; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.modal-close { position: absolute; right: 14px; top: 14px; }

/* ================================================================ shell */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; }
.sidebar { border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; background: linear-gradient(180deg, #0e1015, var(--bg)); }
.brand { display: flex; align-items: center; gap: 10px; padding: 28px 24px 26px; cursor: pointer; }
.brand-logo { display: block; width: 180px; max-width: 100%; height: auto; object-fit: contain; }
.appbar-brand { display: flex; flex: none; align-items: center; justify-content: center; border: 0; padding: 0; width: 96px; height: 48px; background: transparent; cursor: pointer; }
.appbar-brand img { display: block; width: 100%; height: 48px; object-fit: contain; }
@media (max-width: 420px) { .appbar-brand { width: 32px; } .appbar-brand img { width: 32px; height: 32px; } }
.brand-mark { display: block; width: 46px; height: 46px; flex: none; background: url('../assets/brand/clash-emblem-v2.png') center / contain no-repeat; }
.brand-name { font-family: var(--display); font-size: 31px; line-height: .8; }
.brand-name small { display: block; font-family: var(--body); font-weight: 600; font-size: 9.5px; letter-spacing: 6px; color: var(--muted); margin-top: 6px; }
.nav-label { font-size: 9px; letter-spacing: 1.8px; color: var(--muted); font-weight: 600; padding: 0 26px 10px; }
.nav { display: flex; flex-direction: column; gap: 3px; padding: 0 12px; }
.nav-item { display: flex; align-items: center; gap: 12px; height: 45px; padding: 0 13px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-align: left; position: relative; transition: .15s; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.on { color: #fff; background: linear-gradient(90deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .04)); font-weight: 600; }
.nav-item.on::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-item.on .icon-wrap { color: var(--accent); }
.nav-dot { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; margin-left: auto; box-shadow: 0 0 10px var(--accent); }
.side-card { margin: 22px 16px 10px; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: radial-gradient(circle at 100% 0%, rgba(233,188,102,.13), transparent 60%), var(--panel); }
.side-card h4 { font-family: var(--display); font-size: 23px; margin: 12px 0; line-height: 1; }
.side-links { padding: 4px 12px; display: flex; flex-direction: column; }
.side-links .nav-item { height: 40px; font-size: 12.5px; }
.version { padding: 12px 26px 22px; font-size: 9.5px; letter-spacing: 1px; color: #6b7280; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar { height: 72px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(12,14,18,.82); backdrop-filter: blur(10px); position: relative; z-index: 5; }
.crumbs { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.crumbs b { color: var(--text); font-weight: 600; }
.currency { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; padding: 7px 11px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.currency .icon-wrap { color: var(--gold); }
.currency.gems .icon-wrap { color: #8dcdbd; }
.currency.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.12); border-color: var(--gold); } }
.avatar { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); cursor: pointer; }
.avatar:hover { border-color: var(--muted); }
.topbar { transition: background .25s, border-color .25s, backdrop-filter .25s; }
.main { position: relative; }
/* Phone in landscape: a slimmer bar over the content; while scrolling down it
   turns see-through, scrolling back up makes it solid again. */
@media (orientation: landscape) and (max-height: 500px) {
  .topbar { position: absolute; left: 0; right: 0; top: 0; height: 48px; padding: 0 12px; gap: 8px; }
  .topbar.faded { background: rgba(12,14,18,.28); border-bottom-color: transparent; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
  .topbar .crumbs, .topbar .avatar { display: none; }
  .topbar .appbar-brand { height: 36px; width: 72px; }
  .topbar .appbar-brand img { height: 36px; }
  .topbar .iconbtn { width: 34px; height: 34px; }
  .topbar .currency { padding: 4px 8px; font-size: 12.5px; }
  .content { padding-top: 48px; }
  .page { padding-top: 16px; }
}
.content { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; }
.page { max-width: 1500px; margin: 0 auto; padding: 28px 30px 60px; animation: pagein .35s ease; }
@keyframes pagein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bottomnav { display: none; }
.menu-btn { display: none; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90; opacity: 0; pointer-events: none; transition: .2s; }
.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }

@media (max-width: 999px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 100; transform: translateX(-102%); transition: transform .25s; }
  .drawer-open .sidebar { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: inline-grid; }
  /* The crumbs didn't fit next to the counters (a 722 px tablet): Android's WebView then widened
     the whole page, and the race HUD and canvas, which share it, ran off the right edge. */
  .topbar .crumbs { display: none; }
}
@media (max-width: 649px) {
  .topbar { height: 60px; padding: 0 10px; gap: 8px; }
  .crumbs, .topbar .hide-m { display: none; }
  .currency { padding: 5px 8px; font-size: 12px; gap: 5px; }
  .page { padding: 20px 16px calc(96px + var(--safe-b)); }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: calc(64px + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(21,24,30,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 50; }
  .bottomnav button { border: 0; background: none; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; }
  .bottomnav button.on { color: #fff; }
  .bottomnav button { position: relative; }
  .bottomnav .bn-dot { position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
  .bottomnav button.on .icon-wrap { color: var(--accent); }
  h1.display { font-size: 34px; }
}

/* ================================================================ landing */
.landing { height: 100%; overflow-y: auto; }
.land-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; align-items: center; padding: 22px clamp(18px, 4vw, 48px); gap: 12px; }
.land-hero { position: relative; min-height: min(760px, 100vh); display: flex; align-items: center; overflow: hidden; }
.land-bg { position: absolute; inset: 0; background: url('../assets/images/race_hero.webp') right center / cover no-repeat; animation: kenburns 24s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.14) translateX(-2%); } }
.land-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #090b10 0%, rgba(9,11,16,.85) 42%, rgba(9,11,16,.1) 100%), linear-gradient(0deg, var(--bg), transparent 30%); }
.land-copy { position: relative; z-index: 2; padding: 120px clamp(20px, 6vw, 72px) 70px; max-width: 680px; }
.land-copy h1 { font-family: var(--display); font-size: clamp(60px, 9vw, 104px); line-height: .86; margin: 22px 0 22px; }
.land-copy h1 span { color: var(--accent); }
.land-copy p { font-size: 18px; color: #c1c5ce; line-height: 1.55; margin: 0 0 30px; max-width: 520px; }
.land-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 30px; padding: 36px clamp(20px, 6vw, 72px) 60px; max-width: 1200px; }
.land-legal { border-top: 1px solid var(--line); padding: 22px clamp(20px, 6vw, 72px) calc(28px + var(--safe-b)); color: var(--muted); font-size: 12px; max-width: 1200px; }
.land-legal p { margin: 0 0 10px; }
.land-legal nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.land-legal a { color: var(--muted); }
.land-legal a:hover { color: var(--text); }
.cookie-notice { position: fixed; left: 50%; bottom: calc(16px + var(--safe-b)); transform: translateX(-50%); z-index: 250; width: min(calc(100vw - 32px), 640px); display: flex; align-items: center; gap: 14px; background: rgba(20, 24, 31, .97); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px 12px 16px; box-shadow: var(--shadow); font-size: 12.5px; line-height: 1.45; color: var(--muted); backdrop-filter: blur(8px); }
.cookie-notice p { margin: 0; flex: 1; }
.cookie-notice a { color: var(--accent); }
@media (max-width: 520px) { .cookie-notice { flex-direction: column; align-items: stretch; } }
.land-features .num { font-family: var(--display); font-size: 34px; color: var(--accent); }
.land-features h3 { font-family: var(--display); font-size: 25px; margin: 6px 0 8px; }
.land-features p { color: var(--muted); line-height: 1.55; margin: 0; }
.land-stats { display: flex; gap: 34px; margin-top: 36px; flex-wrap: wrap; }
.land-stats b { font-family: var(--display); font-size: 34px; display: block; }
.land-stats span { font-size: 11px; color: var(--muted); letter-spacing: 1px; }

/* ================================================================ auth */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 90px 18px 40px; }
.auth-grid { width: 100%; max-width: 1060px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.auth-art h1 { font-family: var(--display); font-size: 62px; line-height: .9; margin: 18px 0 22px; }
.auth-art .art { height: 270px; border-radius: 16px; background: url('../assets/images/race_hero.webp') 70% center / cover; box-shadow: var(--shadow); }
.auth-card { padding: 30px; }
.auth-card h2 { font-size: 38px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 10px; letter-spacing: 2px; margin: 4px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.form-error { color: #ffb3b7; font-size: 13px; background: rgba(255, 60, 69, .08); border: 1px solid rgba(255, 60, 69, .25); padding: 10px 12px; border-radius: 10px; }
.form-note { color: var(--green); font-size: 13px; }
@media (max-width: 850px) { .auth-grid { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ================================================================ team setup */
.setup-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 22px; align-items: start; }
.setup-preview { position: sticky; top: 0; }
.studio { position: relative; height: 430px; border-radius: 18px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #262b35, #0d0f13 70%); border: 1px solid var(--line); }
.studio::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 60px); pointer-events: none; }
.studio .showroom-canvas { position: absolute; inset: 0; cursor: grab; }
.studio .showroom-canvas:active { cursor: grabbing; }
/* Pinch zoom is handled by the showroom; one finger still scrolls the page vertically. */
.showroom-canvas.zoomable { touch-action: pan-y; }
.studio-hud { position: absolute; left: 18px; right: 18px; top: 16px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; z-index: 2; }
.studio-team { font-family: var(--display); font-size: 34px; line-height: .9; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.studio-foot { position: absolute; left: 18px; bottom: 14px; font-size: 10.5px; color: var(--muted); letter-spacing: 1px; z-index: 2; pointer-events: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 9px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line2); display: grid; place-items: center; transition: transform .12s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.swatch .icon-wrap { color: rgba(0,0,0,.75); }
.avatars { display: flex; gap: 7px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.avatar-pick { width: 48px; height: 48px; border-radius: 50%; flex: none; overflow: hidden; border: 2px solid var(--line); padding: 0; background: var(--panel2); transition: .12s; }
.avatar-pick.on { border-color: #fff; transform: scale(1.06); box-shadow: 0 0 0 3px var(--accent); }
.avatar-pick .portrait { border-radius: 50%; }
.numfield { width: 84px; flex: none; }
.color-dots { display: flex; gap: 10px; }
.setup-preview .color-dots { margin-top: 12px; }
.color-dot { flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font-size: 13px; font-weight: 600; }
.color-dot .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.modal-card .swatches { justify-content: center; }
.dorsal-row { display: flex; gap: 12px; }
.dorsal-row .field { flex: 1; }
/* Team sponsors: three slots per group, slot 1 (biggest logo) widest. */
.spon-picker { gap: 12px; }
.spon-group { display: grid; gap: 6px; }
.spon-head { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.spon-slots { display: grid; grid-template-columns: 1.5fr 1.2fr 1fr; gap: 8px; align-items: end; }
.spon-slot { position: relative; min-width: 0; }
.spon-pick { width: 100%; display: grid; gap: 5px; padding: 6px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); text-align: left; transition: border-color .12s; }
.spon-pick:hover { border-color: var(--muted); }
.spon-slot.vacant .spon-pick { border-style: dashed; }
.spon-logo { aspect-ratio: 2 / 1; width: 100%; border-radius: 6px; overflow: hidden; display: grid; place-items: center; background-size: cover; background-position: center; font-family: var(--display); font-style: italic; font-size: 15px; line-height: 1; text-align: center; padding: 0 4px; white-space: nowrap; text-overflow: ellipsis; }
.spon-logo.add { background: transparent; border: 1px dashed var(--line2); color: var(--muted); font-size: 24px; font-style: normal; }
.spon-cap { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spon-cap b { color: var(--text); }
.spon-x { position: absolute; top: -7px; right: -7px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line2); background: var(--panel); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.spon-x:hover { background: var(--accent); border-color: var(--accent); }
.spon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 55vh; overflow-y: auto; padding: 2px; }
.spon-option { display: grid; gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); text-align: left; }
.spon-option:hover { border-color: var(--muted); }
.spon-option.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.spon-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; min-width: 0; }
.spon-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spon-meta span { color: var(--muted); white-space: nowrap; }
.studio-cats { margin-top: 12px; display: grid; gap: 8px; }
.studio-cats .hint { margin: 0; font-size: 11.5px; color: var(--muted); }
.studio-cats .chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.studio-cats .chip { justify-content: center; padding-left: 4px; padding-right: 4px; }
/* The set row sits in its own lane under the HUD (team name, category), with
   the helmet / suit / bike rows below it, so nothing overlaps. */
.studio .lv-pack { top: 96px; }
@media (max-width: 899px) { .setup-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } .setup-preview { position: static; } .studio { height: 380px; } .studio-team { font-size: 26px; }
  .studio .lv-pack { top: 92px; } .studio .lv-helmet { top: 148px; } .studio .lv-suit { top: 204px; } .studio .lv-bike { top: 260px; } }
@media (max-width: 649px) { .studio-team { font-size: 22px; } .studio-hud { left: 14px; right: 14px; top: 12px; } }

/* ================================================================ dashboard */
.dash-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(260px, 3fr); gap: 20px; }
.hero { position: relative; min-height: 380px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse at 70% 40%, #2a2f39, #0d0f13 70%); }
.hero .showroom-canvas { position: absolute; inset: 0; }
/* Livery design arrows over a showroom: helmet, suit, bike. */
.livery-arrows { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.lv-row { position: absolute; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; transform: translateY(-50%); }
.lv-helmet { top: 34%; } .lv-suit { top: 52%; } .lv-bike { top: 70%; }
.lv-pack { top: 15%; left: 50%; right: auto; transform: translate(-50%, -50%); gap: 10px; padding: 5px; border-radius: 999px; background: rgba(10, 12, 16, .72); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); transition: border-color .2s, background .2s; }
.lv-pack.premium { background: linear-gradient(90deg, rgba(233, 188, 102, .22), rgba(10, 12, 16, .72) 30%, rgba(10, 12, 16, .72) 70%, rgba(233, 188, 102, .22)); border-color: rgba(233, 188, 102, .55); }
.lv-pack .lv-arrow { width: 34px; height: 34px; }
.lv-pack .lv-arrow:hover { background: var(--gold); border-color: var(--gold); color: #1a1408; }
.lv-pack-label { display: grid; gap: 2px; min-width: 128px; text-align: center; line-height: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); }
.lv-pack-label small { white-space: nowrap; font-size: 9px; letter-spacing: 1.6px; color: var(--muted); font-weight: 700; }
.lv-pack.premium .lv-pack-label small { color: var(--gold); }
.lv-pack-label b { font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.lv-pack-label span { font-size: 10px; color: var(--muted); }
.lv-label b { display: inline-flex; align-items: center; gap: 6px; }
.lv-lock { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #1a1408; box-shadow: 0 0 0 3px rgba(233, 188, 102, .25); flex: none; }
.lv-row.locked .lv-label b { color: #f3dca8; }
.lv-locked { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: rgba(12, 13, 17, .88); border: 1px solid rgba(233, 188, 102, .6); box-shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 0 24px rgba(233, 188, 102, .18); backdrop-filter: blur(8px); pointer-events: auto; animation: lv-pop .25s ease-out; }
.lv-locked[hidden] { display: none; }
.lv-locked-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--gold); color: #1a1408; }
.lv-locked-copy { flex: 1; min-width: 0; display: grid; gap: 2px; line-height: 1.15; }
.lv-locked-copy small { font-size: 9.5px; letter-spacing: 1.6px; color: var(--gold); font-weight: 700; }
.lv-locked-copy b { font-family: var(--display); font-size: 17px; text-transform: uppercase; }
.lv-locked-copy span { font-size: 11px; color: var(--muted); }
.lv-buy { flex: none; gap: 6px; }
.font-picks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.font-pick { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line2); color: var(--muted); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; cursor: pointer; transition: border-color .15s, color .15s; }
.font-pick canvas { width: 100%; max-width: 96px; height: auto; }
.font-pick:hover { border-color: var(--muted); }
.font-pick.on { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset; }
@keyframes lv-pop { from { opacity: 0; transform: translate(-50%, 8px); } }
.lv-arrow { pointer-events: auto; width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(10, 12, 16, .7); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); cursor: pointer; transition: background .15s, transform .15s, border-color .15s; }
.lv-arrow:hover { background: var(--accent); border-color: var(--accent); }
.lv-arrow:active { transform: scale(.92); }
.lv-arrow.prev .icon-wrap { transform: scaleX(-1); }
.lv-label { position: absolute; left: 50px; display: grid; gap: 2px; line-height: 1; text-shadow: 0 2px 10px rgba(0, 0, 0, .8); pointer-events: none; }
.lv-label small { font-size: 9.5px; letter-spacing: 1.6px; color: var(--muted); font-weight: 700; }
.lv-label b { font-family: var(--display); font-size: 19px; text-transform: uppercase; letter-spacing: .5px; }
.lv-label span { font-size: 10px; color: var(--muted); }
@media (max-width: 649px) { .lv-arrow { width: 34px; height: 34px; } .lv-label { left: 42px; } .lv-label b { font-size: 16px; } .lv-row { left: 8px; right: 8px; } .lv-pack { left: 50%; right: auto; } .lv-pack-label { min-width: 104px; } .lv-pack-label b { font-size: 15px; } .lv-locked-copy span { display: none; } }
.showroom-loading { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 12px; font: 600 12px/1 var(--font-display, inherit); letter-spacing: 2px; color: #e8eaed; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .3s; }
.showroom-loading.on { opacity: 1; }
.showroom-loading i { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--red, #ff3c45); animation: showroom-spin .8s linear infinite; }
/* Over a bike still on stage (another category downloading): a small pill at the bottom. */
.showroom-loading.over { top: auto; bottom: 46px; transform: translateX(-50%); flex-direction: row; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(12,14,18,.75); font-size: 11px; }
.showroom-loading.over i { width: 14px; height: 14px; border-width: 2px; }
@keyframes showroom-spin { to { transform: rotate(360deg); } }
.hero .hero-stage { position: absolute; inset: 0; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,14,18,.92) 0%, rgba(12,14,18,.55) 32%, transparent 52%); pointer-events: none; }
.hero-copy { position: relative; z-index: 2; padding: 30px; display: flex; flex-direction: column; height: 100%; min-height: 380px; max-width: 470px; pointer-events: none; }
.hero-copy > * { pointer-events: auto; }
.hero-copy h2 { font-family: var(--display); font-size: clamp(46px, 5vw, 60px); line-height: .88; margin: 20px 0 12px; }
.hero-copy p { color: #cbced2; margin: 0 0 18px; line-height: 1.5; }
.hero-badge { position: absolute; right: 18px; top: 18px; z-index: 3; text-align: right; padding: 9px 13px; border-radius: 6px; border: 2px solid var(--c2); background: color-mix(in srgb, var(--c1) 90%, transparent); }
.hero-badge small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 1.3px; color: var(--c2); }
.hero-badge b { font-size: 13px; letter-spacing: .5px; }
.event-card { display: flex; flex-direction: column; min-height: 380px; }
.event-card .trackmap { flex: 1; min-height: 120px; padding: 10px 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; }
.kv > div small { display: block; font-size: 9px; color: var(--muted); letter-spacing: 1px; margin-bottom: 4px; }
.kv > div b { font-size: 14px; }
.lineup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.rider-card { display: grid; grid-template-columns: 140px 1fr; height: 186px; }
.rider-card .rc-photo { position: relative; overflow: hidden; }
.rider-card .rc-photo .tag { position: absolute; left: 10px; top: 10px; }
.rider-card .rc-num { position: absolute; left: 12px; bottom: 4px; font-family: var(--display); font-size: 48px; color: rgba(255,255,255,.92); text-shadow: 0 4px 16px rgba(0,0,0,.6); }
.rider-card .rc-body { padding: 17px; display: flex; flex-direction: column; min-width: 0; }
.rider-card .rc-body h3 { font-family: var(--display); font-size: 30px; margin: 2px 0 0; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circuit-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.circuit-mini { display: grid; grid-template-columns: 1fr 92px; align-items: center; gap: 10px; padding: 16px 18px; }
.circuit-mini h4 { font-family: var(--display); font-size: 25px; margin: 7px 0 4px; }
.circuit-mini .trackmap { height: 70px; }
.missions-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.mission { display: flex; align-items: center; gap: 14px; }
.mission .ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.08) 0); display: grid; place-items: center; flex: none; }
.mission .ring::after { content: attr(data-label); width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.mission .ring.long::after { font-size: 9px; letter-spacing: -.2px; }
.foot-status { display: flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 11px; color: var(--muted); }
.foot-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
@media (max-width: 899px) { .dash-top { grid-template-columns: 1fr; } .hero .hero-stage { width: 100%; opacity: .55; } .event-card { min-height: 0; } }
@media (max-width: 649px) { .hero-badge { display: none; } .lineup { grid-template-columns: 1fr; } .rider-card { grid-template-columns: 112px 1fr; height: 164px; } .rider-card .rc-body h3 { font-size: 25px; } .hero, .hero-copy { min-height: 360px; } .hero-copy { padding: 22px; } }

/* ================================================================ garage */
.garage-hero { position: relative; height: 300px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(ellipse at 65% 40%, #262b35, #0d0f13 70%); margin-bottom: 8px; }
.garage-hero .hero-stage { position: absolute; inset: 0 0 0 30%; }
.garage-hero .copy { position: absolute; left: 26px; top: 24px; bottom: 24px; display: flex; flex-direction: column; z-index: 2; pointer-events: none; }
.garage-hero .copy h2 { font-family: var(--display); font-size: 46px; line-height: .9; margin: auto 0 8px; }
.garage-hero.livery { height: 360px; }
@media (max-width: 649px) {
  /* Compact copy on top, then the set row and the part rows in their own lanes. */
  .garage-hero.livery { height: 480px; }
  .garage-hero.livery .hero-stage { inset: 136px 0 0 0; }
  .garage-hero.livery .copy { left: 18px; top: 16px; bottom: auto; }
  .garage-hero.livery .copy h2 { font-size: 26px; margin: 6px 0 4px; }
  .garage-hero.livery .bikelevel b { font-size: 34px; }
  .garage-hero.livery .lv-pack { top: 34px; }
  .garage-hero.livery .lv-helmet { top: 100px; } .garage-hero.livery .lv-suit { top: 160px; } .garage-hero.livery .lv-bike { top: 220px; }
}
.garage-hero.image { background-size: cover; background-position: center; }
.garage-hero.image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,14,18,.95), rgba(12,14,18,.5) 50%, transparent); }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.up-card { display: flex; flex-direction: column; gap: 14px; }
.up-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); }
.pips { display: flex; gap: 5px; }
.pips i { flex: 1; height: 7px; border-radius: 3px; background: rgba(255,255,255,.07); }
.pips i.on { background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 50%, transparent); }
.pips i.lock { background: repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 3px, transparent 3px 6px); }
.bikelevel { display: flex; align-items: baseline; gap: 6px; }
.garage-stats { display: grid; grid-template-columns: auto 1fr; gap: 10px 36px; align-items: center; }
.garage-stats-level { display: flex; flex-direction: column; gap: 8px; }
.garage-stats-level .bikelevel b { font-family: var(--display); font-size: 44px; line-height: 1; }
.garage-stats .meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.garage-stats .statline { margin-bottom: 8px; }
@media (max-width: 640px) { .garage-stats { grid-template-columns: 1fr; } .garage-stats .meters { gap: 0 16px; } }
.bikelevel b { font-family: var(--display); font-size: 54px; line-height: .8; }

/* ================================================================ riders */
.rider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 17px; }
.rider-tile .rt-photo { height: 190px; position: relative; }
.rider-tile .rt-photo .tag { position: absolute; left: 12px; top: 12px; }
.rider-tile .rt-num { position: absolute; right: 12px; bottom: 2px; font-family: var(--display); font-size: 52px; color: rgba(255,255,255,.8); text-shadow: 0 4px 16px rgba(0,0,0,.5); }
.rider-tile .rt-body { padding: 15px 16px 16px; }
.rider-tile h3 { font-family: var(--display); font-size: 29px; margin: 1px 0 8px; line-height: 1; }
.rider-tile .ovr { font-family: var(--display); font-size: 30px; }
.rider-tile .rt-photo .portrait-photo { background-position: center 22%; }
/* Narrow screens: two compact columns; the photo keeps its 4:5 ratio so the whole face shows. */
@media (max-width: 600px) {
  .rider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rider-tile .rt-photo { height: auto; aspect-ratio: 4 / 5; }
  .rider-tile .rt-photo .portrait-photo { background-position: center top; }
  .rider-tile .rt-photo .tag { left: 6px; top: 6px; font-size: 9px; padding: 3px 6px; }
  .rider-tile .rt-num { right: 6px; font-size: 32px; }
  .rider-tile .rt-body { padding: 9px 10px 10px; }
  .rider-tile h3 { font-size: 20px; margin: 1px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rider-tile .ovr { font-size: 22px; }
  .rider-tile .rt-body > .row:nth-child(4) { margin-top: 6px !important; gap: 6px; }
  .rider-tile .rt-body > .row:nth-child(4) .small.muted { display: none; }
  .rider-tile .rt-body > .row:nth-child(4) .tag { font-size: 9px; padding: 3px 6px; }
  .rider-tile .rt-cards { flex-direction: column; align-items: stretch; gap: 4px; margin-top: 6px; }
  .rider-tile .rt-cards .tiny { white-space: normal; font-size: 10px; line-height: 1.2; }
  .rider-tile .rt-lock svg { width: 20px; height: 20px; }
}
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.toolbar .input-icon { flex: 1; min-width: 220px; }
.rider-modal { display: grid; grid-template-columns: 220px 1fr; }
.rider-modal .rm-photo { min-height: 300px; position: relative; }
.rider-modal .rm-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.rider-modal .rm-head h2 { font-size: 38px; margin: 0; }
.rider-modal .rm-thumb { display: none; }
/* Narrow screens: the big photo becomes a thumbnail beside the name and everything tightens up. */
@media (max-width: 560px) {
  .rider-modal { grid-template-columns: 1fr; }
  .rider-modal .rm-photo { display: none; }
  .rider-modal .rm-body { padding: 14px; gap: 8px; }
  .rider-modal .rm-head { display: flex; align-items: center; gap: 12px; }
  .rider-modal .rm-thumb { display: block; width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; flex: none; position: relative; }
  .rider-modal .rm-thumb.locked .portrait { filter: blur(3px); transform: scale(1.08); }
  .rider-modal .rm-head h2 { font-size: 24px; line-height: 1.05; overflow-wrap: anywhere; }
  .rider-modal .rm-head .muted { font-size: 13px; }
  .rider-modal .statline { margin-bottom: 6px; }
  .rider-modal .notice { padding: 8px 10px; font-size: 12.5px; }
  .rider-modal .btn { height: 40px; font-size: 11.5px; letter-spacing: 1px; }
}

/* ================================================================ circuits */
.circuit-card { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: center; padding: 24px; overflow: hidden; }
.circuit-card h2 { font-family: var(--display); font-size: 46px; margin: 12px 0 10px; line-height: .9; }
.circuit-card .trackmap { height: 210px; }
.circuit-card .bg-num { position: absolute; right: 18px; bottom: -22px; font-family: var(--display); font-size: 160px; color: rgba(255,255,255,.025); pointer-events: none; }
.circuit-meta { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 20px; }
.circuit-meta div small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: 1px; margin-bottom: 3px; }
.circuit-meta div b { font-size: 15px; }
@media (max-width: 760px) { .circuit-card { grid-template-columns: 1fr; } .circuit-card .trackmap { height: 170px; } }

/* ================================================================ tables */
.board { display: flex; flex-direction: column; }
.board-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.board-row.top { background: rgba(149,213,165,.04); }
.board-row.me { background: linear-gradient(90deg, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), .05)); border-color: transparent; }
.board-row .pos { font-family: var(--display); font-size: 24px; color: var(--muted); }
.board-row.top .pos { color: var(--green); }
.board-row .pts { font-weight: 600; }
.board-row.me .pts { color: var(--accent); }
.zone-line { display: flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 1px; color: var(--green); padding: 8px 14px; }
.zone-line::after { content: ''; flex: 1; height: 1px; background: rgba(149,213,165,.35); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-box small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; margin-bottom: 10px; }
.stat-box b { font-family: var(--display); font-size: 38px; line-height: 1; }

/* ================================================================ rewards */
.pack-surface { position: relative; overflow: hidden; border-color: rgba(233,188,102,.35); background:
  radial-gradient(60% 120% at 14% 50%, rgba(233,188,102,.20), transparent 70%),
  repeating-linear-gradient(135deg, rgba(255,255,255,.018) 0 2px, transparent 2px 7px),
  linear-gradient(120deg, #1d1a14, var(--panel) 55%); box-shadow: 0 0 0 1px rgba(233,188,102,.12), 0 24px 60px rgba(0,0,0,.35); }
.pack-surface::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255,240,200,.07) 50%, transparent 60%); background-size: 250% 100%; animation: pack-sheen 5s ease-in-out infinite; }
@keyframes pack-sheen { 0%, 40% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.pack { display: grid; grid-template-columns: 300px 1fr; gap: 26px; align-items: center; position: relative; z-index: 1; }
.pack-copy h2 { font-size: 40px; margin: 16px 0 8px; }
.pack-copy > p { font-size: 15px; margin: 0 0 16px; max-width: 460px; }
.pack-loot { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.pack-loot span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(233,188,102,.25); }
.pack-loot b { font-family: var(--display); font-size: 24px; line-height: 1; }
.pack-loot small { font-size: 10px; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }

.pack-box { height: 250px; display: grid; place-items: center; position: relative; isolation: isolate; }
.pack-box > * { grid-area: 1 / 1; }
.pack-rays { width: 330px; height: 330px; border-radius: 50%; z-index: -3; background: repeating-conic-gradient(rgba(233,188,102,.22) 0 7deg, transparent 7deg 20deg); -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%); mask: radial-gradient(circle, #000 18%, transparent 66%); animation: chest-rays 18s linear infinite; }
.pack-glow { width: 250px; height: 250px; border-radius: 50%; z-index: -2; background: radial-gradient(circle, rgba(247,214,140,.5), rgba(233,188,102,.14) 45%, transparent 70%); animation: pulse 2.4s ease-in-out infinite; }
.pack-floor { width: 190px; height: 26px; align-self: end; margin-bottom: 18px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.65), transparent); animation: pack-shadow 3.2s ease-in-out infinite; }
.pack-case { display: grid; animation: pack-float 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.pack-case .chest-icon::before { inset: 14%; background: radial-gradient(circle, rgba(247,214,140,.55), transparent 70%); }
.pack-case .chest-icon img { filter: drop-shadow(0 14px 18px rgba(0,0,0,.6)) drop-shadow(0 0 22px rgba(233,188,102,.35)); }
@keyframes pack-float { 50% { transform: translateY(-12px) rotate(-1.5deg); } }
@keyframes pack-shadow { 50% { transform: scale(.82); opacity: .6; } }
.pack-sparks { width: 260px; height: 260px; position: relative; pointer-events: none; }
.pack-sparks i { position: absolute; left: 50%; top: 58%; width: 5px; height: 5px; border-radius: 50%; background: #fff3cf; box-shadow: 0 0 8px 2px rgba(247,214,140,.9); opacity: 0;
  --a: calc(var(--i) * 30deg); animation: pack-spark 2.6s ease-out infinite; animation-delay: calc(var(--i) * -.22s); }
@keyframes pack-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(-30px) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-125px) scale(1); } }
.pack-orb { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; z-index: 2; background: radial-gradient(circle at 35% 30%, #3a3324, #14120d); border: 1px solid rgba(233,188,102,.5); box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 16px rgba(233,188,102,.3); }
.pack-orb.coin { color: var(--gold); justify-self: start; align-self: start; margin: 26px 0 0 14px; animation: pack-orb 3.6s ease-in-out infinite; }
.pack-orb.gem { color: var(--green); border-color: rgba(149,213,165,.5); box-shadow: 0 8px 18px rgba(0,0,0,.5), 0 0 16px rgba(149,213,165,.3); justify-self: end; align-self: end; margin: 0 14px 44px 0; animation: pack-orb 3.6s ease-in-out -1.8s infinite; }
@keyframes pack-orb { 50% { transform: translateY(-10px) rotate(8deg); } }
.pack-sticker { justify-self: end; align-self: start; margin: 12px 18px 0 0; z-index: 3; padding: 6px 10px; border-radius: 8px; transform: rotate(10deg); font-family: var(--display); font-size: 18px; letter-spacing: 1px; color: #1a1408; background: linear-gradient(135deg, #f7dc9a, #e9bc66 50%, #b8862c); box-shadow: 0 6px 14px rgba(0,0,0,.45); animation: pack-sticker 1.8s ease-in-out infinite; }
@keyframes pack-sticker { 50% { transform: rotate(10deg) scale(1.08); } }
.pack-flash { width: 100%; height: 100%; z-index: 4; pointer-events: none; opacity: 0; background: radial-gradient(circle, #fff 0, rgba(255,240,200,.85) 25%, transparent 65%); }

/* Opening: the case rattles harder and harder, then a flash and it's gone */
.pack-box.shaking .pack-case { animation: pack-rattle 1.15s ease-in forwards; }
.pack-box.shaking .pack-glow { animation: pack-charge 1.15s ease-in forwards; }
.pack-box.shaking .pack-rays { animation-duration: 2s; }
.pack-box.shaking .pack-sticker, .pack-box.shaking .pack-orb { transition: opacity .3s; opacity: 0; }
.pack-box.opened .pack-case { animation: pack-gone .35s ease-out forwards; }
.pack-box.opened .pack-flash { animation: pack-flash .7s ease-out; }
@keyframes pack-rattle {
  0% { transform: none; } 10% { transform: rotate(-3deg); } 20% { transform: rotate(3deg); } 30% { transform: rotate(-4deg) translateY(-2px); }
  40% { transform: rotate(4deg); } 50% { transform: rotate(-6deg) translateY(-4px) scale(1.03); } 58% { transform: rotate(6deg) scale(1.04); }
  66% { transform: rotate(-8deg) translateY(-6px) scale(1.06); } 74% { transform: rotate(8deg) scale(1.08); } 82% { transform: rotate(-9deg) translateY(-8px) scale(1.1); }
  90% { transform: rotate(9deg) scale(1.13); } 100% { transform: translateY(-10px) scale(1.18); } }
@keyframes pack-charge { to { transform: scale(1.7); opacity: 1; filter: brightness(1.6); } }
@keyframes pack-gone { to { transform: scale(1.5); opacity: 0; filter: brightness(3); } }
@keyframes pack-flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.6); } }

.gift-reveal h2 { font-size: 40px; margin: 0; }
.gift-loot { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.gift-loot > div { min-width: 150px; padding: 14px 18px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(0,0,0,.3); border: 1px solid rgba(233,188,102,.35); animation: card-in .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.gift-loot b { font-family: var(--display); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.gift-loot small { font-size: 10px; letter-spacing: 1.4px; font-weight: 700; color: var(--muted); }
@keyframes float { 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes pulse { 50% { transform: scale(1.15); opacity: .6; } }
.reward-table { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.reward-table div { padding: 16px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.reward-table b { font-family: var(--display); font-size: 30px; display: block; margin: 6px 0 2px; }
@media (max-width: 700px) { .pack { grid-template-columns: 1fr; text-align: center; } .pack-copy h2 { font-size: 32px; } .pack-copy > p { margin-inline: auto; } .pack-loot { justify-content: center; } .reward-table { grid-template-columns: 1fr; } }

/* ================================================================ career */
.calendar { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.round { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); position: relative; overflow: hidden; }
.round .trackmap { height: 64px; margin: 6px 0; opacity: .8; }
.round .rn { font-family: var(--display); font-size: 22px; color: var(--muted); }
.round.done { border-color: rgba(149,213,165,.35); }
.round.done .rn { color: var(--green); }
.round.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 12px 40px rgba(var(--accent-rgb), .15); }
.round.next .rn { color: var(--accent); }
.code-box { padding: 16px; border-radius: 12px; background: var(--bg); border: 1px solid rgba(233,188,102,.4); }
.code-box .code { font-family: var(--display); font-size: 26px; color: var(--gold); letter-spacing: 1px; word-break: break-all; }

/* ================================================================ race screen */
.race { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; z-index: 60; }
.race-top { height: calc(64px + var(--safe-t)); flex: none; display: flex; align-items: center; gap: 12px; padding: var(--safe-t) 16px 0; background: rgba(10, 12, 16, .96); border-bottom: 1px solid var(--line); z-index: 4; }
.race-title { min-width: 0; flex: 1; }
.race-title h2 { font-family: var(--display); font-size: 26px; margin: 0; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race-title small { font-size: 10px; color: var(--muted); letter-spacing: 1.2px; }
.lapbox { text-align: center; padding: 0 12px; }
.lapbox small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: 1.2px; }
.lapbox b { font-family: var(--display); font-size: 28px; line-height: 1; }
.speedbtn { min-width: 46px; height: 38px; border-radius: 9px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 700; }
.race-body { flex: 1; position: relative; overflow: hidden; }
.stage3d { position: absolute; inset: 0; }
.race-canvas { display: block; touch-action: none; }
.bike-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.bike-label { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 4px; padding: 3px 7px 3px 4px; border-radius: 5px; background: rgba(10,12,16,.82); border-left: 3px solid var(--c); font-size: 11px; font-weight: 600; white-space: nowrap; will-change: transform; }
.bike-label b { background: var(--c); color: #fff; border-radius: 3px; padding: 0 4px; font-size: 10px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.bike-label b:empty { display: none; }
.bike-label.rival { border-left-color: var(--blue); }
.bike-label.rival b { background: #3d74c9; }
.bike-label.far { opacity: .7; transform-origin: bottom center; font-size: 9.5px; }
.bike-label.followed { font-size: 12.5px; padding: 4px 10px 4px 5px; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.scorebar { height: 48px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 20px; background: linear-gradient(90deg, rgba(var(--accent-rgb), .16), var(--panel) 30%, var(--panel) 70%, rgba(120,170,237,.16)); border-bottom: 1px solid var(--line); z-index: 3; }
.scorebar .team { flex: 1; font-weight: 600; font-size: 12px; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.scorebar .team.right { justify-content: flex-end; }
.scorebar .score { font-family: var(--display); font-size: 30px; min-width: 40px; text-align: center; transition: transform .25s; }
.scorebar .score.pop { transform: scale(1.3); }
.scorebar .bar { width: 4px; height: 24px; border-radius: 2px; }

.hud { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.hud > * { pointer-events: auto; }
.tower { position: absolute; left: 14px; top: 14px; width: 232px; background: rgba(10, 12, 16, .82); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; backdrop-filter: blur(8px); overflow: hidden; max-height: calc(100% - 28px - var(--ctrl-h, 0px)); display: flex; flex-direction: column; }
.tower-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 6px 5px 12px; font-size: 9.5px; color: var(--muted); letter-spacing: 1px; border-bottom: 1px solid rgba(255,255,255,.06); }
.tower-head .th-gap { margin-left: auto; }
.tower-list { position: relative; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; overscroll-behavior: contain; touch-action: pan-y; flex: 1 1 auto; min-height: 0; }
.tower-row { position: absolute; left: 0; right: 0; height: 26px; display: grid; grid-template-columns: 22px 3px 1fr auto 16px; gap: 7px; align-items: center; padding: 0 10px; font-size: 11px; transition: transform .45s cubic-bezier(.3,.8,.3,1), background .3s; cursor: pointer; }
.tower-row:hover { background: rgba(255,255,255,.04); }
.tower-row .p { font-weight: 700; text-align: right; }
.tower-row .c { height: 13px; border-radius: 2px; }
.tower-row .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tower-row .g { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.tower-row .t { font-size: 9px; font-weight: 700; text-align: center; }
/* Your riders in green, the rival team's in red. */
.tower-row.player { background: rgba(149,213,165,.16); }
.tower-row.player .p { color: var(--green); }
.tower-row.rival { background: rgba(var(--accent-rgb), .16); }
.tower-row.rival .p { color: var(--accent); }
.tower-row.follow { box-shadow: inset 2px 0 0 var(--focus); }
.tower-row .pit { font-size: 8.5px; color: var(--gold); font-weight: 700; }
.tower-row .g.purple { color: var(--purple); font-weight: 700; }
.tower-toggle { flex: none; height: 16px; border: 0; border-top: 1px solid rgba(255,255,255,.06); background: transparent; color: var(--muted); font-size: 14px; line-height: 1; padding: 0; cursor: pointer; }
.tower-toggle:hover { color: #fff; }
/* Collapsed tower: positions and names only, no gaps or tyres. */
.tower.compact { width: 118px; }
.tower.compact .tower-head .th-gap, .tower.compact .tower-row .g, .tower.compact .tower-row .t { display: none; }
.tower.compact .tower-row { grid-template-columns: 22px 3px 1fr; }
/* Lite HUD (low quality / adaptive savings): blurring what is behind a panel
   over a moving 3D canvas is very costly on weak GPUs; use flat panels. */
.race.lite .tower, .race.lite .pill, .race.lite .minimap, .race.lite .tele-card, .race.lite .practice-panel, .race.lite .overlay.dim, .race.lite .results { backdrop-filter: none; -webkit-backdrop-filter: none; }
.race.lite .tower, .race.lite .pill, .race.lite .minimap, .race.lite .tele-card { background: rgba(10, 12, 16, .9); }
.race.lite .driver { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(14, 16, 21, .6); }

.hud-right { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px; background: rgba(10,12,16,.82); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(8px); font-size: 11.5px; }
button.pill:hover { border-color: rgba(255,255,255,.25); }
.pill .icon-wrap.sun { color: var(--gold); } .pill .icon-wrap.rain { color: var(--blue); }
.cam-menu { position: absolute; right: 0; top: 42px; background: rgba(16,18,23,.97); border: 1px solid var(--line2); border-radius: 12px; padding: 6px; min-width: 220px; box-shadow: var(--shadow); z-index: 10; }
.cam-menu button { width: 100%; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 12.5px; color: var(--muted); }
.cam-menu button:hover { background: var(--panel2); color: var(--text); }
.cam-menu button.on { color: #fff; background: rgba(var(--accent-rgb), .14); }
.cam-menu kbd { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; }
.cam-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.minimap { position: absolute; right: 14px; bottom: calc(14px + var(--ctrl-h, 0px)); width: 250px; height: 184px; background: rgba(10,12,16,.78); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; backdrop-filter: blur(6px); }
.radio { position: absolute; left: 260px; bottom: calc(14px + var(--ctrl-h, 0px)); right: 280px; display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: rgba(10,12,16,.85); border-radius: 9px; border: 1px solid rgba(255,255,255,.06); font-size: 11.5px; color: #d3d6dc; max-width: 560px; }
.radio .icon-wrap { color: var(--gold); }
.radio span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio.flash { animation: flash .8s; }
.radio { transition: opacity .35s, transform .35s; }
.radio.gone { opacity: 0; transform: translateY(6px); pointer-events: none; }
@keyframes flash { 30% { background: rgba(233,188,102,.25); } }
.telemetry { position: absolute; left: 260px; top: 14px; display: flex; gap: 8px; }
.tele-card { padding: 8px 12px; background: rgba(10,12,16,.82); border: 1px solid rgba(255,255,255,.08); border-radius: 9px; min-width: 120px; backdrop-filter: blur(8px); }
.tele-card small { display: block; font-size: 9px; color: var(--muted); letter-spacing: 1px; }
.tele-card b { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.sectors { display: flex; gap: 3px; margin-top: 5px; }
.sectors i { flex: 1; height: 5px; border-radius: 2px; background: rgba(255,255,255,.12); min-width: 22px; }
.sectors i.normal { background: var(--gold); } .sectors i.green { background: #36d26b; } .sectors i.purple { background: var(--purple); }
.delta.neg { color: #36d26b; } .delta.pos { color: var(--accent); }

.banner { position: absolute; left: 50%; top: 18%; transform: translate(-50%, -10px); padding: 12px 26px; border-radius: 10px; background: rgba(10,12,16,.9); border: 1px solid var(--line2); text-align: center; opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; min-width: 260px; }
.banner.in { opacity: 1; transform: translate(-50%, 0); }
.banner small { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.banner b { font-family: var(--display); font-size: 34px; line-height: 1.05; }
.banner.green { border-color: #36d26b; } .banner.green b { color: #7ff0a4; }
.banner.purple { border-color: var(--purple); } .banner.purple b { color: #d7a8ff; }
.banner.red { border-color: var(--accent); } .banner.red b { color: #ff7a80; }
.banner.blue { border-color: var(--blue); } .banner.blue b { color: #a9c9f5; }
.banner.gold { border-color: var(--gold); } .banner.gold b { color: var(--gold); }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; z-index: 6; text-align: center; }
.overlay.dim { background: rgba(8,9,12,.55); backdrop-filter: blur(3px); }
/* Start: small lights at the top with the launch button below, bike in view. */
.overlay.start { display: block; pointer-events: none; }
.start-top { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.start-top .launch-btn { pointer-events: auto; }
.race-body:has(> .overlay.start) .bike-label.followed { visibility: hidden; }
.lights { display: flex; gap: 8px; padding: 9px 11px; background: rgba(10,11,14,.92); border-radius: 12px; border: 1px solid #222; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.lights .lamp { width: 30px; display: flex; flex-direction: column; gap: 5px; padding: 5px; background: #111317; border-radius: 7px; }
.lights .lamp i { width: 20px; height: 20px; border-radius: 50%; background: #2a0d0e; margin: 0 auto; transition: background .08s, box-shadow .08s; }
.lights .lamp.on i { background: #ff2a2a; box-shadow: 0 0 12px #ff2a2a, 0 0 28px rgba(255,42,42,.45); }
.lights.go .lamp i { background: #1d3; box-shadow: 0 0 12px #1d3; }
.launch-btn { height: 52px; padding: 0 30px; font-size: 16px; letter-spacing: 3px; }
.pause-card { padding: 30px 36px; background: rgba(16,18,23,.92); border: 1px solid var(--line2); border-radius: 18px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pause-card h2 { font-family: var(--display); font-size: 46px; margin: 0 0 6px; }

.controls.single { grid-template-columns: minmax(0, 780px) !important; justify-content: center; }
/* Overlaid on the bottom of the track: only the cards catch taps. */
.controls { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; padding: 12px 14px calc(12px + var(--safe-b)); pointer-events: none; z-index: 3; }
.controls > * { pointer-events: auto; }
.driver { position: relative; background: rgba(14, 16, 21, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; transition: border-color .2s, box-shadow .2s; min-width: 0; }
/* The rider the camera follows reads at a glance: neon border with a glow, green
   position, a CÁMARA tag, and a pulse each time the camera switches to it. */
.driver.follow { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), 0 0 16px rgba(57,255,20,.4); animation: follow-pulse .7s ease-out 2; }
.driver.follow::before { content: 'CÁMARA'; position: absolute; top: -8px; left: 12px; padding: 2px 6px; border-radius: 4px; background: var(--focus); color: #08130a; font-size: 8.5px; font-weight: 800; letter-spacing: 1px; line-height: 1; pointer-events: none; }
.driver.follow .driver-pos { color: #08130a; background: var(--focus); }
@keyframes follow-pulse { from { box-shadow: 0 0 0 1px var(--focus), 0 0 0 0 rgba(57,255,20,.8); } to { box-shadow: 0 0 0 1px var(--focus), 0 0 0 12px rgba(57,255,20,0); } }
.driver-head { display: flex; align-items: center; gap: 11px; cursor: pointer; }
.driver-pos { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; font-family: var(--display); font-size: 25px; color: var(--accent); background: rgba(var(--accent-rgb), .13); flex: none; }
.driver-name { min-width: 0; flex: 1; }
.driver-name b { display: block; font-family: var(--display); font-size: 25px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-name small { font-size: 10px; color: var(--muted); letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.driver-state { text-align: right; font-size: 10px; letter-spacing: .8px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.driver-state.attack { color: var(--accent); }
.info-btn { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line2); background: var(--bg); color: var(--muted); font: italic 700 12px/1 Georgia, serif; display: grid; place-items: center; padding: 0; transition: .12s; }
.info-btn:hover { color: var(--text); border-color: var(--focus); }
.info-dialog { max-height: min(82vh, 760px); overflow-y: auto; }
.info-sec { display: flex; flex-direction: column; gap: 8px; }
.info-sec h3 { margin: 6px 0 0; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.info-sec p { font-size: 12px; }
.info-tyre { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; }
.info-tyre.on { border-color: var(--line2); background: var(--bg); }
.info-tyre > div, .info-item { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; line-height: 1.45; }
.info-tyre b, .info-item b { font-size: 13px; }
.info-item { padding-left: 10px; border-left: 3px solid var(--c, var(--line2)); }
.info-item span, .info-tyre span { color: var(--muted); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.meters .mlabel { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 4px; }
.meters .mlabel b { color: var(--text); font-weight: 600; }
.meters .low .meter i { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .35; } }
.pace { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.pace button { height: 46px; border-radius: 7px; border: 1px solid var(--line); background: rgba(8,9,12,.5); color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 600; transition: .12s; }
.pace button:hover:not(:disabled) { color: var(--text); border-color: var(--line2); }
.pace button.on { color: #fff; border-color: transparent; }
.pace button.on.p0 { background: #2f5ea8; } .pace button.on.p1 { background: #2a7a48; box-shadow: 0 0 14px rgba(54,210,107,.28); } .pace button.on.p2 { background: var(--accent2); box-shadow: 0 0 16px rgba(var(--accent-rgb), .35); }
.pace button kbd { font-size: 9px; opacity: .55; font-family: var(--body); }
.selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.selector { display: flex; align-items: center; gap: 4px; }
.selector > span { font-size: 9.5px; color: var(--muted); font-weight: 600; width: 40px; flex: none; letter-spacing: .5px; }
.selector button { flex: 1; height: 36px; border-radius: 5px; border: 1px solid var(--line); background: rgba(8,9,12,.5); color: var(--muted); font-size: 10.5px; font-weight: 600; }
.selector button.on { color: #fff; border-color: transparent; background: var(--c); }
.driver-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.driver-actions .box-tyres { flex: 1 0 100%; justify-content: center; order: -1; }
.driver-actions .btn { flex: 1; }
@media (max-width: 760px) {
  .tower { left: 6px; top: 6px; width: 108px; max-height: calc(100% - 12px - var(--ctrl-h, 0px)); border-radius: 7px; background: rgba(10, 12, 16, .7); }
  .tower-head { display: none; }
  .tower-row { height: 19px; grid-template-columns: 12px 3px minmax(3.4ch, 1fr) auto 7px; gap: 3px; font-size: 9.5px; padding: 0 4px 0 3px; }
  .tower-row .c { height: 10px; }
  .tower-row .t { font-size: 8px; }
  .tower-row .g { font-size: 8.5px; letter-spacing: -.2px; }
  .tower.compact { width: 58px; }
  .tower.compact .tower-row { grid-template-columns: 12px 3px minmax(3.4ch, 1fr); }
  .lights { gap: 4px; padding: 5px 6px; border-radius: 9px; }
  .lights .lamp { width: 20px; gap: 3px; padding: 3px; border-radius: 5px; }
  .lights .lamp i { width: 13px; height: 13px; }
  .lights .lamp.on i { box-shadow: 0 0 8px #ff2a2a, 0 0 18px rgba(255,42,42,.4); }
  .start-top { top: 8px; gap: 8px; }
  .launch-btn { height: 42px; padding: 0 22px; font-size: 13px; letter-spacing: 2px; }
  /* Narrow screens: compact 2×2 telemetry between the tower and the pills,
     hidden only while the start lights use that space. */
  .telemetry { left: 122px; right: 54px; top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
  .race-body:has(> .overlay.start) .telemetry { display: none; }
  .tele-card { min-width: 0; padding: 4px 7px; border-radius: 7px; }
  .tele-card small { font-size: 8px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tele-card b { font-size: 16px; line-height: 1.1; }
  .tele-card > small:not(:first-child), .tele-card > div, .tele-card .delta { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tele-card > div b { font-size: 11px; }
  .sectors { margin-top: 3px; } .sectors i { min-width: 0; height: 4px; }
  .hud-right { right: 8px; top: 8px; gap: 6px; }
  .hud-right .pill { height: 30px; padding: 0 9px; gap: 5px; font-size: 11px; }
  .pill .pill-txt { display: none; }
  .cam-menu { top: 36px; }
  .minimap { right: 8px; bottom: calc(8px + var(--ctrl-h, 0px)); width: 128px; height: 96px; border-radius: 8px; }
  .radio { left: 122px; right: 8px; bottom: calc(110px + var(--ctrl-h, 0px)); }
  .controls { gap: 8px; padding: 8px 8px calc(8px + var(--safe-b)); }
  .driver { padding: 9px; gap: 7px; }
  .driver-pos { width: 32px; height: 32px; font-size: 20px; }
  .driver-name b { font-size: 19px; }
  .meters { grid-template-columns: 1fr; gap: 5px; }
  .pace button { height: 42px; }
  .pace button span:not(.icon-wrap), .pace button kbd { display: none; }
  .banner { min-width: 0; padding: 8px 16px; top: 22%; } .banner b { font-size: 24px; }
  .selectors { grid-template-columns: 1fr; gap: 4px; }
  .selector > span { width: 30px; font-size: 8.5px; }
  .selector button { height: 32px; font-size: 9.5px; }
  .race-top { height: calc(56px + var(--safe-t)); padding: var(--safe-t) 8px 0; gap: 6px; }
  .race-title h2 { font-size: 20px; }
  .lapbox b { font-size: 22px; }
  .scorebar { height: 42px; padding: 0 12px; }
  .scorebar .team .tname { display: none; }
  .driver-state { display: none; }
  .hide-m { display: none !important; }
}

/* ---------------------------------------------------------------- immersive race layout
   Port of the Unity build's race.uss "immersive" block: full-screen 3D with the
   top bar, score bar, HUD and driver cards floating on top, on every platform.
   Landscape is the base; (orientation: portrait) holds the phone-portrait overrides. */
.race.immersive .race-body { position: absolute; inset: 0; }
.race.immersive .hide-m, .race.immersive .pace button kbd { display: none !important; }
.race.immersive .race-top { position: absolute; left: 0; top: 0; right: 0; height: calc(44px + var(--safe-t)); padding: var(--safe-t) 8px 0; gap: 6px; border-bottom: 0; background: rgba(8, 10, 14, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 7; }
.race.immersive .race-title h2 { font-size: 20px; }
.race.immersive .race-title small { display: block; font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race.immersive .lapbox b { font-size: 22px; }
.race.immersive .lapbox small { font-size: 8px; }
.race.immersive .speedbtn { height: 32px; min-width: 38px; }
.race.immersive .scorebar { position: absolute; top: 5px; left: 31%; right: 31%; height: 34px; padding: 0 10px; gap: 8px; border-radius: 9px; border: 1px solid rgba(255,255,255,.1); z-index: 8; }
.race.immersive .scorebar .score { font-size: 24px; min-width: 32px; }
.race.immersive .scorebar .team { font-size: 10px; }
.race.immersive .scorebar .team .tname { display: none; }
.race.immersive .hud { top: 48px; }
/* Full screen under the camera cutout: the 3D runs behind it, the HUD starts below it. */
.race.immersive .scorebar, .race.immersive .hud, .race.immersive .start-top { margin-top: var(--safe-t); }
.race.immersive .tower { left: 6px; top: 0; width: 150px; border-radius: 8px; background: rgba(10, 12, 16, .62); max-height: calc(100% - 8px - var(--ctrl-h, 0px)); }
.race.immersive .tower-head { display: none; }
.race.immersive .tower-row { height: 19px; font-size: 10px; padding: 0 5px 0 3px; grid-template-columns: 18px 3px minmax(0, 1fr) auto 10px; gap: 5px; }
.race.immersive .tower-row .c { height: 10px; }
.race.immersive .tower.dense .tower-row { font-size: 9px; } .race.immersive .tower.dense .tower-row .c { height: 9px; }
.race.immersive .tower.compact { width: 70px; }
.race.immersive .tower.compact .tower-row { grid-template-columns: 18px 3px minmax(0, 1fr); }
.race.immersive .telemetry { display: flex; left: 162px; right: 228px; top: 0; gap: 4px; }
.race.immersive .race-body:has(> .overlay.start) .telemetry { display: none; }
.race.immersive .tele-card { flex: 1 1 0; min-width: 0; padding: 4px 7px; border-radius: 7px; background: rgba(10, 12, 16, .7); overflow: hidden; }
.race.immersive .tele-card small { font-size: 8px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race.immersive .tele-card b { font-size: 16px; white-space: nowrap; line-height: 1.1; }
.race.immersive .tele-card > small:not(:first-child), .race.immersive .tele-card > div, .race.immersive .tele-card .delta { font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.race.immersive .tele-card > div b { font-size: 11px; }
.race.immersive .sectors { margin-top: 3px; } .race.immersive .sectors i { min-width: 0; height: 4px; }
.race.immersive .start-top { top: 50px; }
.race.immersive .launch-btn { height: 42px; padding: 0 22px; font-size: 13px; letter-spacing: 2px; }
.race.immersive .hud-right { top: 0; right: 6px; flex-direction: row; align-items: flex-start; gap: 6px; }
.race.immersive .pill { height: 30px; padding: 0 9px; gap: 5px; font-size: 10.5px; background: rgba(10, 12, 16, .62); }
.race.immersive .hud-right > div .pill-txt { display: none; }
.race.immersive .cam-menu { top: 36px; }
.race.immersive .minimap { top: 38px; bottom: auto; right: 6px; width: 170px; height: 120px; background: rgba(10, 12, 16, .55); border-radius: 8px; }
.race.immersive .radio { top: 64px; bottom: auto; left: 31%; right: 31%; padding: 5px 10px; font-size: 10.5px; background: rgba(10, 12, 16, .62); }
.race.immersive .banner { min-width: 0; padding: 8px 16px; } .race.immersive .banner b { font-size: 24px; }
.race.immersive .controls { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; padding: 4px 6px calc(6px + var(--safe-b)); background: transparent; }
.race.immersive .controls.single { justify-content: flex-start; }
.race.immersive .driver { flex: 0 1 33%; max-width: 33%; padding: 6px 8px; gap: 5px; border-radius: 12px; background: rgba(12, 14, 19, .86); border-color: rgba(255,255,255,.1); }
.race.immersive .driver.follow { border-color: var(--focus); }
.race.immersive .driver-pos { width: 28px; height: 28px; font-size: 18px; border-radius: 7px; }
.race.immersive .driver-name b { font-size: 17px; }
.race.immersive .driver-name small { font-size: 9px; }
.race.immersive .driver-state { font-size: 8.5px; }
.race.immersive .meters { gap: 4px 10px; }
.race.immersive .meters .mlabel { margin-bottom: 2px; font-size: 9px; }
.race.immersive .pace button { height: 42px; border-radius: 9px; background: rgba(8,10,14,.9); border-color: rgba(255,255,255,.1); font-size: 10px; }
.race.immersive .pace button.on { color: #fff; border-color: rgba(255,255,255,.35); }
.race.immersive .pace button.on.p0 { background: #2f5ea8; } .race.immersive .pace button.on.p1 { background: #2a7a48; } .race.immersive .pace button.on.p2 { background: var(--accent2); }
.race.immersive .selector button { height: 36px; border-radius: 8px; background: rgba(8,10,14,.9); border-color: rgba(255,255,255,.1); }
.race.immersive .selector button.on { background: var(--c); }
.race.immersive .selector > span { width: 30px; font-size: 8.5px; }
.race.immersive .driver-actions { gap: 6px; }
.race.immersive .driver-actions .btn { min-width: 0; padding: 0 8px; font-size: 11px; letter-spacing: .4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Practice times: the free bottom-right corner (the single driver card sits bottom left). */
.race.immersive .practice-panel { left: auto; right: 6px; top: auto; bottom: 6px; width: 290px; max-height: calc(100% - 172px); padding: 8px 10px; border-radius: 10px; background: rgba(10, 12, 16, .78); font-size: 10.5px; }
.race.immersive .practice-panel.hidden, .race.immersive .practice-panel.empty { display: none; }
.race.immersive .practice-panel h4 { font-size: 9.5px; letter-spacing: .5px; margin-bottom: 4px; }

@media (orientation: portrait) {
  .race.immersive .race-top { height: calc(52px + var(--safe-t)); }
  .race.immersive .scorebar { top: 58px; left: 8px; right: 8px; height: 38px; }
  .race.immersive .hud { top: 56px; }
  .race.immersive:has(.scorebar:not(.hidden)) .hud { top: 100px; }
  .race.immersive .tower { width: 112px; }
  .race.immersive .tower.compact { width: 62px; }
  .race.immersive .hud-right { flex-direction: column; align-items: flex-end; }
  .race.immersive .minimap { top: auto; bottom: calc(6px + var(--ctrl-h, 0px)); width: 150px; height: 125px; }
  .race.immersive .radio { top: auto; bottom: calc(137px + var(--ctrl-h, 0px)); left: 124px; right: 8px; }
  .race.immersive .start-top { top: 104px; padding-left: 112px; }
  .race.immersive .telemetry { left: 124px; right: 58px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Both driver cards side by side, taller and narrower; the actions stack so no label is cut. */
  .race.immersive .controls { flex-direction: row; align-items: flex-end; }
  .race.immersive .driver { flex: 1 1 0; max-width: none; padding: 6px; }
  .race.immersive .controls.single { justify-content: center; }
  .race.immersive .controls.single .driver { flex: 0 0 calc(50% - 3px); }
  .race.immersive .driver-name b { font-size: 15px; }
  .race.immersive .controls:not(.single) .info-btn { display: none; }
  .race.immersive .controls .meters { grid-template-columns: 1fr; gap: 3px; }
  .race.immersive .pace button { height: 46px; border-radius: 10px; }
  .race.immersive .pace button span:not(.icon-wrap) { display: none; }
  .race.immersive .controls .selectors { grid-template-columns: 1fr; gap: 4px; }
  .race.immersive .selector > span { width: 26px; }
  .race.immersive .selector button { height: 36px; border-radius: 9px; font-size: 10px; }
  .race.immersive .controls .driver-actions { flex-direction: column; }
  .race.immersive .controls .driver-actions .btn { flex: none; width: 100%; height: 36px; font-size: 10.5px; letter-spacing: .3px; padding: 0 4px; }
  /* Practice (single rider): no standings, times on the left, telemetry stacked between them and the pills. */
  .race.immersive .hud.practice .tower { display: none; }
  .race.immersive .hud.practice .radio { left: 8px; }
  .race.immersive .practice-panel { left: 6px; right: auto; top: 0; bottom: auto; width: calc(60% - 6px); max-height: calc(100% - 140px - var(--ctrl-h, 0px)); padding: 6px 8px; }
  .race.immersive .hud.practice .telemetry { left: calc(60% + 6px); right: 58px; display: flex; flex-direction: column; }
  .race.immersive .hud.practice .tele-card { flex: none; padding: 6px 9px; }
  .race.immersive .hud.practice .tele-card b { font-size: 19px; }
  .race.immersive .hud.practice .tele-card > small:not(:first-child), .race.immersive .hud.practice .tele-card > div { font-size: 9px; }
  .race.immersive .hud.practice .sectors { margin-top: 5px; }
  .race.immersive .hud.practice:has(.practice-panel.empty) .telemetry { left: 6px; right: 58px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- preparation */
.prep { position: absolute; inset: 0; overflow-y: auto; background: radial-gradient(ellipse at 80% -10%, rgba(var(--accent-rgb), .16), transparent 50%), linear-gradient(90deg, rgba(10,12,16,.95), rgba(10,12,16,.82) 50%, rgba(10,12,16,.95)); z-index: 5; }
.race.immersive .prep { top: calc(44px + var(--safe-t)); }
.prep-timer { position: sticky; top: 0; z-index: 4; pointer-events: none; }
.prep-timer-pill { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 14px 9px; background: rgba(10,12,16,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); font-size: 12.5px; color: #c9ccd2; }
.prep-timer-pill .icon, .prep-timer-pill svg { width: 15px; height: 15px; color: var(--gold); flex: none; }
.prep-timer-pill b { font-family: var(--display); font-size: 17px; line-height: 1; color: var(--gold); min-width: 1.4ch; text-align: right; }
.prep-timer-pill em { font-style: normal; font-size: 11px; color: var(--muted); }
.prep-timer-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.08); }
.prep-timer-track i { display: block; height: 100%; background: var(--gold); transform-origin: left; transition: transform .2s linear, background .2s; }
.prep-timer-pill.hurry { border-color: var(--accent); }
.prep-timer-pill.hurry b { color: var(--accent); animation: prepPulse 1s ease-in-out infinite; }
.prep-timer-pill.hurry .prep-timer-track i { background: var(--accent); }
@keyframes prepPulse { 50% { transform: scale(1.15); } }
@media (max-width: 760px) { .prep-timer-pill em { display: none; } }
.prep-inner { max-width: 1080px; margin: 0 auto; padding: calc(28px + var(--safe-t)) 22px 60px; }
.prep-circuit { display: grid; grid-template-columns: 1fr 200px; align-items: center; gap: 16px; }
.prep-circuit .trackmap { height: 110px; }
.weather-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.wcard { padding: 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); text-align: center; }
.wcard .wicon { height: 62px; display: grid; place-items: center; }
.wcard small { display: block; font-size: 9.5px; color: var(--muted); letter-spacing: 1px; margin-top: 6px; }
.wcard b { font-size: 12.5px; }
.wx3d { overflow: visible; }
.wx3d .wx-rays { animation: spin 24s linear infinite, wxPulse 3s ease-in-out infinite; }
.wx-sun { animation: bob 4s ease-in-out infinite; }
.wx-cloud .wx-float { animation: drift 5s ease-in-out infinite; }
.wx-rain .wx-float { animation: drift 4s ease-in-out infinite; }
.wx3d .wx-drop { animation: wxFall 1.2s cubic-bezier(.5,0,1,1) infinite; opacity: 0; }
@keyframes wxPulse { 50% { opacity: .75; } }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes wxFall { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } 85% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 50% { transform: translateX(5px); } }
.strategy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.strategy-grid.single { grid-template-columns: minmax(0, 560px); justify-content: center; }
.setup-select { width: 100%; cursor: pointer; }
.strat-head { display: flex; align-items: center; gap: 14px; }
.strat-head .ph { width: 64px; height: 74px; border-radius: 10px; overflow: hidden; flex: none; }
.strat-head h3 { font-family: var(--display); font-size: 27px; margin: 2px 0 0; line-height: .95; }
.tyres { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tyre-opt { padding: 10px 2px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); transition: .12s; }
.tyre-opt:hover { border-color: var(--line2); color: var(--text); }
.tyre-opt.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--bg)); color: #fff; }
.slider-row { display: grid; grid-template-columns: 92px 1fr 36px; align-items: center; gap: 10px; }
.range-ticks { position: relative; display: flex; align-items: center; }
.range-ticks .range { position: relative; z-index: 1; margin: 0; }
/* Inset by half the thumb (~16 px) so each mark sits under the thumb's centre at that value. */
.slider-ticks { position: absolute; left: 8px; right: 8px; top: 50%; height: 0; pointer-events: none; }
.slider-ticks i { position: absolute; left: calc(var(--f) * 100%); top: 3px; width: 1px; height: 4px; background: rgba(255,255,255,.35); }
.slider-ticks i.major { top: 2px; height: 8px; background: rgba(255,255,255,.85); }
.slider-row .lbl { font-size: 11.5px; color: var(--muted); }
.slider-row .val { font-size: 12px; font-weight: 600; text-align: right; }
.slider-hints { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin: 4px 0 6px 102px; padding-right: 46px; }
.setup-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.setup-stats div { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.setup-stats small { display: block; font-size: 9px; color: var(--muted); letter-spacing: .7px; }
.setup-stats b { font-size: 13px; }
.setup-stats .up { color: var(--green); } .setup-stats .down { color: #ff8d92; }
.start-actions { display: grid; gap: 10px; margin-top: 20px; }
.start-actions .btn { height: 56px; font-size: 14px; }
.grid-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.grid-slot span:not(.tiny) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-slot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); font-size: 12px; }
/* Your riders in green, the rival team's in red (as in the timing tower). */
.grid-slot.me { border-color: var(--green); background: rgba(149,213,165,.12); }
.grid-slot.rival { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); }
.grid-slot b { font-family: var(--display); font-size: 20px; }
@media (max-width: 760px) { .strategy-grid { grid-template-columns: 1fr; } .prep-circuit { grid-template-columns: 1fr; } .prep-circuit .trackmap { display: none; } .weather-cards { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------- practice panel */
.practice-panel { position: absolute; left: 14px; bottom: calc(64px + var(--ctrl-h, 0px)); width: 300px; max-height: calc(100% - 90px - var(--ctrl-h, 0px)); overflow-y: auto; background: rgba(10,12,16,.88); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 12px; backdrop-filter: blur(8px); font-size: 11.5px; }
.practice-panel h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.laps-list { display: flex; flex-direction: column; gap: 2px; }
.laps-list .lap-row { display: grid; grid-template-columns: 30px 22px 1fr auto; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.laps-list .lap-row.best { background: rgba(180,108,255,.15); color: #d7a8ff; }
.laps-list .lap-row.last { background: rgba(255,255,255,.05); }
.laps-list .lap-g { text-align: right; }
.pp-ideal { margin-top: 8px; gap: 4px; }
.pp-hist .pp-ideal + .pp-ideal { margin-top: 3px; }
.trace-box { margin-top: 12px; }
.pp-vs { gap: 6px; align-items: center; }
.pp-vs h4 { margin: 0; }
.pp-total { font-variant-numeric: tabular-nums; }
.pp-secs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.pp-sec { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.05); font-variant-numeric: tabular-nums; }
.pp-sec.gain { background: rgba(149,213,165,.16); color: var(--green); }
.pp-sec.lose { background: rgba(255, 60, 69, .16); color: var(--red); }
.pp-sec-n { color: var(--muted); }

/* ---------------------------------------------------------------- results */
.results { position: absolute; inset: 0; z-index: 8; overflow-y: auto; background: rgba(6,7,9,.78); backdrop-filter: blur(10px); padding: 26px 16px 60px; animation: fadein .5s; }
@keyframes fadein { from { opacity: 0; } }
.results-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.verdict { text-align: center; padding: 26px 20px 20px; position: relative; overflow: hidden; }
.verdict h1 { font-family: var(--display); font-size: clamp(54px, 9vw, 86px); margin: 6px 0; line-height: .9; }
.verdict.win h1 { color: var(--gold); text-shadow: 0 0 40px rgba(233,188,102,.35); }
.verdict.lose h1 { color: #c9ccd2; }
.verdict .vs { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 12px; }
.verdict .vs b { font-family: var(--display); font-size: 48px; }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 10px; }
.podium .step { text-align: center; }
.podium .ph { width: 76px; height: 76px; border-radius: 50%; overflow: hidden; margin: 0 auto 8px; border: 3px solid var(--line2); }
.podium .blk { border-radius: 10px 10px 0 0; background: linear-gradient(180deg, var(--panel3), var(--panel)); border: 1px solid var(--line); border-bottom: 0; display: grid; place-items: center; font-family: var(--display); font-size: 40px; color: var(--muted); }
.podium .s1 .blk { height: 110px; color: var(--gold); } .podium .s2 .blk { height: 80px; } .podium .s3 .blk { height: 60px; color: #d39b6a; }
.podium .s1 .ph { border-color: var(--gold); width: 92px; height: 92px; }
.podium .nm { font-weight: 600; font-size: 13px; } .podium .tm { font-size: 11px; color: var(--muted); }
.podium .me .nm { color: var(--accent); }
.rewards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rewards-row div { text-align: center; padding: 16px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); }
.rewards-row b { display: block; font-family: var(--display); font-size: 34px; color: var(--gold); margin: 4px 0; }
.rewards-row small { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.classif { font-size: 12.5px; }
.classif .crow { display: grid; grid-template-columns: 30px 4px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); }
/* Your riders in green, the rival team's in red (as in the timing tower and the grid). */
.classif .crow.me { background: rgba(149,213,165,.14); box-shadow: inset 3px 0 0 var(--green); }
.classif .crow.rival { background: rgba(var(--accent-rgb), .12); box-shadow: inset 3px 0 0 var(--accent); }
.classif .crow.gap { border-top: 1px dashed var(--muted); margin-top: 6px; }
.classif .crow .ct { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.classif .crow .fl { color: var(--purple); font-size: 10px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------------------------------------------------------------- misc */
.kbd-help { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 13px; }
.kbd-help kbd { border: 1px solid var(--line2); border-radius: 5px; padding: 2px 8px; background: var(--panel2); font-size: 11px; text-align: center; }
.help-steps { display: flex; flex-direction: column; gap: 14px; }
.help-steps div { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.help-steps b { font-family: var(--display); font-size: 26px; color: var(--accent); }
.help-steps p { margin: 0; line-height: 1.5; color: #c9ccd2; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button { background: none; border: 0; padding: 12px 14px; color: var(--muted); font-weight: 600; font-size: 12.5px; letter-spacing: .6px; position: relative; white-space: nowrap; }
.tabs button.on { color: #fff; }
.tabs .tab-dot { position: absolute; top: 8px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: badge-pulse 1.8s ease-in-out infinite; }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; color: #c9ccd2; line-height: 1.45; }
.notice .icon-wrap { color: var(--muted); margin-top: 1px; }
.notice.gold { border-color: rgba(233,188,102,.35); } .notice.gold .icon-wrap { color: var(--gold); }
.notice.green { border-color: rgba(149,213,165,.35); } .notice.green .icon-wrap { color: var(--green); }
.toggle { width: 42px; height: 24px; border-radius: 20px; background: var(--line2); border: 0; position: relative; transition: .2s; flex: none; }
.toggle::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.toggle.on { background: var(--accent); } .toggle.on::after { left: 21px; }
.setting-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row .lbl { flex: 1; } .setting-row .lbl small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* Practice: fresh tyres of any compound while parked in the box */
.box-tyres { display: flex; gap: 4px; align-items: center; }
.tyre-pick { display: grid; place-items: center; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.tyre-pick.on { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.tyre-pick:disabled { opacity: .35; cursor: not-allowed; }
.tyre-pick:not(:disabled):hover { border-color: var(--c); }

/* Upgrade in progress (garage) */
.pips i.building { background: repeating-linear-gradient(90deg, var(--c) 0 6px, transparent 6px 10px); opacity: .8; animation: build-pulse 1.4s ease-in-out infinite; }
@keyframes build-pulse { 50% { opacity: .35; } }
.surface.up-building { border-color: color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 0 24px color-mix(in srgb, var(--c) 14%, transparent); }
.build-progress { display: grid; gap: 6px; }
.build-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.build-bar i { display: block; height: 100%; width: 0; background: var(--c); transition: width .9s linear; }
.build-progress .small { display: flex; align-items: center; gap: 4px; color: #cfd2d8; }

/* Circuits page: all tracks at a glance */
.circuit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.circuit-tile { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.circuit-tile h3 { font-family: var(--display); font-size: 30px; line-height: .95; margin: 0; }
.circuit-tile .trackmap { height: 150px; }
.circuit-tile .circuit-meta { margin: 0; }
.circuit-tile > .btn { margin-top: auto; }

/* ---------------------------------------------------------------- superadmin */
.admin { max-width: 1100px; }
.admin-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.admin-section { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 0 16px; }
.admin-section > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 15px; }
.admin-section > summary::-webkit-details-marker { display: none; }
.admin-section > summary.unpublished { box-shadow: inset 3px 0 0 var(--gold); padding-left: 10px; }
.sponsor-row { align-items: flex-start; }
.sponsor-preview { width: 160px; height: 80px; flex-shrink: 0; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; font-size: 18px; text-align: center; }
.admin-small { display: block; color: var(--muted); font-size: 11px; text-transform: none; letter-spacing: 0; }
.admin-section[open] > summary { border-bottom: 1px solid var(--line); }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-row:last-child { border-bottom: 0; }
.admin-row.modified { box-shadow: inset 3px 0 0 var(--blue); padding-left: 10px; }
.admin-lbl > b .tag { margin-left: 8px; vertical-align: 1px; }
.admin-lbl { flex: 1 1 260px; min-width: 0; }
.admin-lbl small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.admin-lbl .admin-def { opacity: .75; }
.admin-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-input { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.admin-input input.input { width: 104px; height: 38px; padding: 0 10px; font-size: 14px; }
.sponsor-row { align-items: center; }
.sponsor-preview { width: 192px; height: 64px; border-radius: 6px; border: 1px solid var(--line); flex: none; }
.sponsor-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; flex: 1 1 320px; min-width: 0; }
.admin-input select.input { height: 38px; padding: 0 8px; font-size: 13px; }
.admin-input input.input.sponsor-color { width: 46px; padding: 3px; cursor: pointer; }
.admin-table-wrap { overflow-x: auto; padding: 12px 0; }
.admin-table { border-collapse: collapse; font-size: 12px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 8px; white-space: nowrap; }
.admin-table td { padding: 4px; }
.admin-table td.modified input.input { border-color: var(--gold); }
.admin-table .admin-input input.input { width: 88px; }
@media (max-width: 600px) {
  .admin-input input.input { width: 84px; }
}

/* Simulated online matchmaking before a Grand Prix */
.mm { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px 16px; text-align: center; background: radial-gradient(ellipse at center, rgba(20,23,29,.82), rgba(8,9,12,.94)); backdrop-filter: blur(4px); transition: opacity .25s; }
.mm.out { opacity: 0; }
.mm-title { font-size: clamp(36px, 6vw, 56px); margin: 0; }
.mm-versus { display: flex; align-items: center; gap: clamp(12px, 4vw, 40px); margin: 10px 0 4px; }
.mm-vs { font-family: var(--display); font-size: clamp(28px, 5vw, 44px); color: var(--accent); font-weight: 700; font-style: italic; }
.mm-card { width: clamp(130px, 30vw, 190px); padding: 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); }
.mm-card b { font-family: var(--display); font-size: 20px; letter-spacing: .5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-card small { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.mm-card.me { border-color: var(--accent); }
.mm-card.found { border-color: var(--gold); animation: mm-pop .45s cubic-bezier(.2,1.4,.4,1); }
.mm-card.found b { color: var(--gold); }
.mm-avatar { position: relative; width: clamp(72px, 16vw, 104px); aspect-ratio: 1; border-radius: 50%; background: var(--panel3) center / cover no-repeat; border: 2px solid var(--line2); flex: none; }
.mm-unknown { display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.mm-radar { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 70%, rgba(var(--accent-rgb), .55)); animation: mm-spin 1.1s linear infinite; }
.mm-search b { color: var(--muted); animation: mm-blink 1.2s ease-in-out infinite; }
.mm-status { font-size: 14px; color: #d4d7dc; min-height: 1.4em; }
.mm-status.ok { color: var(--green); }
.mm-card small.mm-league { font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: #c9ccd2; }
/* Duel preparation: who is ready under the LISTO button. */
.ready-box { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.ready-box span { display: inline-flex; align-items: center; gap: 4px; }
.ready-box .ok { color: var(--green); }
.ready-box .out { color: var(--accent); }
.mm-actions { width: min(320px, 100%); margin-top: 6px; }
.mm-strip { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line2); border-left: 3px solid var(--gold); border-radius: var(--radius); }
.mm-strip .mm-avatar { width: 46px; }
@keyframes mm-spin { to { transform: rotate(360deg); } }
@keyframes mm-blink { 50% { opacity: .4; } }
@keyframes mm-pop { from { transform: scale(.8); opacity: 0; } }
@media (max-width: 520px) { .mm-strip > .small { display: none; } }
/* Free practice: "Preparando paddock" (garage shutter + checklist). */
.pd-scene { display: flex; align-items: stretch; gap: clamp(14px, 4vw, 32px); margin: 10px 0 4px; }
.pd-garage { position: relative; width: clamp(140px, 32vw, 200px); min-height: 170px; overflow: hidden; background: linear-gradient(180deg, #1c2029, #0f1116 70%, #2a2e36 70% 72%, #14161b 72%); border: 1px solid var(--line2); border-top: 6px solid #2e333d; border-radius: var(--radius); box-shadow: var(--shadow); }
.pd-inside { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; background: radial-gradient(ellipse at 50% 0%, rgba(255,240,200,.18), transparent 65%); }
.pd-inside b { font-family: var(--display); font-size: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-shutter { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, #3a3f49 0 9px, #22262e 9px 11px); box-shadow: inset 0 -6px 0 #15171c; transition: transform 1.2s cubic-bezier(.6,0,.3,1); }
.pd-garage:not(.open) .pd-shutter { animation: pd-rattle .9s ease-in-out infinite; }
.pd-garage.open .pd-shutter { transform: translateY(-92%); }
.pd-beacon { position: absolute; top: 6px; right: 8px; z-index: 2; width: 10px; height: 10px; border-radius: 50%; background: #ffb020; box-shadow: 0 0 10px 3px rgba(255,176,32,.7); animation: mm-blink .7s steps(2) infinite; }
.pd-garage.open .pd-beacon { background: var(--green); box-shadow: 0 0 10px 3px rgba(60,220,120,.6); animation: none; }
.pd-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; text-align: left; font-size: 14px; }
.pd-step { display: flex; align-items: center; gap: 10px; color: var(--muted); opacity: .55; transition: opacity .25s, color .25s; }
.pd-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line2); }
.pd-ok { margin-left: auto; color: var(--green); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s cubic-bezier(.2,1.4,.4,1); }
.pd-step.on { opacity: 1; color: #fff; }
.pd-step.on .pd-ic { border-color: var(--accent); color: var(--accent); }
.pd-step.on .pd-ic .icon-wrap { animation: mm-spin 1.2s linear infinite; }
.pd-step.done { opacity: 1; color: #d4d7dc; }
.pd-step.done .pd-ok { opacity: 1; transform: none; }
.pd-bar { width: min(360px, 100%); height: 4px; border-radius: 2px; background: var(--panel3); overflow: hidden; }
.pd-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .5s ease; }
@keyframes pd-rattle { 50% { transform: translateY(-3%); } }
@media (max-width: 420px) { .pd-scene { flex-direction: column; align-items: center; } .pd-garage { min-height: 140px; } }

/* ---------------------------------------------------------------- admin diagnostics */
.diag-list { display: flex; flex-direction: column; gap: 6px; }
.diag-row { padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.diag-row:hover { border-color: var(--line2); }
.diag-row .tiny { word-break: break-word; }
.diag-json { margin: 4px 0 0; padding: 8px; max-height: 300px; overflow: auto; font-size: 11px; background: rgba(0,0,0,.3); border-radius: 6px; white-space: pre-wrap; word-break: break-all; }

/* Phones: no backdrop blur over the live 3D view. Each blurred panel makes the
   GPU re-blur the moving scene behind it every frame (a big cost on mobile and a
   source of stutter); the panels keep their translucent backgrounds. */
@media (pointer: coarse) {
  .race, .race * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}

/* Phones in landscape: Unity draws the race UI smaller relative to the screen
   (its phone UI scale); shrink every floating piece alike so the layout stays coherent. */
@media (orientation: landscape) and (max-height: 500px) {
  .race.immersive .tower, .race.immersive .telemetry, .race.immersive .hud-right, .race.immersive .minimap,
  .race.immersive .radio, .race.immersive .banner, .race.immersive .practice-panel, .race.immersive .driver,
  .race.immersive .start-top { zoom: .8; }
}

/* Phone in landscape (browser bars eat the height): the single practice/quali card goes two-column
   (gauges + pace | selectors + actions) instead of one tall stack. */
@media (orientation: landscape) and (max-height: 500px) {
  .race.immersive .controls.single .driver { flex: 0 1 54%; max-width: 54%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; row-gap: 5px; align-items: start; }
  .race.immersive .controls.single .driver-head { grid-column: 1 / -1; }
  .race.immersive .controls.single .meters { grid-column: 1; grid-row: 2; grid-template-columns: 1fr; gap: 4px; }
  .race.immersive .controls.single .pace { grid-column: 1; grid-row: 3; }
  .race.immersive .controls.single .selectors { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; gap: 4px; }
  .race.immersive .controls.single .driver-actions { grid-column: 2; grid-row: 3; }
  .race.immersive .controls.single .pace button { height: 34px; }
  .race.immersive .controls.single .selector button { height: 28px; }
  .race.immersive .controls.single .driver-actions .btn { height: 32px; }
}
@media (orientation: landscape) and (max-height: 380px) {
  .race.immersive .controls.single .driver { flex-basis: 58%; max-width: 58%; padding: 4px 8px; }
  .race.immersive .controls.single .driver-pos { width: 22px; height: 22px; font-size: 14px; }
  .race.immersive .controls.single .pace button { height: 28px; }
  .race.immersive .controls.single .selector button { height: 24px; }
  .race.immersive .controls.single .driver-actions .btn { height: 28px; }
}

/* ---------------------------------------------------------------- progression (Liga E → A) */
.tier-badge { --s: 44px; --c: var(--gold); width: var(--s); height: calc(var(--s) * 1.12); flex: none; display: grid; place-items: center; position: relative;
  clip-path: polygon(50% 0, 100% 14%, 100% 58%, 50% 100%, 0 58%, 0 14%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #fff), color-mix(in srgb, var(--c) 55%, #000)); }
.tier-badge::before { content: ''; position: absolute; inset: calc(var(--s) * .07); clip-path: inherit; background: linear-gradient(160deg, #1d2129, #0c0e12); }
.tier-badge b { position: relative; font-family: var(--display); font-size: calc(var(--s) * .55); line-height: 1; color: var(--c); margin-top: calc(var(--s) * -.06); }

.road { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.road-cat { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.road-name { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.road-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.road-steps i { font-style: normal; display: grid; place-items: center; height: 24px; border-radius: 4px; font-size: 10.5px; font-weight: 700; color: var(--muted); background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.road-steps i.done { color: #1a1408; background: var(--gold); border-color: var(--gold); }
.road-steps i.now { color: #fff; background: var(--c); border-color: var(--c); animation: road-pulse 1.6s ease-in-out infinite; }
@keyframes road-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent), 0 0 16px var(--c); } }
@media (max-width: 649px) { .road { gap: 5px; } .road-steps { gap: 2px; } .road-steps i { height: 20px; font-size: 9px; } .road-name { font-size: 8.5px; letter-spacing: .5px; } }

.road-surface { margin-top: 16px; }
.road-card { display: flex; flex-direction: column; gap: 16px; }
.road-head { display: flex; align-items: center; gap: 14px; }
.road-head h3 { margin: 2px 0; font-size: 28px; }
.road-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.road-meta b { font-size: 30px; color: var(--gold); }
@media (max-width: 649px) { .road-head { flex-wrap: wrap; } .road-head h3 { font-size: 23px; } .road-meta { flex-direction: row; align-items: baseline; gap: 10px; width: 100%; justify-content: space-between; } .road-meta b { font-size: 22px; } }

.zone-head { font-size: 10px; letter-spacing: 1px; font-weight: 700; color: var(--green); padding: 6px 14px; border-radius: 8px 8px 0 0; background: rgba(149,213,165,.10); border-left: 3px solid var(--green); }
.board-row.top { border-left: 3px solid rgba(149,213,165,.55); border-radius: 0; }
.zone-head.down { color: var(--red); background: rgba(255, 60, 69, .10); border-left-color: var(--red); margin-top: 10px; }
.board-row.bottom { background: rgba(255, 60, 69, .05); border-left: 3px solid rgba(255, 60, 69, .55); border-radius: 0; }
.board-row.bottom .pos { color: var(--red); }
.zone-pill { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.zone-pill.up { color: var(--green); background: rgba(149,213,165,.14); box-shadow: inset 0 0 0 1px rgba(149,213,165,.45); }
.zone-pill.down { color: var(--red); background: rgba(255, 60, 69, .14); box-shadow: inset 0 0 0 1px rgba(255, 60, 69, .5); animation: zone-pulse 1.6s ease-in-out infinite; }
@keyframes zone-pulse { 50% { box-shadow: inset 0 0 0 1px rgba(255, 60, 69, .5), 0 0 14px rgba(255, 60, 69, .45); } }
.notice.red { border-color: rgba(255, 60, 69, .4); } .notice.red .icon-wrap { color: var(--red); }
.board-row.me { box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55); }

.promo-card { background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c, var(--gold)) 22%, var(--panel)), var(--panel) 70%); }
.promo { --c: var(--gold); padding: 30px 26px 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.promo-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 2.4px; color: var(--c); }
.promo h1 { margin: 0; font-size: 64px; line-height: .9; color: #fff; text-shadow: 0 0 40px color-mix(in srgb, var(--c) 55%, transparent); animation: promo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.promo .tier-badge { animation: promo-pop .7s .15s cubic-bezier(.2, 1.6, .4, 1) both; }
.promo-tiers { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 17px; }
.promo-tiers b { font-size: 21px; color: var(--c); }
.promo-arrow { color: var(--gold); font-size: 22px; }
.promo p { margin: 0; max-width: 460px; line-height: 1.5; }
.promo .road { width: 100%; text-align: left; }
.promo-stage { width: 100%; height: 240px; position: relative; }
@keyframes promo-pop { from { transform: scale(.4); opacity: 0; } }
@media (max-width: 649px) { .promo h1 { font-size: 48px; } .promo-stage { height: 190px; } .promo { padding: 24px 14px 18px; } }
.promo-stage .showroom-canvas { position: absolute; inset: 0; }

/* ---------------------------------------------------------------- rankings */
.lb-row { grid-template-columns: 46px minmax(0, 1fr) 24px auto; }
.lb-tyre { display: flex; justify-content: center; }
.lb-row.podium .pos { color: var(--gold); }
.lb-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lb-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.lb-time { text-align: right; font-variant-numeric: tabular-nums; }
.lb-time b { font-family: var(--display); font-size: 20px; letter-spacing: .4px; }
.board-row.me .lb-time b { color: var(--accent); }
.lb-sep { color: var(--muted); padding-top: 14px; }
.lb-sep::after { background: var(--line2); }
.paddock-cup { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
/* Qualifying: final countdown once nobody can improve. */
.quali-end { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; text-align: center; padding: 18px 34px; border-radius: 16px; background: rgba(10,12,16,.72); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.quali-end small { display: block; font-size: 12px; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.quali-end b { display: block; font-family: var(--display); font-size: 84px; line-height: 1; color: #fff; margin-top: 6px; }
.quali-end.pulse b { animation: qe-pulse .5s ease-out; }
@keyframes qe-pulse { from { transform: scale(1.35); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 720px) { .quali-end b { font-size: 60px; } .quali-end { padding: 14px 24px; } }

/* ---------------------------------------------------------------- paddock top: hero · circuit · road */
.dash-top > .road-surface { grid-column: 1 / -1; margin-top: 0; }
.hero, .hero-copy { min-height: 380px; }
.hero-copy { padding: 26px 30px; }
.hero-copy h2 { margin: 6px 0 12px; }
.event-card { min-height: 380px; }
.event-card h2.display { font-size: 34px !important; }
.event-card .trackmap { flex: 1 1 0; height: 0; min-height: 150px; padding: 10px 0; }
.hero-track { display: none; }
@media (max-width: 899px) {
  .dash-top > .event-card { display: none; }
  .hero-track { position: absolute; top: 12px; right: 12px; z-index: 3; width: 128px; display: flex; flex-direction: column; gap: 3px; padding: 10px 10px 6px; border-radius: 12px; text-align: left; color: var(--text); font: inherit; cursor: pointer;
    background: rgba(12, 14, 18, .74); border: 1px solid var(--line2); backdrop-filter: blur(6px); }
  .hero-track > .tiny:first-child { color: var(--accent); font-weight: 700; letter-spacing: 1px; font-size: 8.5px; }
  .hero-track b { font-family: var(--display); font-size: 19px; line-height: 1; }
  .hero-track .trackmap { height: 64px; min-height: 0; }
}
@media (max-width: 649px) { .hero, .hero-copy { min-height: 320px; } .hero-copy { padding: 22px; } }
@media (max-width: 649px) {
  .hero-copy h2 { font-size: 44px; margin-top: 0; }
  .hero-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; width: 100%; margin-top: 18px; }
  .hero-actions .btn { height: 40px; min-height: 0; padding: 0 4px; gap: 5px; justify-content: center; font-size: 12px; letter-spacing: .4px; }
  .hero-actions .btn .icon-wrap svg { width: 15px; height: 15px; }
  .hero-track { width: 116px; padding: 8px 9px 5px; }
  .hero-track b { font-size: 16px; }
  .hero-track .trackmap { height: 46px; }
}
/* Hero actions: the three buttons share one row */
.hero-actions { flex-wrap: nowrap; }
@media (min-width: 650px) { .hero-copy { max-width: 540px; } .hero-actions .btn { height: 44px; padding: 0 18px; } }
.quali-end .qe-cancel { pointer-events: auto; margin-top: 14px; }

/* ---------------------------------------------------------------- premios (F2) */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 10px var(--accent); animation: badge-pulse 1.8s ease-in-out infinite; }
@keyframes badge-pulse { 50% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25), 0 0 14px var(--accent); } }
.bottomnav .bn-badge { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700; display: grid; place-items: center; animation: badge-pulse 1.8s ease-in-out infinite; }
.bottomnav button.center { color: #fff; }
.bottomnav .bn-center { width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #7dff5c, var(--accent2)); border: 3px solid var(--bg); box-shadow: 0 6px 18px rgba(var(--accent-rgb), .45); }
.bottomnav button.center.on .icon-wrap { color: var(--on-accent); }
.bottomnav button.center:not(.on) .bn-center { background: linear-gradient(160deg, #3a3f49, #23272f); box-shadow: 0 6px 18px rgba(0,0,0,.4); }

.waiting-card { margin-top: 16px; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: linear-gradient(90deg, rgba(233,188,102,.12), transparent 70%), var(--panel); }
.waiting-card b { font-size: 16px; }

.missions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mission b { display: block; }
.mission.ready { --ring: var(--gold); }
.mission.claimed { opacity: .55; }
.reward-chips { display: flex; gap: 10px; margin-top: 5px; font-size: 12.5px; font-weight: 600; }
.reward-chips span { display: inline-flex; align-items: center; gap: 4px; }

.chest-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.chest-slot { height: 110px; border-radius: 14px; border: 1px dashed var(--line2); background: rgba(255,255,255,.02); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }

.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.streak-day { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); }
.streak-day b { color: var(--text); font-size: 13.5px; }
.streak-day.done { border-color: rgba(149,213,165,.45); background: rgba(149,213,165,.07); color: var(--green); }
.streak-day.now { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 0 3px rgba(233,188,102,.18); animation: road-pulse 1.8s ease-in-out infinite; --c: var(--gold); }
.streak-day.big { background: linear-gradient(160deg, rgba(233,188,102,.16), var(--panel)); }
@media (max-width: 649px) {
  .chest-slots { grid-template-columns: repeat(2, 1fr); }
  .streak { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .streak-day.big { grid-column: span 4; flex-direction: row; justify-content: center; gap: 12px; }
  .missions-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- cofres y pilotos (F3) */
.portrait-photo { position: absolute; inset: 0; background-size: cover; background-position: center top; }
.chest-icon { --s: 54px; --c: #a3abb8; width: var(--s); height: var(--s); position: relative; display: inline-grid; place-items: center; flex: none; isolation: isolate; }
.chest-icon::before { content: ''; position: absolute; inset: 8%; z-index: -1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 45%, transparent), transparent 68%); filter: blur(calc(var(--s) * .06)); }
.chest-icon img { width: 100%; height: 100%; object-fit: contain; user-select: none; filter: drop-shadow(0 calc(var(--s) * .06) calc(var(--s) * .08) rgba(0,0,0,.55)); }
.chest-icon.t-epic::before, .chest-icon.t-legend::before { animation: chest-glow 2.4s ease-in-out infinite; }
.chest-icon.t-legend::before { inset: 0; background: radial-gradient(circle, color-mix(in srgb, var(--c) 60%, transparent), transparent 70%); }
@keyframes chest-glow { 50% { opacity: .55; transform: scale(.9); } }
/* Reveal: light rays spinning behind the chest */
.reveal > .chest-icon::after { content: ''; position: absolute; inset: -38%; z-index: -2; border-radius: 50%; background: repeating-conic-gradient(color-mix(in srgb, var(--c) 30%, transparent) 0 8deg, transparent 8deg 22deg); mask: radial-gradient(circle, #000 25%, transparent 68%); -webkit-mask: radial-gradient(circle, #000 25%, transparent 68%); animation: chest-rays 14s linear infinite; }
@keyframes chest-rays { to { transform: rotate(1turn); } }

.chest-row { display: flex; flex-direction: column; gap: 10px; }
.chest-row .chest-slots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.chest-row .chest-slot { height: auto; min-height: 150px; padding: 12px 8px; border-style: solid; border-color: color-mix(in srgb, var(--c, var(--line2)) 45%, var(--line)); background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--c, #000) 14%, transparent), transparent 70%), var(--panel); gap: 10px; text-align: center; }
.chest-row .chest-slot.empty { border-style: dashed; background: rgba(255,255,255,.02); }
.chest-row .chest-slot .btn { width: 100%; height: 34px; padding: 0 6px; font-size: 11px; letter-spacing: .4px; }
.chest-tier { font-size: 10px; font-weight: 700; letter-spacing: 1.2px; color: var(--c); }
.chest-slot.unlocking { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }
.chest-slot.ready { animation: road-pulse 1.6s ease-in-out infinite; border-color: var(--gold); }
.chest-slot.ready .chest-icon { animation: chest-bounce 1.2s ease-in-out infinite; }
@keyframes chest-bounce { 50% { transform: translateY(-5px) rotate(-3deg); } }
.chest-timer { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; height: 34px; }
.free-chest { display: flex; align-items: center; gap: 16px; }
.free-chest b { font-size: 17px; }
.team-prize { flex-wrap: wrap; }
.team-prize .chest-icon { filter: drop-shadow(0 0 16px color-mix(in srgb, var(--c) 55%, transparent)); }
.team-prize .reward-chips { margin-top: 6px; }
.cup-prizes { display: grid; gap: 8px; }
.cup-prize-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.cup-prize span { white-space: nowrap; }
.cup-prize { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); }
.cup-prize .chest-icon { grid-row: span 2; }
.cup-prize b { font-size: 14px; }

.odds { display: flex; flex-direction: column; gap: 10px; }
.odds-row { display: grid; grid-template-columns: 48px 90px 1fr; align-items: center; gap: 10px; }
.odds-row b { color: var(--c); }

.reveal { padding: 26px 22px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.reveal > .chest-icon { animation: promo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.reveal-loot { display: flex; gap: 22px; font-size: 22px; }
.reveal-loot span { display: inline-flex; align-items: center; gap: 6px; }
/* Waiting for the server: the chest rattles and the rays spin fast; then it pops open. */
.reveal.pending > .chest-icon { animation: promo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both, chest-wait .9s ease-in-out .6s infinite; }
.reveal.pending > .chest-icon::after { animation-duration: 3s; }
.reveal.pending .promo-eyebrow { animation: blink 1.2s ease-in-out infinite; }
.reveal.opened > .chest-icon { animation: promo-pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.reveal.opened .reveal-loot { animation: promo-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes chest-wait { 0%, 100% { transform: none; } 20% { transform: rotate(-5deg) translateY(-3px); } 40% { transform: rotate(5deg); } 60% { transform: rotate(-3deg) translateY(-2px); } 80% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .reveal.pending > .chest-icon, .reveal.pending .promo-eyebrow { animation: none; } }
.claimed-all .reveal-loot { font-size: 30px; animation: promo-pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
.claimed-list { align-self: stretch; display: flex; flex-direction: column; gap: 6px; max-height: min(46vh, 340px); overflow-y: auto; text-align: left; }
.claimed-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, transparent); font-size: 13.5px; }
.claimed-text { flex: 1; min-width: 0; }
.reveal-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 150px)); justify-content: center; gap: 10px; width: 100%; }
.reveal-card { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--c) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel)); padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.reveal-card .rc-portrait { width: 100%; aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.reveal-card > .tiny:first-of-type { color: var(--c); font-weight: 700; letter-spacing: 1px; }
.reveal-card b { font-size: 13px; line-height: 1.15; }
.reveal-count { position: absolute; top: 12px; right: 12px; background: rgba(0,0,0,.7); border-radius: 8px; padding: 2px 7px; font-family: var(--display); font-size: 20px; color: #fff; }
.reveal-card.signed { box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(233,188,102,.35); }
@keyframes card-in { from { transform: translateY(20px) scale(.85); opacity: 0; } }

.rider-tile.locked .rt-photo .portrait { filter: blur(4px); transform: scale(1.08); }
.rt-photo { overflow: hidden; }
.rt-lock { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); pointer-events: none; }
.rt-cards { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.rt-cards .tiny { white-space: nowrap; }
.rm-photo { overflow: hidden; }
.rm-photo.locked .portrait { filter: blur(5px); transform: scale(1.08); }
@media (max-width: 649px) {
  .chest-row .chest-slots { grid-template-columns: repeat(2, 1fr); }
  .odds-row { grid-template-columns: 34px 1fr; } .odds-row .small { grid-column: 1 / -1; }
}
.btn.dev-btn { border: 1px dashed var(--gold); color: var(--gold); }

/* ---------------------------------------------------------------- rider cards by rarity
   novato plain · común green edge · raro blue glow · épico gold foil + shine · leyenda holographic rainbow */
.rider-tile { position: relative; isolation: isolate; transition: transform .2s, box-shadow .2s; }
.rider-tile:hover { transform: translateY(-3px); }
.card-shine { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0; }
.rider-tile.rar-1 { border-color: rgba(149,213,165,.45); }
.rider-tile.rar-2 { border-color: rgba(120,170,237,.7); box-shadow: 0 0 0 1px rgba(120,170,237,.25), 0 10px 30px rgba(120,170,237,.18); }
.rider-tile.rar-3 { border: 1px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, linear-gradient(135deg, #fff1c4, #e9bc66 30%, #a8792a 55%, #ffe39a 80%, #c9962f) border-box; box-shadow: 0 0 22px rgba(233,188,102,.32), 0 14px 34px rgba(0,0,0,.4); }
.rider-tile.rar-3 .rt-body { background: linear-gradient(180deg, rgba(233,188,102,.10), transparent 60%); }
.rider-tile.rar-3 h3, .rider-tile.rar-3 .ovr { color: #f5d58e; text-shadow: 0 0 18px rgba(233,188,102,.45); }
.rar-3 .card-shine, .rar-4 .card-shine { opacity: 1; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.38) 45%, rgba(255,255,255,.08) 52%, transparent 60%); background-size: 260% 100%; animation: card-sweep 3.6s ease-in-out infinite; mix-blend-mode: screen; }
@keyframes card-sweep { 0% { background-position: 130% 0; } 60%, 100% { background-position: -40% 0; } }

.rider-tile.rar-4 { border: 2px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, conic-gradient(from var(--holo-a, 0deg), #ff6b4a, #ffd166, #6bff9e, #4ad7ff, #a46bff, #ff4ad2, #ff6b4a) border-box; animation: holo-spin 4s linear infinite; box-shadow: 0 0 26px rgba(255,107,74,.38), 0 0 60px rgba(164,107,255,.18), 0 16px 40px rgba(0,0,0,.45); }
.rider-tile.rar-4 .rt-photo::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(125deg, rgba(255,107,74,.22), rgba(255,209,102,.12) 25%, rgba(107,255,158,.12) 45%, rgba(74,215,255,.16) 65%, rgba(255,74,210,.2)); background-size: 200% 200%; mix-blend-mode: color-dodge; animation: holo-pan 6s ease-in-out infinite alternate; }
.rider-tile.rar-4 .rt-body { background: linear-gradient(180deg, rgba(255,107,74,.12), rgba(164,107,255,.06) 50%, transparent); }
.rider-tile.rar-4 h3, .rider-tile.rar-4 .ovr { background: linear-gradient(90deg, #ffd166, #ff6b4a, #ff4ad2, #4ad7ff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255,107,74,.4)); }
@property --holo-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes holo-spin { to { --holo-a: 360deg; } }
@keyframes holo-pan { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }

/* Locked cards keep the whole card and its effects: only the photo is blurred */

/* Details modal photo and chest reveal cards share the same treatment */
.rm-photo { position: relative; }
.rm-photo.rar-3 { box-shadow: inset 0 0 0 2px #e9bc66, inset 0 0 40px rgba(233,188,102,.35); }
.rm-photo.rar-4 { box-shadow: inset 0 0 0 2px #ff6b4a, inset 0 0 50px rgba(164,107,255,.35); }
.reveal-card .rc-portrait { position: relative; }
.reveal-card.rar-3 { border-color: #e9bc66; box-shadow: 0 0 24px rgba(233,188,102,.4); }
.reveal-card.rar-4 { border: 2px solid transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, conic-gradient(from var(--holo-a, 0deg), #ff6b4a, #ffd166, #6bff9e, #4ad7ff, #a46bff, #ff4ad2, #ff6b4a) border-box; animation: card-in .45s cubic-bezier(.2, 1.4, .4, 1) both, holo-spin 4s linear infinite; box-shadow: 0 0 30px rgba(255,107,74,.45); }
@media (prefers-reduced-motion: reduce) { .card-shine, .rider-tile.rar-4, .rider-tile.rar-4 .rt-photo::after, .reveal-card.rar-4 { animation: none !important; } }
.admin-rider { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.admin-rider-photo { width: 56px; height: 70px; border-radius: 8px; overflow: hidden; flex: none; }
.name-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); cursor: pointer; font: inherit; }
.name-opt.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); }
.name-opt .radio-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line2); flex: none; }
.name-opt.on .radio-dot { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 45%, transparent 50%); }
.rm-mini { width: 54px; height: 66px; border-radius: 8px; overflow: hidden; flex: none; margin-right: 6px; }

/* ---- Duel emotes: picker under the camera pill, 3D bubbles over the bikes (mine blue, rival red) ---- */
.hud-col { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.emote-btn { justify-content: center; min-width: 36px; padding: 0 8px; }
.emote-btn-ico { font-size: 17px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); transition: transform .2s; }
.emote-btn:hover .emote-btn-ico { transform: scale(1.15) rotate(-8deg); }
.emote-btn.cooling { opacity: .5; }
.race.immersive .emote-btn { height: 30px; min-width: 30px; padding: 0 6px; }
.race.immersive .hud.emotes .minimap { top: 74px; }
@media (orientation: portrait) { .race.immersive .hud.emotes .minimap { top: auto; } }
.emote-menu { position: absolute; right: 0; top: 38px; z-index: 10; display: grid; grid-template-columns: repeat(4, 46px); gap: 4px; padding: 7px; background: rgba(16,18,23,.96); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); perspective: 400px; animation: emoMenuIn .18s ease-out; }
.emote-menu button { width: 46px; height: 46px; border: 0; border-radius: 11px; background: radial-gradient(circle at 35% 28%, rgba(120,170,255,.22), rgba(255,255,255,.04) 60%); font-size: 27px; line-height: 1; display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .15s; }
.emote-menu button span { display: inline-block; filter: drop-shadow(0 3px 2px rgba(0,0,0,.5)); transform-style: preserve-3d; animation: emoIdle 2.4s ease-in-out infinite; }
.emote-menu button:nth-child(odd) span { animation-delay: -1.2s; }
.emote-menu button:hover, .emote-menu button:active { transform: translateY(-2px) scale(1.12); background: radial-gradient(circle at 35% 28%, rgba(120,170,255,.45), rgba(61,139,255,.12) 65%); }
@keyframes emoMenuIn { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes emoIdle { 0%,100% { transform: rotateY(-18deg) translateY(0); } 50% { transform: rotateY(18deg) translateY(-2px); } }

.emote-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.emote { --ec: #3d8bff; --ec2: #9cc4ff; --ecd: #0f3d8c; position: absolute; left: 0; top: 0; will-change: transform; }
.emote.theirs { --ec: #ff3c45; --ec2: #ffa0a4; --ecd: #8c1016; }
.emote > * { position: absolute; }
.emote-orb { left: -32px; top: -82px; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; perspective: 300px;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,.55), rgba(255,255,255,0) 32%), radial-gradient(circle at 50% 60%, var(--ec) 0%, var(--ecd) 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 6px var(--ec), 0 0 22px 6px color-mix(in srgb, var(--ec) 60%, transparent), inset 0 -8px 14px rgba(0,0,0,.35);
  animation: emoPop .45s cubic-bezier(.2,1.6,.4,1) both; }
.emote-glyph { font-size: 38px; line-height: 1; display: inline-block; transform-style: preserve-3d; filter: drop-shadow(0 4px 3px rgba(0,0,0,.55)) drop-shadow(0 0 1px rgba(255,255,255,.6)); }
.emote-tail { left: -9px; top: -24px; width: 18px; height: 14px; background: var(--ec); clip-path: polygon(0 0, 100% 0, 50% 100%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); animation: emoPop .45s cubic-bezier(.2,1.6,.4,1) both; }
.emote-spark { width: 8px; height: 8px; border-radius: 50%; background: var(--ec2); box-shadow: 0 0 8px var(--ec); left: -4px; top: -54px; opacity: 0; animation: emoSpark 1s ease-out .1s both; }
.emote-spark.s2 { animation-delay: .25s; --sx: -38px; --sy: -30px; } .emote-spark.s1 { --sx: 40px; --sy: -26px; } .emote-spark.s3 { animation-delay: .4s; --sx: 6px; --sy: -50px; width: 6px; height: 6px; }
.emote.edge .emote-tail { display: none; }
/* Rival answer while both rival bikes are behind: shown beside yours, tagged. */
.emote-tag { display: none; left: 0; top: -104px; transform: translateX(-50%); padding: 2px 7px; border-radius: 6px; background: var(--ecd); border: 1px solid var(--ec); color: #fff; font-size: 9px; letter-spacing: .6px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.4); animation: emoPop .45s cubic-bezier(.2,1.6,.4,1) both; }
.emote.behind .emote-tag { display: block; }
.emote.behind .emote-tail { display: none; }
.emote.out .emote-tag { animation: emoOut .35s ease-in both; }
.emote.edge .emote-orb { transform: scale(.82); }
.emote.out .emote-orb, .emote.out .emote-tail { animation: emoOut .35s ease-in both; }
@keyframes emoPop { from { opacity: 0; transform: scale(.2) translateY(30px); } }
@keyframes emoOut { to { opacity: 0; transform: scale(.5) translateY(-24px); } }
@keyframes emoSpark { 0% { opacity: 1; transform: translate(0,0) scale(1); } 100% { opacity: 0; transform: translate(var(--sx, 30px), var(--sy, -30px)) scale(.3); } }
/* Each emote moves its own way (3D turns, bounces, shakes). */
.emote-glyph.emo-bounce { animation: emoBounce .7s ease-in-out .3s infinite; }
.emote-glyph.emo-spin { animation: emoSpin 1.6s linear .2s infinite; }
.emote-glyph.emo-shake { animation: emoShake .5s ease-in-out .3s infinite; }
.emote-glyph.emo-pulse { animation: emoPulse .8s ease-in-out .3s infinite; }
.emote-glyph.emo-wave { transform-origin: 70% 80%; animation: emoWave .6s ease-in-out .3s infinite; }
.emote-glyph.emo-dash { animation: emoDash .9s ease-in-out .3s infinite; }
@keyframes emoBounce { 0%,100% { transform: translateY(0) rotateX(0); } 40% { transform: translateY(-9px) rotateX(20deg); } 60% { transform: translateY(-9px) rotateX(-10deg); } }
@keyframes emoSpin { to { transform: rotateY(360deg); } }
@keyframes emoShake { 0%,100% { transform: rotateZ(0) rotateY(0); } 25% { transform: rotateZ(-14deg) rotateY(25deg); } 75% { transform: rotateZ(14deg) rotateY(-25deg); } }
@keyframes emoPulse { 0%,100% { transform: scale(1) rotateY(-15deg); } 50% { transform: scale(1.22) rotateY(15deg); } }
@keyframes emoWave { 0%,100% { transform: rotateZ(-18deg) rotateY(-10deg); } 50% { transform: rotateZ(18deg) rotateY(10deg); } }
@keyframes emoDash { 0%,100% { transform: translateX(-6px) rotateY(-25deg); } 50% { transform: translateX(8px) rotateY(25deg); } }
@media (orientation: portrait) {
  .emote-orb { left: -27px; top: -72px; width: 54px; height: 54px; }
  .emote-glyph { font-size: 31px; }
  .emote-tail { top: -22px; }
}

/* ---------------------------------------------------------------- retos (online challenges) */
.ch-card.mine { border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .15) inset; }
.ch-card.faded { opacity: .55; }
.ch-alert { margin-bottom: 18px; }
.ch-new { padding: 2px 7px; border-radius: 6px; background: var(--gold); color: #111; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; }
.ch-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.ch-vs { align-self: center; font-family: var(--display); font-size: 18px; color: var(--muted); }
.ch-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--team, var(--line2)); }
.ch-side.win { border-color: rgba(233,188,102,.55); border-left-color: var(--team, var(--gold)); box-shadow: 0 0 18px rgba(233,188,102,.12); }
.ch-team { font-family: var(--display); font-size: 18px; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-points { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--text); }
.ch-points small { font-size: 14px; color: var(--muted); }
.ch-side.win .ch-points { color: var(--gold); }
.ch-pending { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.invite-card { margin-bottom: 22px; padding: 16px 18px; border-radius: 14px; background: rgba(12,14,18,.82); border: 1px solid rgba(233,188,102,.45); box-shadow: 0 0 24px rgba(233,188,102,.12); max-width: 560px; }
.invite-card h3 { margin: 8px 0 0; font-family: var(--display); font-size: 26px; }
@media (max-width: 560px) {
  .ch-compare { grid-template-columns: 1fr; }
  .ch-vs { justify-self: center; font-size: 14px; }
}


/* ---------------------------------------------------------------- speed-ups (F5) */
.chest-row .chest-slot .chest-timer { height: 24px; }
.chest-row .chest-slot .btn.chest-speed { height: 30px; }
.dialog.speedup { gap: 12px; }
.dialog.speedup h2 { margin: 0; }
.speed-clock { display: inline-flex; align-items: center; gap: 8px; font-size: 26px; font-variant-numeric: tabular-nums; color: var(--gold); }
.speed-options { display: flex; flex-direction: column; gap: 8px; }
.speed-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.speed-row .btn { flex: none; min-width: 92px; }
.ad-test { text-align: center; align-items: center; }
.ad-test-count { font-size: 54px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- premium licence & shop (F6p / F4) */
.chest-slot.premium-slot { cursor: pointer; border-color: color-mix(in srgb, var(--gold) 45%, var(--line)) !important; background: radial-gradient(circle at 50% 40%, rgba(233,188,102,.12), transparent 70%) !important; font: inherit; color: inherit; }
.chest-slot.premium-slot:hover { border-color: var(--gold) !important; }
.workshop-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.workshop-bar .link { color: var(--gold); display: inline-flex; align-items: center; gap: 4px; }
button.currency { color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
button.currency.gems:hover { border-color: #8dcdbd; }
.currency .plus { display: grid; place-items: center; width: 17px; height: 17px; margin-left: 2px; border-radius: 50%; background: #2c8f74; color: #fff; font-size: 13px; line-height: 1; font-weight: 800; }
.currency.big { font-size: 18px; padding: 9px 14px; }
.premium-chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent); background: linear-gradient(180deg, rgba(233,188,102,.18), rgba(233,188,102,.06)); color: var(--gold); font: inherit; font-weight: 700; font-size: 12px; letter-spacing: 1px; cursor: pointer; }
.shop-offers { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.premium-card { display: flex; flex-direction: column; gap: 16px; }
.premium-head { display: flex; gap: 14px; align-items: center; }
.premium-head h2 { margin: 2px 0 6px; font-size: 26px; }
.premium-badge { flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 16px; color: #1a1205; background: linear-gradient(160deg, #fff1b0, #e9bc66 55%, #b07a14); box-shadow: 0 8px 24px rgba(233,188,102,.35); }
.premium-card.active .premium-badge { animation: road-pulse 2s ease-in-out infinite; }
.premium-perks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.premium-perks .perk { display: flex; gap: 10px; align-items: flex-start; }
.premium-perks b { font-size: 15px; }
.premium-buy { display: flex; gap: 10px; flex-wrap: wrap; }
.premium-buy .btn { flex: 1; min-width: 160px; }
.offer-card { display: flex; flex-direction: column; gap: 12px; }
.offer-card h3 { margin: 0; font-size: 24px; }
.offer-items { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.offer-items span { display: flex; align-items: center; gap: 8px; }
.gem-packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gem-pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 12px 12px; border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 30%, rgba(141,205,189,.12), transparent 65%), var(--panel); text-align: center; }
.gem-pack.tagged { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.gem-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 1px; color: #1a1205; background: var(--gold); }
.gem-art { height: 58px; display: grid; place-items: center; filter: drop-shadow(0 6px 14px rgba(141,205,189,.35)); }
.gem-amount { font-size: 28px; font-family: 'Barlow Condensed', sans-serif; }
.gem-bonus { font-size: 12px; font-weight: 800; letter-spacing: .5px; color: #6fe0a6; min-height: 16px; }
.gem-pack .btn { margin-top: 6px; }
@media (max-width: 900px) {
  .shop-offers { grid-template-columns: 1fr; }
  .gem-packs { grid-template-columns: repeat(2, 1fr); }
  .premium-perks { grid-template-columns: 1fr; }
}
/* Speed-up dialog: how much time to skip with diamonds. */
.speed-row.speed-gems { flex-direction: column; align-items: stretch; gap: 10px; border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); }
.speed-gems-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.speed-gems-head > b { color: var(--gold); font-size: 18px; white-space: nowrap; }
.speed-range { width: 100%; accent-color: var(--gold); height: 28px; cursor: pointer; }
.speed-quick { display: flex; gap: 6px; flex-wrap: wrap; }
.speed-quick .chip { --c: var(--gold); height: 30px; padding: 0 11px; }
/* Narrow phones: diamonds now run into thousands, so the top bar tightens up. */
@media (max-width: 420px) {
  .topbar { gap: 5px; padding: 0 6px; }
  .topbar .menu-btn { width: 34px; }
  .topbar .currency { padding: 4px 6px; gap: 4px; font-size: 11.5px; }
  .topbar .currency svg { width: 15px; height: 15px; }
  .topbar .currency .plus { display: none; }
  .topbar .premium-chip { padding: 4px 6px; }
}

/* ---------------------------------------------------------------- retos (from Moto Clash) */
.ch-card.mine { border-color: rgba(var(--accent-rgb), .45); box-shadow: 0 0 0 1px rgba(var(--accent-rgb), .15) inset; }
.ch-card.faded { opacity: .55; }
.ch-alert { margin-bottom: 18px; }
.ch-new { padding: 2px 7px; border-radius: 6px; background: var(--gold); color: #111; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; }
.ch-compare { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.ch-vs { align-self: center; font-family: var(--display); font-size: 18px; color: var(--muted); }
.ch-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--team, var(--line2)); }
.ch-side.win { border-color: rgba(233,188,102,.55); border-left-color: var(--team, var(--gold)); box-shadow: 0 0 18px rgba(233,188,102,.12); }
.ch-team { font-family: var(--display); font-size: 18px; letter-spacing: .3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-points { font-family: var(--display); font-size: 30px; line-height: 1; color: var(--text); }
.ch-points small { font-size: 14px; color: var(--muted); }
.ch-side.win .ch-points { color: var(--gold); }
.ch-pending { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dialog .ch-compare { margin: 14px 0 4px; }
@media (max-width: 560px) {
  .ch-compare { grid-template-columns: minmax(0, 1fr); }
  .ch-vs { justify-self: center; font-size: 14px; }
}

/* ---------------------------------------------------------------- salas */
.room-slots { display: grid; gap: 6px; margin-top: 4px; }
.room-slot { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.room-slot > span:not(.tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-slot > b { width: 16px; color: var(--muted); font-size: 12px; }
.room-slot.me { border-color: var(--accent); }
.room-slot.here { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, var(--panel2)); box-shadow: 0 0 0 1px var(--green) inset; }
.room-slot.away { opacity: 0.75; }
.room-slot > span:nth-of-type(2) { min-width: 4em; }
.room-ready { flex: none; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.room-ready.on { background: var(--green); color: #0c0e12; border-color: transparent; }
.ready-box { align-items: flex-start; }
.ready-call .ready-count { font-family: var(--display); font-size: 44px; text-align: center; margin: 6px 0 4px; color: var(--gold); }
.room-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.room-table td { padding: 6px 4px; border-top: 1px solid var(--line); }
.room-table td:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.room-table tr.hd td { border-top: 0; color: var(--muted); font-size: 11.5px; }
.room-table tr.me td { color: var(--accent); font-weight: 700; }
.room-chat { display: flex; flex-direction: column; gap: 4px; max-height: 210px; overflow-y: auto; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.room-chat .me b { color: var(--accent); }
/* A quick chat phrase pops in the middle of the screen when it is said (like the race emotes: mine blue, the others red). */
.chat-pops { position: fixed; left: 50%; top: 42%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.chat-pop { --cc: #ff3c45; --cd: #8c1016; position: relative; padding: 10px 18px 11px; border-radius: 16px; background: linear-gradient(180deg, var(--cc), var(--cd)); color: #fff; font: 800 20px/1.2 system-ui; text-align: center; max-width: min(86vw, 420px); box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.35); animation: chatPopIn .45s cubic-bezier(.2,1.6,.4,1) both, chatPopOut .4s ease-in 2.4s forwards; }
.voice-volume { gap: 8px; align-items: center; }
.voice-volume input { flex: 1; max-width: 220px; accent-color: var(--accent); }
.chat-pop.mine { --cc: #3d8bff; --cd: #0f3d8c; }
.chat-pop small { display: block; font-size: 11.5px; font-weight: 700; opacity: .85; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 2px; }
.chat-pop::after { content: ''; position: absolute; left: 50%; bottom: -10px; margin-left: -9px; width: 18px; height: 11px; background: var(--cd); clip-path: polygon(0 0, 100% 0, 50% 100%); }
@keyframes chatPopIn { from { opacity: 0; transform: scale(.3) translateY(26px); } }
@keyframes chatPopOut { to { opacity: 0; transform: translateY(-24px) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .chat-pop { animation: chatPopOut .4s ease-in 2.4s forwards; } }
.room-phrases .chip { font-size: 12.5px; }
.report-reason { padding: 6px 2px; }
.room-host { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--gold); border: 1px solid var(--gold); }
.room-more { flex: none; }
.room-voice { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); border: 1px solid var(--line); }
.room-voice.talking { color: #0c0e12; background: var(--green); border-color: transparent; box-shadow: 0 0 0 3px rgba(149, 213, 165, .35); }
.room-voice.silenced { color: var(--red); border-color: var(--red); }
.voice-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.voice-bar .btn.voice-btn { min-width: 46px; justify-content: center; }
.voice-bar .voice-btn.on { border-color: var(--green); color: var(--green); }
.voice-talking { font-size: 12.5px; font-weight: 700; color: var(--green); }
.room-here { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green); color: #0c0e12; }
.room-name { margin: 0; font-size: clamp(22px, 4vw, 30px); line-height: 1.1; overflow-wrap: anywhere; }
.room-slot.ai { opacity: 0.6; border-style: dashed; }
.room-item { width: 100%; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; padding: 12px; }
.room-item:hover { border-color: var(--accent); }
.room-item-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.room-item-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-item-text > b { font-size: 14px; letter-spacing: 0.04em; }
.room-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 3px solid transparent; }
.abandon-rewards { display: flex; gap: 10px; flex-wrap: wrap; }
.abandon-rewards div { flex: 1; min-width: 92px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); text-align: center; }
.abandon-rewards b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent); }
.abandon-rewards div.loss b { color: var(--red, #ff5a5a); }
.abandon-rewards small { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------------------------------------------------------------- touch controls tutorial (js/ui/controlsTutorial.js) */
.ctut h2 { margin: 0; }
.ctut-head { display: flex; align-items: center; gap: 8px; }
.ctut-step { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ctut-tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(var(--accent-rgb), .14); color: var(--accent); }
.ctut-phone { position: relative; display: flex; aspect-ratio: 2.1; width: min(100%, 40vh * 2.1); margin: 0 auto; border: 3px solid var(--line2); border-radius: 22px; background: linear-gradient(180deg, #2b3a4c, #3a3428 62%, #4a4a4f); overflow: hidden; }
.ctut-half { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding: 10px; font-size: 11px; font-weight: 700; text-align: center; color: #fffd; }
.ctut-half.l { border-right: 1px dashed #fff3; }
.ctut-stick { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #fff8; background: #0006; display: grid; place-items: center; }
.ctut-stick i { width: 26px; height: 26px; border-radius: 50%; background: #fffc; animation: ctut-stick 2.4s ease-in-out infinite; }
@keyframes ctut-stick { 0%, 100% { transform: none; } 30% { transform: translateX(14px); } 60% { transform: translateX(-14px); } }
.ctut-pad { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ctut-pad b { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: #0008; }
.ctut-dot { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; background: #e01b2e; border: 2px solid #fff; animation: ctut-swipe 2.4s ease-in-out infinite; }
@keyframes ctut-swipe { 0%, 100% { transform: none; } 25% { transform: translateY(-14px); } 60% { transform: translateY(12px); } }
.ctut-btns { display: grid; grid-template-areas: '. jump' 'manual pedal'; gap: 6px; align-items: end; justify-items: center; }
.ctut-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 8px; background: #0009; border: 2px solid #fff6; }
.ctut-btn:nth-child(1) { grid-area: jump; } .ctut-btn:nth-child(2) { grid-area: manual; }
.ctut-btn.main { grid-area: pedal; width: 52px; height: 52px; background: #b31222; }
.ctut-tilt { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.ctut-phone.mini { width: min(160px, 20vh * 2.1); place-items: center; justify-content: center; align-items: center; font-size: 22px; color: #fff; animation: ctut-tilt 2.6s ease-in-out infinite; }
@keyframes ctut-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-16deg); } 70% { transform: rotate(16deg); } }
.ctut-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; font-size: 14px; }
.ctut-dots { display: flex; justify-content: center; gap: 6px; }
.ctut-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line2); }
.ctut-dots i.on { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .ctut-stick i, .ctut-dot, .ctut-phone.mini { animation: none; } }

/* Notice at the top of the paddock after a race that hitched (js/main.js _slowBanner). */
/* Full-screen wait while the race screen downloads (the first Competir / Entrenar of a session). */
.race-loading { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: rgba(8,9,12,.92); animation: pagein .2s ease-out; }
.race-loading i { width: 40px; height: 40px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent, #b6ff1a); animation: showroom-spin .8s linear infinite; }
.race-loading p { margin: 0; color: #e8eaed; font: 700 16px/1.2 var(--font-display, inherit); letter-spacing: 2px; text-transform: uppercase; }
/* Rankings: circuit drop-down (js/ui/pages/rankings.js). */
.rank-pick { display: flex; flex-direction: column; gap: 6px; max-width: 420px; margin-bottom: 4px; }
.rank-pick select.input { min-height: 44px; }

/* ---------------------------------------------------------- first-time tutorial (js/ui/tutorial.js) */
.tut { position: fixed; inset: 0; z-index: 190; pointer-events: none; }
.tut-shade { position: fixed; background: rgba(4, 6, 9, .72); pointer-events: auto; }
.tut-shade.full { inset: 0; }
.tut-ring { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px var(--accent), 0 0 26px rgba(var(--accent-rgb), .55); pointer-events: none; animation: tut-pulse 1.4s ease-in-out infinite; }
@keyframes tut-pulse { 50% { box-shadow: 0 0 0 5px var(--accent), 0 0 40px rgba(var(--accent-rgb), .8); } }
.tut-tip { position: fixed; pointer-events: auto; background: var(--panel2); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); animation: tut-in .25s ease-out; }
.tut-tip p { margin: 4px 0 0; font-size: 15px; line-height: 1.4; }
.tut-tip::before { content: ''; position: absolute; left: var(--arrow, 50%); width: 12px; height: 12px; background: var(--panel2); border: 1px solid var(--accent); transform: translateX(-50%) rotate(45deg); }
.tut-tip.down::before { top: -7px; border-right: 0; border-bottom: 0; }
.tut-tip.up::before { bottom: -7px; border-left: 0; border-top: 0; }
.tut-tip.center { left: 50%; top: 50%; width: min(340px, calc(100vw - 32px)); transform: translate(-50%, -50%); }
.tut-tip.center::before { display: none; }
.tut-tag { font-family: var(--display); font-size: 12px; letter-spacing: 1.6px; color: var(--accent); font-weight: 700; }
.tut-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); pointer-events: auto; background: var(--panel); border: 1px solid var(--line2); border-top: 3px solid var(--accent); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); animation: tut-in .25s ease-out; }
.tut-card h2 { margin: 8px 0 10px; font-size: 30px; line-height: 1.05; }
.tut-card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.tut-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.tut-tip .tut-actions { margin-top: 10px; }
.tut-tip .btn.small { height: 34px; padding: 0 14px; }
@keyframes tut-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tut-ring, .tut-tip, .tut-card { animation: none; } }
