/* Leonida Garage, skin Vice City.
   Layout: neon top bar, sunset hero with palms and skyline, sticky search toolbar,
   filter sidebar on desktop / bottom sheet on phones, grid of in-game ↔ real-world cards,
   bottom tab bar on phones, detail as modal (desktop) / bottom sheet (phones).
   Two themes: "Tramonto" (light, sunset beach) and "Notte" (dark, neon night). */

:root {
  color-scheme: light;
  /* surfaces */
  --bg: #fdf0f5;
  --surface: #fffafc;
  --surface-2: #fbe3ee;
  --ink: #22103a;
  --muted: #69557e;
  --line: #eccfe0;
  /* Vice City accents */
  --pink: #cc1167;          /* magenta, safe for text */
  --pink-neon: #ff2e88;     /* decorative neon */
  --aqua: #00736f;          /* ocean teal, safe for text */
  --aqua-neon: #19d3c5;
  --orange: #b9470a;        /* safe for text */
  --orange-neon: #ff8a3d;
  --sun: #ffc24a;
  --violet: #5a24a8;
  --violet-neon: #9d6bff;
  --on-accent: #fff7fb;
  --good: #00736f;
  --warn: #8f5200;
  --focus: #5a24a8;
  --scrim: rgb(24 6 44 / .55);
  /* top bar + bottom nav: always night */
  --bar-bg: #1b0733;
  --bar-ink: #fdeaf4;
  --bar-muted: #c3a9d6;
  --bar-line: #3a1a5e;
  --bar-active: rgb(255 46 136 / .16);
  /* hero sky */
  --hero-ink: #fff5fa;
  --hero-ink-2: #ffe1ee;
  --sky-1: #2a0d58;
  --sky-2: #6d1b72;
  --sky-3: #d93b78;
  --sky-4: #ff9a4d;
  --sea-a: #19b3b3;
  --sea-b: #0b5a78;
  --silhouette: #2a0b40;
  --skyline: #4a1660;
  --glint: #fff1c9;
  /* card stage */
  --stage-1: #ffe9f2;
  --stage-2: #ffd3c2;
  --stage-ground: #f6d7ea;
  --stage-line: rgb(204 17 103 / .18);
  --car-glass: #2f1a4f;
  --car-wheel: #22103a;
  --car-rim: #f3dbe8;
  --car-shadow: rgb(34 16 58 / .16);
  /* car paint */
  --paint-0: #ff2e88;
  --paint-1: #16bfb3;
  --paint-2: #ff8a3d;
  --paint-3: #ffc24a;
  --paint-4: #8a55f0;
  --paint-5: #3aa0ff;
  /* licence plate */
  --plate-bg: #fbf7f2;
  --plate-ink: #1f1033;
  --plate-edge: #2a1a4a;
  --plate-state: #e0590f;
  --plate-foot: #00736f;
  /* effects */
  --glow-pink: 0 0 1px rgb(255 46 136 / .9), 0 0 10px rgb(255 46 136 / .75), 0 0 26px rgb(255 46 136 / .45);
  --glow-aqua: 0 0 8px rgb(25 211 197 / .55);
  --card-shadow: 0 1px 2px rgb(34 16 58 / .05), 0 10px 26px -16px rgb(204 17 103 / .45);
  --card-hover: 0 0 0 1px var(--pink-neon), 0 14px 30px -14px rgb(255 46 136 / .55);
  --fav-bg: rgb(255 250 252 / .86);
  /* type */
  --f-display: "Big Shoulders Display", "Anton", "Arial Narrow", Impact, sans-serif;
  --f-script: "Mr Dafoe", "Brush Script MT", "Segoe Script", cursive;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  /* shape */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --bar-h: 58px;
  --nav-h: 64px;
  --tool-h: 69px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12071f;
    --surface: #1c0d2f;
    --surface-2: #28133f;
    --ink: #fbeaf4;
    --muted: #b8a1cb;
    --line: #3b2257;
    --pink: #ff5aac;
    --aqua: #34e3d3;
    --orange: #ff9d5c;
    --violet: #b48cff;
    --on-accent: #1a0628;
    --good: #34e3d3;
    --warn: #ffc24a;
    --focus: #19d3c5;
    --scrim: rgb(5 0 12 / .7);
    --bar-bg: #0c0317;
    --bar-line: #2c1347;
    --sky-1: #07020f;
    --sky-2: #250a45;
    --sky-3: #6c1466;
    --sky-4: #e33583;
    --sea-a: #2a0d46;
    --sea-b: #0a0316;
    --skyline: #12041f;
    --silhouette: #07010d;
    --glint: #ff5aac;
    --stage-1: #170a2a;
    --stage-2: #3d1150;
    --stage-ground: #10061c;
    --stage-line: rgb(255 46 136 / .32);
    --car-glass: #0e0519;
    --car-wheel: #07020d;
    --car-rim: #4c2a66;
    --car-shadow: rgb(255 46 136 / .22);
    --plate-bg: #f6f0ea;
    --card-shadow: 0 1px 0 rgb(255 255 255 / .02);
    --card-hover: 0 0 0 1px var(--pink-neon), 0 0 22px rgb(255 46 136 / .4), 0 0 60px -20px rgb(25 211 197 / .5);
    --fav-bg: rgb(18 7 31 / .78);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12071f;
  --surface: #1c0d2f;
  --surface-2: #28133f;
  --ink: #fbeaf4;
  --muted: #b8a1cb;
  --line: #3b2257;
  --pink: #ff5aac;
  --aqua: #34e3d3;
  --orange: #ff9d5c;
  --violet: #b48cff;
  --on-accent: #1a0628;
  --good: #34e3d3;
  --warn: #ffc24a;
  --focus: #19d3c5;
  --scrim: rgb(5 0 12 / .7);
  --bar-bg: #0c0317;
  --bar-line: #2c1347;
  --sky-1: #07020f;
  --sky-2: #250a45;
  --sky-3: #6c1466;
  --sky-4: #e33583;
  --sea-a: #2a0d46;
  --sea-b: #0a0316;
  --skyline: #12041f;
  --silhouette: #07010d;
  --glint: #ff5aac;
  --stage-1: #170a2a;
  --stage-2: #3d1150;
  --stage-ground: #10061c;
  --stage-line: rgb(255 46 136 / .32);
  --car-glass: #0e0519;
  --car-wheel: #07020d;
  --car-rim: #4c2a66;
  --car-shadow: rgb(255 46 136 / .22);
  --plate-bg: #f6f0ea;
  --card-shadow: 0 1px 0 rgb(255 255 255 / .02);
  --card-hover: 0 0 0 1px var(--pink-neon), 0 0 22px rgb(255 46 136 / .4), 0 0 60px -20px rgb(25 211 197 / .5);
  --fav-bg: rgb(18 7 31 / .78);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden]:not([hidden="until-found" i]) { display: none !important; }
