:root { --team: #e10600; --bg: #070b12; --panel: #111823; --line: #243042; --txt: #eef2f7; --mut: #9aa6b6; }
body.app { margin: 0; background: var(--bg); color: var(--txt); font-family: system-ui, sans-serif; }
.screen[hidden], [hidden] { display: none !important; }
.btn { background: #1b2433; color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--team); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 10px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: default; }
.chip { background: #1b2433; color: var(--txt); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.stack { display: grid; gap: 10px; max-width: 420px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.hint { color: var(--mut); font-size: .9rem; }
.eyebrow { color: var(--mut); text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; margin: 0 0 4px; }
.lede { font-size: 1.05rem; line-height: 1.5; max-width: 560px; }
.title-screen { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; overflow: hidden; isolation: isolate; }
.title-view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; }
.title-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, rgba(7,11,18,.94) 0%, rgba(7,11,18,.72) 38%, rgba(7,11,18,.1) 70%), linear-gradient(0deg, rgba(7,11,18,.85), transparent 30%); }
.title-inner { padding: 32px clamp(20px, 5vw, 64px); max-width: 600px; animation: rise .7s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.title-inner h1 { font-size: clamp(2.8rem, 10vw, 5.2rem); line-height: .95; margin: 0 0 14px; font-style: italic; font-weight: 900; letter-spacing: -.02em; text-shadow: 0 4px 30px rgba(0,0,0,.6); }
.title-inner h1 span { color: #e10600; }
.title-inner .lede { color: #d5dce6; }
.logo-lights { display: flex; gap: 6px; margin-bottom: 14px; }
.logo-lights i { width: 14px; height: 14px; border-radius: 50%; background: #3a0505; animation: lamp 4s infinite; }
.logo-lights i:nth-child(2) { animation-delay: .25s; } .logo-lights i:nth-child(3) { animation-delay: .5s; } .logo-lights i:nth-child(4) { animation-delay: .75s; } .logo-lights i:nth-child(5) { animation-delay: 1s; }
@keyframes lamp { 0%, 10% { background: #3a0505; box-shadow: none; } 12%, 55% { background: #ff1a1a; box-shadow: 0 0 12px #f00; } 57%, 100% { background: #3a0505; box-shadow: none; } }
.btn.big { padding: 15px 18px; font-size: 1.05rem; box-shadow: 0 8px 24px rgba(225,6,0,.3); }
.row.two > * { flex: 1; }
.chip[aria-pressed="false"] { opacity: .6; }
.title-live { position: absolute; top: 14px; left: clamp(20px, 5vw, 64px); font-size: .75rem; letter-spacing: .08em; color: #cfd6df; background: rgba(7,11,18,.7); border: 1px solid var(--line); padding: 5px 10px; border-radius: 99px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff2a2a; animation: blink 1.2s infinite; vertical-align: 1px; }
@keyframes blink { 50% { opacity: .2; } }
.title-tower { position: absolute; right: 16px; top: 16px; width: 190px; background: rgba(7,11,18,.78); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; backdrop-filter: blur(4px); }
.title-tower ol { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.title-tower li { display: grid; grid-template-columns: 16px 4px 1fr; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #1a2331; transition: background .3s; }
.title-tower li i { height: 14px; border-radius: 2px; }
.title-tower li.cam { color: #fff; font-weight: 700; background: linear-gradient(90deg, rgba(255,42,42,.18), transparent); }
body.app > main { margin: 0; padding: 0; max-width: none; display: block; }
.pit-info { margin: 6px 0 0; font-size: .75rem; color: #9fd3ff; font-variant-numeric: tabular-nums; }
.warn-txt { color: #ff6b6b; font-weight: 700; }
.objective.tip { border-left-color: #3fa9ff; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.btn, .chip, .seg button, .tyre-btn, .speeds button, .cam button { transition: transform .08s, background .15s, filter .15s; }
.btn:active, .chip:active, .seg button:active, .tyre-btn:active, .speeds button:active, .cam button:active { transform: scale(.96); }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .title-inner, .logo-lights i, .live-dot { animation: none; } }
.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 90px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.page-head h2 { margin: 0; font-size: 1.5rem; }
.money { text-align: right; } .money small { display: block; color: var(--mut); } .money strong { font-size: 1.4rem; color: #35d07f; }
.bar-bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px; background: rgba(7,11,18,.92); border-top: 1px solid var(--line); z-index: 5; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.team-card { text-align: left; background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--tc); border-radius: 12px; padding: 12px; color: var(--txt); font: inherit; cursor: pointer; }
.team-card:hover { border-color: var(--tc); }
.team-card h3 { margin: 6px 0 2px; font-size: 1rem; }
.team-car, .mini-car { width: 100%; height: 110px; display: block; }
.team-meta { color: var(--mut); font-size: .85rem; margin-bottom: 8px; }
.bar { display: grid; grid-template-columns: 80px 1fr 56px; align-items: center; gap: 8px; font-size: .8rem; margin: 4px 0; }
.bar-t, .meter-t { height: 7px; background: #0a0f17; border-radius: 9px; overflow: hidden; display: block; }
.bar-t i, .meter-t i { display: block; height: 100%; background: var(--team); }
.bar-v { text-align: right; color: var(--mut); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { background: none; border: 0; color: var(--mut); padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--txt); border-color: var(--team); }
.garage { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.showcase { background: radial-gradient(ellipse at center, #1d2636, #0a0f17); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
#garageCar { width: 100%; height: 300px; display: block; }
.caption { text-align: center; color: var(--mut); font-size: .9rem; }
.upgrades { display: grid; gap: 8px; }
.upgrade { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.upgrade small { display: block; color: var(--mut); }
.pips { display: flex; gap: 4px; margin-top: 6px; } .pips i { width: 18px; height: 6px; border-radius: 3px; background: #26303f; } .pips i.on { background: var(--team); }
.cards2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.driver-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.driver-card h3 { margin: 6px 0 4px; }
.table-list { list-style: none; padding: 0; margin: 0; }
.table-list li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table-list li span { flex: 1; } .table-list li.mine, .grid-list li.mine, tr.mine { background: rgba(255,255,255,.07); font-weight: 700; }
.sw { display: inline-block; width: 4px; height: 16px; border-radius: 2px; }
.calendar { list-style: none; padding: 0; display: grid; gap: 8px; }
.calendar li { display: grid; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.calendar li.now { border-color: var(--team); } .calendar li.done { opacity: .75; } .calendar span, .calendar em { color: var(--mut); font-size: .85rem; }
.wk-facts, .res-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.fact { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.fact small { display: block; color: var(--mut); font-size: .75rem; }
.objective { background: rgba(53,208,127,.12); border: 1px solid rgba(53,208,127,.4); border-radius: 10px; padding: 10px; }
.brief { background: rgba(63,169,255,.12); border: 1px solid rgba(63,169,255,.4); border-radius: 10px; padding: 10px; margin: 10px 0; }
.lbl { display: block; color: var(--mut); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin: 8px 0 4px; }
.seg { display: flex; gap: 4px; }
.seg button, .pit-row button { flex: 1; background: #0d131d; color: var(--txt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 4px; font: inherit; font-size: .82rem; cursor: pointer; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--team); border-color: transparent; color: #fff; }
.tyre-btn { border-bottom: 3px solid #888 !important; }
.tyre-btn.S { border-bottom-color: #ff2b2b !important; } .tyre-btn.M { border-bottom-color: #ffd400 !important; } .tyre-btn.H { border-bottom-color: #f2f2f2 !important; } .tyre-btn.I { border-bottom-color: #2fd36b !important; } .tyre-btn.W { border-bottom-color: #2f8bff !important; }
.tyre-btn[aria-pressed="true"] { background: #2a3546 !important; outline: 2px solid #fff; }
.pit-row { display: flex; gap: 4px; } .pit-row button:disabled { opacity: .4; }
.grid-details { margin-top: 14px; } .grid-list { list-style: none; padding: 0; columns: 2; }
.grid-list li { display: flex; gap: 8px; align-items: center; padding: 4px; break-inside: avoid; } .grid-list small { color: var(--mut); margin-left: auto; }
.table-wrap { overflow-x: auto; }
.results { width: 100%; border-collapse: collapse; font-size: .9rem; } .results th, .results td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.season-car { width: 100%; height: 220px; display: block; }
.season-form { margin: 16px 0; } .season-form input { flex: 1; min-width: 160px; background: #0d131d; color: var(--txt); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.help ul { padding-left: 18px; line-height: 1.6; }
kbd { background: #1b2433; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 20; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; width: min(360px, 90vw); }

/* Race */
.race { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.race-top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: #0b111a; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flag { font-weight: 800; padding: 4px 10px; border-radius: 6px; font-size: .8rem; }
.flag.green { background: #138a43; } .flag.vsc { background: #ffcc00; color: #111; } .flag.wet { background: #2f6bd0; } .flag.chq { background: repeating-linear-gradient(45deg,#fff 0 6px,#111 6px 12px); color: #e10600; }
.lapbox small { color: var(--mut); margin-right: 4px; font-size: .75rem; }
.forecast { display: flex; gap: 3px; } .forecast span { position: relative; font-size: 1rem; padding: 2px 4px; background: #121a26; border-radius: 6px; }
.forecast span.unsure { opacity: .5; }
.speeds { display: flex; gap: 2px; margin-left: auto; } .speeds button, .cam button { background: #121a26; color: var(--txt); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; font: inherit; font-size: .8rem; cursor: pointer; }
.speeds button[aria-pressed="true"], .cam button[aria-pressed="true"] { background: var(--team); color: #fff; }
.race-main { flex: 1; display: grid; grid-template-columns: 1fr 210px; min-height: 0; }
.view-wrap { position: relative; min-height: 0; }
#view { width: 100%; height: 100%; display: block; touch-action: none; }
.cam { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.lights { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; background: #111; padding: 8px 12px; border-radius: 10px; }
.lights span { width: 22px; height: 22px; border-radius: 50%; background: #300; } .lights span.on { background: #ff1a1a; box-shadow: 0 0 14px #f00; }
.banner { position: absolute; top: 40%; left: 50%; transform: translate(-50%,-50%); background: rgba(7,11,18,.88); border: 2px solid var(--team); padding: 12px 18px; border-radius: 10px; font-weight: 800; text-align: center; }
.banner.pop { animation: pop .35s ease-out; } @keyframes pop { from { transform: translate(-50%,-50%) scale(.7); opacity: 0; } }
.tower { overflow-y: auto; background: #0b111a; border-left: 1px solid var(--line); }
.tower ol { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.tower li { display: grid; grid-template-columns: 20px 4px 34px 10px 1fr; gap: 6px; align-items: center; padding: 4px 6px; border-bottom: 1px solid #151d29; }
.tower li.mine { background: rgba(255,255,255,.1); font-weight: 700; } .tower li.out { opacity: .4; } .tower li.pit .gap { color: #ffcc00; }
.tower .gap { text-align: right; color: var(--mut); font-variant-numeric: tabular-nums; }
.tyre-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #222; }
.pitwall { display: grid; grid-template-columns: 1fr 260px; gap: 8px; padding: 8px; background: #0b111a; border-top: 1px solid var(--line); max-height: 46vh; overflow-y: auto; }
.car-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.car-card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--tc); border-radius: 10px; padding: 8px; }
.car-card.focused { box-shadow: 0 0 0 2px #fff3; } .car-card.alert { border-color: #ff3b3b; } .car-card.dead { opacity: .5; }
.cc-head { display: flex; gap: 8px; align-items: baseline; width: 100%; background: none; border: 0; color: var(--txt); font: inherit; padding: 0; cursor: pointer; text-align: left; }
.cc-pos { font-size: 1.3rem; } .cc-status { margin-left: auto; color: #ffcc00; font-size: .78rem; }
.cc-stats { font-size: .8rem; display: grid; gap: 4px; margin-top: 4px; }
.cc-tyre { display: flex; align-items: center; gap: 6px; }
.meter { display: grid; grid-template-columns: 56px 1fr 38px; gap: 6px; align-items: center; } .meter-l, .meter-v { color: var(--mut); } .meter-v { text-align: right; }
.cc-gaps { color: var(--mut); font-variant-numeric: tabular-nums; }
.wall-side { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.radio { list-style: none; margin: 0; padding: 0; font-size: .8rem; overflow-y: auto; max-height: 220px; }
.radio li { padding: 4px 6px; border-left: 3px solid #334; margin-bottom: 3px; background: #0e1520; }
.radio li.mine { border-color: var(--team); } .radio li.flag { border-color: #ffcc00; } .radio li.warn { border-color: #ff3b3b; }

@media (max-width: 820px) {
  .garage, .cards2 { grid-template-columns: 1fr; }
  #garageCar { height: 200px; }
  .race-main { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .race-main { grid-template-rows: auto 1fr; }
  .tower { border-left: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tower ol { display: flex; }
  .tower li { grid-template-columns: auto 4px auto auto; flex: none; border-bottom: 0; border-right: 1px solid #151d29; padding: 4px 8px; }
  .tower li .tyre-dot { display: none; }
  .pitwall { grid-template-columns: 1fr; max-height: 50vh; padding: 6px; }
  .car-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; scrollbar-width: none; }
  .car-card { flex: 0 0 88%; scroll-snap-align: center; }
  .radio { max-height: 84px; }
  .title-screen { align-items: flex-end; }
  .title-shade { background: linear-gradient(0deg, rgba(7,11,18,.97) 0%, rgba(7,11,18,.85) 52%, rgba(7,11,18,.15) 80%); }
  .title-inner { padding-bottom: 28px; padding-top: 180px; }
  .title-tower { display: none; }
  .title-inner .lede { font-size: .95rem; }
  .speeds { margin-left: 0; }
  .grid-list { columns: 1; }
}
