:root {
  --bg: #07080a; --panel: #101216; --panel-2: #181b20; --hover: #1d2127;
  --line: #2a2f36; --control-line: #6b737d; --line-hi: #4a525c; /* hairline + its lit top edge */
  --tick: #6b737d; /* editorial corner marks (decorative) */
  --text: #e8ebef; --muted: #9ba4ae;
  --accent: #e10600; --accent-text: #ff6a60; --accent-soft: rgba(225, 6, 0, .14); --stripe: rgba(232, 235, 239, .10); --focus: #e10600;
  --buff: #86c9a4; --nerf: #ec938e; --mixed: #d9b676;
  --s: #e3c56a; --a: #8fb6e0; --b: #aab2bb; --c: #8f98a2;
  --h: #e3a284; --m: #86bcd9; --l: #bba6df;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d4d8dd 36%, #8d959e 50%, #eef0f2 64%, #a7aeb6 100%);
  --chrome-bar: linear-gradient(180deg, #ffffff 0%, #c3c8ce 40%, #5d656e 52%, #e3e6e9 70%, #8f969e 100%);
  --btn-bg: linear-gradient(180deg, #f4f6f8, #b9c0c7); --btn-text: #0b0c0e;
  --glow: rgba(255, 255, 255, .22);
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  --grain-opacity: .03; --grain-blend: screen;
  --page: #07080a;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --head: "Barlow Condensed", "Inter", sans-serif;
  --jp: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", "Meiryo", sans-serif;
  --fs-sm: .834rem; --fs-base: 1rem; --fs-lg: 1.25rem; --fs-h2: 1.6rem; --fs-h1: 2.25rem;
  --track-wide: .14em; --tap: 44px; --radius: 6px;
}
:root[data-theme="light"] {
  --bg: #dde0e4; --panel: #ffffff; --panel-2: #eef0f3; --hover: #e7eaee;
  --line: #c6ccd3; --control-line: #767e88; --line-hi: #ffffff; --tick: #8a929c; --stripe: rgba(20, 23, 27, .12); /* neutral graphite stripes */
  --text: #15181c; --muted: #4c545e;
  --accent-text: #b30500; --accent-soft: rgba(225, 6, 0, .07); --focus: #e10600;
  --buff: #1d6b44; --nerf: #a5302a; --mixed: #7a5500;
  --s: #7a5d00; --a: #285d93; --b: #545e69; --c: #5f6872;
  --h: #984722; --m: #245f90; --l: #6a479f;
  --chrome: linear-gradient(180deg, #5a626b 0%, #2a2f35 44%, #0f1114 52%, #4b535c 74%, #23272c 100%);
  --chrome-bar: linear-gradient(180deg, #7d858e 0%, #3a4047 44%, #101215 52%, #5d656e 74%, #2a2f35 100%);
  --btn-bg: linear-gradient(180deg, #3a4047, #15181c); --btn-text: #ffffff;
  --panel-shadow: inset 0 1px 0 #fff, 0 10px 28px -14px rgba(38, 50, 66, .35), 0 1px 2px rgba(38, 50, 66, .08);
  --grain-opacity: .05; --grain-blend: multiply;
  --page: linear-gradient(180deg, #e9ebee 0%, #d6dadf 100%) fixed;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #dde0e4; --panel: #ffffff; --panel-2: #eef0f3; --hover: #e7eaee;
    --line: #c6ccd3; --control-line: #767e88; --line-hi: #ffffff; --tick: #8a929c; --stripe: rgba(20, 23, 27, .12);
    --text: #15181c; --muted: #4c545e;
    --accent-text: #b30500; --accent-soft: rgba(225, 6, 0, .07); --focus: #e10600;
    --buff: #1d6b44; --nerf: #a5302a; --mixed: #7a5500;
    --s: #7a5d00; --a: #285d93; --b: #545e69; --c: #5f6872;
    --h: #984722; --m: #245f90; --l: #6a479f;
    --chrome: linear-gradient(180deg, #5a626b 0%, #2a2f35 44%, #0f1114 52%, #4b535c 74%, #23272c 100%);
    --chrome-bar: linear-gradient(180deg, #7d858e 0%, #3a4047 44%, #101215 52%, #5d656e 74%, #2a2f35 100%);
    --btn-bg: linear-gradient(180deg, #3a4047, #15181c); --btn-text: #ffffff;
    --panel-shadow: inset 0 1px 0 #fff, 0 10px 28px -14px rgba(38, 50, 66, .35), 0 1px 2px rgba(38, 50, 66, .08);
    --grain-opacity: .05; --grain-blend: multiply;
    --page: linear-gradient(180deg, #e9ebee 0%, #d6dadf 100%) fixed;
  }
}
* { box-sizing: border-box; }
html { font-size: 112.5%; scroll-behavior: smooth; scrollbar-gutter: stable; } /* no sideways jump when the JS render adds a scrollbar (CLS) */
body { margin: 0; background: var(--page); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: var(--fs-base); line-height: 1.6; }
a { color: inherit; }
/* static film grain: fixed SVG noise, no animation; sits under .top (z 5) */
body::before { content: ""; position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
button, select, input { font: inherit; color: inherit; }
.top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 16px;
  border-bottom: 1px solid var(--line); box-shadow: inset 0 -1px 0 var(--line-hi); background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.brand { font: 700 1.5rem var(--head); text-decoration: none; letter-spacing: .5px; display: flex; align-items: center; gap: 10px; min-height: var(--tap);
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent; }
@supports not ((background-clip: text) or (-webkit-background-clip: text)) { .brand { background: none; color: var(--text); } }
@media (forced-colors: active) {
  .brand { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; }
  .seg .on, .lang button.on, .row.sel { outline: 2px solid Highlight; outline-offset: -2px; }
}
@media print { .brand { background: none; color: #000; -webkit-text-fill-color: #000; } body::before { display: none; } }
.stripe { position: relative; width: 28px; height: 24px; transform: skew(-20deg); flex: none; }
.stripe i { position: absolute; top: 0; bottom: 0; background: var(--chrome-bar); filter: drop-shadow(-1px 0 0 rgba(255, 50, 110, .45)) drop-shadow(1px 0 0 rgba(60, 200, 255, .45)); }
.stripe i:nth-child(1) { left: 0; width: 7px; } .stripe i:nth-child(2) { left: 11px; width: 7px; }
.stripe i:nth-child(3) { left: 22px; width: 3px; background: var(--accent); filter: none; }
nav.tabs { display: flex; gap: 8px; flex: 1; min-width: 0; }
nav.tabs a, nav.tabs button { text-decoration: none; color: var(--muted); font-weight: 600; padding: 8px 14px; border-radius: 8px;
  min-height: var(--tap); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
nav.tabs a { flex: none; }
@media (min-width: 768px) and (max-width: 970px) { nav.tabs a, nav.tabs button { padding-inline: 8px; } nav.tabs { gap: 4px; } }
nav.tabs a:hover { color: var(--text); background: var(--hover); }
nav.tabs a.on { color: var(--text); background: var(--panel-2); box-shadow: inset 0 -3px 0 var(--accent); }
/* desktop: the search entry looks like a field but opens the same dialog as on phones */
nav.tabs button { margin-left: auto; width: auto; flex: 0 1 240px; min-width: var(--tap); overflow: hidden; background: var(--panel-2); border: 1px solid var(--control-line); border-radius: 10px; cursor: pointer; font: inherit; font-weight: 400; }
nav.tabs button:hover { color: var(--text); }
nav.tabs .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#settings { position: fixed; inset: 56px 16px auto auto; margin: 0; padding: 8px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--panel-shadow); }
#settings:popover-open { display: flex; gap: 8px; align-items: center; }
#search-dlg { width: min(560px, 100%); max-height: 80vh; margin: 10vh auto auto; padding: 16px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; }
#search-dlg::backdrop { background: rgba(0, 0, 0, .7); }
#search-dlg h2 { margin: 0 0 12px; padding-right: 110px; }
#search-dlg .suggest { position: static; margin-top: 4px; } /* in flow so the dialog (max-height, scrolls) holds the list */
#search-dlg .btn { position: absolute; top: 12px; right: 12px; } /* always visible while the list scrolls */
#search-dlg input[type=search] { width: 100%; min-width: 0; box-sizing: border-box; }
.tools { display: flex; gap: 8px; align-items: center; }
.lang { display: flex; border: 1px solid var(--control-line); border-radius: 8px; overflow: hidden; }
.lang button, .icon-btn { background: none; border: 0; padding: 0 12px; min-width: var(--tap); min-height: var(--tap); cursor: pointer; font-weight: 600; color: var(--muted); }
.icon-btn { border: 1px solid var(--control-line); border-radius: 8px; font-size: var(--fs-lg); line-height: 1; }
.lang button.on { background: var(--btn-bg); color: var(--btn-text); }
.skip { position: absolute; left: 8px; top: -100px; z-index: 10; background: var(--panel); color: var(--text); padding: 10px 16px; border-radius: 8px; border: 2px solid var(--focus); }
.skip:focus { top: 8px; }
main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 56px; min-height: 100vh; min-height: 100svh; } /* footer starts below the fold: the JS render can't push it (CLS) */
main:focus { outline: none; }
footer { text-align: center; color: var(--muted); font-size: var(--fs-sm); padding: 24px 16px; border-top: 1px solid var(--line); line-height: 2; }
h1, h2, h3 { font-family: var(--head); letter-spacing: .3px; margin: 0 0 8px; }
h1 { font-size: var(--fs-h1); line-height: 1.15; } h2 { font-size: var(--fs-h2); line-height: 1.2; text-transform: uppercase; letter-spacing: var(--track-wide); display: flex; align-items: center; gap: 12px; }
h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.hero-labels { display: flex; flex-wrap: wrap; gap: 4px 12px; font: var(--fs-sm) var(--mono); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 8px; color: var(--muted); }
.hero-labels span::before { content: "["; content: "[" / ""; } .hero-labels span::after { content: "]"; content: "]" / ""; }
h3 { font-size: var(--fs-base); color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
h1:focus { outline: none; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); } .mono { font-family: var(--mono); } .mt { margin-top: 14px; } .pad { padding: 16px; }
.lead { font-size: var(--fs-lg); max-width: 70ch; margin: 8px 0 0; }
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-top-color: var(--line-hi); box-shadow: var(--panel-shadow); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
/* corner ticks: ::before = top corners, ::after = bottom corners (8 px L-shapes) */
.panel::before, .panel::after { content: ""; position: absolute; left: 5px; right: 5px; height: 8px; pointer-events: none; opacity: .7; background-repeat: no-repeat;
  background-image: linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)); }
.panel::before { top: 5px; background-position: 0 0, 0 0, 100% 0, 100% 0; background-size: 8px 1px, 1px 8px, 8px 1px, 1px 8px; }
.panel::after { bottom: 5px; background-position: 0 100%, 0 100%, 100% 100%, 100% 100%; background-size: 8px 1px, 1px 8px, 8px 1px, 1px 8px; }
.panel.accent { border-color: var(--line-hi); background: var(--panel-2); }
.prose li { margin-bottom: 8px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.hero-grid .panel { margin-bottom: 18px; }
.counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.count { background: var(--panel-2); border-radius: 10px; padding: 12px; text-decoration: none; transition: background .15s; }
.count:hover { background: var(--hover); }
.count b { font: 700 var(--fs-lg) var(--head); display: block; }
.link-more:hover, .prose a:hover { text-decoration-thickness: 2px; }
.trk > a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.link-more { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: var(--tap); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar.between { justify-content: space-between; align-items: flex-end; }
.seg { display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: none; padding: 0 14px; min-height: var(--tap); min-width: var(--tap); border-radius: 8px; cursor: pointer;
  font-weight: 600; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.seg button:not(.on):hover, .seg a:not(.on):hover { color: var(--text); }
.seg .on { background: var(--btn-bg); color: var(--btn-text); box-shadow: inset 0 0 0 1px var(--line-hi); }
.seg .on small { color: inherit; }
.seg small { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }
input[type=search], select { background: var(--panel-2); border: 1px solid var(--control-line); border-radius: 10px; padding: 8px 14px; min-height: var(--tap); min-width: 260px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.picker { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.picker select { width: 100%; }
.btn { background: var(--btn-bg); color: var(--btn-text); border: 0; border-radius: 10px; padding: 0 20px; min-height: var(--tap); font-weight: 700; cursor: pointer; align-self: flex-start;
  display: inline-flex; align-items: center; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
/* list rows (responsive grid instead of wide tables) */
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 40px 40px minmax(180px, 2fr) 90px 110px 150px minmax(200px, 2fr); gap: 12px;
  align-items: center; padding: 12px 8px; min-height: var(--tap); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s;
  text-decoration: none; color: inherit; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left;
  animation: rise 220ms ease-out backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
/* timing-tower position: big mono number on a bar coloured by tier */
.pos { align-self: stretch; display: grid; place-items: center; border-left: 4px solid var(--line); font: 600 var(--fs-lg)/1 var(--mono); }
.pos.S { border-left-color: var(--s); } .pos.A { border-left-color: var(--a); } .pos.B { border-left-color: var(--b); } .pos.C { border-left-color: var(--c); }
.row.head .pos { border-left-color: transparent; font: inherit; }
.im { display: block; line-height: 0; }
/* car pictures (transparent WebP) and the fallback silhouette */
.car-img { display: block; height: auto; max-width: 100%; object-fit: contain; }
.car-img-s { width: 72px; aspect-ratio: 16 / 9; } .car-img-l { aspect-ratio: 16 / 9; }
.car-sil { display: grid; place-items: center; aspect-ratio: 16 / 9; color: color-mix(in srgb, var(--muted) 45%, transparent); }
.car-sil svg { display: block; width: 88%; height: auto; }
.car-img-l.car-sil { width: 320px; } .car-img-l.car-sil svg { width: 72%; }
/* broadcast delta chips: up = faster (green), down = slower (red) */
.delta { display: inline-block; padding: 0 8px; border-radius: 4px; font: 600 var(--fs-sm) var(--mono); white-space: nowrap; }
.delta.up { color: var(--buff); background: color-mix(in srgb, var(--buff) 12%, var(--panel)); }
.delta.down { color: var(--nerf); background: color-mix(in srgb, var(--nerf) 12%, var(--panel)); }
.delta.flat { color: var(--muted); background: var(--panel-2); } /* PP: direction only, neutral colour */
.delta.up::before, .delta.rise::before { content: "▲ " / ""; } .delta.down::before, .delta.fall::before { content: "▼ " / ""; }
.row:hover { background: var(--hover); }
div.row.cr { cursor: default; } div.row.cr:hover { background: none; }
.row.head { animation: none; cursor: default; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding-block: 10px; }
.row.head:hover { background: none; }
.row .nm b { display: block; }
.row.cr { grid-template-columns: 36px 56px minmax(0, 1fr) auto auto; min-height: 64px; padding: 6px 8px; gap: 10px; }
.row.cr.nopos { grid-template-columns: 56px minmax(0, 1fr) auto auto; }
.cr .im .car-img-s { width: 56px; }
.cr .nm { min-width: 0; } .cr .nm b, .cr .nm small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr .nm small { margin: 0; } .cr .end { justify-self: end; min-width: 20px; text-align: center; } .cr sup.est { font-size: 1rem; line-height: 0; margin-left: 2px; font-weight: 700; }
.panel > .toolbar:has(#groups) { position: sticky; top: 64px; z-index: 4; background: var(--panel); padding-block: 8px; margin-bottom: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.row .nm small { color: var(--muted); font-size: var(--fs-sm); margin-right: 8px; }
.rrow { grid-template-columns: minmax(180px, 2fr) 110px 80px 50px 90px 70px; }
.crow { grid-template-columns: 80px 120px 150px minmax(160px, 1.5fr) 90px 130px; }
.row.sel { background: var(--hover); box-shadow: inset 4px 0 0 var(--text); }
.tier { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; min-width: 30px; height: 28px; border-radius: 6px; font: 700 var(--fs-base) var(--mono); background: none; }
.tier::before { content: "["; content: "[" / ""; } .tier::after { content: "]"; content: "]" / ""; }
.tier.S { color: var(--s); } .tier.A { color: var(--a); } .tier.B { color: var(--b); } .tier.C { color: var(--c); }
.set { display: inline-block; font: 600 var(--fs-sm) var(--mono); text-transform: uppercase; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.set.h { color: var(--h); } .set.m { color: var(--m); } .set.l { color: var(--l); }
.v { font-weight: 600; white-space: nowrap; }
.v.buff { color: var(--buff); } .v.nerf { color: var(--nerf); } .v.mixed { color: var(--mixed); } .v.unchanged { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: var(--fs-sm); white-space: nowrap; }
.chips .soft { color: var(--muted); } .chips .weak { border-color: var(--nerf); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { background: var(--panel-2); border-radius: 10px; padding: 16px; }
.card h3 { font-size: var(--fs-sm); margin-bottom: 8px; }
.bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; margin: 6px 0 10px; }
.bar i { display: block; height: 100%; background: var(--chrome-bar); border-radius: 5px; }
.fit .set { margin-right: 6px; }
.lvl { font: 700 1.4rem var(--head); text-transform: uppercase; display: block; }
.lvl.low { color: var(--buff); } .lvl.medium { color: var(--mixed); } .lvl.high { color: var(--nerf); }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.specs dt { color: var(--muted); } .specs dd { margin: 0; text-align: right; font-family: var(--mono); }
.now { display: flex; gap: 8px; align-items: center; font-size: var(--fs-lg); }
.note { font-size: var(--fs-sm); color: var(--muted); margin-top: 12px; }
svg.chart { width: 100%; height: 260px; display: block; }
svg.chart text { fill: var(--muted); font: 15px var(--mono); }
.legend { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }
.legend i { display: inline-block; width: 16px; height: 4px; vertical-align: middle; margin-right: 6px; }
.updates a { display: grid; grid-template-columns: 80px 120px 1fr; gap: 12px; padding: 14px 8px; min-height: var(--tap); text-decoration: none;
  border-bottom: 1px solid var(--line); align-items: center; }
.updates a:hover { background: var(--hover); }
/* tracks (unlinked, kept working) */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.cols3 .panel h2 { display: flex; gap: 8px; align-items: center; font-size: var(--fs-lg); }
.trk { padding: 10px 0; border-bottom: 1px solid var(--line); }
.trk:last-child { border-bottom: 0; }
.trk > a { text-decoration: none; display: block; }
.pill { display: inline-block; font-size: var(--fs-sm); padding: 2px 10px; margin: 4px 4px 0 0; border-radius: 999px; border: 1px dashed var(--line);
  color: var(--muted); text-decoration: none; }
.pill.has { border-style: solid; color: var(--text); }
.ev { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tyre { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 3px solid; font: 700 15px var(--mono); margin-right: 4px; }
.tyre.rh { border-color: #ddd; } .tyre.rm { border-color: #f5c518; } .tyre.rs { border-color: #ef4b4b; }
.tyre.ri { border-color: #2fbf71; } .tyre.rw { border-color: #4da3ff; }
.badge { font-size: var(--fs-sm); font-weight: 600; padding: 3px 10px; border-radius: 6px; line-height: 1.4; } /* tighter when it wraps on phones */
.badge.lb { background: color-mix(in srgb, var(--buff) 18%, transparent); color: var(--buff); }
.badge.est { background: var(--panel-2); color: var(--muted); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; } .cols3 { grid-template-columns: minmax(0, 1fr); }
  .cols3 .panel h2 { flex-wrap: wrap; } .cols3 .panel h2::after { flex: 1 1 0; min-width: 0; }
  .row { grid-template-columns: 34px 34px 1fr 80px; }
  .row .bs, .row .lc { display: none; }
  .row .tr { grid-column: 3 / -1; }
  .rrow { grid-template-columns: 1fr auto auto auto; } .rrow > :nth-child(2), .rrow > :nth-child(6) { display: none; }
  .crow { grid-template-columns: 72px minmax(0, 1fr) 72px; column-gap: 6px; row-gap: 4px; } .crow > :nth-child(2), .crow > :nth-child(5) { display: none; }
  /* version | verdict over power/weight | PP rank: 4 cells in 3 columns without wrapping the rank to a new row */
  .crow > :nth-child(1) { grid-row: span 2; } .crow > :nth-child(3), .crow > :nth-child(4) { grid-column: 2; } .crow > :nth-child(6) { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
  .crow > :nth-child(4) { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; } .crow .v { white-space: normal; }
  .row.head .tr, .row.head .sm { display: none; }
}
@media (max-width: 640px) {
  .panel > .toolbar:has(#groups) { top: 0; }
  .top { gap: 8px; position: static; } /* a sticky 2-row header would take ~15 % of a phone screen */ .tools { margin-left: auto; flex: none; }
  /* brand shrinks instead of wrapping the tools onto a new row while the web font loads (CLS) */
  .brand { flex: 1 1 0; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 1.3rem;
    padding-left: 6px; margin-left: -6px; } .stripe { flex: none; } /* room for the skewed stripe inside the clip */
  h1 { font-size: 1.8rem; }
  .counts { grid-template-columns: repeat(2, 1fr); }
  .updates a { grid-template-columns: auto auto minmax(0, 1fr); }
  input[type=search], select { min-width: 0; width: 100%; }
  /* equal columns instead of a lone button wrapping onto a 2nd row; labels wrap inside their button */
  .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
  .seg button, .seg a { flex-wrap: wrap; text-align: center; padding: 4px 6px; line-height: 1.2; }
  .seg small { flex-basis: 100%; } /* count always under the label, so every button wraps the same way */
  /* pinned ranking selectors stay ~100px: counts inline, no seg padding */
  .panel > .toolbar:has(#groups) { gap: 4px; padding-block: 4px; margin-bottom: 0; } .toolbar:has(#groups) .seg { padding: 0; gap: 0; } .toolbar:has(#groups) .seg small { flex-basis: auto; margin-left: 4px; }
  .lead { font-size: var(--fs-base); } /* keeps the car search above the fold */
  .panel { padding: 16px; }
  .set { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .row, .car-hero { animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
/* ⓘ popovers */
.info-wrap { position: relative; display: inline-block; text-transform: none; letter-spacing: 0; }
.info { min-width: var(--tap); min-height: var(--tap); margin: -12px -8px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: var(--fs-base); font-weight: 700; line-height: 1; vertical-align: middle; }
.info:hover, .info[aria-expanded="true"] { color: var(--text); }
.tip { position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(300px, 80vw);
  background: var(--panel); color: var(--text); border: 2px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font: 400 var(--fs-sm)/1.5 Inter, system-ui, sans-serif; text-transform: none; letter-spacing: 0; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
/* home */
.find-label { display: block; font-weight: 700; font-size: var(--fs-lg); margin: 18px 0 8px; }
.search { position: relative; max-width: 640px; }
.search input { width: 100%; min-height: 56px; font-size: var(--fs-lg); border-width: 2px; padding: 8px 16px; }
.suggest { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 6px; list-style: none;
  background: var(--panel); border: 2px solid var(--line); border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.suggest li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 8px 12px; min-height: var(--tap); border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--hover); box-shadow: inset 4px 0 0 var(--text); }
#car-empty { margin-top: 10px; }
/* car page hero: black stage in both themes (dark tokens re-declared), chrome title, glowing car on a floor line, spec sheet */
.car-hero { --bg: #07080a; --panel: #000; --panel-2: #181b20; --hover: #1d2127; --line: #2a2f36; --control-line: #6b737d; --line-hi: #3a4048; --tick: #6b737d;
  --text: #e8ebef; --muted: #9ba4ae; --buff: #86c9a4; --nerf: #ec938e; --mixed: #d9b676; --s: #e3c56a; --a: #8fb6e0; --b: #aab2bb; --c: #8f98a2;
  --chrome: linear-gradient(180deg, #ffffff 0%, #d4d8dd 36%, #8d959e 50%, #eef0f2 64%, #a7aeb6 100%); --panel-shadow: none;
  color: var(--text); color-scheme: dark;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "txt pic jp" "spec pic jp" "sum sum jp"; gap: 8px 32px;
  animation: rise 220ms ease-out backwards; }
.hero-txt { grid-area: txt; min-width: 0; align-self: end; } .car-hero #spec { grid-area: spec; min-width: 0; } .car-hero .lead { grid-area: sum; }
.car-hero h1 { font-size: calc(var(--fs-h1) * 1.4); line-height: 1.05; margin: 0 0 14px; overflow-wrap: anywhere;
  background: var(--chrome) 0 0 / 100% 1.05em; -webkit-background-clip: text; background-clip: text; color: transparent; } /* gradient repeats per line */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) { .car-hero h1 { background: none; color: var(--text); } }
@media (forced-colors: active) { .car-hero h1 { color: CanvasText; -webkit-text-fill-color: CanvasText; background: none; } }
.car-hero .now { flex-wrap: wrap; }
.hero-pic { grid-area: pic; align-self: center; position: relative; isolation: isolate; }
/* soft white glow + 1px floor line where GT7 thumbnails put the wheels (~74 % down); kept inside the panel, no overflow
   clipping, so ⓘ popups stay visible. Pictures stay at their 320 px source width (upscaling blurs them). */
.hero-pic::before { content: ""; position: absolute; z-index: -1; inset: 10% 0 -10%; background: radial-gradient(50% 45% at 50% 62%, rgba(255, 255, 255, .22), transparent 70%); }
.hero-pic::after { content: ""; position: absolute; left: 4%; right: 4%; top: 74%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); }
.hero-pic > .car-sil { max-width: 100%; }
.hero-pic > .car-img { filter: drop-shadow(-1px 0 0 rgba(255, 50, 110, .35)) drop-shadow(1px 0 0 rgba(60, 200, 255, .35)); }
.reflection { position: absolute; left: 0; right: 0; top: 74%; height: 30%; overflow: hidden; }
.reflection .car-img { width: 100%; margin-top: -15%; transform: scaleY(-1); opacity: .22; filter: blur(1px);
  -webkit-mask-image: linear-gradient(to top, #000, transparent 45%); mask-image: linear-gradient(to top, #000, transparent 45%); }
.spec { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 12px 0 0; border-top: 1px solid var(--line); }
.spec div { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.spec dt { font: 600 var(--fs-sm)/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.spec dd { margin: 0; font: 600 var(--fs-lg)/1.3 var(--mono); overflow-wrap: anywhere; }
.spec div { position: relative; } .spec .info-wrap { position: static; } .spec .tip { left: 0; transform: none; } /* tip anchored to the cell: centred on the ⓘ it ran off the phone screen */
.spec dd small { font-size: var(--fs-sm); color: var(--muted); font-weight: 400; margin-left: 4px; }
/* decorative vertical Japanese labels: own grid column / flex item, so they never overlap content; desktop only */
.vtext { writing-mode: vertical-rl; text-orientation: upright; font: 700 1rem/1 var(--jp); letter-spacing: .4em; color: var(--muted); opacity: .75; user-select: none; }
.vtext span { display: block; margin-top: .8em; font-size: 4.2rem; letter-spacing: .08em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--text) 20%, transparent); }
.car-hero .vtext { grid-area: jp; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; } .page-head > div { flex: 1; min-width: 0; }
.page-head .vtext { font-size: .85rem; margin-top: 8px; }
@media (forced-colors: active) { .vtext span { -webkit-text-stroke-color: CanvasText; } }
@media (max-width: 900px) {
  .vtext { display: none; }
  .car-hero { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "txt pic" "spec pic" "sum sum"; }
}
.race-feat { position: relative; isolation: isolate; }
.race-feat::before { content: ""; position: absolute; z-index: -1; left: -14%; right: -14%; top: 34%; bottom: 6%;
  background: repeating-linear-gradient(115deg, var(--stripe) 0 8px, transparent 8px 20px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 70%, transparent); }
.tower { display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 10px; background: var(--panel-2); border-left: 4px solid var(--line); border-radius: 0 8px 8px 0; }
.tower.S { border-left-color: var(--s); } .tower.A { border-left-color: var(--a); } .tower.B { border-left-color: var(--b); } .tower.C { border-left-color: var(--c); }
.tower b { font: 600 2rem/1.1 var(--mono); }
.tower > span:last-child { color: var(--muted); font-family: var(--mono); }
@media (max-width: 700px) {
  .car-hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "txt" "spec" "sum"; }
  .hero-pic { justify-self: center; max-width: 100%; } .reflection { display: none; }
  .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .car-hero h1 { font-size: calc(1.8rem * 1.4); }
}
/* landing: the car hero layout with only text | class leader | vertical label; text first on phones (search above the fold) */
.landing { grid-template-areas: "txt pic jp"; }
.landing h1 { font-size: calc(var(--fs-h1) * 1.2); }
.landing .hero-txt { align-self: center; }
.hero-feat { grid-area: pic; align-self: center; min-width: 0; }
.hero-feat .hero-pic { width: fit-content; max-width: 100%; margin: 0 auto; }
.hero-cap { margin: 10px 0 0; text-align: center; font-size: var(--fs-sm); }
.hero-cap a { color: var(--text); text-decoration: none; } .hero-cap a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.entry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.entry { display: flex; flex-direction: column; gap: 8px; }
.entry h2 { font-size: var(--fs-lg); margin: 0; }
.entry p { margin: 0; }
.entry-list { list-style: none; margin: 0; padding: 0; }
.entry-list li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.entry .link-more { margin-top: auto; }
@media (max-width: 900px) { .landing { grid-template-areas: "txt pic"; } }
@media (max-width: 700px) { .landing { grid-template-areas: "txt" "pic"; } .landing h1 { font-size: 2.1rem; } }
/* help */
.steps { padding-left: 1.4em; } .steps li { margin-bottom: 10px; padding-left: 4px; }
.glossary { margin: 0; } .glossary dt { font-weight: 700; margin-top: 14px; } .glossary dt::first-letter { text-transform: uppercase; } .glossary dd { margin: 4px 0 0; }
.prose a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* Daily Race guide */
.races { display: grid; gap: 4px; margin-top: 16px; }
.race-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 8px; }
.race-head h2 { margin: 0; }
.race-feat { margin-left: auto; width: min(240px, 100%); }
.race-feat .car-img { width: 100%; }
.race-feat::before { left: -10%; right: 0; } /* race cards don't clip (info popovers), so keep the stripes inside */
.feat-tag { position: absolute; left: 0; top: 4px; padding: 0 8px; background: var(--btn-bg); color: var(--btn-text); font: 700 var(--fs-base) var(--mono); transform: skewX(-12deg); }
@media (max-width: 700px) { .race-feat { flex-basis: 100%; max-width: 280px; margin: 0 auto; } }
.letter { display: inline-grid; place-items: center; min-width: 52px; height: 52px; border-radius: 12px; background: var(--btn-bg); color: var(--btn-text);
  font: 700 1.8rem var(--head); }
.letter.sm { min-width: 36px; height: 36px; font-size: 1.2rem; border-radius: 8px; }
.rules { font-weight: 600; }
.why-rules > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; }
.why-rules ul { margin: 0 0 8px; padding-left: 20px; }
.copy-wrap { margin-top: 12px; }
.copy-wrap textarea { display: block; width: 100%; margin-top: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font: inherit; color: inherit; }
.btn.ghost { background: none; color: var(--text); border: 2px solid var(--line); }
.stale { border-color: var(--mixed); color: var(--text); }
@media (max-width: 767px) {
  .top { backdrop-filter: none; } /* it would make the fixed tab bar relative to the header, not the viewport */
  nav.tabs { position: fixed; inset: auto 0 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; min-height: 56px; padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line); z-index: 6; }
  nav.tabs a, nav.tabs button { flex-direction: column; justify-content: center; gap: 2px; padding: 4px; border-radius: 0; font-size: var(--fs-sm); text-align: center;
    width: auto; margin: 0; background: none; border: 0; color: var(--muted); font-weight: 600; }
  nav.tabs a.on { box-shadow: inset 0 3px 0 var(--accent); }
  nav.tabs .lbl { position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; } nav.tabs .ph { display: none; }
  footer { padding-bottom: calc(72px + env(safe-area-inset-bottom)); } /* footer follows main on every page; keeps its last line above the fixed bar */
  #search-dlg { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; box-sizing: border-box; }
}
/* collapsible secondary sections on the car page */
details.sec > summary { display: flex; align-items: center; cursor: pointer; min-height: var(--tap); list-style: none; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary h2 { flex: 1; margin: 0; }
details.sec > summary::before { content: "▸"; color: var(--muted); margin-right: 10px; }
details.sec[open] > summary::before { content: "▾"; }
details.sec[open] > summary { margin-bottom: 8px; }
details.sec > summary h2::after { display: none; } /* the rule line squeezed long titles onto several lines */
/* hero spec: 4 headline cells in one row on desktop, 2x2 on phones */
.car-hero .spec { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .car-hero .spec { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  details.sec:not([open]) { padding-block: 4px; margin-bottom: 10px; }
  details.sec[open] > summary { margin-bottom: 4px; }
  .car-hero .hero-pic > .car-sil { width: 231px; } /* 130px tall at 16:9, same cap as the picture */
  .car-hero .hero-pic > img { max-height: 130px; width: auto; max-width: 100%; object-fit: contain; } /* main picture only: the mirrored one in .reflection keeps width:100% */
  .car-hero h1 { margin-bottom: 8px; } .car-hero .spec div { padding-block: 6px; }
}
@media (max-width: 767px) { details.sec > summary h2 { font-size: var(--fs-lg); letter-spacing: .06em; line-height: 1.25; } }
@media (max-width: 767px) { .car-hero { row-gap: 4px; } .car-hero .lead { font-size: var(--fs-base); margin-top: 4px; } }
