/* Fredoka (SIL Open Font License), self-hosted so the page works offline and loads nothing from third parties */
@font-face {
  font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fredoka-latin.woff2') format('woff2');
}
:root {
  --navy: #14194a;
  --navy-2: #232a6b;
  --ink: #1b2152;          /* the navy ink of the cards */
  --sky: #3aa9ea;          /* Metro card light blue */
  --lemon: #edf28f;        /* Street card yellow */
  --teal: #1fa6ab;         /* Street card line art */
  --kerb: #e2294f;         /* the red kerb under the Street cards */
  --metro-red: #d9252f;
  --pink: #d4202d;          /* Paris red (kept the variable name from the London helper) */
  --pink-deep: #b3141f;
  --blue: #1d8fe5;
  --yellow: #f6ee6a;
  --cream: #fff8e6;
  --font: 'Fredoka', ui-rounded, 'Trebuchet MS', system-ui, sans-serif;
  --vh: 100vh;
  --back-art: url('card-back.svg');   /* the real deck's back: rising white lines, red M roundels and stations on royal blue */
  --m-roundel: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path d='M5.6 14.4V5.8L10 10.6l4.4-4.8v8.6' fill='none' stroke='white' stroke-width='2.6' stroke-linejoin='round' stroke-linecap='round'/></svg>");
  --peek: 60px;            /* how far the held Railroad Switch sticks out above the card */
  --tail: 68px;            /* empty space under the card, keeps it centred between the badges and the counter */
  --drop: 40px;            /* how far the card moves down while a Railroad Switch peeks out behind it */
  --pile-step: 12px;       /* each discard sits this much lower than the previous one */
    --small-w: min(13vw, 190px);
  --splash-ms: 1600;
  --bg-opacity: .7;        /* how strongly the background shows; the rest fades into the navy page colour */
}
@supports (height: 100dvh) { :root { --vh: 100dvh; } }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body { height: var(--vh); }
body {
  font-family: var(--font); color: var(--cream); background: var(--navy);
  overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none;
}
.bg {
  position: fixed; inset: 0; z-index: -2; opacity: var(--bg-opacity);
  background: url('bg.svg') center 62% / cover no-repeat;   /* Paris at dusk: Sacré-Cœur, the Arc, the Eiffel Tower, Notre-Dame and the Seine */
}
.bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(20,25,74,.1) 25%, rgba(10,14,50,.7) 100%); }

.stage, .footer-hint { transition: opacity .5s ease; }
body.loading .stage, body.loading .footer-hint { opacity: 0; }
/* Failsafe: if the script never removes .loading (it failed or is blocked), reveal the page anyway after 3 seconds */
body.loading .stage, body.loading .footer-hint { animation: failsafe .3s 3s forwards; }
@keyframes failsafe { to { opacity: 1; } }
.fatal { position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--navy); }
.fatal:not([hidden]) { display: flex; }
.fatal p { max-width: 420px; font-size: 1.25rem; font-weight: 500; line-height: 1.4; color: var(--cream); }

