/* Cars standing together on one ground, at one scale (src/app/ui/scene.ts): the stage at the head of a page that is
   read, the two cars of a tile that leads to their comparison, the few cars of a tile that speaks of several; and the
   tiles and cards those stand in on the comparisons, the guides and the topics. After app.css and topics.css; it never
   redefines a token. The place sets `--mm` from the longest car it holds: the cars of one place always compare. */

/* ── The stage at the head of a page ─────────────────────────────────────────────────────────────────── */
.scene { --gap: 12px; --pad: 16px; display: grid; gap: 6px; min-width: 0; margin: 0; container-type: inline-size; }
.scene-cars { --mm: min(0.078px, calc((100cqi - 2 * var(--pad) - (var(--n) - 1) * var(--gap)) / (var(--n) * var(--longest)))); position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: auto auto; gap: 12px var(--gap); padding: 28px var(--pad) 14px; overflow: hidden; border-radius: var(--r-l); background: radial-gradient(90% 80% at 50% 30%, var(--kind-lit), transparent 80%), var(--stage, var(--road)); }
.scene[data-kind="suv"] { --stage: var(--kind-suv); }
.scene[data-kind="citadines"] { --stage: var(--kind-citadines); }
.scene[data-kind="berlines"] { --stage: var(--kind-berlines); }
.scene[data-kind="monospaces"] { --stage: var(--kind-monospaces); }
.scene[data-kind="pick-up"] { --stage: var(--kind-pick-up); }
.scene[data-kind="coupes"] { --stage: var(--kind-coupes); }
/* The floor the cars stand on: from the ground line down, under their names. */
.scene-cars::before { content: ""; grid-area: 2 / 1 / 3 / -1; margin: -12px calc(var(--pad) * -1) -14px; background: var(--kind-floor); }
.scene-car { position: relative; display: grid; grid-row: 1 / span 2; grid-column: var(--at); grid-template-rows: subgrid; justify-items: center; min-width: 0; color: inherit; text-decoration: none; }
.scene-car > .carfig { grid-area: 1 / 1; align-self: end; z-index: 1; }
.scene-under { grid-area: 2 / 1; position: relative; padding-top: 2px; display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 0; max-width: 100%; text-align: center; }
.scene-make { display: block; --logo-w: 44px; --logo-h: 22px; }
.scene-make > .mk-mono { display: none; }
.scene-name { max-width: 100%; font: 800 clamp(0.875rem, 0.8rem + 0.5cqi, 1.0625rem)/1.15 var(--display); letter-spacing: -0.015em; text-wrap: balance; overflow-wrap: anywhere; }
.scene-fact { font: 600 0.8125rem/1.3 var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.scene-fact small { font-size: inherit; font-weight: 500; }
.scene-car:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 2px; border-radius: var(--r-m); }
@media (hover: hover) { .scene-car:hover .scene-name { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; } }
.scene-said { font: 500 var(--fs-note)/1.4 var(--label); color: var(--soft); text-wrap: pretty; }
/* With room the stage stands beside the page's first words rather than over them. */
.tp-head.has-scene { gap: 14px; }
@media (min-width: 900px) {
  .tp-head.has-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); column-gap: 32px; align-items: start; }
  .tp-head.has-scene > * { grid-column: 1; }
  .tp-head.has-scene > .scene { grid-column: 2; grid-row: 1 / span 6; align-self: center; }
}

/* ── Two cars nose to nose, a few cars in a row: inside a tile ───────────────────────────────────────── */
.duel, .lineup { display: flex; align-items: flex-end; justify-content: center; min-width: 0; container-type: inline-size; padding: 10px 8px 0; border-bottom: 1.5px solid var(--line); }
.duel { gap: 10px; }
.duel > .carfig { --mm: min(0.034px, calc((100cqi - 26px) / (2 * var(--longest)))); }
.lineup { gap: 8px; }
.lineup > .carfig { --mm: min(0.03px, calc((100cqi - 16px - (var(--n) - 1) * 8px) / (var(--n) * var(--longest)))); }

