/* Heatline UI (v0.9.2 rebuild). Night asphalt, amber heat, mint cash, violet events.
   EVERYTHING HERE IS IN STAGE UNITS. #ui is a stage at least 800 x 450 units (a phone held sideways), scaled to the window as one piece
   (src/ui/stage.js), so a "px" below is a stage unit and there are no breakpoints and no viewport units: a layout that
   is right on the stage is right at every window size. The few rules that look at the stage's SHAPE (a window much
   wider or taller than 16:9) are container queries on #ui.
   style.css: tokens, the stage, the parts every screen is made of, dialogs, the loading pages.
   screens.css: the garage and every menu.     hud.css: the driving HUD. */
:root {
  --bg: #0b0d12; --bg2: #12151d; --panel: #171a23; --line: #2a2f3c; --line2: #3a4050;
  --ink: #f4f1ea; --ink2: #c9c4b8; --dim: #8f8b7d;
  --amber: #ff9f1c; --amber2: #ffd166; --amber3: #b85d0a; --hot: #ff3b30; --mint: #3ddc97; --mint2: #9ff5cf; --blue: #4aa3ff;
  --violet: #a66bff; --violet2: #d4b8ff; --violet3: #5a2fa0; --gold: #f2c230;
  --font-display: 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --s: 1;
  /* the safe areas are window pixels: on the stage they are that many units */
  --safe-t: calc(env(safe-area-inset-top, 0px) / var(--s)); --safe-b: calc(env(safe-area-inset-bottom, 0px) / var(--s));
  --safe-l: calc(env(safe-area-inset-left, 0px) / var(--s)); --safe-r: calc(env(safe-area-inset-right, 0px) / var(--s));
  --edge: 12px;                       /* the gap every corner block keeps from the stage's edge */
  --tray: 214px;                      /* the tray under the car in a garage place */
  --panel-bg: linear-gradient(180deg, rgba(23,26,35,.98), rgba(14,16,22,.99));
}
@font-face { font-family: 'Nunito'; src: url('fonts/nunito-400.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--font-body);
  user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; touch-action: none; -webkit-touch-callout: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; -webkit-touch-callout: none; }
/* THE STAGE */
#ui { position: fixed; left: 0; top: 0; width: 800px; height: 450px; transform-origin: 0 0; overflow: hidden; pointer-events: none;
  font-size: 14px; line-height: 1.3; container-type: size; container-name: stage; -webkit-touch-callout: none; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; line-height: inherit; }
button:disabled { cursor: default; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: .02em; margin: 0; font-weight: 900; }
p { margin: 0; }

