/* Redline (templates/redline/game.html.twig): black and racing red - carbon-dark surfaces, white numbers, the red of a
   rev counter's red line (the owner did not want the first, brown palette). Mobile first: tabs at the bottom on a phone,
   on top with two columns on a laptop. */
:root {
    --bg: #09090b;
    --bg2: #111114;
    --card: #17171b;
    --card2: #1f1f25;
    --line: #2c2c33;
    --text: #f4f4f6;
    --muted: #a6a6b0;
    --faint: #6c6c78;
    --accent: #e8101a;
    --accent2: #ff3b3b;
    --good: #5fd68a;
    --bad: #ff6a5a;
    --c-D: #a7b0ba;
    --c-C: #63c983;
    --c-B: #4aa8ff;
    --c-A: #b583ff;
    --c-S: #ffb02e;
    --c-X: #ff4a2e;
    --tabs: 64px;
    font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 480px at 50% -140px, rgba(232, 16, 26, .22), transparent 70%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 7px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 7px),
        var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent2); }
button { font: inherit; color: inherit; }
.num, .rl-bar b, .rl-h2, h1, h2, .rl-tap-value, .rl-rating { font-family: 'Space Grotesk', system-ui, sans-serif; }

.rl-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: 1180px; margin: 0 auto; }
.rl-nav nav { display: flex; gap: 14px; align-items: center; font-size: 14px; }
.rl-nav nav a { color: var(--text); text-decoration: none; }
.rl-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); }
.rl-brand span { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 21px; letter-spacing: .02em; text-transform: uppercase; }
.rl-brand b { color: var(--accent); }
.rl { max-width: 1180px; margin: 0 auto; padding: 0 16px calc(var(--tabs) + 32px + env(safe-area-inset-bottom)); }
.rl-loading { text-align: center; color: var(--muted); padding: 80px 0; }
.rl-foot { text-align: center; color: var(--faint); font-size: 12px; padding: 0 16px calc(var(--tabs) + 24px + env(safe-area-inset-bottom)); margin-top: -12px; }
.rl-eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; margin: 26px 0 0; }
h1 { font-size: clamp(28px, 6vw, 44px); margin: 6px 0 8px; line-height: 1.05; }
.rl-lead { color: var(--muted); margin: 0 0 22px; max-width: 44em; line-height: 1.5; }
.rl-h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 24px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.rl-h2 small { text-transform: none; letter-spacing: 0; color: var(--faint); font-size: 13px; font-family: 'Atkinson Hyperlegible', sans-serif; }
.rl-note { color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.rl-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }

