/* Focus HUD: the side panels sit faded and come up when they matter, on
   hover, or for a moment after any key press. --hud-op is the resting
   opacity (Settings > HUD opacity). The dash, the message strip, the alerts,
   the big texts, the lights, the pit-stop panel and the mentor card are
   never faded. */
.hud.focus { --hud-op: 0.55; }
.hud.focus .lcol > *, .hud.focus .hud-wx, .hud.focus .radar, .hud.focus .status, .hud.focus .minimap, .hud.focus .testrate {
  opacity: var(--hud-op);
  transition: opacity .45s ease;
}
.hud.focus.awake .lcol > *, .hud.focus.awake .hud-wx, .hud.focus.awake .radar, .hud.focus.awake .status, .hud.focus.awake .minimap, .hud.focus.awake .testrate,
.hud.focus .live, .hud.focus .lcol > *:hover, .hud.focus .hud-wx:hover, .hud.focus .radar:hover, .hud.focus .status:hover, .hud.focus .minimap:hover, .hud.focus .testrate:hover {
  opacity: 1;
}
/* hover needs the panels to take the mouse (the hud itself passes it through) */
.hud.focus .lcol > *, .hud.focus .hud-wx, .hud.focus .radar, .hud.focus .status, .hud.focus .minimap { pointer-events: auto; }

/* Spotlight: while Ray is talking on the test day, only his card is bright;
   everything else dims and blurs, then fades back in. */
.hud.spotlight > *:not(.mentor):not(.bigmsg):not(.lights):not(.lcol):not(.rcol):not(.keyhint):not(.tour) { opacity: 0.12 !important; filter: blur(3px); transition: opacity .35s ease, filter .35s ease; }
.hud.spotlight .lcol > *:not(.pitbar), .hud.spotlight .rcol > *:not(.testrate) { opacity: 0.12 !important; filter: blur(3px); }
.hud.spotlight .testrate, .hud.spotlight .pitbar, .hud.spotlight .keyhint { opacity: 1 !important; filter: none; }
.hud.spotlight .mentor { opacity: 1; filter: none; }
.hud .lcol > *, .hud .rcol > *, .hud .status, .hud .minimap, .hud .dash, .hud .strip, .hud .alerts, .hud .hud-top { transition: opacity .45s ease, filter .45s ease; }