/* scroll padding: sticky top bar (desktop), sticky search toolbar (only in the garage), bottom tab bar (phones) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 12px); scroll-padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px); }
html:has(#view-garage:not([hidden])) { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--tool-h) + 12px); }
@media (min-width: 760px) {
  html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + 12px); scroll-padding-bottom: 12px; }
  html:has(#view-garage:not([hidden])) { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + var(--tool-h) + 12px); }
}
/* always-dark areas keep the bright focus ring */
.topbar, .bottomnav, .site-footer, .page-head, .hero { --focus: #19d3c5; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--f-body);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 760px) { body { padding-bottom: 0; } }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 45; background: var(--bg); }
@media (min-width: 760px) { body::before { background: var(--bar-bg); } }
html.locked, html.locked body { overflow: hidden; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 760px) {
  .wrap { padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
}
a { color: var(--pink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
main:focus { outline: none; }

.skip {
  position: fixed; z-index: 100; top: calc(env(safe-area-inset-top, 0px) + 8px); left: max(12px, env(safe-area-inset-left, 0px));
  padding: 10px 16px; border-radius: 999px; background: var(--pink); color: var(--on-accent); font-weight: 700; text-decoration: none;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent;
  font: 700 15px/1 var(--f-body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--pink); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--pink); color: var(--pink); }
.icon-btn:disabled { opacity: .35; cursor: default; border-color: var(--line); color: var(--ink); }
.icon-btn-lg { width: 48px; height: 48px; }

/* ---------- top bar ---------- */
.topbar { background: var(--bar-bg); color: var(--bar-ink); border-bottom: 1px solid var(--bar-line); }
@media (min-width: 760px) { .topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; } }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--bar-h); }
.logo { display: inline-flex; align-items: center; text-decoration: none; color: inherit; padding: 6px 0; border-radius: 8px; }
.brand-w1 {
  font: 900 25px/1 var(--f-display); letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--sun) 12%, var(--orange-neon) 45%, var(--pink-neon) 78%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-w2 {
  font: 400 31px/1 var(--f-script); color: var(--pink-neon); text-shadow: var(--glow-pink);
  transform: rotate(-7deg) translateY(3px); margin-left: 4px; display: inline-block;
}
.bar-right { display: flex; align-items: center; gap: 10px; }
.tabs { display: none; gap: 4px; }
@media (min-width: 760px) { .tabs { display: flex; } }
.tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--bar-muted); text-decoration: none; font: 800 13px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase;
}
.tabs a .ico { width: 18px; height: 18px; }
/* tablet: cinque sezioni nella barra, quindi solo testo e meno spazio */
@media (min-width: 760px) and (max-width: 1099px) {
  .tabs { gap: 2px; }
  .tabs a { padding: 0 10px; letter-spacing: .05em; }
  .tabs a > .ico { display: none; }
}
.tabs a:hover { color: var(--bar-ink); }
.tabs a[aria-current="page"] { color: var(--bar-ink); background: var(--bar-active); box-shadow: inset 0 0 0 1px var(--pink-neon), 0 0 18px rgb(255 46 136 / .35); }
.theme-btn { background: transparent; border-color: var(--bar-line); color: var(--bar-ink); }
.theme-btn:hover { color: var(--sun); border-color: var(--sun); }
.theme-btn .ico-sun { display: none; }
.is-dark .theme-btn .ico-sun { display: block; }
.is-dark .theme-btn .ico-moon { display: none; }
.nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--pink-neon); color: #1a0628; font: 800 11px/1 var(--f-body); letter-spacing: 0;
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--hero-ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 58%, var(--sky-3) 84%, var(--sky-4) 100%);
}
.hero-in { position: relative; z-index: 1; padding-block: 22px 108px; }
@media (min-width: 760px) { .hero-in { padding-block: 44px 150px; } }
.hero-kicker { margin: 0 0 6px; font: 700 11.5px/1.2 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--aqua-neon); text-shadow: var(--glow-aqua); }
.hero-title { margin: 0; line-height: .9; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .12em; padding-bottom: clamp(20px, 4.6vw, 50px); }
.hero-title .w1 {
  font: 900 clamp(52px, 13vw, 128px)/.86 var(--f-display); letter-spacing: .03em; text-transform: uppercase;
  background: linear-gradient(180deg, #fff4c7 0%, var(--sun) 30%, var(--orange-neon) 58%, var(--pink-neon) 88%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgb(42 11 64 / .55));
}
.hero-title .w2 {
  font: 400 clamp(50px, 12vw, 118px)/.8 var(--f-script); color: var(--hero-ink);
  text-shadow: var(--glow-pink); transform: rotate(-8deg) translateY(.06em); display: inline-block; margin-left: -.06em;
}
.hero-lede { margin: 14px 0 0; max-width: 54ch; font-size: clamp(15px, 1.9vw, 18px); line-height: 1.5; color: var(--hero-ink-2); text-shadow: 0 1px 3px rgb(20 0 40 / .55); text-wrap: pretty; }
.stats { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 18px 0 0; }
.stat { display: flex; flex-direction: column-reverse; }
.stat dt { font: 700 10.5px/1.2 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hero-ink-2); text-shadow: 0 1px 2px rgb(20 0 40 / .6); }
.stat dd { margin: 0; font: 900 clamp(30px, 5vw, 44px)/1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--hero-ink); text-shadow: var(--glow-aqua); }
.hero-scene { position: absolute; inset: auto 0 0 0; width: 100%; height: 104px; display: block; }
@media (min-width: 760px) { .hero-scene { height: 160px; } }
.hero-scene .sun-a { stop-color: var(--sun); }
.hero-scene .sun-b { stop-color: var(--pink-neon); }
.hero-scene .sea-a { stop-color: var(--sea-a); }
.hero-scene .sea-b { stop-color: var(--sea-b); }
.hero-scene .skyline { fill: var(--skyline); }
.hero-scene .palms path { fill: var(--silhouette); }
.hero-scene .glints rect { fill: var(--glint); opacity: .8; }
.is-dark .hero-scene .skyline { stroke: var(--pink-neon); stroke-width: 1.2; stroke-opacity: .55; }
.is-dark .hero-scene .sun { filter: drop-shadow(0 0 22px rgb(255 46 136 / .7)); }