/* Buttons */
.rl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 11px 16px; font-weight: 700; cursor: pointer; background: var(--card2); color: var(--text); min-height: 44px; transition: transform .08s, filter .15s; }
.rl-btn:active { transform: scale(.97); }
.rl-btn:disabled { opacity: .45; cursor: not-allowed; }
.rl-primary { background: linear-gradient(180deg, #ff2b2b, var(--accent)); color: #fff; box-shadow: 0 6px 18px rgba(232, 16, 26, .32); }
.rl-gold { background: #f4f4f6; color: #0b0b0d; }
.rl-ghost { background: transparent; border: 1px solid var(--line); }
.rl-lock { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; }
.rl-x { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); font-size: 24px; line-height: 1; cursor: pointer; }

/* Class badge */
.rl-class { display: inline-flex; align-items: center; gap: 5px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 13px; padding: 2px 8px 2px 2px; border-radius: 8px; background: rgba(255, 255, 255, .06); white-space: nowrap; }
.rl-class i { font-style: normal; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #111; background: var(--cc, var(--c-D)); font-size: 13px; }
.rl-class[data-c="D"] { --cc: var(--c-D); } .rl-class[data-c="C"] { --cc: var(--c-C); } .rl-class[data-c="B"] { --cc: var(--c-B); }
.rl-class[data-c="A"] { --cc: var(--c-A); } .rl-class[data-c="S"] { --cc: var(--c-S); } .rl-class[data-c="X"] { --cc: var(--c-X); }

/* Starters */
.rl-starter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rl-car-card { position: relative; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px 14px; overflow: hidden; }
.rl-car-img { position: relative; aspect-ratio: 16 / 8.5; display: grid; place-items: center; margin: -4px -6px 6px; background: radial-gradient(60% 45% at 50% 78%, rgba(0, 0, 0, .45), transparent 70%); }
.rl-car-img img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); }
.rl-car-img .rl-noimg { width: 70%; opacity: .55; }
.rl-car-make { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.rl-car-name { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 19px; line-height: 1.15; margin: 1px 0 6px; }
.rl-car-name small { font-weight: 500; color: var(--faint); font-size: 14px; }
.rl-specs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 0 10px; }
.rl-specs div { background: rgba(0, 0, 0, .22); border-radius: 8px; padding: 5px 6px; text-align: center; }
.rl-specs b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 14px; }
.rl-specs span { font-size: 10.5px; color: var(--faint); }
.rl-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.rl-price { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 17px; }
.rl-locked { filter: saturate(.25) brightness(.7); }
.rl-owned-tag { position: absolute; top: 10px; left: 10px; background: var(--good); color: #062; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px; }

/* Top bar */
.rl-bar { position: sticky; top: 0; z-index: 20; display: flex; gap: 10px; align-items: center; padding: 10px 0; background: linear-gradient(180deg, var(--bg) 75%, rgba(9, 9, 11, 0)); }
.rl-bar > div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px; min-width: 0; }
.rl-bar b { font-size: 20px; white-space: nowrap; }
.rl-cash b { color: var(--text); }
.rl-income b { font-size: 15px; color: var(--good); }
.rl-active { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 4px 10px 4px 4px; cursor: pointer; max-width: 46%; }
.rl-active img { width: 62px; height: 34px; object-fit: contain; }
.rl-active span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; text-align: left; }