.stage {
  height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; overflow-y: auto; overflow-x: hidden;
  padding: calc(18px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(54px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}

header { text-align: center; position: relative; z-index: 10; }   /* above the cards, which can overflow upward on short windows and would cover the theme button */
h1 {
  font-size: clamp(1.6rem, 4.5vw, 3rem); font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  text-shadow: 0 3px 0 var(--navy), 0 6px 18px rgba(0,0,0,.5);
}
h1 span { color: var(--yellow); }
.badges { display: flex; gap: 10px; justify-content: center; margin-top: 8px; align-items: center; }
.badge {
  padding: 4px 18px; border-radius: 999px; font-weight: 600; font-size: 1rem; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(20,25,74,.85); border: 2px solid var(--yellow); color: var(--yellow);
  box-shadow: 0 4px 10px rgba(0,0,0,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

main { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.deal { display: flex; flex-direction: column; align-items: center; gap: 14px; perspective: 1400px; padding-top: calc(var(--peek) + 6px); padding-bottom: var(--tail); }
.row { position: relative; display: flex; align-items: center; justify-content: center; }

/* Cards: portrait, with the symbol rings from the real cards */
.stack { position: relative; }
.card {
  --reserve: 330px;   /* vertical space taken by everything that is not the card */
  --cap: 70vw;
  --wmin: 200px;
  --wmax: 560px;
  --w: clamp(var(--wmin), min(var(--cap), var(--wmax), calc((var(--vh) - var(--reserve)) * 1.4)), var(--wmax));   /* Paris cards are landscape: height = width x 5/7 */
  width: var(--w); aspect-ratio: 7 / 5;
  border-radius: 18px; border: 4px solid #fff; position: relative; cursor: pointer; overflow: hidden;
  box-shadow: 0 2px 0 #d9dce8, 0 18px 40px rgba(0,0,0,.55);
  background: var(--navy-2); touch-action: manipulation;
}
/* a soft sheen and a fine inner edge on every card face, like printed card stock */
.card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
  background: linear-gradient(155deg, rgba(255,255,255,.16), transparent 38%); box-shadow: inset 0 0 0 1px rgba(27,33,82,.18); }
.card > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card.dealt { animation: deal .55s cubic-bezier(.2,.8,.2,1); }
@keyframes deal {
  from { transform: translateY(-60px) rotateY(100deg) scale(.9); }
  to   { transform: var(--rest, none); }   /* ends where the card really rests, so it does not jump when the animation finishes */
}
#card { z-index: 1; }
.stack.has-held #card { --rest: translateY(var(--drop)); transform: var(--rest); }   /* a Railroad Switch is waiting behind: the card sits lower, so more of the switch shows */
/* Held Railroad Switch: tucked behind the current card, peeking out above it */
.card.held { position: absolute; left: 0; top: calc(var(--peek) * -1); z-index: 0; cursor: default; pointer-events: none; transform: rotate(3deg); transform-origin: bottom left; border-color: var(--yellow); box-shadow: 0 0 0 3px var(--navy), 0 0 30px rgba(255,233,74,.8), 0 14px 30px rgba(0,0,0,.5); }
.card.held.peek { animation: peek .5s ease-out; }
@keyframes peek { from { transform: translate(0, var(--peek)) rotate(0); } }
.held-cap {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); white-space: nowrap; display: flex; align-items: center; gap: 6px;
  background: var(--yellow); color: var(--navy); border: 3px solid var(--navy); border-radius: 999px;
  padding: 3px 14px 3px 5px; font-weight: 700; font-size: clamp(.62rem, calc(var(--w) / 15), 1.1rem); letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.held-cap svg { width: clamp(20px, calc(var(--w) / 8), 34px); height: clamp(20px, calc(var(--w) / 8), 34px); border-radius: 6px; display: block; flex: none; }
.card.small { --w: var(--small-w); cursor: default; pointer-events: none; border-width: 3px; border-radius: 12px; }
.pile { --w: var(--small-w); position: absolute; top: 50%; left: calc(100% + 70px); width: var(--w); height: 0; }   /* out of the flow, so the drawn card alone is centred */
.pile .card { position: absolute; left: 0; top: calc(var(--w) * -0.357 - 20px); transform: translate(var(--dx), calc(var(--n) * var(--pile-step) + var(--dy, 0px))) rotate(var(--rot));  box-shadow: 0 8px 18px rgba(0,0,0,.45); pointer-events: auto; cursor: pointer; }   /* click the discard pile to see the past cards */
/* The draw deck, on the left: a tidy stack of card backs */
.deck { --w: var(--small-w); position: absolute; top: 50%; right: calc(100% + 70px); width: var(--w); height: 0; cursor: pointer; }
.deck:focus-visible { outline: 3px solid var(--yellow); outline-offset: 8px; border-radius: 12px; }
.deck .card { position: absolute; left: 0; top: calc(var(--w) * -0.357 - 20px); transform: translate(calc(var(--n) * -3px), calc(var(--n) * -3px)); box-shadow: 0 4px 10px rgba(0,0,0,.45); pointer-events: auto; cursor: pointer; }
@media (max-width: 1150px) {
  .pile, .deck { display: none; }
  :root { --drop: 14px; }   /* phones: only a small step down, the page is short on room */
}
.card.back {
  background: var(--back-art) 0 0 / calc(var(--w) / 3.3) auto, #1f62c8; color: var(--ink); text-align: center;
}   /* the card back is the blue Metro pattern, like the real deck */
.card.back::before { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 calc(var(--w) / 9) rgba(10,20,80,.45); }
.back-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: linear-gradient(180deg, var(--lemon), #e2e97c); border-top: 3px solid var(--ink);
  box-shadow: 0 -7px 0 var(--kerb), 0 -10px 0 var(--ink);   /* the red and navy kerb of the Street cards */
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 10px;
}
.back-title { font-size: clamp(1.2rem, 2.2vw, 1.7rem); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; line-height: 1.1; }
.back-sub { font-size: 1rem; font-weight: 500; }
.back-sub kbd { background: #fff; border: 3px solid var(--ink); border-radius: 8px; padding: 0 10px; font-family: inherit; font-weight: 700; box-shadow: 0 3px 0 var(--ink); }
.back-title, .back-sub { color: var(--ink); }
.card[hidden] { display: none; }


/* Underground line progress, like the bar in Harmonies */
.line { width: min(92vw, 620px); text-align: center; margin-top: 4px; }
/* Metro progress: a line on a Metro-card band, one station per Metro card; drawn stations become red M roundels */
.stops {
  position: relative; display: flex; justify-content: space-between; align-items: center; padding: 8px 26px;
  background: linear-gradient(180deg, var(--sky) 0 22%, var(--ink) 22% 30%, var(--sky) 30% 70%, var(--ink) 70% 78%, var(--sky) 78%);
  border: 4px solid #fff; border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(27,33,82,.35), 0 6px 18px rgba(0,0,0,.4);
}
.stops::before { content: ''; position: absolute; left: 40px; right: 40px; top: 50%; height: 10px; margin-top: -5px; background: var(--ink); border-radius: 5px; box-shadow: 0 0 0 2px #fff; }
.stop {
  position: relative; width: 34px; height: 34px; border-radius: 50%; border: 5px solid var(--ink);
  background: #fff; transition: background-color .4s, transform .4s, border-color .4s;
}
.stop.on { background: var(--m-roundel) center / 72% no-repeat, var(--metro-red); border-color: #fff; box-shadow: 0 0 0 2px var(--ink), 0 3px 6px rgba(0,0,0,.35); transform: scale(1.14); }
.stop.final::before { content: ''; position: absolute; inset: -11px; border-radius: 50%; border: 6px solid rgba(255,233,74,.95); animation: pulse-layer .9s ease-in-out infinite; }

/* Splash */
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(31,98,200,.55), rgba(20,25,74,.82) 70%); z-index: 50; animation: fade calc(var(--splash-ms) * 1ms) ease forwards; pointer-events: none; }
.splash[hidden] { display: none; }
#splash-text { font-size: clamp(2.4rem, 9vw, 6rem); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--yellow); text-align: center; text-shadow: 0 5px 0 var(--navy), 0 10px 30px rgba(0,0,0,.6); }
#splash-text small { display: block; font-size: .3em; letter-spacing: .2em; color: #8fd3ff; margin-top: 8px; }
@keyframes fade { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

/* Past cards overlay */
.overlay { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 30%, rgba(36,44,120,.97), rgba(10,14,50,.98) 75%); z-index: 60; display: flex; align-items: center; overflow-y: auto;
  padding: calc(20px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left)); }
.overlay > * { margin: auto; }   /* centres, and still lets tall content scroll */
.overlay[hidden] { display: none; }
.overlay-box { text-align: center; max-width: 900px; }
.overlay h2 { font-size: 1.8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--yellow); margin-bottom: 18px; text-shadow: 0 3px 0 var(--navy), 0 6px 16px rgba(0,0,0,.45); }
.overlay h2::after { content: ''; display: block; width: 120px; height: 8px; margin: 10px auto 0; border-radius: 4px; background: linear-gradient(90deg, var(--sky) 0 33%, #fff 33% 66%, var(--metro-red) 66%); box-shadow: 0 0 0 2px var(--ink); }
.past-grid .card { --w: min(40vw, 210px); cursor: default; }
.past-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.hint { margin-top: 18px; opacity: .7; }
#past-close { margin-top: 22px; }
.overlay .sub { margin: -8px 0 16px; opacity: .8; }

.footer-hint {
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .85rem; letter-spacing: .04em;
  background: rgba(20,25,74,.85); padding: 5px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.footer-hint strong { color: var(--yellow); font-weight: 600; }

/* Confirm dialog */
.dialog {
  width: min(92vw, 400px); background: var(--lemon); color: var(--ink); border: 5px solid #fff; border-radius: 20px;
  overflow: hidden; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.6); animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { transform: scale(.85); } to { transform: none; } }
/* the header of the dialog is a tiny Street card: teal skyline over the red and navy kerb */
.dialog-band { height: 76px; background: url('skyline.svg') center bottom / auto 72px no-repeat, var(--lemon); border-bottom: 7px solid var(--kerb); box-shadow: 0 3px 0 var(--ink); box-sizing: content-box; }
.dialog h2 { font-size: 1.6rem; text-transform: uppercase; letter-spacing: .06em; margin: 20px 16px 10px; color: var(--ink); text-shadow: none; }
.dialog p { font-size: 1.05rem; margin: 0 20px 20px; font-weight: 500; }
.dialog-buttons { display: flex; gap: 12px; justify-content: center; padding: 0 20px 22px; }
.btn {
  font-family: inherit; font-size: 1.05rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
  padding: 10px 22px; border-radius: 999px; border: 3px solid var(--navy); box-shadow: 0 4px 0 var(--navy); transition: transform .1s, box-shadow .1s, filter .15s; touch-action: manipulation;
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 55%);
}
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(1.06); transform: translateY(-1px); } }
.btn:disabled { background-color: #8d89b5; color: #e4e2f3; border-color: #3d3880; box-shadow: 0 4px 0 #3d3880; cursor: not-allowed; }
.btn:disabled:active { transform: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--navy); }
.btn.no { background-color: #fff; color: var(--navy); }
.btn.yes { background-color: var(--pink-deep); color: #fff; }   /* white on --pink was only ~4:1, this is ~6:1 */
.btn:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.dialog .btn:focus-visible { outline-color: var(--navy); }
#card:focus-visible { outline: 4px solid var(--yellow); outline-offset: 6px; }

/* Touch buttons (phones have no keyboard) */
.tools { display: flex; gap: 8px 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.tools .btn { font-size: .8rem; padding: 8px 12px; min-height: 44px; box-shadow: 0 4px 0 var(--navy), 0 8px 14px rgba(0,0,0,.35); }

/* Phones, and any touch device (including landscape): show buttons, hide the keyboard hint */
@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .tools { display: flex; }
  .footer-hint { display: none; }
}
@media (max-width: 760px) {
  .badges { margin-top: 8px; }
  .stage { padding-bottom: calc(14px + env(safe-area-inset-bottom)); padding-left: calc(4px + env(safe-area-inset-left)); padding-right: calc(4px + env(safe-area-inset-right)); }
  .card { --reserve: 270px; --cap: calc(100vw - 8px); --wmax: 520px; }
}
/* Very narrow phones: keep the three buttons on one row */
@media (max-width: 360px) {
  .tools { gap: 6px; }
  .tools .btn { font-size: .7rem; padding: 8px 9px; letter-spacing: .02em; }
}
/* Small portrait phones (iPhone SE and similar) */
@media (max-width: 760px) and (max-height: 640px) {
  h1 { font-size: 1.3rem; }
  .badges { margin-top: 4px; }
  :root { --peek: 52px; --tail: 52px; }
  .deal { gap: 8px; }
  .card { --reserve: 250px; }
}
/* Short screens, mostly landscape phones: card on the left, status and buttons on the right */
@media (max-height: 520px) {
  h1, .footer-hint { display: none; }
  .stage {
    display: grid; grid-template-columns: 1fr minmax(230px, 42%); grid-template-rows: auto 1fr auto auto;
    align-items: center; justify-items: center; column-gap: 16px; row-gap: 6px;
    padding: calc(8px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }
  header { grid-column: 2; grid-row: 1; }
  .badges { margin-top: 0; }
  main { grid-column: 1; grid-row: 1 / 5; height: 100%; }
  .line { grid-column: 2; grid-row: 3; width: 100%; margin-top: 0; }
  .tools { display: flex; grid-column: 2; grid-row: 4; margin-top: 4px; }   /* keyboard hint is hidden here, so mouse users get the buttons too */
  .stops { padding: 5px 18px; border-width: 3px; }
  .stop { width: 26px; height: 26px; border-width: 4px; }
  :root { --peek: 34px; --tail: 48px; }
  .deal { gap: 8px; }
  .card { --reserve: 90px; --cap: 62vw; --wmin: 150px; }
}
/* Last card of the round: unmissable */
.card.final { box-shadow: 0 0 0 6px var(--yellow), 0 0 28px 6px rgba(255,233,74,.7), 0 18px 40px rgba(0,0,0,.55); }
/* Pulse: a layer behind the card whose opacity animates (cheap), instead of animating box-shadow */
.stack.is-final::before {
  content: ''; position: absolute; inset: 0; border-radius: 18px; z-index: 0; pointer-events: none;
  box-shadow: 0 0 0 9px var(--yellow), 0 0 60px 20px rgba(255,233,74,.95);
  animation: pulse-layer 1s ease-in-out infinite;
}
.stack.is-final.has-held::before { transform: translateY(var(--drop)); }   /* follow the card when it sits lower for a Railroad Switch */
@keyframes pulse-layer { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
.sash {
  position: absolute; top: 24px; left: -50px; width: 200px; text-align: center; transform: rotate(-38deg);
  background: var(--yellow); color: var(--navy); border-top: 3px solid var(--navy); border-bottom: 3px solid var(--navy);
  padding: 3px 0; font-weight: 700; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0,0,0,.4); z-index: 5;
}

/* Past cards: turn numbers, latest highlighted */
.num {
  position: absolute; top: 6px; left: 6px; z-index: 5; width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff; border: 2px solid #fff; display: grid; place-items: center; font-weight: 700; font-size: .95rem;
}
.past-grid .card.latest { box-shadow: 0 0 0 4px var(--yellow), 0 0 22px 4px rgba(255,233,74,.8); }
/* in the grid the cards are small: shrink the turn badge */
.past-grid .num { width: 24px; height: 24px; top: 4px; left: 4px; font-size: .8rem; border-width: 2px; }

/* Visually hidden, still read by screen readers */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }


/* The table: click the pile and the cards still in the deck are laid out over the play area (desktop only) */
.table {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; gap: 14px; padding: 18px 22px; cursor: pointer;
  background: linear-gradient(rgba(20,25,74,.9), rgba(20,25,74,.9)), var(--back-art) 0 0 / 220px auto; border: 3px solid #fff; border-radius: 24px;
  box-shadow: inset 0 0 0 3px rgba(20,25,74,.9), inset 0 0 0 5px rgba(255,255,255,.35), 0 18px 50px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transform-origin: 30% 50%;
}
.table[hidden] { display: none; }
.table.open { animation: table-in .35s cubic-bezier(.2,.8,.2,1); }
.table.closing { animation: table-out .22s ease-in forwards; }
@keyframes table-in { from { opacity: 0; transform: scale(.9); } }
@keyframes table-out { to { opacity: 0; transform: scale(.94); } }
.table-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; color: var(--yellow); font-weight: 700; font-size: 1.3rem; letter-spacing: .1em; text-transform: uppercase; }
.table-hint { font-size: .8rem; font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--cream); opacity: .7; }
.table-grid { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-content: flex-start; padding: 6px; }
.table-grid .card { --w: clamp(150px, 14vw, 220px); cursor: pointer; pointer-events: none; box-shadow: 0 6px 14px rgba(0,0,0,.45);   /* a bit smaller than the drawn card, but far from tiny */
  animation: table-deal .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i) * 18ms + 120ms); }
/* each card slides in from the deck (or the discard pile) and settles */
.table.from-right { --from: 45vw; }
@keyframes table-deal { from { opacity: 0; transform: translate(var(--from, -45vw), 8vh) rotate(-14deg) scale(.6); } }
@media (max-width: 1150px) { .table { display: none !important; } }

/* Respect reduced-motion: no animation, keep static highlights */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.loading .stage, body.loading .footer-hint { animation: failsafe .01s 3s forwards !important; }   /* keep the failsafe */
  .stack.is-final::before { opacity: .55; }
  .stop.final::before { opacity: 1; }
}

.badges { align-items: center; }

/* Phones held upright: tall cards, like the London helper */
@media (max-width: 760px) and (orientation: portrait) {
  .card { --reserve: 300px; --cap: calc(100vw - 40px); --wmin: 150px; --wmax: 380px; aspect-ratio: 5 / 7; --w: clamp(var(--wmin), min(var(--cap), var(--wmax), calc((var(--vh) - var(--reserve)) / 1.4)), var(--wmax)); }
  :root { --peek: 56px; --drop: 30px; }
}