/* ---------- toolbar ---------- */
.toolbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 25; background: var(--bg); border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .toolbar { top: calc(env(safe-area-inset-top, 0px) + var(--bar-h)); } }
.toolbar-in { display: flex; align-items: center; gap: 8px; padding-block: 10px; }
.search {
  flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; color: var(--muted);
}
.search:focus-within { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(255 46 136 / .18); }
.search input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink);
  font: 600 16px/1 var(--f-body); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.kbd { display: none; font: 700 12px/1 var(--f-mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; margin-right: 8px; }
@media (hover: hover) and (min-width: 900px) { .kbd { display: inline-block; } .search:focus-within .kbd { display: none; } }
.clear-btn { width: 38px; height: 38px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.clear-btn .ico { width: 16px; height: 16px; }
.tool-btn {
  position: relative; height: 48px; min-width: 48px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 800 14px/1 var(--f-body); cursor: pointer;
}
.tool-btn:hover { border-color: var(--pink); color: var(--pink); }
.count-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--pink); color: var(--on-accent); font: 800 12px/1 var(--f-body); }
@media (max-width: 559px) {
  #random-btn { padding: 0; width: 48px; }
  #random-btn .tool-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #open-filters { padding: 0 12px; }
}
/* very narrow phones: the dice moves next to the result count, so the search field keeps its room */
.random-inline { display: none; }
@media (max-width: 419px) {
  .random-tool { display: none; }
  .random-inline { display: inline-grid; margin-left: auto; }
  .search { padding-left: 12px; gap: 6px; }
  .clear-btn { width: 34px; height: 34px; }
}
@media (min-width: 1024px) { #open-filters { display: none; } }

/* ---------- layout ---------- */
.layout { display: grid; gap: 24px; padding-block: 16px 48px; }
@media (min-width: 1024px) { .layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; padding-block: 24px 64px; } }
.results { min-width: 0; }

/* ---------- filters ---------- */
.filters { display: none; }
.f-head { display: flex; align-items: center; gap: 12px; }
.f-heading { margin: 0; font: 900 22px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.f-close { margin-left: auto; }
.grab { display: none; }
.f-group { display: grid; gap: 8px; }
.f-scroll { display: grid; gap: 20px; }
.f-title { margin: 0; font: 700 11px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.f-foot { display: flex; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 13.5px/1 var(--f-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--pink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip .n { font: 500 11px/1 var(--f-mono); opacity: .7; font-variant-numeric: tabular-nums; }
.chip.is-zero { opacity: .42; border-style: dashed; }
.chip.is-zero:hover { opacity: .75; }

/* searchable brand picker (ARIA combobox, list shown inline so the sidebar and the sheet never clip it) */
.combo, .f-group, .f-scroll > * { position: relative; min-width: 0; } /* nowrap option text must not widen the sidebar */
.filters { overflow-x: hidden; }
.combo-field {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); cursor: text;
}
.combo-field:hover { border-color: var(--pink); }
.combo:focus-within .combo-field, .combo.is-open .combo-field { border-color: var(--pink); box-shadow: 0 0 0 3px rgb(255 46 136 / .18); }
.combo.is-set .combo-field { background: var(--surface-2); border-color: var(--pink); }
.combo-ico { width: 18px; height: 18px; }
.combo-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--ink);
  font: 700 16px/1 var(--f-body); -webkit-appearance: none; appearance: none; /* 16px: no iOS zoom */
}
.combo-input::placeholder { color: var(--muted); font-weight: 600; opacity: 1; }
.combo.is-set:not(.is-open) .combo-input { font: 900 20px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; color: var(--pink); }
.combo-clear {
  flex: none; width: 34px; height: 34px; border-radius: 999px; border: 0; background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.combo-clear:hover { color: var(--pink); }
.combo-clear .ico { width: 16px; height: 16px; }
.combo-chev, .dd-chev {
  flex: none; width: 8px; height: 8px; margin: -3px 10px 0 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); color: var(--muted);
}
.combo.is-open .combo-chev, .dd.is-open .dd-chev { transform: rotate(-135deg); margin-top: 3px; }
.combo-list {
  list-style: none; margin: 6px 0 0; padding: 6px; max-height: 312px; overflow: auto; overscroll-behavior: auto; /* a fine elenco lo scroll passa al pannello */
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 16px 34px -18px rgb(20 0 40 / .45), 0 0 0 1px rgb(255 46 136 / .14);
}
@media (prefers-reduced-motion: no-preference) { .combo-list:not([hidden]), .dd-list:not([hidden]) { animation: pop-in .16s ease; } }
.combo-opt { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.combo-opt.is-active, .combo-opt:hover { background: var(--surface-2); }
.combo-opt.is-zero { opacity: .5; }
.opt-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.opt-main { font: 800 18px/1.05 var(--f-display); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.combo-opt[aria-selected="true"] .opt-main { color: var(--pink); }
.opt-sub { font-size: 12.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-n {
  flex: none; min-width: 26px; padding: 5px 7px; border-radius: 999px; text-align: center;
  font: 700 11.5px/1 var(--f-mono); color: var(--muted); background: var(--surface-2); font-variant-numeric: tabular-nums;
}
.combo-opt.is-active .opt-n, .combo-opt:hover .opt-n { background: var(--surface); }
.opt-check { flex: none; width: 18px; height: 18px; color: var(--pink); visibility: hidden; }
.combo-opt[aria-selected="true"] .opt-check, .dd-opt[aria-selected="true"] .opt-check { visibility: visible; }
.combo-empty { padding: 14px 10px; font-size: 14px; color: var(--muted); }

@media (min-width: 1024px) {
  .filters {
    display: grid; gap: 20px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--bar-h) + var(--tool-h) + 16px);
    max-height: calc(100vh - var(--bar-h) - var(--tool-h) - 40px); overflow: auto; overscroll-behavior: contain;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  }
  .f-close, #filters-apply { display: none; }
  .f-foot .btn { width: 100%; }
}
@media (max-width: 1023px) {
  .filters.open {
    display: flex; flex-direction: column; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 24px); background: var(--surface); color: var(--ink);
    border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px -20px rgb(20 0 40 / .5);
    animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1);
  }
  .filters.open .f-head { position: relative; padding: 22px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); }
  .filters.open .grab { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 99px; background: var(--line); }
  .filters.open .f-scroll { overflow: auto; overscroll-behavior: contain; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 22px max(16px, env(safe-area-inset-left, 0px)); }
  .filters.open .f-foot {
    padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line); background: var(--surface);
  }
  .filters.open .f-foot .btn { flex: 1 1 0; min-width: 0; min-height: 52px; padding: 0 12px; white-space: normal; text-align: center; line-height: 1.2; }
  .filters.open .chip { min-height: 44px; font-size: 14.5px; }
  .filters.open .combo-field { height: 52px; }
  .filters.open .combo-list { max-height: min(42dvh, 340px); }
}
.scrim { position: fixed; inset: 0; z-index: 55; background: var(--scrim); animation: fade-in .2s ease; }
@media (min-width: 1024px) { .scrim { display: none; } }

