/* A Casino: the brand layer, loaded last. The look comes from race control, not from a casino
   template: flat asphalt surfaces split by hairlines, square-cut controls, condensed numbers
   that carry the page (race numbers, positions, the time left), and one signal red used only
   where something can be done or someone is leading. No glows, gradients, tilts or sweeps. */
:root {
  --asphalt: #121316; --pit: #191b1e; --pit-2: #202226; --kerb: #2a2d32; --kerb-2: #383c42;
  --chalk: #eceef0; --alloy: #b4bac2; --alloy-2: #868c95; --signal: #e10a23; --signal-h: #f2233a;
  --win: #3ccf8e;
  --bg: var(--asphalt); --page: var(--asphalt); --side: #0f1012; --panel: var(--pit); --panel-2: var(--pit-2); --panel-3: var(--pit-2);
  --card: var(--pit); --card-2: #16181b; --line: var(--kerb); --line-2: var(--kerb-2); --btn: var(--pit-2); --btn-h: #2a2d32;
  --text: var(--chalk); --muted: var(--alloy-2); --muted-2: #6c727b;
  --green: var(--signal); --green-h: var(--signal-h); --green-d: #3a1016; --green-dt: #9a5a62; --green-t: #ff4d62;
  --green-tint: #1f1416; --green-line: #7d1824;
  --r: 4px; --r-s: 3px;
  --font: 'Saira', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cond: 72%;
}
body, body.home { background: var(--asphalt); --page: var(--asphalt); }
body.home .main { background: var(--asphalt); }
body.home .top { background: var(--asphalt); }
body { font-stretch: 100%; }
h1, h2, .banner h3, .p-hero h1, .sec-h h2, .ph h1 { font-stretch: var(--cond); font-weight: 800; letter-spacing: 0; line-height: 1; }
h3 { letter-spacing: 0; }
.ccy .amt, .cdown b, .tbl td, .timing dd, .gh-no, .cc-no, .stat b, .kpis b { font-variant-numeric: tabular-nums; }
::selection { background: var(--signal); color: #fff; }
:focus-visible { outline: 2px solid var(--chalk); outline-offset: 2px; }

/* ---------- the Tengri polish layer, switched off: no spotlights, sweeps, tilts or glows ---------- */
:is(.card, .stat, .board, .prov, .plogo, .gdet, .acc.box, .fold, .wr, .nr, .stage, .banner, .cat-tabs, .searchbar)::before { display: none !important; }
:is(.card, .stat, .board, .acc.box, .fold, .wr, .nr):hover { background-image: none !important; }
.banner, .banner:hover, .banner.tilting { transform: none !important; box-shadow: none !important; }
.banner::after, .banner .bg::after, .tile::before { display: none !important; }
.banner:hover .bg svg { transform: none !important; }
.tile, .tile:hover, .row:hover .tile, .grid8:hover .tile { transform: none !important; box-shadow: none !important; filter: none !important; opacity: 1 !important; }
.btn, .btn:hover, .btn-green, .btn-green:hover:not(:disabled), .btn-orange, .btn-violet { box-shadow: none !important; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.pm.hot { animation: none; background: none; }

/* ---------- logo ---------- */
.logo { gap: 5px; color: var(--chalk); }
.logo .mark { width: 26px; height: 26px; color: var(--chalk); }
.logo .mark .bar { fill: var(--signal); }
.logo .word { font-stretch: 78%; font-weight: 800; font-size: 26px; letter-spacing: .005em; transform: none; }
.foot .logo .word { font-size: 30px; }

/* ---------- sidebar: lists on hairlines, a red bar marks where you are ---------- */
.side { background: #0f1012; border-right: 1px solid var(--kerb); }
.side-top { padding: 0; height: 52px; gap: 0; border-bottom: 1px solid var(--kerb); }
.seg { background: none; border-radius: 0; height: 52px; }
.seg a { border: 0 !important; border-radius: 0; background: none !important; font-stretch: var(--cond); font-weight: 800; font-size: 17px; color: var(--alloy-2); }
.seg a.on, .seg a.on:hover { color: var(--chalk); box-shadow: inset 0 -2px 0 var(--signal); }
.side-collapse { height: 52px; width: 44px; border: 0; border-left: 1px solid var(--kerb); border-radius: 0; }
.side-scroll { padding: 6px 0 16px; }
.panel { background: none; border-radius: 0; padding: 6px 0; margin: 0; border-bottom: 1px solid var(--kerb); }
.panel.grp, .panel.grp.open { padding: 6px 0; }
.nv { border-radius: 0; height: 38px; padding: 0 18px; font-weight: 500; font-size: 14px; color: #c9cdd3; }
.nv:hover { background: #16181b; color: #fff; }
.nv.on { background: #16181b; color: #fff; font-weight: 600; }
.nv.on::before { left: 0 !important; top: 0; bottom: 0; width: 3px; border-radius: 0; background: var(--signal); box-shadow: none; }
.nv .i, .nv.on .i { color: var(--alloy-2); }
.nv.on .i { color: var(--chalk); }
.panel > .nv + .nv, .grp-body > .nv + .nv, .grp-body > .nv:first-child { margin-top: 0; }
.pm { border-radius: 0; padding: 8px 18px; min-height: 52px; }
.pm:hover { background: #16181b; }
.pm .pmi, .pm.car .pmi { color: var(--alloy); }
.pm b { font-size: 14px; font-weight: 600; }
.pm small { color: var(--alloy-2); }
.pm .left { border: 0; background: none; color: var(--alloy); font-weight: 600; font-size: 11.5px; padding: 0; font-variant-numeric: tabular-nums; }
.pm.car .left { color: var(--green-t); }
.view-all { background: none; border-radius: 0; justify-content: flex-start; padding: 0 18px; color: var(--alloy); height: 34px; margin: 0; }
.view-all:hover { background: none; color: #fff; }

/* ---------- top bar ---------- */
.top { background: var(--asphalt); border-bottom: 1px solid var(--kerb); }
.circ { border-radius: var(--r); background: none; border: 1px solid var(--kerb); }
.circ:hover { background: var(--pit); }
.ccy { border-radius: var(--r); background: var(--pit); border-color: var(--kerb); }
.rw-pill { border-radius: var(--r); background: var(--pit); border-color: var(--kerb); }
.rw-pill .bar { border-radius: 0; height: 4px; }
.rw-pill .bar i { border-radius: 0; }
.avatar { border-radius: var(--r); }

/* ---------- buttons: square-cut, flat ---------- */
.btn { border-radius: var(--r-s); font-weight: 600; letter-spacing: .005em; }
.btn-green { background: var(--signal); }
.btn-green:hover:not(:disabled) { background: var(--signal-h); }
.btn-green:disabled { background: var(--green-d); color: var(--green-dt); }
.btn-orange, .btn-violet { background: none; color: var(--chalk); box-shadow: inset 0 0 0 1px var(--alloy) !important; }
.btn-orange:hover:not(:disabled), .btn-violet:hover:not(:disabled) { background: var(--chalk); color: #111; }
.btn-dark { background: var(--pit-2); }
.btn-out { border-radius: var(--r-s); }

/* ---------- surfaces ---------- */
.card, .stat, .board, .prov, .gdet, .acc.box, .fold, .wr, .nr, .stage, .plogo, .tile, .skel { border-radius: var(--r); }
.card, .stat { background: var(--pit); border-color: var(--kerb); }
.tbl tbody tr:nth-child(odd) td { background: #16181b; }
.tbl tbody tr td:first-child, .tbl tbody tr td:last-child { border-radius: 0; }
.badge { border-radius: 2px; }
.modal, .modal-box, .pop, .mbox, .auth { border-radius: var(--r) !important; }
.searchbar { border-radius: var(--r); background: var(--pit); border-color: var(--kerb); }
.searchbar:focus-within { border-color: var(--alloy); }

/* ---------- money that came in stays green: wins, totals, rewards ---------- */
.tbl .pos, .tot .big b, .perk .amt, .bounty .r span:last-child, .calc .res2 b, .kpis b.g, .wchip b { color: var(--win); }
b.g, .ok-note, .how .st.done em, .rrk.done b, .toast .i { color: var(--win); }
.badge.ok { background: #0e2a1e; color: var(--win); }
.tbl tr.me .badge.ok { background: var(--signal); color: #fff; }
.sb-st.green, .wz-steps .done i { background: #0e2a1e; color: var(--win); }
@keyframes balUp { 0% { color: var(--win); } 100% { color: #fff; } }
.tbl .pos .prize-car { display: inline-flex; align-items: center; gap: 6px; color: var(--chalk); font-weight: 600; white-space: normal; line-height: 1.25; }
.prize-car .i { width: 13px; height: 13px; color: var(--signal); }
.tbl .pos .none { color: var(--muted-2); }

/* ---------- lobby: section heads, tabs, rows ---------- */
.sec-h { margin-bottom: 16px; }
.sec-h h2 { font-size: 26px; gap: 8px; }
.sec-h h2 .i { width: 16px; height: 16px; color: var(--alloy-2); }
.see { background: none; padding: 0 2px; height: auto; color: var(--alloy); font-weight: 600; border-radius: 0; }
.see:hover { background: none; color: #fff; box-shadow: inset 0 -1px 0 currentColor !important; }
.arr { background: none; border: 1px solid var(--kerb); border-radius: var(--r-s); }
.arr:hover:not(:disabled) { background: var(--pit); }
.arr:disabled { background: none; border-color: #1f2125; }
.cats { margin-bottom: 26px; align-items: stretch; }
.cat-tabs { background: none; border: 0; border-bottom: 1px solid var(--kerb); border-radius: 0; padding: 0; gap: 0; }
.cat-tabs a { border: 0 !important; border-radius: 0; height: 40px; padding: 0 14px; color: var(--alloy); background: none !important; font-weight: 600; }
.cat-tabs a:hover { color: #fff; }
.cat-tabs a.on { color: #fff; box-shadow: inset 0 -2px 0 var(--signal); }
.cat-tabs .i { color: var(--alloy-2); }
.cat-tabs a.on .i { color: #fff; }
.tile:hover { outline: 2px solid var(--chalk); outline-offset: -2px; }
.plogo { background: var(--pit); border: 1px solid var(--kerb); }
.plogo:hover { border-color: var(--alloy-2); }
.banner { border-radius: var(--r); }
.banner .badge { border-radius: 2px; border: 1px solid var(--kerb-2) !important; background: rgba(18, 19, 22, .85) !important; text-transform: none; }
.banner .badge em { font-style: normal; color: var(--alloy); margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--kerb-2); }
/* promotions without a car: plain cards, no stock artwork */
.promo-grid .banner:not(.car-banner) { background: var(--pit); border: 1px solid var(--kerb); }
.promo-grid .banner:not(.car-banner) .bg { display: none; }
.promo-grid .banner:not(.car-banner) h3, .promo-grid .banner:not(.car-banner) p { max-width: 100%; }
.promo-grid .banner { justify-content: flex-start; }

/* ---------- a prize photo over the drawn car ---------- */
.car-pic { position: relative; display: block; overflow: hidden; background: #0d0e10; }
.car-pic > svg, .car-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car-pic > img { object-position: 50% 60%; }

/* ---------- the race hero: the car, its number, and a timing strip under it ---------- */
.grid-hero { margin: 4px 0 12px; border: 1px solid var(--kerb); border-radius: var(--r); overflow: hidden; background: var(--pit); }
.gh-main { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 380px; color: inherit; }
.gh-main > .car-pic { grid-column: 2; grid-row: 1; min-height: 100%; }
a.gh-main:hover > .car-pic > img { transform: scale(1.02); }
.gh-main > .car-pic > img { transition: transform .8s ease; }
.gh-copy { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 14px; padding: 30px 32px 30px; border-right: 1px solid var(--kerb); }
.gh-no { font-stretch: 62%; font-weight: 800; font-size: 112px; line-height: .78; color: var(--signal); letter-spacing: -.01em; }
.gh-no small { font-size: 36px; color: var(--alloy-2); margin-left: 4px; letter-spacing: 0; }
.gh-copy h1, .gh-copy h2 { margin: 6px 0 0; font-size: 46px; line-height: .95; color: var(--chalk); max-width: 12ch; }
.gh-copy p { margin: 0; color: var(--alloy); font-size: 14.5px; line-height: 1.45; max-width: 36ch; }
.gh-copy .btn { height: 42px; padding: 0 22px; font-size: 14.5px; margin-top: 4px; }
.timing { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--kerb); background: #15171a; }
.timing > div { padding: 12px 20px 14px; border-left: 1px solid var(--kerb); min-width: 0; }
.timing > div:first-child { border-left: 0; }
.timing dt { font-size: 12px; font-weight: 500; color: var(--alloy-2); margin-bottom: 4px; }
.timing dd { margin: 0; font-stretch: var(--cond); font-weight: 800; font-size: 26px; line-height: 1; color: var(--chalk); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timing dd.p { color: var(--signal); }
.timing dd.dim { font-size: 19px; color: var(--alloy); font-weight: 700; }

/* ---------- the rest of what is on: plain rows ---------- */
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--kerb); border-radius: var(--r); margin-bottom: 34px; }
.quick a { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-left: 1px solid var(--kerb); }
.quick a:first-child { border-left: 0; }
.quick a:hover { background: var(--pit); }
.quick .i { width: 18px; height: 18px; color: var(--alloy); flex: none; }
.quick b { display: block; font-size: 14px; font-weight: 600; }
.quick small { display: block; font-size: 12.5px; color: var(--alloy-2); margin-top: 1px; }

/* ---------- the garage: the four cars on one hairline grid, numbered by race ---------- */
.garage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--kerb); border: 1px solid var(--kerb); border-radius: var(--r); overflow: hidden; }
.car-card { display: flex; flex-direction: column; background: var(--pit); min-width: 0; }
a.car-card:hover { background: var(--pit-2); }
.car-card .car-pic { aspect-ratio: 16 / 10; }
.cc-b { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; padding: 12px 14px 14px; flex: 1; }
.cc-no { grid-row: 1 / span 2; font-stretch: 62%; font-weight: 800; font-size: 46px; line-height: .8; color: var(--alloy-2); }
.car-card.now .cc-no { color: var(--signal); }
.cc-t { min-width: 0; }
.cc-t b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.cc-r { display: block; font-size: 12px; color: var(--alloy-2); margin-top: 2px; }
.cc-s { font-size: 12px; font-weight: 600; color: var(--alloy-2); }
.car-card.now .cc-s { color: var(--green-t); }
.car-card.now { box-shadow: inset 0 3px 0 var(--signal); }
.car-card.done .car-pic > * { filter: grayscale(1) brightness(.75); }
.car-card.done .cc-t b { color: var(--alloy); }
.garage-sec { margin-bottom: 34px; }
.garage-card .garage { margin-top: 14px; }

/* ---------- race page ---------- */
.grid-hero.page .gh-main { min-height: 340px; }
.grid-hero.page .gh-no { font-size: 92px; }
.grid-hero.page h1 { font-size: 40px; }
.ph-prize { display: flex; align-items: center; gap: 8px; color: var(--alloy); font-size: 14px; }
.ph-prize .i { width: 14px; height: 14px; color: var(--signal); flex: none; }
.ph-prize b { color: var(--chalk); font-weight: 600; }
.tbl .rank { width: 30px; height: 24px; border-radius: 2px; background: var(--pit-2); font-stretch: var(--cond); font-weight: 800; font-size: 15px; }
.tbl .rank.m1 { background: var(--signal); color: #fff; }
.tbl .rank.m2 { background: var(--chalk); color: #111; }
.tbl .rank.m3 { background: var(--alloy-2); color: #111; }
.tbl.tower .gap { color: var(--alloy-2); font-weight: 500; }
.tbl.tower .gap .lead { color: var(--chalk); font-weight: 600; }
.tbl.tower tr.me td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
.car-banner .bg .car-pic { position: absolute; inset: 0; }
.car-banner .bg::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(18, 19, 22, .94) 0%, rgba(18, 19, 22, .55) 50%, rgba(18, 19, 22, 0) 85%); }
.cdown > div { border-radius: 2px; }

/* ---------- sign in / sign up: the car up for grabs ---------- */
.auth-art.car { background: #0d0e10; }
.auth-art.car > .car-pic { position: absolute; inset: 0; z-index: -2; }
.auth-art.car::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(13, 14, 16, .96) 0%, rgba(13, 14, 16, .7) 38%, rgba(13, 14, 16, 0) 70%); }
.auth-art.car .copy { bottom: 28px; }
.auth-art.car .gh-no { display: block; font-size: 64px; margin-bottom: 8px; }
.auth-art.car .gh-no small { font-size: 22px; }
.auth-art h3 { font-stretch: var(--cond); font-weight: 800; letter-spacing: 0; font-size: 40px; line-height: .95; }
.auth-art p { font-weight: 500; color: var(--alloy); max-width: 34ch; margin-top: 8px; }

@media (max-width: 860px) {
  .auth-art.car { min-height: 240px; }
  .auth-art.car .copy { bottom: 18px; left: 18px; }
  .auth-art.car .gh-no { display: none; }
  .auth-art.car h3 { font-size: 28px; }
  .auth-art.car p { font-size: 13px; margin-top: 6px; }
}

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--kerb); margin-top: 20px; }
.foot h4 { font-size: 13px; font-weight: 600; color: var(--alloy-2); }
.foot .by { font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--alloy-2); margin-top: 8px; }
.foot .tag { font-size: 14px; font-weight: 600; }
.foot .promo-note { font-size: 12.5px; color: var(--alloy-2); margin: -6px 0 18px; }
.foot .copy { font-size: 13px; color: var(--alloy); }
.foot .age { border-radius: 2px; }

@media (max-width: 1100px) {
  .garage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gh-copy h1, .gh-copy h2 { font-size: 38px; }
  .gh-no { font-size: 92px; }
}
@media (max-width: 760px) {
  .gh-main { grid-template-columns: 1fr; min-height: 0; }
  .gh-main > .car-pic { grid-column: 1; grid-row: 1; height: 210px; min-height: 0; }
  .gh-copy { grid-row: 2; border-right: 0; padding: 18px 18px 20px; gap: 10px; }
  .gh-no, .grid-hero.page .gh-no { font-size: 72px; }
  .gh-no small { font-size: 26px; }
  .gh-copy h1, .gh-copy h2, .grid-hero.page h1 { font-size: 32px; max-width: none; }
  .gh-copy p { font-size: 13.5px; }
  .timing { grid-template-columns: 1fr 1fr; }
  .timing > div:nth-child(3) { border-left: 0; }
  .timing > div:nth-child(n + 3) { border-top: 1px solid var(--kerb); }
  .timing > div { padding: 10px 16px 12px; }
  .timing dd { font-size: 22px; }
  .quick { grid-template-columns: 1fr; }
  .quick a { border-left: 0; border-top: 1px solid var(--kerb); }
  .quick a:first-child { border-top: 0; }
  .garage { grid-template-columns: repeat(4, 76%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .garage::-webkit-scrollbar { display: none; }
  .car-card { scroll-snap-align: start; }
  .tbl.tower .gap { display: none; }
  .tbl .pos .prize-car { font-size: 12px; }
  .tbl .pos .prize-car .i { display: none; }
  .sec-h h2 { font-size: 23px; }
}