/* ── A tile that leads to a comparison (the list of comparisons, two makes' face-to-faces) ───────────── */
.duels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.duels > li { min-width: 0; }
.duel-tile { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; height: 100%; padding: 10px 14px 14px; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--card); color: inherit; text-decoration: none; transition: border-color var(--quick); }
.duel-tile > :is(.duel, .lineup, .duel-marks) { margin-bottom: 8px; }
.duel-n { display: flex; align-items: start; justify-content: space-between; gap: 8px; font: 800 1rem/1.2 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.duel-n .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.duel-f { font: 600 0.875rem/1.35 var(--body); font-variant-numeric: tabular-nums; }
.duel-w { font: 500 0.8125rem/1.35 var(--body); color: var(--soft); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .duel-tile:hover { border-color: var(--ink); } }
.duel-tile:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }
/* Two makes: their logos face to face where two cars would stand. */
.duel-marks { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; justify-items: center; gap: 8px; min-height: 64px; padding: 6px 0 12px; border-bottom: 1.5px solid var(--line); --logo-w: 72px; --logo-h: 36px; }
.duel-marks > i { font: 600 0.75rem/1 var(--label); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.duel-marks > .mk-mono { display: grid; place-items: center; width: 36px; height: 36px; border: 1.5px solid var(--edge); border-radius: 50%; font: 800 1rem/1 var(--label); color: var(--soft); }
/* On a phone a long list of tiles is a row one swipes, two tiles high where it holds many: the page stays short and
   every tile stays a link of the page. The next tile shows at the edge. */
@media (max-width: 699px) {
  .duels.is-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(78%, 280px); margin-inline: calc(var(--pad) * -1); padding: 2px var(--pad) 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: var(--pad); scrollbar-width: none; }
  .duels.is-row::-webkit-scrollbar { display: none; }
  .duels.is-row > li { scroll-snap-align: start; }
  .duels.is-row.is-many { grid-template-rows: repeat(2, auto); }
}
/* The kinds of the list as links to their rows, and how many each holds. */
.duel-jump .tp-chips small { margin-inline-start: 6px; color: var(--soft); font-size: 0.8125rem; }

/* ── A verdict's cell: its sign, the question, who it goes to, the figures ───────────────────────────── */
.vs-answers > div.has-sign { position: relative; padding-inline-start: 68px; }
.vs-sign { position: absolute; top: 14px; inset-inline-start: 16px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sunk); color: var(--ink); }
.vs-sign .ic { width: 22px; height: 22px; }
.vs-answers dd b { display: flex; align-items: center; gap: 6px; }
.vs-answers dd b .ic { flex: none; width: 18px; height: 18px; padding: 2px; border-radius: 50%; background: var(--good); color: var(--card); }

/* With room a verdict stands four cells a row: eight answers are two full rows, never five and three. */
@media (min-width: 1100px) { .vs-answers { grid-template-columns: repeat(auto-fit, minmax(max(230px, 22%), 1fr)); } }

/* ── A tile with its car beside its words (an engine's cars by power, the guides' engines) ───────────── */
.tp-part.has-car { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
.tp-part.has-car > :not(.tp-part-car) { grid-column: 1; }
.tp-part-car { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.tp-part-car .carfig { --mm: 0.021px; }
.tp-part > .lineup { margin-bottom: 6px; }

/* ── A make's models, each by its car (two makes side by side) ───────────────────────────────────────── */
.vm-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.vm-models > li { min-width: 0; }
.vm-model { display: grid; justify-items: center; align-content: end; gap: 2px; height: 100%; padding: 10px 6px 8px; border: 1.5px solid var(--line); border-radius: var(--r-m); color: inherit; text-decoration: none; text-align: center; transition: border-color var(--quick); }
.vm-model .carfig { --mm: 0.019px; margin-bottom: 6px; }
.vm-model b { max-width: 100%; font: 700 0.8125rem/1.2 var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-model small { font: 500 0.75rem/1.2 var(--body); color: var(--soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (hover: hover) { .vm-model:hover { border-color: var(--ink); } }
.vm-model:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; }
.vm-name .makemark img { width: 36px; height: 36px; }

/* ── A model weighed in two energies: its car at the head of its card ────────────────────────────────── */
.cz-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: end; padding-bottom: 10px; border-bottom: 1.5px solid var(--line); }
.cz-head > :not(.cz-car) { grid-column: 1; }
.cz-car { grid-column: 2; grid-row: 1 / span 2; }
.cz-car .carfig { --mm: 0.026px; }
.cz-head .cz-won { margin-top: 6px; }