/* Tabs: bottom on a phone */
.rl-tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabs) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(9, 9, 11, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.rl-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--faint); font-size: 11.5px; cursor: pointer; position: relative; }
.rl-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rl-tabs button[aria-selected="true"] { color: var(--text); }
.rl-tabs button[aria-selected="true"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.rl-tabs .rl-dot { position: absolute; top: 9px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }

/* Garage */
.rl-hero { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #141418 center / cover no-repeat; aspect-ratio: 16 / 11.5; display: flex; align-items: flex-end; }
.rl-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(9, 9, 11, .94) 78%); pointer-events: none; }
.rl-hero-car { position: absolute; left: 50%; bottom: 33%; width: min(80%, 620px); max-height: 60%; object-fit: contain; transform: translateX(-50%); filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); z-index: 1; }
.rl-hero-info { position: relative; z-index: 2; padding: 14px 16px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; width: 100%; }
.rl-hero-info h2 { margin: 0; font-size: clamp(19px, 4.6vw, 28px); line-height: 1.1; }
.rl-hero-info p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.rl-rating { font-size: 30px; font-weight: 700; text-align: right; line-height: 1; }
.rl-rating small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.rl-cols { display: grid; gap: 0 22px; }
.rl-work { display: grid; gap: 10px; }
.rl-tap { position: relative; display: grid; gap: 2px; justify-items: center; padding: 18px 12px; border-radius: 18px; border: 1px solid #5a1218; cursor: pointer; overflow: hidden; touch-action: manipulation; user-select: none;
    background: radial-gradient(120% 140% at 50% 0%, #3a0c10, #160709); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 20px rgba(0, 0, 0, .4); }
.rl-tap:active { transform: scale(.985); }
.rl-tap-title { font-weight: 700; font-size: 16px; }
.rl-tap-value { font-size: 30px; font-weight: 700; color: var(--text); }
.rl-tap-hint { font-size: 12px; color: var(--muted); }
.rl-pop { position: absolute; pointer-events: none; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: #fff; font-size: 18px; animation: rl-pop .8s ease-out forwards; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
@keyframes rl-pop { from { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, -60px) scale(1.15); } }
.rl-upgrades { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rl-upg { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; min-height: 96px; }
.rl-upg b { font-size: 14px; }
.rl-upg span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.rl-upg em { font-style: normal; margin-top: auto; font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--accent2); font-size: 14px; }
.rl-upg:disabled { cursor: not-allowed; }
.rl-upg:disabled em { color: var(--faint); }
.rl-garage { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rl-gcar { flex: 0 0 168px; scroll-snap-align: start; position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 6px 8px 8px; text-align: left; cursor: pointer; }
.rl-gcar[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rl-gcar img { width: 100%; aspect-ratio: 16 / 8; object-fit: contain; }
.rl-gcar b { display: block; font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-gcar .rl-class { margin-top: 4px; font-size: 12px; }
.rl-gcar .rl-trophy { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--accent2); }
.rl-parts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rl-part { display: grid; grid-template-columns: 46px 1fr; gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 9px; text-align: left; cursor: pointer; }
.rl-part img { width: 46px; height: 46px; object-fit: contain; grid-row: span 2; }
.rl-part b { font-size: 14px; }
.rl-pips { display: flex; gap: 3px; }
.rl-pips i { width: 14px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.rl-pips i.on { background: var(--accent); }
.rl-part-foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-top: 2px; }
.rl-part-foot em { font-style: normal; color: var(--good); font-weight: 700; }
.rl-part-foot span { font-family: 'Space Grotesk', sans-serif; font-weight: 700; color: var(--accent2); }
.rl-part:disabled { cursor: not-allowed; }
.rl-part.rl-short .rl-part-foot span { color: var(--faint); }
.rl-part.rl-max .rl-part-foot span { color: var(--good); }

/* Races */
.rl-classes { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.rl-classes button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 6px 12px 6px 6px; cursor: pointer; font-weight: 700; min-height: 40px; }
.rl-classes button[aria-pressed="true"] { border-color: var(--text); background: var(--card2); }
.rl-classes button:disabled { opacity: .45; cursor: not-allowed; }
.rl-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rl-event { position: relative; display: grid; grid-template-columns: 96px 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 10px; overflow: hidden;
    background: linear-gradient(90deg, rgba(23, 23, 27, .97) 30%, rgba(23, 23, 27, .82) 62%, rgba(23, 23, 27, .5)), var(--scene, none) right center / cover no-repeat, var(--card); }
.rl-event.rl-done { border-color: #3c5a40; }
.rl-event.rl-off { opacity: .5; }
.rl-thumb { width: 96px; height: 96px; border-radius: 12px; background: var(--g, #4f7a3a); display: grid; place-items: center; box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .25); }
.rl-thumb svg { width: 86%; height: 86%; overflow: visible; }
.rl-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.rl-event h3 { margin: 0; font-size: 16px; font-family: 'Space Grotesk', sans-serif; }
.rl-event p { margin: 2px 0; color: var(--muted); font-size: 13px; }
.rl-event .rl-btn { margin-top: 6px; padding: 8px 14px; min-height: 40px; }
.rl-badge { position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--good); }

/* Lista 15 */
.rl-list-head { border-radius: 20px; padding: 22px 18px; background: linear-gradient(180deg, rgba(9, 9, 11, .5), rgba(9, 9, 11, .88)), var(--scene, #1a0b0d) center / cover; border: 1px solid var(--line); margin-top: 8px; }
.rl-list-head h2 { margin: 0; font-size: 30px; text-transform: uppercase; letter-spacing: .06em; }
.rl-list-head p { margin: 6px 0 0; color: var(--muted); max-width: 40em; }
.rl-list-score { color: var(--accent2) !important; font-weight: 700; }
.rl-rivals { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 14px; }
.rl-rival { position: relative; display: grid; grid-template-columns: 92px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 10px; overflow: hidden; }
.rl-rival-photo { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: #111; }
.rl-rival-photo img { width: 100%; height: 100%; object-fit: cover; }
.rl-rival-num { position: absolute; left: 0; bottom: 0; background: rgba(0, 0, 0, .75); font-family: 'Space Grotesk', sans-serif; font-weight: 700; padding: 1px 7px; border-top-right-radius: 8px; font-size: 15px; }
.rl-rival h3 { margin: 0; font-size: 18px; font-family: 'Space Grotesk', sans-serif; }
.rl-rival p { margin: 3px 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.rl-rival .rl-btn { margin-top: 6px; min-height: 40px; padding: 8px 14px; }
.rl-rival.rl-closed .rl-rival-photo img { filter: brightness(.12) contrast(1.4); }
.rl-rival.rl-beaten::after { content: "POKONANY"; position: absolute; right: -32px; top: 18px; transform: rotate(32deg); background: var(--accent); color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .1em; padding: 3px 40px; }
.rl-gate { font-size: 12px; color: var(--accent2) !important; }

/* Showroom */
.rl-filters { display: grid; gap: 8px; margin-top: 6px; }
.rl-selects { display: flex; gap: 8px; flex-wrap: wrap; }
.rl-selects label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; flex: 1 1 140px; }
.rl-selects select { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px; font: inherit; font-size: 14px; }
.rl-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* Ranking */
.rl-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rl-table th { text-align: left; color: var(--faint); font-weight: 400; font-size: 12px; padding: 6px; }
.rl-table td { padding: 9px 6px; border-top: 1px solid var(--line); }
.rl-table tr.rl-me td { background: rgba(232, 16, 26, .1); }
.rl-table td.num { text-align: right; }

/* Race overlay */
.rl-race { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.rl-race-head { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 56px 8px 16px; border-bottom: 1px solid var(--line); }
.rl-race-head b { font-family: 'Space Grotesk', sans-serif; font-size: 18px; }
.rl-race-meta { margin-left: auto; color: var(--muted); font-size: 13px; text-align: right; }
.rl-race-body { flex: 1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.rl-board-wrap { position: relative; min-height: 0; background: radial-gradient(70% 60% at 50% 45%, #24171a, #09090b); }
.rl-board { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rl-lights { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(0, 0, 0, .35); cursor: pointer; user-select: none; touch-action: manipulation; }
.rl-lamps { display: flex; gap: 10px; padding: 12px 16px; background: #0d0b0a; border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.rl-lamps i { width: 34px; height: 34px; border-radius: 50%; background: #2a1110; box-shadow: inset 0 3px 6px rgba(0, 0, 0, .6); }
.rl-lamps i.on { background: radial-gradient(circle at 40% 35%, #ff9a85, #ff2a10 55%, #a50f00); box-shadow: 0 0 18px #ff2a10; }
.rl-lights p { margin: 0; font-weight: 700; font-size: 18px; text-shadow: 0 2px 6px #000; text-align: center; }
.rl-hud { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
.rl-hud span { background: rgba(0, 0, 0, .6); border-radius: 10px; padding: 5px 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
.rl-skip { pointer-events: auto; margin-left: auto; border: 0; border-radius: 10px; background: rgba(0, 0, 0, .6); padding: 7px 12px; cursor: pointer; font-weight: 700; }
.rl-standings { max-height: 34vh; overflow-y: auto; border-top: 1px solid var(--line); padding: 6px 10px; }
.rl-st { display: grid; grid-template-columns: 22px 34px 1fr auto; gap: 8px; align-items: center; padding: 6px 4px; font-size: 14px; border-radius: 8px; }
.rl-st.rl-you { background: rgba(232, 16, 26, .16); font-weight: 700; }
.rl-st i { width: 12px; height: 12px; border-radius: 3px; display: block; }
.rl-st i.rl-st-car { width: 34px; height: 18px; border-radius: 0; background: center / contain no-repeat; justify-self: center; }
.rl-st i:not(.rl-st-car) { justify-self: center; }
.rl-st b { font-family: 'Space Grotesk', sans-serif; }
.rl-st span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-st small { color: var(--muted); font-family: 'Space Grotesk', sans-serif; }
.rl-race-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.rl-race-foot:empty { display: none; }
.rl-result { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rl-place { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 34px; line-height: 1; }
.rl-place small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.rl-result-text { flex: 1 1 200px; color: var(--muted); font-size: 14px; }
.rl-result-text b { color: var(--accent2); }
.rl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rl-actions .rl-btn { flex: 1 1 140px; }
.rl-unlock { background: rgba(95, 214, 138, .12); border: 1px solid #3c5a40; color: var(--good); border-radius: 10px; padding: 8px 10px; font-size: 14px; }

/* Modal and toast */
.rl-modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .65); display: grid; place-items: end center; }
.rl-modal-card { position: relative; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.rl-modal-card h2 { margin: 0 44px 4px 0; font-size: 22px; }
.rl-modal-card .rl-car-img { margin: 4px 0 8px; }
.rl-modal-card .rl-actions { margin-top: 12px; }
.rl-modal-card p { color: var(--muted); line-height: 1.45; }
.rl-toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tabs) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #1f1f25; border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 10px 14px; font-size: 14px; max-width: min(92vw, 460px); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.rl-toast.rl-bad { background: #3a0c10; border-color: #7a1820; }

/* Laptop: tabs on top, two columns */
@media (min-width: 900px) {
    :root { --tabs: 0px; }
    .rl-tabs { position: static; height: auto; display: flex; gap: 4px; background: none; border: 0; backdrop-filter: none; padding: 0 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
    .rl-tabs button { flex-direction: row; gap: 8px; font-size: 15px; padding: 10px 16px; border-radius: 12px 12px 0 0; }
    .rl-tabs button[aria-selected="true"] { background: var(--card); }
    .rl-tabs button[aria-selected="true"]::before { top: auto; bottom: -7px; left: 12px; right: 12px; border-radius: 3px 3px 0 0; }
    .rl-tabs .rl-dot { top: 8px; right: 6px; }
    .rl-cols { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .rl-hero { aspect-ratio: 16 / 6.2; }
    .rl-hero::after { background: linear-gradient(90deg, rgba(9, 9, 11, .9) 0, rgba(9, 9, 11, .55) 38%, rgba(0, 0, 0, 0) 62%); }
    .rl-hero-car { left: 64%; bottom: 9%; width: min(56%, 640px); max-height: 82%; }
    .rl-hero-info { flex-direction: column; align-items: flex-start; justify-content: flex-end; width: 42%; height: 100%; padding: 22px; }
    .rl-hero-info .rl-rating { text-align: left; margin-top: 12px; }
    .rl-race { inset: 24px; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
    .rl-race-body { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) 300px; }
    .rl-standings { max-height: none; border-top: 0; border-left: 1px solid var(--line); }
    .rl-modal { place-items: center; }
    .rl-modal-card { border-radius: 22px; }
    .rl-toast { bottom: 24px; }
    .rl-foot { padding-bottom: 24px; }
}
@media (max-width: 420px) {
    .rl-bar { gap: 6px; }
    .rl-bar > div { padding: 5px 8px; }
    .rl-bar b { font-size: 17px; }
    .rl-income b { font-size: 13px; }
    .rl-active img { width: 48px; }
    .rl-active span { display: none; }
    .rl-upgrades { grid-template-columns: 1fr; }
    .rl-upg { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
    .rl-upg em { margin: 0 0 0 auto; }
    .rl-parts { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .rl-pop { animation-duration: .01s; } }

/* Credits */
.rl-credits { padding-bottom: 40px; }
.rl-credits .rl-table td { vertical-align: top; font-size: 13px; }
.rl-credits .rl-table a { word-break: break-word; }
@media (max-width: 640px) { .rl-credits .rl-table thead { display: none; } .rl-credits .rl-table tr { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); } .rl-credits .rl-table td { border: 0; padding: 0 4px; } }

/* The look of a car: the paint shop, wheels, kit, decals */
.rl-looks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rl-look-btn { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.rl-look-btn b { font-size: 14px; }
.rl-look-btn span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.rl-sw { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4); }
.rl-gcar canvas { width: 100%; height: auto; display: block; aspect-ratio: 16 / 8; object-fit: contain; }
.rl-hero canvas.rl-hero-car { height: auto; }
.rl-look-preview { background: radial-gradient(60% 50% at 50% 60%, #2a1418, transparent 70%); border-radius: 14px; margin: 6px 0 10px; }
.rl-look-preview canvas, .rl-look-preview img, .rl-look-preview svg { width: 100%; height: auto; display: block; }
.rl-tabs-mini { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rl-tabs-mini button { flex: 0 0 auto; }
.rl-tabs-mini button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--muted); font-weight: 700; border-bottom: 2px solid transparent; }
.rl-tabs-mini button.on { color: var(--text); border-bottom-color: var(--accent); }
.rl-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.rl-sw-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); cursor: pointer; position: relative; display: grid; place-items: center; font-weight: 700; color: var(--muted); background: var(--card2); }
.rl-sw-btn.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.rl-sw-btn:disabled { opacity: .3; cursor: not-allowed; }
.rl-sw-custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); color: #fff; text-shadow: 0 1px 2px #000; }
.rl-sw-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.rl-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 7px 11px; cursor: pointer; font-weight: 700; font-size: 14px; }
.rl-chip small { font-weight: 400; color: var(--muted); font-size: 12px; }
.rl-chip.on { border-color: var(--accent); background: rgba(232, 16, 26, .14); }
.rl-chip:disabled { opacity: .4; cursor: not-allowed; }
.rl-h3 { font-size: 14px; margin: 12px 0 2px; }

/* Drag */
.rl-drags { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.rl-drag { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: linear-gradient(160deg, #1b1014, var(--card)); }
.rl-drag p { margin: 3px 0; font-size: 13px; color: var(--muted); }
.rl-drag.rl-done { border-color: #3c5a40; }
.rl-drag.rl-off { opacity: .5; }
.rl-drag .rl-btn { margin-top: 6px; min-height: 40px; }
.rl-drag-controls { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; }
.rl-tree { display: flex; gap: 6px; padding: 8px; background: #0b0b0d; border-radius: 12px; }
.rl-tree i { width: 22px; height: 22px; border-radius: 50%; background: #2a2210; }
.rl-tree i.on { background: radial-gradient(circle at 40% 35%, #ffe08a, #ffb000 60%, #a86f00); box-shadow: 0 0 14px #ffb000; }
.rl-tree i.go { background: #0f2a14; }
.rl-tree i.go.on { background: radial-gradient(circle at 40% 35%, #b5ffbf, #19d23a 60%, #0a7a1d); box-shadow: 0 0 16px #19d23a; }
.rl-big { grid-column: 1 / -1; min-height: 64px; font-size: 22px; letter-spacing: .05em; text-transform: uppercase; touch-action: manipulation; }
.rl-rpm { position: relative; height: 26px; border-radius: 13px; background: linear-gradient(90deg, #1f1f25 0, #2c2c33 70%, #4a1016 100%); overflow: hidden; }
.rl-rpm-green { position: absolute; top: 0; bottom: 0; background: rgba(25, 210, 58, .55); }
.rl-rpm-needle { position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff; left: 30%; }
.rl-rpm span { position: absolute; right: 10px; top: 3px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 14px; }
.rl-st-drag { grid-template-columns: 34px 1fr auto; }
.rl-looks { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.rl-plate-input { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.rl-plate-input input { font: 700 24px 'Space Grotesk', sans-serif; letter-spacing: .12em; text-transform: uppercase; padding: 10px 12px 10px 34px; border-radius: 8px; border: 2px solid #111; background: linear-gradient(90deg, #1d3f9e 0 26px, #f4f4f0 26px); color: #111; max-width: 260px; }
.rl-sw-custom { margin: -4px 0 10px; }