/* ---------------------------------------------------------------- v0.9 modes: locked features */
/* visible but heavily faded, with the mode that hands them over */
/* small dash labels only fade: the key bar already says where they unlock (a chip covered the speed) */
/* the results page: the next mode to earn */
.card.nextmode { display: grid; gap: 6px; border-color: rgba(255,204,0,0.35); }
.card.nextmode b { font-size: 15px; }
.nm-prog { display: flex; align-items: center; gap: 5px; }
.nm-prog i { width: 22px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.nm-prog i.on { background: #ffcc00; }
.nm-prog em { font-style: normal; font-size: 12px; opacity: 0.7; margin-left: 4px; }
/* the landing: current mode and the next rung */
.land-mode { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: rgba(238,241,246,0.8); margin-top: 2px; }
.land-mode .chip { background: rgba(255,204,0,0.16); color: #ffcc00; border: 1px solid rgba(255,204,0,0.4); }
/* "Racer unlocked!" */
.levelup.unlock em { display: block; font-style: normal; font-size: 12px; opacity: 0.75; margin-top: 4px; }
.levelup.unlock .row { display: flex; gap: 8px; margin-top: 10px; }
/* the pause menu's keys and the Modes screen */
.land-mode button.chip { cursor: pointer; font: inherit; font-weight: 800; }
.mode-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.mode-card { display: grid; gap: 6px; align-content: start; }
.mode-card b { font-size: 20px; }
.mode-card.on { border-color: #ffcc00; box-shadow: 0 0 0 1px #ffcc00 inset; }
.mode-card.locked { opacity: 0.5; }
.mode-card .md-you { font-size: 12.5px; opacity: 0.8; }
.mode-card .md-need { font-size: 12.5px; color: #ffcc00; font-weight: 700; }
/* v0.9: settings gear at the top right of the race HUD (the mode + aids live in the pause menu / Settings) */
.hud .rtop { display: flex; gap: 8px; align-items: stretch; }
.hud .rtop > .hud-wx { flex: 1; min-width: 0; }
.hud-gear { pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 52px; padding: 6px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); color: #e8ecf2; cursor: pointer; font: 700 11px/1 Inter, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(8px); }
.hud-gear svg { width: 20px; height: 20px; }
.hud-gear kbd { margin: 0; font-size: 11px; }
.hud-gear:hover { border-color: var(--acc); color: var(--acc); }
.set-mode { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.set-mode .chip { background: rgba(255,204,0,0.16); color: #ffcc00; border: 1px solid rgba(255,204,0,0.4); }
/* v0.9 contracts: the offers page with deal details */
.deals .deal-wrap { display: grid; grid-template-columns: minmax(220px, 0.9fr) minmax(300px, 1.1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .deals .deal-wrap { grid-template-columns: 1fr; } }
.deal-card.on { border-color: #ffcc00; box-shadow: 0 0 0 1px #ffcc00 inset; }
.deal-card.gone { opacity: 0.45; cursor: default; }
.deal-card .walked { color: #ff8a7a; font-weight: 800; }
.deal-panel { background: var(--panel, rgba(12,15,22,0.92)); border: 1px solid var(--line, rgba(255,255,255,0.12)); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; }
.deal-panel.empty { color: rgba(238,241,246,0.75); text-align: center; padding: 28px 16px; }
.deal-panel header { display: flex; align-items: center; gap: 10px; }
.deal-panel header > div { flex: 1; display: grid; }
.deal-panel header b { font-size: 18px; }
.deal-panel .patience { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; display: grid; gap: 4px; justify-items: end; }
.pdots { display: flex; gap: 4px; }
.pdots i { width: 16px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.14); }
.pdots i.on { background: #ffcc00; }
.deal-panel .terms { width: 100%; border-collapse: collapse; font-size: 14px; }
.deal-panel .terms th { text-align: left; font-weight: 700; padding: 6px 0; }
.deal-panel .terms th small { display: block; font-weight: 500; font-size: 11.5px; opacity: 0.65; }
.deal-panel .terms td { text-align: right; font-family: var(--mono); font-size: 16px; }
.deal-panel .terms td em { display: block; font-style: normal; font-size: 11px; color: #7ee08a; }
.deal-panel .terms tr + tr { border-top: 1px solid rgba(255,255,255,0.07); }
.deal-panel .terms tr.up b { color: #7ee08a; }
.deal-panel .cur { font-size: 11.5px; opacity: 0.6; }
.deal-reply { margin: 0; padding: 8px 10px; border-radius: 8px; background: rgba(255,204,0,0.1); border-left: 3px solid #ffcc00; font-size: 13.5px; }
.deal-panel .asks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.deal-panel .asks .kick { width: 100%; }
.deal-panel footer { display: flex; justify-content: flex-end; }
.deals .mentor.deal-ray { position: static; transform: none; opacity: 1; width: auto; min-width: 0; margin: 0 0 12px; }
.pay-toast { position: fixed; right: 18px; top: 64px; z-index: 40; background: #ffcc00; color: #0b0d12; font: 800 14px/1.2 Inter, system-ui, sans-serif; padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,0.4); transition: opacity .5s, transform .5s; }
.pay-toast.out { opacity: 0; transform: translateY(-8px); }
/* v0.9: stacked messages never clip (the strip was a fixed 118 px column and the messages shrank) */
.hud .strip { height: auto; max-height: 46vh; }
.hud .strip .msg { flex: none; overflow-wrap: anywhere; }
/* v0.9: the grid tyre pick, centred; the radar enlarges on tap */
.hud .pitpanel.grid { position: fixed; left: 50%; top: 52%; transform: translate(-50%, -50%); width: min(430px, calc(100vw - 32px)); z-index: 7; box-shadow: 0 16px 48px rgba(0,0,0,0.55); }
.hud .pitpanel.grid h4 small { font-weight: 600; font-size: 11px; opacity: 0.6; margin-left: 6px; }
.hud .radar { pointer-events: auto; cursor: zoom-in; }
.hud .radar.zoom { position: fixed; right: 16px; top: 64px; width: min(520px, 46vw); z-index: 8; cursor: zoom-out; box-shadow: 0 16px 48px rgba(0,0,0,0.55); }
.hud .radar.zoom canvas { width: 100%; height: auto; }
/* v0.9 loading screens: two stills of the circuit cross-fade behind the text (no moving map) */
.loading-screen.has-stills { position: fixed; inset: 0; background: #05070c; }
.loading-screen .ld-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.loading-screen .ld-bg i { position: absolute; inset: 0; background: center / cover no-repeat; animation: ld-a 12s ease-in-out infinite; }
.loading-screen .ld-bg i:nth-child(2) { animation-name: ld-b; }
.loading-screen .ld-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4,6,11,0.88) 0%, rgba(4,6,11,0.55) 45%, rgba(4,6,11,0.15) 100%), linear-gradient(0deg, rgba(4,6,11,0.85), rgba(4,6,11,0) 45%); }
.loading-screen.has-stills > :not(.ld-bg) { position: relative; z-index: 1; }
/* the first still is up from the first frame, then the two cross-fade */
@keyframes ld-a { 0%, 40% { opacity: 1; } 50%, 90% { opacity: 0; } 100% { opacity: 1; } }
@keyframes ld-b { 0%, 40% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
/* no moving items on loading screens (Uday): the sliding car goes, the lights and the bar stay */
.loading-screen.has-stills .la-scene, #boot .la-scene { display: none; }
@media (prefers-reduced-motion: reduce) { .loading-screen .ld-bg i { animation: none; } .loading-screen .ld-bg i:first-child { opacity: 1; } }
/* the boot screen: the landing still, dimmed, instead of the moving map */
#boot { background: linear-gradient(90deg, rgba(4,6,11,0.92) 0%, rgba(4,6,11,0.6) 50%, rgba(4,6,11,0.35) 100%), var(--landing-still) center / cover no-repeat, #06080c; }
#boot .bt-drive { visibility: hidden; }
.rw-adnote { display: block; margin-top: 8px; font-size: 12px; opacity: 0.75; }