/* ------------------------------------------------------------ the parts every screen is made of */
.ico { width: 1.4em; height: 1.4em; flex: none; vertical-align: middle; display: inline-block; }
/* THE REWARD BADGES (v0.9.7, src/ui/gems.js): full colour, a glint now and then, a pop when won */
.gem { width: 1.5em; height: 1.5em; flex: none; vertical-align: middle; display: inline-block; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); overflow: visible; }
.gem.sm { width: 1.2em; height: 1.2em; } .gem.lg { width: 34px; height: 34px; } .gem.xl { width: 56px; height: 56px; }
.gem .gem-glint { animation: gemGlint 4.6s ease-in-out infinite; }
.gem-credits .gem-glint { animation-delay: .8s; } .gem-coin .gem-glint { animation-delay: 1.6s; } .gem-crate .gem-glint { animation-delay: 2.4s; } .gem-trophy .gem-glint { animation-delay: 3.1s; }
@keyframes gemGlint { 0%, 78%, 100% { opacity: .18; } 86% { opacity: .9; } }
.gem-crate .gem-band { animation: gemBand 2.4s ease-in-out infinite; }
@keyframes gemBand { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.gem.pop { animation: gemPop .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes gemPop { 0% { transform: scale(.2) rotate(-18deg); opacity: 0; } 70% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.amt { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt b { font-weight: 900; } .amt-cash b { color: var(--mint); } .amt-credits b { color: #c4a6ff; } .amt-coin b { color: var(--amber2); }
@media (prefers-reduced-motion: reduce) { .gem .gem-glint, .gem-crate .gem-band, .gem.pop { animation: none; } }
/* THE SCROLLBAR (v0.9.7): a slim rail that only shows its weight under the pointer */
* { scrollbar-width: thin; scrollbar-color: rgba(255,159,28,.55) transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,159,28,.45); border-radius: 6px; border: 1px solid rgba(0,0,0,.25); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffd166, #ff9f1c); }
*::-webkit-scrollbar-corner { background: transparent; }
.ico.sm { width: 1.15em; height: 1.15em; } .ico.lg { width: 30px; height: 30px; }
.hidden { display: none !important; }
.small { font-size: 12px; } .dim { color: var(--dim); } .muted { color: var(--ink2); }
.mint-t { color: var(--mint); } .amber-t { color: var(--amber2); } .hot-t { color: #ff8a80; } .event-t { color: var(--violet2); }
.tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); font-weight: 900; }
.nm { font-weight: 900; }
.row { display: flex; gap: 8px; align-items: center; } .row.between { justify-content: space-between; } .row.center { justify-content: center; }
.mono { font-variant-numeric: tabular-nums; }

/* buttons: three sizes, one line of text each, never wrapped and never cut */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; min-height: 40px; padding: 0 18px; border-radius: 11px;
  font-weight: 900; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: var(--ink);
  background: linear-gradient(180deg, #2b3040, #1c2030); border: 1px solid var(--line2); box-shadow: 0 3px 0 #0a0c12, 0 6px 14px rgba(0,0,0,.3);
  transition: transform .1s ease, filter .12s, box-shadow .1s; }
.btn:hover:not(:disabled) { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #0a0c12; }
.btn.primary { background: linear-gradient(180deg, #ffbf3f, #ff7a1a); color: #2a1200; border-color: #ffd98a; box-shadow: 0 3px 0 #8a3f08, 0 8px 20px rgba(255,120,30,.3); }
.btn.mint { background: linear-gradient(180deg, #5fe9b0, #1fb277); color: #032a1b; border-color: #a8f5d6; box-shadow: 0 3px 0 #0d5a3b; }
.btn.amber { background: linear-gradient(180deg, #3a2f18, #241c0e); border-color: var(--amber3); color: var(--amber2); }
.btn.danger { background: linear-gradient(180deg, #ff5a4e, #c2302a); border-color: #ff9a92; box-shadow: 0 3px 0 #6b1c16; }
.btn.ghost { background: rgba(255,255,255,.04); border-color: var(--line2); box-shadow: none; }
.btn.small { min-height: 33px; padding: 0 12px; font-size: 12px; border-radius: 9px; box-shadow: 0 2px 0 #0a0c12; }
.btn.small.primary { box-shadow: 0 2px 0 #8a3f08; } .btn.small.mint { box-shadow: 0 2px 0 #0d5a3b; } .btn.small.ghost { box-shadow: none; }
.btn.big { min-height: 46px; padding: 0 22px; font-size: 15px; border-radius: 13px; }
.btn.wide { width: 100%; }
.btn:disabled { filter: grayscale(.7) brightness(.7); box-shadow: none; transform: none; }
.btn .ico { width: 1.25em; height: 1.25em; }
.btn[data-fake] { pointer-events: none; }
.iconbtn { position: relative; width: 38px; min-height: 38px; padding: 0; border-radius: 11px; }
.iconbtn .ico { width: 19px; height: 19px; }
.close { flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.07); color: var(--ink2); font-size: 15px; display: flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
.close:hover { background: rgba(255,255,255,.16); transform: rotate(90deg); }
.chev { font-size: 1.35em; line-height: .8; margin-right: -2px; }

.chip { display: inline-flex; align-items: center; gap: 5px; flex: none; background: rgba(11,13,18,.82); border: 1px solid var(--line2); border-radius: 999px; padding: 3px 9px; font-weight: 800; font-size: 12px; white-space: nowrap; }
.chip .ico { width: 13px; height: 13px; }
.chip.mint { color: var(--mint); border-color: rgba(61,220,151,.4); } .chip.amber { color: var(--amber2); border-color: var(--amber3); }
.chip.hot { color: #ff8a80; border-color: rgba(255,90,70,.45); } .chip.wet { color: var(--blue); border-color: rgba(74,163,255,.4); }
.chip.gold { color: var(--gold); border-color: rgba(242,194,48,.5); background: rgba(20,14,0,.6); }
.chip.event, .chip.theme { color: var(--violet2); border-color: var(--violet3); background: rgba(26,16,48,.7); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.badge { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 19px; height: 19px; border-radius: 10px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 900; padding: 0 5px; letter-spacing: 0; }
.badge.amber { background: var(--amber); color: #2a1200; } .badge.mint { background: var(--mint); color: #00261a; } .badge.gold { background: var(--gold); color: #2a1d00; }
.bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; width: 100%; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber3), var(--amber2)); border-radius: 3px; transition: width .3s; }
.bar.mint > i { background: linear-gradient(90deg, #1fb277, var(--mint2)); }
.bar.violet > i { background: linear-gradient(90deg, var(--violet3), var(--violet)); }
.bar > b.ghost { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(90deg, rgba(61,220,151,.85) 0 3px, rgba(61,220,151,.35) 3px 6px); border-radius: 3px; animation: ghostPulse 1.1s ease-in-out infinite; }
.bar > b.ghost.down { background: repeating-linear-gradient(90deg, rgba(255,90,60,.85) 0 3px, rgba(255,90,60,.35) 3px 6px); }
@keyframes ghostPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.pips { display: flex; gap: 3px; }
.pips i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); }
.pips i.on { background: linear-gradient(90deg, var(--amber3), var(--amber2)); box-shadow: 0 0 6px rgba(255,159,28,.5); }
.key { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 5px; background: #2b3040; border: 1px solid #4a5068; box-shadow: 0 2px 0 #0a0c12; font-size: 11px; font-weight: 900; color: var(--ink); font-family: inherit; }
.brand { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 24px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; text-shadow: 0 3px 0 rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.6); padding-right: .12em; }
.brand .h { color: var(--amber); } .brand .l { color: var(--ink); }
.cash { font-family: var(--font-display); font-weight: 900; font-size: 18px; color: var(--mint); letter-spacing: .02em; white-space: nowrap; }
/* a number over its label */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { padding: 7px 10px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); min-width: 0; }
.stat .v { font-size: 16px; font-weight: 900; color: var(--amber2); white-space: nowrap; }
.stat .k { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
/* an offer: what it is, and the buttons that take it */
.offer { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: rgba(255,159,28,.09); border: 1px solid rgba(255,159,28,.4); }
.offer > .ico { width: 20px; height: 20px; color: var(--amber2); }
.offer-text { flex: 1; min-width: 0; }
.offer .t { font-weight: 900; font-size: 14px; } .offer .d { font-size: 12px; color: var(--ink2); }
.offer-actions { display: flex; gap: 6px; flex: none; }
.offer.strong { border: 2px solid rgba(255,176,60,.8); background: rgba(255,159,40,.15); }
.offer.off { border: 1px dashed var(--line2); background: rgba(255,255,255,.03); color: var(--ink2); }
.offer.mint { border-color: rgba(61,220,151,.5); background: rgba(61,220,151,.08); }
.btn.ad-wait[disabled] { opacity: .75; font-variant-numeric: tabular-nums; }
.ad-veil { position: absolute; inset: 0; background: rgba(0,0,0,.3); z-index: 55; pointer-events: auto; }
/* a list row: a thing, what it is, and the one control beside it */
.list { display: flex; flex-direction: column; gap: 7px; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); text-align: left; }
.item.noicon { grid-template-columns: minmax(0, 1fr) auto; }
.item .nm { font-size: 14px; line-height: 1.2; } .item .what { color: var(--ink2); font-size: 12px; line-height: 1.3; }
.item.ready { border-color: rgba(61,220,151,.5); background: rgba(61,220,151,.07); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { min-height: 33px; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-weight: 900; font-size: 12px; text-transform: uppercase; color: var(--ink2); white-space: nowrap; }
.seg button.on { background: rgba(255,159,28,.16); border-color: var(--amber); color: var(--amber2); }
input[type=range] { width: 100%; accent-color: var(--amber); margin: 0; }

/* ------------------------------------------------------------ screens and dialogs */
.screen { position: absolute; inset: 0; display: none; pointer-events: none; }
.screen.active { display: block; }
/* A MODAL IS IN FRONT OF EVERYTHING on the garage and the road: above the signs (20) and the side panels (21), below the
   loading hold (40), the reward reveal (70) and the messages, which are feedback about what the modal just did */
.screen.modal { align-items: center; justify-content: center; background: rgba(6, 8, 12, .76); z-index: 30; pointer-events: auto;
  padding: calc(10px + var(--safe-t)) calc(10px + var(--safe-r)) calc(10px + var(--safe-b)) calc(10px + var(--safe-l)); }
/* A PAGE: the biggest screens (Events, Races, Settings, a result) take the whole stage on a phone, edge to edge, so their
   content has every unit of it; on a stage bigger than a page they are a card in the middle like the rest */
.screen.modal.page { padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); background: rgba(6, 8, 12, .9); }
.screen.modal.active { display: flex; animation: fadeIn .2s ease; }
.screen.modal.confirm { z-index: 50; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
/* THE DIALOG: head, the one part that scrolls, and a foot that holds the buttons that act */
.panel { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: min(100%, 600px); min-height: 0;
  background: var(--panel-bg); border: 1px solid var(--line2); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); overflow: hidden; }
.panel.enter { animation: popIn .26s cubic-bezier(.2,.9,.3,1.15); }
.screen.noanim .panel { animation: none !important; }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-s { max-width: 400px; } .dlg-m { max-width: 520px; } .dlg-l { max-width: 700px; }
.dlg-xl { max-width: 1040px; height: 100%; max-height: 600px; border-radius: 0; border-width: 0; }
@container stage (min-width: 1060px) { .dlg-xl { border-radius: 16px; border-width: 1px; } }
@container stage (min-height: 620px) { .dlg-xl { border-radius: 16px; border-width: 1px; } }
.dlg-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px 6px 16px; border-bottom: 1px solid var(--line); }
.dlg-title { flex: 1 1 auto; min-width: 0; }
.dlg-title h2 { color: var(--amber2); font-size: 19px; line-height: 1.1; text-transform: uppercase; font-style: italic; padding-right: .1em; }
.dlg-sub { font-size: 12px; color: var(--ink2); margin-top: 2px; line-height: 1.3; }
.dlg-aside { flex: none; display: flex; align-items: center; gap: 8px; }
.dlg-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 10px 16px; display: flex; flex-direction: column; gap: 9px; }
.dlg-body > * { flex: none; }
.dlg-foot { flex: none; display: flex; align-items: center; gap: 12px; padding: 7px 16px 9px; border-top: 1px solid var(--line); background: rgba(8,10,14,.55); }
.dlg-note { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.dlg-actions { display: flex; gap: 8px; margin-left: auto; flex: none; }
.dlg-foot .dlg-actions:only-child { margin: 0 auto; }
/* v0.9.6: a result card with Try again. The button the card is for spans the foot; the ways elsewhere share a row under it */
.has-retry .dlg-foot { flex-wrap: wrap; } .has-retry .dlg-actions { display: flex; flex-wrap: wrap; width: 100%; margin: 0; }
.has-retry .dlg-actions > .btn { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; }
.has-retry .dlg-actions > .btn.primary { flex: 1 1 100%; order: -1; min-height: 46px; font-size: 1.05em; }
/* the pause card of a race, event or job (Uday 26-10): Try again is the big first button, Tune & try again second, the rest a row under them */
.pause-retry .dlg-actions > .btn.amber { flex: 1 1 100%; order: -1; min-height: 42px; }
.pause-retry .dlg-actions > .btn.primary { min-height: 52px; font-size: 1.12em; }
.pause-retry .dlg-body { padding: 6px 16px; }
.panel.win .dlg-title h2 { color: var(--mint2); } .panel.lost .dlg-title h2 { color: var(--ink2); } .panel.hot .dlg-title h2 { color: #ff8a80; }
.panel.event .dlg-title h2 { color: var(--violet2); }
/* two columns inside a dialog body */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sec-head { display: flex; align-items: center; gap: 8px; }
.sec-head::after { content: ''; flex: 1; height: 1px; background: var(--line2); }

/* ------------------------------------------------------------ messages: parked, they are a column at the top centre */
.feed { position: absolute; left: 50%; top: calc(var(--safe-t) + 56px); transform: translateX(-50%); width: min(560px, 92%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 36; }
.toasts { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.toasts:empty { display: none; }
.toast { padding: 7px 16px; border-radius: 11px; background: rgba(11,13,18,.92); border: 1px solid var(--line2); font-weight: 900; letter-spacing: .05em; font-size: 13px; text-transform: uppercase; text-align: center; animation: toast 2.4s ease forwards; box-shadow: 0 8px 22px rgba(0,0,0,.45); }
.toast.mint { color: var(--mint); border-color: rgba(61,220,151,.5); }
.toast.amber { color: var(--amber2); border-color: rgba(255,159,28,.5); }
.toast.hot { color: #ffb3ae; border-color: rgba(255,59,48,.6); background: rgba(80,12,10,.92); }
.toast.big { font-size: 15px; padding: 9px 20px; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px) scale(.94); } 10% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
.banner { text-align: center; opacity: 0; }
.banner:empty, .hud-left .banner:empty { display: none; }
.banner.show { animation: banner 2.4s ease forwards; }
.banner h1 { font-size: 48px; line-height: 1; color: var(--ink); text-transform: uppercase; font-style: italic; text-shadow: 0 5px 0 rgba(0,0,0,.35), 0 10px 40px rgba(0,0,0,.8); padding: 0 .12em; }
.banner .s { font-size: 13px; letter-spacing: .26em; text-transform: uppercase; color: var(--amber2); font-weight: 900; text-shadow: 0 2px 6px #000; margin-bottom: 4px; }
.banner.hot h1 { color: var(--hot); text-shadow: 0 0 40px rgba(255,59,48,.7), 0 5px 0 rgba(0,0,0,.35); }
.banner.mint h1 { color: var(--mint); text-shadow: 0 0 40px rgba(61,220,151,.5), 0 5px 0 rgba(0,0,0,.35); }
.banner.amber h1 { color: var(--amber2); }
@keyframes banner { 0% { opacity: 0; transform: scale(1.15); } 12% { opacity: 1; transform: scale(1); } 82% { opacity: 1; } 100% { opacity: 0; } }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 110px rgba(0,0,0,.5); transition: box-shadow .3s; }
.vignette.hurt { box-shadow: inset 0 0 150px rgba(255,40,30,.7); }
.vignette.heat { box-shadow: inset 0 0 90px rgba(255,59,48,.22); }
.flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: #fff; transition: opacity .35s ease; z-index: 36; }
.flash.on { transition: none; }

/* ------------------------------------------------------------ loading, the hold after Drive, the phone held upright */
#s-loading { position: absolute; inset: 0; display: none; overflow: hidden; background: #0b0d12; transition: opacity .65s ease; pointer-events: auto; z-index: 38; }
#s-loading.active { display: block; }
#s-loading.fade { opacity: 0; pointer-events: none; }
#s-loading .art { position: absolute; inset: -6% 0 0 0; background: #0b0d12 url('assets/keyart.jpg') center bottom / cover no-repeat; transform-origin: 50% 100%; animation: kenburns 30s ease-in-out infinite alternate; transition: opacity 1.6s ease; }
@keyframes kenburns { from { transform: scale(1.0); } to { transform: scale(1.08); } }
#s-loading .dusk { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,13,18,.55) 0%, rgba(11,13,18,.12) 40%, rgba(11,13,18,.55) 78%, rgba(11,13,18,.95) 100%); transition: background 1.6s ease; }
#s-loading .scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(180deg, rgba(255,255,255,.015) 0 2px, transparent 2px 4px); mix-blend-mode: overlay; }
.load-wrap { position: absolute; top: 30px; left: 0; right: 0; margin: 0 auto; text-align: center; width: 420px; }
.load-cta { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 34px); display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 74px; }
#s-loading .brand { font-size: 78px; line-height: .95; color: #f4f1ea; text-shadow: 0 6px 0 rgba(0,0,0,.35), 0 18px 60px rgba(255,120,30,.35); padding: 0; }
/* the italic is synthesised (Nunito ships upright only), so the slanted T reaches past the span's box and clip-to-text left
   that part unpainted: padding widens the painted area, the negative margin keeps the letter spacing */
#s-loading .brand-heat { color: #ff9f1c; background: linear-gradient(180deg, #ffd166, #ff7a1a 70%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; padding: .08em .22em .08em .08em; margin: -.08em -.22em -.08em -.08em; }
#s-loading .brand-sub { color: #d8d3c8; letter-spacing: .32em; font-size: 12px; margin: 10px 0 20px; text-transform: uppercase; text-shadow: 0 2px 6px #000; font-weight: 800; }
.load-bar { position: relative; height: 10px; border-radius: 5px; background: rgba(11,13,18,.85); border: 1px solid #3a3d48; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.6); }
.load-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ff7a1a, #ffd166); transition: width .25s; box-shadow: 0 0 14px rgba(255,159,28,.6); }
.load-text { margin-top: 10px; font-size: 12px; color: #d8d3c8; letter-spacing: .12em; min-height: 18px; text-shadow: 0 1px 3px #000; text-transform: uppercase; font-weight: 800; }
#s-loading.ready .load-bar, #s-loading.ready .load-text { opacity: 0; transition: opacity .4s; }
#s-loading.live { background: transparent; }
#s-loading.live .art { opacity: 0; }
#s-loading.live .dusk { background: linear-gradient(180deg, rgba(11,13,18,.5) 0%, rgba(11,13,18,.05) 40%, rgba(11,13,18,.12) 70%, rgba(11,13,18,.8) 100%); }
.load-cta .btn.big { min-height: 52px; padding: 0 46px; font-size: 19px; letter-spacing: .12em; animation: ctaPulse 2.2s ease-in-out infinite; }
@keyframes ctaPulse { 0%,100% { box-shadow: 0 3px 0 #8a3f08, 0 8px 22px rgba(255,120,30,.35); } 50% { box-shadow: 0 3px 0 #8a3f08, 0 10px 44px rgba(255,159,28,.75); } }
.load-hint { color: #d8d3c8; font-size: 13px; letter-spacing: .06em; text-shadow: 0 1px 4px #000; opacity: .9; }
.load-hint b { color: #ffd166; }
.safety { color: var(--dim); font-size: 11px; letter-spacing: .06em; text-align: center; text-shadow: 0 1px 3px #000; }
/* the hold after Drive: the shaders for a fresh run link for seconds on a slow GPU and the last frame just sits there,
   which reads as a hang (Uday, 16-09). Same art as the loading page, so the two screens are one family. */
#s-hold { position: absolute; inset: 0; display: none; z-index: 40; background: #0b0d12; opacity: 1; transition: opacity .4s ease; pointer-events: auto; }
#s-hold.on { display: block; }
#s-hold.fade { opacity: 0; pointer-events: none; }
#s-hold .hold-art { position: absolute; inset: 0; background: #0b0d12 url('assets/keyart.jpg') center bottom / cover no-repeat; opacity: .45; }
#s-hold .hold-veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,13,18,.8), rgba(11,13,18,.55) 45%, rgba(11,13,18,.92)); }
#s-hold .hold-wrap { position: absolute; left: 0; right: 0; bottom: 54px; text-align: center; }
#s-hold .hold-brand { font-family: var(--font-display); font-style: italic; font-weight: 900; text-transform: uppercase; color: #f4f1ea; font-size: 40px; letter-spacing: .04em; }
#s-hold .hold-brand i { color: #ff9f1c; font-style: italic; }
#s-hold .hold-bar { position: relative; width: 300px; height: 6px; margin: 14px auto 0; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; }
#s-hold .hold-fill { position: absolute; top: 0; bottom: 0; width: 38%; border-radius: 3px; background: linear-gradient(90deg, #ff7a1a, #ffd166); animation: holdSlide 1.15s ease-in-out infinite; }
@keyframes holdSlide { 0% { left: -40%; } 100% { left: 100%; } }
#s-hold .hold-text { margin-top: 12px; color: #d8d3c8; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; text-shadow: 0 1px 3px #000; }
/* a click is all the game is waiting for (a first visit starts driving on its own; the keys need the page to have focus) */
.focus-ask { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 39; display: none; flex-direction: column; align-items: center; gap: 8px; padding: 18px 30px; border-radius: 16px;
  background: rgba(11,13,18,.9); border: 1px solid var(--amber3); box-shadow: 0 16px 50px rgba(0,0,0,.6); pointer-events: auto; cursor: pointer; text-align: center; }
.focus-ask.on { display: flex; }
.focus-ask b { font-size: 22px; font-style: italic; text-transform: uppercase; color: var(--amber2); }
/* landscape only. A phone held upright gets this card over everything (App.checkOrientation). */
.rotate-card { position: absolute; inset: 0; z-index: 99; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(8, 10, 16, .95); color: #f4f6fb; text-align: center; font-size: 30px; padding: 24px; pointer-events: auto; }
.rotate-card.on { display: flex; }
.rotate-card b { font-size: 40px; letter-spacing: .02em; }
.rotate-card .rot-phone { width: 80px; height: 136px; border: 5px solid #ffb627; border-radius: 14px; margin-bottom: 12px; animation: rot-turn 1.8s ease-in-out infinite; }
@keyframes rot-turn { 0%, 25% { transform: rotate(0deg); } 55%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate-card .rot-phone { animation: none; transform: rotate(-90deg); } }

/* the result cards' banner (26-10): bottom centre, under everything the card asks of the player */
.hl-banner { position: fixed; left: 50%; bottom: calc(var(--safe-b, 0px) + 6px); transform: translateX(-50%); z-index: 45; pointer-events: auto; }
.hl-banner.top { bottom: auto; top: 6px; }
body.hl-strip::after { content: ""; position: fixed; left: 0; right: 0; top: 0; height: 76px; background: linear-gradient(180deg, #0b0e14, #06080c); border-bottom: 1px solid rgba(255, 255, 255, .06); z-index: 44; pointer-events: none; }

/* a result card with a banner under it (26-10): the card is lifted clear of the banner's strip, its buttons always above it */
body.has-banner .screen.modal.active { padding-bottom: calc(var(--banner-h, 102px) + var(--safe-b, 0px)); }

/* v0.9.9: the one dead-end card (graphics reset, a stalled or failed load) */
#hl-dead { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; background: rgba(8,10,16,.86); backdrop-filter: blur(3px); }
#hl-dead .hl-dead-card { width: min(420px, 88vw); padding: 22px 22px 18px; border-radius: 14px; background: #141824; border: 1px solid rgba(255,159,28,.45); box-shadow: 0 18px 50px rgba(0,0,0,.6); text-align: center; color: #e9e4da; font-family: var(--font-body, sans-serif); }
#hl-dead b { display: block; font-size: 19px; margin-bottom: 8px; color: #ffd166; }
#hl-dead p { margin: 0 0 16px; font-size: 14px; line-height: 1.45; color: #cfc9bd; }

/* v0.9.11: pause foot wraps instead of clipping Resume */
.pause-panel .dlg-foot { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
.pause-panel .dlg-foot > .btn { flex: 1 1 auto; min-width: 0; }

/* v0.9.11: localhost-only ad placeholders */
.hl-adcard { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; background: repeating-linear-gradient(45deg, rgba(40,44,58,.96), rgba(40,44,58,.96) 14px, rgba(50,55,72,.96) 14px, rgba(50,55,72,.96) 28px); font-family: Nunito, sans-serif; color: #f4f1ea; }
.hl-adbox { max-width: 520px; padding: 22px 28px; border-radius: 16px; background: rgba(12,14,20,.88); border: 1px solid rgba(255,159,28,.6); text-align: center; }
.hl-adbox b { display: block; font-size: 30px; font-weight: 900; font-style: italic; text-transform: uppercase; color: #ff9f1c; margin: 6px 0 8px; }
.hl-adbox p { margin: 6px 0; font-size: 15px; color: #d8d3c8; }
.hl-adtag { font-size: 11px; font-weight: 900; letter-spacing: .18em; color: #9aa3b5; }
.hl-adleft { font-weight: 800; color: #f4f1ea !important; }

/* v0.9.11: one header bar. Banner at the left; on the garage home the cash + icon row lives in the same bar */
body.hl-strip .hl-banner.top { left: calc(var(--safe-l, 0px) + 14px); transform: none; top: 13px; }
body.hl-strip.hl-home #ui { overflow: visible; z-index: 46; }
body.hl-strip.hl-home #s-garage .gar-top:not(.gar-inside):not(.in-place) { top: calc(-76px / var(--s, 1)); height: calc(76px / var(--s, 1)); min-height: 0; padding-top: 0; padding-bottom: 0; background: none; z-index: 46; padding-left: calc(350px / var(--s, 1)); }

/* v0.9.11: header room, garage home fills the top, Multiplayer call to action bottom right */
body.hl-strip.hl-home #s-garage .gar-top:not(.gar-inside):not(.in-place) .gar-tools { gap: 10px; padding-top: 4px; }
body.hl-strip #s-garage .side-stack { top: 12px; }
body.hl-strip #s-garage .gar-bottom:has(> .deck) { top: 12px; bottom: auto; }
body.hl-strip #s-garage .gar-bottom > .mp-chip { position: fixed; right: calc(var(--safe-r, 0px) + var(--edge, 14px)); left: auto; bottom: calc(var(--safe-b, 0px) + 14px); top: auto; width: auto; min-width: 250px; padding: 12px 20px; border-radius: 14px; font-size: 16px; gap: 10px; justify-content: center; background: linear-gradient(180deg, rgba(20,120,110,.95), rgba(9,70,64,.95)); border: 1px solid rgba(94,234,212,.7); box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 18px rgba(45,212,191,.25); z-index: 24; }
body.hl-strip #s-garage .gar-bottom > .mp-chip:hover { filter: brightness(1.12); }

/* v0.9.11 patch 41: garage home layout */
#s-garage .hl-centre { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: clamp(240px, calc(100% - 660px), 380px); z-index: 21; pointer-events: none; }
#s-garage .hl-centre > * { pointer-events: auto; }
#s-garage .hl-centre .season-mini { width: 100%; }
#s-garage .hl-chatdock { position: absolute; left: calc(var(--safe-l, 0px) + var(--edge, 14px)); bottom: calc(var(--safe-b, 0px) + 14px); width: min(280px, 34vw); z-index: 22; }
#s-garage .hl-chatdock:empty { display: none; }
#s-garage .hl-chatdock .hc-btn { width: 100%; }
body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill { position: fixed; top: calc(-76px / var(--s, 1) + 14px / var(--s, 1)); left: calc((var(--safe-l, 0px) + 348px) / var(--s, 1)); height: calc(48px / var(--s, 1)); width: auto; max-width: calc(260px / var(--s, 1)); margin: 0; padding: 0 calc(12px / var(--s, 1)); z-index: 46; font-size: calc(13px / var(--s, 1)); border-radius: calc(12px / var(--s, 1)); }
body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill .ap-t { display: flex; flex-direction: column; line-height: 1.15; }
body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill .ap-t i { font-size: .82em; }
@media (max-width: 1180px) { body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill .ap-t i { display: none; } body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill { max-width: calc(200px / var(--s, 1)); } }
@media (max-width: 1060px) { body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill { position: static; height: auto; max-width: none; padding: 6px 10px; font-size: inherit; border-radius: 12px; } }
@media (max-width: 900px) { #s-garage .hl-centre { display: none; } }
/* v0.9.11 patch 41b: the clubs board shows its rows again (the old short-screen rule hid all but the leader); the stack's own fit steps still trim it when space truly runs out */
@media (min-height: 521px) { body.hl-strip #s-garage .side-stack:not([class*="fit-"]) .club-board .cb-row { display: grid; } body.hl-strip #s-garage .side-stack:not([class*="fit-"]) .cb-pay { display: flex; } }
/* v0.9.11 patch 41c: the two fixed-height xl panels never run past the bottom under the header */
.screen.modal .dlg-xl.lbx, .screen.modal .dlg-xl.updates-panel { max-height: calc(100% - 16px); }

/* v0.9.11 patch 42: the garage home fills its space at every window size */
body.hl-strip #s-garage .side-stack { width: 290px; top: 12px; gap: 8px; }
body.hl-strip #s-garage .side-stack:not([class*="fit-"]) .club-board .cb-row { display: grid; }
body.hl-strip #s-garage .side-stack:not([class*="fit-"]) .cb-pay { display: flex; }
body.hl-strip #s-garage .side-stack .club-board { padding: 8px 10px 9px; }
#s-garage .hl-centre { top: 12px; width: clamp(240px, calc(100% - 680px), 400px); }
#s-garage .hl-centre .season-mini { margin: 0; }
#s-garage .hl-chatdock { display: flex; flex-direction: column-reverse; gap: 6px; }
#s-garage .hl-chatdock .home-chat { display: flex; flex-direction: column-reverse; gap: 6px; padding: 6px 8px; }
#s-garage .hl-dock-lines { display: flex; flex-direction: column-reverse; gap: 3px; overflow: hidden; cursor: pointer; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px); mask-image: linear-gradient(to bottom, transparent 0, #000 16px); }
#s-garage .hl-dock-lines .hc-line { display: flex !important; flex: 0 0 auto; font-size: 12.5px; line-height: 1.35; }
body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill { left: calc((var(--safe-l, 0px) + 372px) / var(--s, 1)); max-width: calc(340px / var(--s, 1)); white-space: nowrap; }
body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill .ap-t b { overflow: visible; text-overflow: clip; white-space: nowrap; }

/* v0.9.11 patch 44 */
#s-garage .hl-centre .season-mini { position: static; top: auto; left: auto; right: auto; max-height: none; }
#s-garage .hl-chatdock .home-chat { background: rgba(12,14,22,.86); border: 1px solid rgba(20,184,166,.45); border-radius: 12px; box-shadow: 0 8px 22px rgba(0,0,0,.35); padding: 6px; }
#s-garage .hl-chatdock .hl-dock-lines { padding: 2px 4px 0; }
#s-garage .hl-chatdock .home-chat .hc-btn { border-radius: 9px; }
@media (min-width: 1181px) { body.hl-strip.hl-home #s-garage .gar-bottom > .ad-pill { font-size: calc(15px / var(--s, 1)); max-width: calc(360px / var(--s, 1)); height: calc(50px / var(--s, 1)); top: calc(-76px / var(--s, 1) + 13px / var(--s, 1)); } }

/* v0.9.11 patch 46: header strip without a banner (adblock, review build): wordmark in the empty slot */
body.hl-strip.hl-nobanner::before { content: "HEATLINE"; position: fixed; left: calc(var(--safe-l, 0px) + 18px); top: 0; height: 76px; display: flex; align-items: center; z-index: 45; pointer-events: none; font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 30px; letter-spacing: .03em; color: #f4f1ea; background: linear-gradient(180deg, #ffd166, #ff7a1a 75%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
/* chat dock: older lines are clipped, not just faded, so they never sit over (and catch clicks for) the Clubs tile */
#s-garage .hl-chatdock, #s-garage .hl-chatdock .home-chat { overflow: hidden; min-height: 0; }
#s-garage .hl-chatdock .hl-dock-lines { flex: 1 1 auto; min-height: 0; }
/* patch 47: the chat dock takes clicks (it sits outside .gar-bottom, so it does not inherit its pointer-events) */
#s-garage .hl-chatdock { pointer-events: auto; }
/* patch 49: live MP pill (qualifying / grid / queue) owns the bottom-right MP slot on the garage home */
body.hl-home #mp-pill { position: fixed; left: auto; transform: none; right: calc(var(--safe-r, 0px) + var(--edge, 14px)); bottom: calc(var(--safe-b, 0px) + 14px); z-index: 60; max-width: min(360px, 44vw); min-width: min(250px, 40vw); padding: 12px 18px; border-radius: 14px; font-size: 15px; line-height: 1.2; white-space: normal; text-align: center; background: linear-gradient(180deg, rgba(20,120,110,.97), rgba(9,70,64,.97)); }
body.hl-home:has(#mp-pill) #s-garage .gar-bottom > .mp-chip { visibility: hidden; pointer-events: none; }