/* ---------- results ---------- */
.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.count { margin: 0; font: 700 13px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.count b { color: var(--ink); font-size: 15px; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 13px; font-weight: 600; color: var(--muted); }
/* custom "Ordina per" menu (select-only combobox) */
.dd { position: relative; }
.dd-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 6px 0 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 14.5px/1 var(--f-body); cursor: pointer;
}
.dd-btn:hover, .dd.is-open .dd-btn { border-color: var(--pink); }
.dd.is-open .dd-btn { box-shadow: 0 0 0 3px rgb(255 46 136 / .18); }
@media (max-width: 1023px) { .dd-btn { height: 44px; font-size: 15.5px; } }
.dd-list {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 6px); min-width: 232px; margin: 0; padding: 6px; list-style: none;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: 0 18px 40px -16px rgb(20 0 40 / .5), 0 0 0 1px rgb(255 46 136 / .18);
}
.dd-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 12px;
  border-radius: 10px; font: 700 15px/1.2 var(--f-body); color: var(--ink); cursor: pointer;
}
.dd-opt.is-active, .dd-opt:hover { background: var(--surface-2); }
.dd-opt[aria-selected="true"] { color: var(--pink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-filters:empty { display: none; }
.af {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 6px 0 12px; border-radius: 999px;
  border: 1.5px solid var(--pink); background: var(--surface-2); color: var(--ink); font: 700 13px/1 var(--f-body); cursor: pointer;
}
.af .ico { width: 16px; height: 16px; color: var(--pink); }
.af-clear { border-color: transparent; background: transparent; color: var(--pink); padding: 0 10px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: 16px; }
.card {
  position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--card-shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
  .card:hover { transform: translateY(-3px); }
}
.card:hover { border-color: var(--pink-neon); box-shadow: var(--card-hover); }
.stage {
  position: relative; overflow: hidden; aspect-ratio: 16 / 8; max-width: 100%;
  background: linear-gradient(180deg, var(--stage-1) 0%, var(--stage-2) 66%, var(--stage-ground) 66%);
}
.stage::before {
  content: ""; position: absolute; left: 50%; top: 14%; width: 34%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%;
  background: linear-gradient(180deg, var(--sun) 15%, var(--pink-neon) 90%);
  -webkit-mask: linear-gradient(#000 0 55%, transparent 55%), repeating-linear-gradient(180deg, #000 0 7%, transparent 7% 10%);
  mask: linear-gradient(#000 0 55%, transparent 55%), repeating-linear-gradient(180deg, #000 0 7%, transparent 7% 10%);
  opacity: .9;
}
.stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  background: repeating-linear-gradient(180deg, transparent 0 8px, var(--stage-line) 8px 9px);
}
.car { position: absolute; z-index: 1; left: 6%; bottom: 5%; width: 88%; height: auto; overflow: visible; }
.car-shadow { fill: var(--car-shadow); }
.car-body { stroke: var(--car-wheel); stroke-opacity: .55; stroke-width: 1.4; stroke-linejoin: round; }
.car-glass { fill: var(--car-glass); opacity: .88; }
.wheel circle, .wheel-track { fill: var(--car-wheel); }
.wheel .rim { fill: var(--car-rim); }
.lamp-f { fill: var(--sun); }
.lamp-r { fill: var(--pink-neon); }
.paint-0 { fill: var(--paint-0); } .paint-1 { fill: var(--paint-1); } .paint-2 { fill: var(--paint-2); }
.paint-3 { fill: var(--paint-3); } .paint-4 { fill: var(--paint-4); } .paint-5 { fill: var(--paint-5); }
.is-dark .car-body { stroke: rgb(255 255 255 / .35); stroke-width: 1; }
.is-dark .car { filter: drop-shadow(0 0 6px rgb(255 46 136 / .45)); }

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; }
.kicker { margin: 0; font: 700 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kicker .ue { color: var(--orange); }
/* etichetta delle varianti Standout: pillola rosa, leggibile anche in piccolo */
.so-badge { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px; background: var(--pink); color: var(--surface); font: 700 10px/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; vertical-align: 1px; }
.d-facts .muted, .muted { color: var(--muted); }
.game { margin: 0; font: 800 24px/1 var(--f-display); letter-spacing: .015em; text-transform: uppercase; overflow-wrap: anywhere; }
.game a { color: var(--ink); text-decoration: none; }
.game a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.game a:focus-visible { outline: none; }
.game a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: var(--r-md); }
.maker { display: block; font-size: 15px; letter-spacing: .1em; color: var(--pink); margin-bottom: 2px; }
.real { margin: 0; font: 500 14.5px/1.35 var(--f-body); color: var(--ink); overflow-wrap: anywhere; }
.real-k { display: block; font: 700 10px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.real .brand { font-weight: 800; color: var(--aqua); }
.real-none { font-style: italic; color: var(--muted); }
.d-real .real-none { font-size: 18px; font-weight: 600; }
.card-foot { margin-top: auto; padding-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.conf { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 6px; border-radius: 999px; background: var(--surface-2); font: 700 12px/1.2 var(--f-body); }
.conf .ico { width: 15px; height: 15px; }
.conf-A { color: var(--good); }
.conf-B { color: var(--warn); }
.conf-N { color: var(--muted); }
.fav {
  position: absolute; z-index: 2; top: 8px; right: 8px; width: 42px; height: 42px; border-radius: 999px; border: 0;
  display: grid; place-items: center; background: var(--fav-bg); color: var(--ink); cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.fav:hover { color: var(--pink-neon); }
.fav[aria-pressed="true"] { color: var(--pink-neon); }
.fav[aria-pressed="true"] .ico { fill: currentColor; }
@media (prefers-reduced-motion: no-preference) { .fav.pop .ico { animation: pop .35s ease; } }

/* ---------- photos (card, quiz, thumbnails) ---------- */
.card .stage { aspect-ratio: 16 / 9; }
.stage .photo {
  /* no fade: a re-rendered card with a cached photo must not flash back to the illustration */
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-tag, .inset-tag {
  position: absolute; z-index: 3; font: 800 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
  color: #fff7fb; background: rgb(18 7 31 / .74); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.photo-tag { left: 10px; top: 10px; padding: 6px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgb(255 46 136 / .6); }
.inset {
  position: absolute; z-index: 3; right: 10px; bottom: 10px; width: 40%; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: 10px; background: var(--stage-2); border: 2px solid #fff7fb;
  box-shadow: 0 8px 20px -6px rgb(10 0 25 / .65), 0 0 0 1px rgb(255 46 136 / .55), 0 0 18px -4px rgb(255 46 136 / .7);
}
.inset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inset-tag { left: 5px; bottom: 5px; padding: 4px 6px; border-radius: 6px; font-size: 9px; }
@media (prefers-reduced-motion: no-preference) {
  .stage .photo { transition: transform .5s ease; }
  .card:hover .stage .photo { transform: scale(1.04); }
}
.card .stage.has-photo::after { z-index: 2; height: 40%; background: linear-gradient(180deg, transparent, rgb(18 7 31 / .35)); pointer-events: none; }

/* phone: full-width cards, photo first */
@media (max-width: 559px) {
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card-body { padding: 12px 14px 14px; }
  .game { font-size: 23px; }
  .real-k { letter-spacing: .08em; }
  .inset { width: 38%; }
}

.grid-more { display: flex; justify-content: center; padding-top: 22px; }

/* ---------- empty ---------- */
.empty { padding: 48px 20px; text-align: center; border: 1.5px dashed var(--line); border-radius: var(--r-lg); background: var(--surface); }
.empty-title { margin: 0; font: 900 28px/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.empty-text { margin: 10px auto 0; max-width: 46ch; color: var(--muted); }
.empty-actions { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- page heads (marchi, quiz, preferiti) ---------- */
.page-head { background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); color: var(--hero-ink); border-bottom: 3px solid var(--pink-neon); box-shadow: 0 3px 18px -4px rgb(255 46 136 / .45); }
.page-head .wrap { padding-block: 26px 24px; }
@media (min-width: 760px) { .page-head .wrap { padding-block: 40px 32px; } }
.page-kicker { margin: 0 0 6px; font: 700 11.5px/1.2 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--aqua-neon); }
.page-title { margin: 0; font: 900 clamp(36px, 7vw, 68px)/.95 var(--f-display); text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; }
.page-title .script { font: 400 1.05em/.8 var(--f-script); text-transform: none; letter-spacing: 0; color: var(--hero-ink); text-shadow: var(--glow-pink); display: inline-block; transform: rotate(-6deg); padding-inline: .06em; }
.page-lede { margin: 12px 0 0; max-width: 60ch; color: var(--hero-ink-2); }
.page-body { padding-block: 22px 56px; }
.segmented { margin-top: 18px; display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .2); max-width: 100%; }
.seg { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: transparent; color: var(--hero-ink-2); font: 800 13px/1.1 var(--f-body); cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--hero-ink); color: #2a0d58; }
.segmented-sm { margin: 0; background: var(--surface-2); border-color: var(--line); }
.segmented-sm .seg { min-height: 40px; padding: 0 14px; color: var(--muted); }
.segmented-sm .seg[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- marchi ---------- */
.maker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 14px; }
.maker-tile { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.maker-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.maker-name { margin: 0; font: 900 28px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; color: var(--pink); overflow-wrap: anywhere; }
.maker-name.is-real { color: var(--aqua); }
.maker-n { font: 700 12px/1 var(--f-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.maker-map { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.maker-map li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font: 700 13.5px/1.2 var(--f-body); }
.maker-map li b { font: 700 11px/1 var(--f-mono); color: var(--muted); }
.maker-cars { margin: 0; font-size: 13.5px; color: var(--muted); }
.maker-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mthumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, var(--stage-1), var(--stage-2)); }
.mthumb img { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; object-fit: cover; display: block; }
.mthumb .car { left: 4%; width: 92%; bottom: 8%; }
.maker-tile .btn { margin-top: auto; align-self: flex-start; min-height: 42px; font-size: 14px; }
.charts { margin-top: 28px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.chart-card { min-width: 0; padding: 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.chart-title { margin: 0 0 14px; font: 800 20px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(88px, 34%) minmax(0, 1fr) 2.6em; align-items: center; gap: 10px; font-size: 13.5px; }
.bar-label { font-weight: 600; overflow-wrap: anywhere; }
.bar-track { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--pink-neon), var(--orange-neon)); }
.bar-fill.alt { background: linear-gradient(90deg, var(--aqua-neon), var(--paint-5)); }
.bar-val { text-align: right; font: 700 13px/1 var(--f-mono); font-variant-numeric: tabular-nums; }

/* ---------- quiz ---------- */
.quiz { max-width: 760px; margin-inline: auto; }
.quiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.quiz-card .stage { aspect-ratio: 16 / 8; }
@media (max-width: 559px) { .quiz-card .stage { aspect-ratio: 16 / 9; } }
.quiz-card .stage .car { left: 16%; width: 68%; }
.quiz-inner { padding: 18px; display: grid; gap: 16px; }
@media (min-width: 760px) { .quiz-inner { padding: 24px 28px 28px; } }
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font: 700 12px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.q-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.q-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--aqua-neon), var(--pink-neon)); border-radius: 99px; }
.q-prompt { margin: 0; font: 600 18px/1.4 var(--f-body); text-wrap: pretty; }
.q-prompt strong { font: 900 1.45em/1 var(--f-display); text-transform: uppercase; letter-spacing: .02em; color: var(--pink); }
.q-options { display: grid; gap: 10px; }
@media (min-width: 640px) { .q-options { grid-template-columns: 1fr 1fr; } }
.q-opt {
  min-height: 60px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left;
  border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 700 15.5px/1.3 var(--f-body); cursor: pointer;
}
.q-opt:hover:not(:disabled) { border-color: var(--pink); }
.q-opt .q-key { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font: 700 13px/1 var(--f-mono); color: var(--muted); }
.q-opt:disabled { cursor: default; }
.q-opt.is-correct { border-color: var(--good); background: color-mix(in srgb, var(--aqua-neon) 14%, var(--surface)); }
.q-opt.is-correct .q-key { background: var(--good); color: var(--on-accent); }
.q-opt.is-wrong { border-color: var(--pink); background: color-mix(in srgb, var(--pink-neon) 12%, var(--surface)); }
.q-opt.is-wrong .q-key { background: var(--pink); color: var(--on-accent); }
.q-opt.is-dim { opacity: .55; }
.q-tag { margin-left: auto; font: 800 12px/1 var(--f-body); letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; }
.q-tag .ico { width: 16px; height: 16px; }
.q-feedback { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 6px; }
.q-feedback p { margin: 0; }
.q-feedback .fb-title { font: 800 16px/1.3 var(--f-body); display: flex; align-items: center; gap: 8px; }
.q-feedback .fb-title.ok { color: var(--good); }
.q-feedback .fb-title.ko { color: var(--pink); }
.q-feedback .fb-note { font-size: 14px; color: var(--muted); }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q-actions .btn { min-height: 50px; }
.q-start-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .q-start-grid { grid-template-columns: 1fr 1fr; } }
.q-mode {
  text-align: left; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  display: grid; gap: 6px;
}
.q-mode:hover { border-color: var(--pink); box-shadow: var(--card-hover); }
.q-mode b { font: 900 22px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; }
.q-mode span { font-size: 14px; color: var(--muted); }
.q-mode small { font: 700 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--aqua); }
.q-score { text-align: center; display: grid; gap: 6px; justify-items: center; }
.q-score .big { font: 900 clamp(64px, 16vw, 112px)/.9 var(--f-display); background: linear-gradient(180deg, var(--orange), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.q-score .rank { font: 400 clamp(34px, 8vw, 52px)/1 var(--f-script); color: var(--pink); }
.is-dark .q-score .rank { text-shadow: var(--glow-pink); color: var(--ink); }
.q-score .best { font: 700 12px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.q-missed { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.q-missed a { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; font-size: 14px; }
.q-missed a:hover { outline: 1.5px solid var(--pink); }
.q-missed b { font-weight: 800; }
.q-missed .arrow { color: var(--muted); }
.q-section-title { margin: 6px 0 0; font: 800 18px/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- footer ---------- */
.site-footer { background: var(--bar-bg); color: var(--bar-muted); border-top: 3px solid var(--pink-neon); }
.footer-in { padding-block: 32px 36px; display: grid; gap: 18px; }
@media (min-width: 900px) { .footer-in { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; } }
.footer-brand { display: flex; align-items: center; }
.footer-text { font-size: 13.5px; line-height: 1.6; max-width: 82ch; display: grid; gap: 10px; }
.footer-text p { margin: 0; }
.footer-text strong { color: var(--bar-ink); }
.footer-text a { color: var(--aqua-neon); }

/* ---------- bottom nav (phones) ---------- */
.bottomnav {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--bar-bg); border-top: 1px solid var(--bar-line);
  padding: 0 max(6px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(6px, env(safe-area-inset-left, 0px));
}
@media (min-width: 760px) { .bottomnav { display: none; } }
.bottomnav a {
  position: relative; min-height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--bar-muted); text-decoration: none; font: 700 11px/1 var(--f-body); letter-spacing: .02em;
}
.bottomnav a .ico { width: 23px; height: 23px; }
.bottomnav a[aria-current="page"] { color: var(--bar-ink); }
.bottomnav a[aria-current="page"] .ico { color: var(--pink-neon); filter: drop-shadow(0 0 6px rgb(255 46 136 / .8)); }
.bottomnav a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 26%; right: 26%; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--pink-neon); box-shadow: 0 0 10px var(--pink-neon);
}
.nav-ico-wrap { position: relative; display: inline-flex; }
.nav-ico-wrap .nav-badge { position: absolute; top: -6px; right: -12px; }

/* ---------- detail dialog ---------- */
.detail {
  padding: 0; border: 0; color: var(--ink); background: var(--surface);
  width: min(780px, calc(100vw - 48px)); max-width: none; max-height: min(90dvh, 920px);
  border-radius: 26px; overflow: hidden; box-shadow: 0 30px 80px -20px rgb(20 0 40 / .6), 0 0 0 1px var(--line);
}
.detail[open] { display: flex; flex-direction: column; }
.detail::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) { .detail[open] { animation: pop-in .26s cubic-bezier(.2, .8, .2, 1); } }
@media (max-width: 759px) {
  .detail {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 24px 24px 0 0;
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 10px);
  }
  @media (prefers-reduced-motion: no-preference) { .detail[open] { animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1); } }
}
.d-scroll { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* detail media: before/after comparison between the in-game shot and the real photo */
.d-media { margin: 0; }
.compare { --pos: 50%; position: relative; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--stage-2); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.compare[data-mode="compare"] { cursor: ew-resize; }
.compare.has-game:not(.real-loaded) .cmp-real-wrap { background: linear-gradient(180deg, var(--stage-1), var(--stage-2)); }
.cmp-art { position: absolute; inset: 0; z-index: 0; aspect-ratio: auto; }
.cmp-game { z-index: 1; }
.cmp-art .car { left: 14%; width: 72%; bottom: 8%; }
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; }
.compare.game-loaded .cmp-game, .compare.real-loaded .cmp-real { opacity: 1; }
.cmp-real-wrap { position: absolute; inset: 0; z-index: 2; clip-path: inset(0 0 0 var(--pos)); }
.compare:not(.has-game) .cmp-game, .compare:not(.has-real) .cmp-real-wrap { display: none; }
.cmp-handle { position: absolute; z-index: 3; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff7fb; box-shadow: 0 0 12px #ff2e88, 0 0 2px rgb(0 0 0 / .6); pointer-events: none; }
.cmp-handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  display: grid; place-items: center; background: #1b0733; color: #fff7fb; border: 2px solid #fff7fb;
  font: 800 18px/1 var(--f-body); letter-spacing: -.05em; box-shadow: 0 0 16px #ff2e88;
}
.compare:has(.cmp-range:focus-visible) .cmp-handle::after { outline: 3px solid #19d3c5; outline-offset: 3px; }
.cmp-label {
  position: absolute; z-index: 3; bottom: 10px; padding: 6px 10px; border-radius: 999px; pointer-events: none;
  font: 800 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #fff7fb; background: rgb(18 7 31 / .74);
  box-shadow: inset 0 0 0 1px rgb(255 46 136 / .6);
}
.cmp-label-game { left: 10px; }
.cmp-label-real { right: 10px; }
.cmp-range {
  /* invisible, kept for keyboard and assistive tech; pointer drags are handled on .compare */
  position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0;
  -webkit-appearance: none; appearance: none; pointer-events: none;
}
.compare:not([data-mode="compare"]) .cmp-handle { display: none; }
.compare[data-mode="game"] .cmp-label-real, .compare[data-mode="real"] .cmp-label-game, .compare[data-mode="none"] .cmp-label { display: none; }
.d-media-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px)); }
@media (min-width: 760px) { .d-media-bar { padding: 14px 32px 0; } }
.d-credits { display: grid; gap: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); min-width: 0; }
.d-credits a { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.d-credits a:hover { color: var(--pink); }
.detail { position: fixed; }
.d-close { position: absolute; z-index: 5; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); background: var(--fav-bg); border-color: transparent; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.d-body { display: grid; gap: 20px; padding: 20px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px)); }
@media (min-width: 760px) { .d-body { padding: 24px 32px 28px; } }
.pair { display: grid; gap: 14px; align-items: center; }
@media (min-width: 620px) { .pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; } }
.pair-side { min-width: 0; display: grid; gap: 8px; }
.k { margin: 0; font: 700 10.5px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lplate {
  position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 14px 8px; border-radius: 12px;
  background: var(--plate-bg); color: var(--plate-ink); border: 2px solid var(--plate-edge);
  box-shadow: inset 0 0 0 3px var(--plate-bg), inset 0 0 0 4.5px var(--plate-edge), 0 8px 20px -12px rgb(20 0 40 / .5);
  text-align: center; max-width: 380px;
}
.lplate::before, .lplate::after { content: ""; position: absolute; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--plate-edge); opacity: .55; }
.lplate::before { left: 12px; } .lplate::after { right: 12px; }
.p-state { font: 400 27px/1 var(--f-script); color: var(--plate-state); }
.p-num { margin: 0; font: 700 clamp(24px, 6.4vw, 34px)/1.05 var(--f-mono); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.p-foot { font: 800 10px/1.2 var(--f-body); letter-spacing: .22em; text-transform: uppercase; color: var(--plate-foot); }
.pair-link { display: flex; align-items: center; gap: 8px; color: var(--pink); font: 400 24px/1 var(--f-script); }
.pair-link .ico { width: 26px; height: 26px; }
@media (max-width: 619px) { .pair-link .ico { transform: rotate(90deg); } }
@media (min-width: 620px) { .pair-link { flex-direction: column; gap: 2px; } }
.d-real { margin: 0; font: 600 21px/1.25 var(--f-body); overflow-wrap: anywhere; }
.d-real .brand { display: block; font: 900 30px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; color: var(--aqua); }
.d-country { margin: 0; font-size: 14px; color: var(--muted); }
.d-note { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--orange-neon); font-size: 14.5px; }
.d-facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: 14.5px; }
.d-facts dt { color: var(--muted); }
.d-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
@media (max-width: 419px) { .d-facts { grid-template-columns: 1fr; gap: 2px; } .d-facts dd { margin-bottom: 8px; } }
.d-links { display: flex; flex-wrap: wrap; gap: 8px; }
.d-links a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font: 700 14px/1 var(--f-body);
}
.d-links a:hover { border-color: var(--pink); color: var(--pink); }
.d-links .ico { width: 15px; height: 15px; }
.d-links-note { flex-basis: 100%; margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.d-actions {
  display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); background: var(--surface);
  padding: 10px max(14px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
}
.d-pos { flex: 1; margin: 0; text-align: center; font: 700 12px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-variant-numeric: tabular-nums; }
.d-fav { min-height: 48px; padding: 0 16px; }
.d-fav[aria-pressed="true"] { color: var(--pink); border-color: var(--pink); background: var(--surface-2); }
.d-fav[aria-pressed="true"] .ico { fill: currentColor; }
@media (max-width: 380px) {
  .d-fav { padding: 0; width: 48px; }
  #d-fav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .d-pos { font-size: 11px; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--bar-bg); color: var(--bar-ink); font: 700 14px/1.3 var(--f-body);
  box-shadow: 0 0 0 1px var(--pink-neon), 0 10px 30px -8px rgb(255 46 136 / .6); text-align: center;
}
@media (min-width: 1024px) { .toast { bottom: 28px; } }
.detail .toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: no-preference) { .toast { transition: opacity .2s ease, transform .2s ease; } }

/* ---------- motion ---------- */
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 8% { opacity: .35; } 10% { opacity: 1; } 14% { opacity: .5; } 16% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-title .w2 { animation: flicker 2.4s ease-in-out .4s 1 both; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- i miei garage ---------- */
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.mg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.mg-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.mg-tools .ico { width: 18px; height: 18px; }
.mg-form {
  margin-bottom: 18px; padding: 18px; border-radius: var(--r-lg); border: 1.5px solid var(--pink); background: var(--surface);
  box-shadow: 0 10px 30px -18px rgb(255 46 136 / .6);
}
.mg-form-title { margin: 0 0 14px; font: 900 24px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.mg-fields { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 12px; }
@media (max-width: 419px) { .mg-fields { grid-template-columns: minmax(0, 1fr) 104px; } }
.mg-field { display: grid; gap: 6px; min-width: 0; }
.mg-input {
  width: 100%; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font: 700 16px/1 var(--f-body); /* 16px: niente zoom su iOS */
}
.mg-input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.mg-input:hover { border-color: var(--pink); }
.mg-error { margin: 10px 0 0; color: var(--pink); font-weight: 700; font-size: 14px; }
.mg-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.mg-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.mg-card { min-width: 0; border-radius: var(--r-lg); border: 1.5px solid var(--line); background: var(--surface); overflow: hidden; }
.mg-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 16px 16px 14px;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2)); color: var(--hero-ink); border-bottom: 3px solid var(--pink-neon);
}
.mg-head .icon-btn { background: transparent; border-color: rgb(255 255 255 / .35); color: var(--hero-ink); --focus: #19d3c5; }
.mg-head .icon-btn:hover { border-color: var(--pink-neon); color: var(--pink-neon); }
.mg-head .icon-btn .ico { width: 19px; height: 19px; }
.mg-head-actions { display: flex; gap: 6px; }
.mg-name { margin: 0; font: 900 28px/1 var(--f-display); letter-spacing: .03em; text-transform: uppercase; overflow-wrap: anywhere; }
.mg-name:focus { outline: none; }
.mg-name:focus-visible { outline: 2px solid #19d3c5; outline-offset: 3px; border-radius: 4px; }
.mg-slots { margin: 6px 0 0; font: 700 11.5px/1.3 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--hero-ink-2); font-variant-numeric: tabular-nums; }
.mg-card.is-full .mg-slots { color: var(--sun); }
.mg-meter { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: rgb(255 255 255 / .2); overflow: hidden; }
.mg-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua-neon), var(--pink-neon)); }
.mg-none { margin: 0; padding: 16px; color: var(--muted); }
.mg-cars { list-style: none; margin: 0; padding: 6px 0; }
.mg-car { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; }
.mg-car + .mg-car { border-top: 1px solid var(--line); }
.mg-car-link { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; min-height: 52px; color: inherit; text-decoration: none; border-radius: 10px; }
.mg-car-link:hover .mg-car-name { color: var(--pink); }
.mg-thumb { width: 76px; border-radius: 8px; }
.mg-car-text { display: grid; gap: 3px; min-width: 0; }
.mg-car-name { font: 800 17px/1.05 var(--f-display); letter-spacing: .03em; text-transform: uppercase; overflow-wrap: anywhere; }
.mg-car-name .maker { color: var(--pink); font-size: 12px; margin-bottom: 1px; }
.mg-car-name .so-badge { font-size: 9px; }
.mg-car-real { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-move {
  max-width: 116px; height: 40px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 14px/1 var(--f-body); cursor: pointer;
}
/* telefono: azioni sotto al veicolo, così nome e menu restano leggibili */
@media (max-width: 559px) {
  .mg-car { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; padding-block: 10px; }
  .mg-car-link { grid-column: 1 / -1; }
  .mg-move { max-width: none; width: 100%; height: 44px; font-size: 16px; }
  .mg-car > .mg-remove:first-of-type:last-child { grid-column: 2; }
  .mg-remove { width: 44px; height: 44px; }
  .mg-tools { width: 100%; }
  .mg-tools .btn { min-height: 44px; padding: 0 14px; font-size: 14.5px; }
  .mg-tools #mg-new { flex: 1 1 100%; }
  .mg-tools .btn-ghost { flex: 1 1 0; }
}
.mg-remove { width: 40px; height: 40px; }
.mg-remove .ico { width: 18px; height: 18px; }
.mg-add { position: relative; padding: 10px 12px 14px; border-top: 1px solid var(--line); }
.mg-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--bg); }
.mg-search:focus-within, .mg-search:hover { border-color: var(--pink); border-style: solid; }
.mg-search .ico { width: 18px; height: 18px; color: var(--muted); flex: none; }
.mg-q { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink); font: 600 16px/1 var(--f-body); -webkit-appearance: none; appearance: none; }
.mg-q:focus { outline: none; }
.mg-q::placeholder { color: var(--muted); opacity: 1; }
.mg-q::-webkit-search-cancel-button { -webkit-appearance: none; }
.mg-add.is-disabled .mg-search { opacity: .55; }
.mg-results { list-style: none; margin: 8px 0 0; padding: 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); max-height: 360px; overflow-y: auto; }
.mg-res {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 8px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.mg-res:hover, .mg-res:focus-visible { background: var(--surface-2); }
.mg-res .mg-thumb { width: 64px; }
.mg-res-plus { width: 20px; height: 20px; color: var(--pink); }
.mg-res-none { padding: 12px; color: var(--muted); }

/* scheda: nei miei garage */
.d-garages { margin-top: 18px; display: grid; gap: 10px; }
.d-garages .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.d-garages .chip[aria-disabled="true"] { opacity: .45; border-style: dashed; }
.d-garages-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.d-garages-note { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- account (cloud.js) ---------- */
.acct-btn { position: relative; background: transparent; border-color: var(--bar-line); color: var(--bar-ink); }
.acct-btn:hover { color: var(--sun); border-color: var(--sun); }
.acct-btn.is-in { background: var(--pink-neon); border-color: var(--pink-neon); color: #22103a; }
.acct-btn.is-in .ico { display: none; }
.acct-initial { font: 800 17px/1 var(--f-body); }
.acct {
  padding: 0; border: 0; color: var(--ink); background: var(--surface);
  width: min(440px, calc(100vw - 32px)); max-width: none; border-radius: 22px;
  box-shadow: 0 30px 80px -20px rgb(20 0 40 / .6), 0 0 0 1px var(--line);
}
.acct::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (prefers-reduced-motion: no-preference) { .acct[open] { animation: pop-in .26s cubic-bezier(.2, .8, .2, 1); } }
.acct-in { padding: 18px 20px 22px; display: grid; gap: 14px; }
.acct-panel:not([hidden]) { display: grid; gap: 14px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-title { margin: 0; font: 900 24px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; }
.acct-text { margin: 0; line-height: 1.5; }
.acct-text b { overflow-wrap: anywhere; }
.acct-google { width: 100%; }
.acct-google .ico { width: 20px; height: 20px; }
.acct-or { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); font-size: 14px; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-form { display: grid; gap: 10px; }
.acct-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.acct-status { margin: 0; color: var(--muted); font-size: 14px; }
.acct-status:empty { display: none; }
.acct-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.acct .mg-error { margin: 0; }
.acct button:disabled { opacity: .6; cursor: progress; }

/* ---------- storico quiz ---------- */
.q-stats, .q-history { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.q-stats li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 14px; }
.q-stats span { color: var(--muted); }
.q-history li {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px;
}
.q-h-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-h-mode { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-h-score { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 419px) { .q-history li { grid-template-columns: minmax(0, 1fr) auto; } .q-h-when { grid-column: 1 / -1; } }
