/* SportGeo — old sports newspaper: yellowed newsprint, letterpress headlines
   (Alfa Slab One), typewriter text (Special Elite), burgundy ink, stadium tickets
   and rubber stamps. */
:root {
  --paper: #efe2c4;
  --paper-2: #e3d1aa;
  --card: #f5ead2;
  --ink: #231a14;
  --ink-2: #5e4a3a;
  --pencil: #b59c74;
  --burgundy: #7a1c2a;
  --burgundy-deep: #561320;
  --gold: #b8913f;
  --on-burgundy: #f5ead2;

  /* Answer bands, from bullseye to way off: faded printing inks */
  --t4: #3b6e48;
  --t3: #a2771c;
  --t2: #b45a2a;
  --t1: #7a1c2a;

  /* Map: sepia satellite print, with a nautical chart underneath as a fallback */
  --ocean: #a39882;
  --land: #e6d6b0;
  --land-border: #8a7458;
  --graticule: rgba(35, 26, 20, .1);
  --sat-border: rgba(245, 234, 210, .6);
  --target: var(--burgundy);
  --guess: var(--ink);

  /* Names kept from the old theme, used across the stylesheet and by game.js */
  --bg: var(--card);
  --text: var(--ink);
  --muted: var(--ink-2);
  --faint: #93806a;
  --line: rgba(35, 26, 20, .2);
  --line-strong: rgba(35, 26, 20, .38);
  --elev: var(--paper-2);
  --volt: var(--burgundy);
  --volt-ink: var(--on-burgundy);

  --display: "Alfa Slab One", Rockwell, "Courier New", serif;
  --ui: "Special Elite", "Courier New", Courier, monospace;
  --serif: Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Newsprint: fine grain, a few foxing stains, edges browned by age */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .13 0 0 0 0 .07 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --stains:
    radial-gradient(circle at 14% 22%, rgba(150, 100, 40, .12), transparent 22%),
    radial-gradient(circle at 88% 74%, rgba(150, 100, 40, .14), transparent 26%),
    radial-gradient(circle at 63% 8%, rgba(120, 80, 30, .08), transparent 18%),
    radial-gradient(circle at 30% 92%, rgba(120, 80, 30, .09), transparent 20%);
  --aged: inset 0 0 60px rgba(120, 80, 30, .22), inset 0 0 6px rgba(120, 80, 30, .25);
  --lift: 0 2px 3px rgba(40, 25, 10, .25), 0 12px 30px -6px rgba(40, 25, 10, .45);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--grain), var(--paper);
  color: var(--text);
  font-family: var(--ui);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px dotted var(--burgundy); outline-offset: 3px; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }

/* A sheet of old newsprint: grain, stains, browned edges, a thin printed double frame. */
.panel, .modal, .title-card, .play-card {
  border: 1px solid rgba(35, 26, 20, .55);
  border-radius: 2px;
  background: var(--grain), var(--stains), var(--card);
  box-shadow: var(--aged), var(--lift);
  outline: 3px double rgba(35, 26, 20, .5);
  outline-offset: -9px;
}

/* ── Top bar ─────────────────────────────────────────── */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1100;
  height: 56px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grain), var(--paper);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 2px 0 var(--paper), 0 3px 0 var(--ink), 0 8px 18px -8px rgba(40, 25, 10, .5);   /* thick-thin rule */
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { width: 16px; height: 22px; color: var(--burgundy); }
.brand-word { font-family: var(--display); font-size: 20px; letter-spacing: .5px; }
.brand-word b { font-weight: 400; color: var(--burgundy); }

.topbar-actions { display: flex; gap: 8px; }
.ghost-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 2.75px rgba(35, 26, 20, .45);
  transition: background .15s;
}
.ghost-btn:hover { background: var(--paper-2); }
.ghost-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lang-btn { font-family: var(--display); font-size: 12px; letter-spacing: .5px; }

/* ── Map ─────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  background: var(--ocean);
  cursor: crosshair;
}
.leaflet-container { font-family: var(--ui); background: var(--ocean); }
/* Print the satellite imagery like an old sepia photograph.
   (On the images themselves: a filter on the tile pane isn't always composited.) */
.leaflet-tile-pane img { filter: sepia(.75) saturate(.6) contrast(.7) brightness(1.15); }
/* Newsprint grain and browned, burnt-in corners over the whole map. */
#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 420;
  pointer-events: none;
  background: var(--grain), radial-gradient(ellipse at center, rgba(239, 226, 196, 0) 50%, rgba(90, 55, 20, .45) 100%);
}
.map-locked { cursor: grab !important; }
.leaflet-control-zoom { border: 0 !important; margin-top: 72px !important; display: flex; flex-direction: column; gap: 6px; }
.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 31px !important;
  border: 1.5px solid var(--ink) !important;
  border-radius: 50% !important;
  background: var(--card) !important;
  color: var(--ink) !important;
  font-family: var(--display);
  font-size: 18px !important;
  box-shadow: 0 2px 4px rgba(40, 25, 10, .35);
}
.leaflet-control-zoom a:hover { background: var(--paper-2) !important; }
.leaflet-control-attribution {
  background: rgba(239, 226, 196, .85) !important;
  color: var(--ink-2) !important;
  font-family: var(--ui);
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* Pins */
.pin {
  position: relative;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--card);
  box-shadow: 0 0 0 1.5px var(--ink), 0 2px 4px rgba(0, 0, 0, .45);
  animation: pin-drop .35s var(--ease) both;
}
.pin.guess { background: var(--guess); }
.pin.target { background: var(--target); }
.pin.target::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  border: 2px solid var(--target);
  animation: ping 1.6s ease-out infinite;
}
.country-label { pointer-events: none; }
.country-label span {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--card);
  text-shadow: 0 0 2px var(--ink), 0 0 2px var(--ink), 0 1px 3px rgba(0, 0, 0, .8);
  white-space: nowrap;
}
.pin-label {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 12px;
  color: var(--card);
  background: var(--ink);
  border-radius: 2px;
  padding: 0 6px;
  line-height: 18px;
}
@keyframes pin-drop { from { transform: translateY(-14px) scale(.6); opacity: 0; } }

/* A locked-in pin becomes its sport's emoji (toned to the old print), then moves like it. */
.sport-pin { width: 36px; height: 36px; display: grid; place-items: center; }
.sport-pin span {
  font-size: 27px;
  line-height: 1;
  filter: sepia(.35) saturate(.9) drop-shadow(0 2px 1px rgba(0, 0, 0, .6));
  animation: morph .55s var(--ease) both;
}
.sport-pin.m-bounce span { animation: morph .55s var(--ease) both, bounce 2.2s ease-out .6s infinite; }
.sport-pin.m-ride span { animation: morph .55s var(--ease) both, ride 1.6s ease-in-out .6s infinite; }
.sport-pin.m-spin span { animation: morph .55s var(--ease) both, spin 3s ease-in-out .6s infinite; }
.sport-pin.m-pop span { animation: morph .55s var(--ease) both, pop 2s ease-in-out .6s infinite; }
.sport-pin.still span { font-size: 22px; animation: none; }
@keyframes morph { 0% { transform: scale(.2) rotate(-120deg); opacity: 0; } 60% { transform: scale(1.3) rotate(10deg); opacity: 1; } 100% { transform: none; } }
@keyframes bounce {
  0%, 45%, 100% { transform: translateY(0); }
  15% { transform: translateY(-16px) rotate(-10deg); }
  27% { transform: translateY(0) scale(1.12, .88); }
  35% { transform: translateY(-6px); }
}
@keyframes ride { 0%, 100% { transform: translateX(-3px) rotate(-5deg); } 50% { transform: translateX(3px) rotate(5deg); } }
@keyframes spin { 0%, 55% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
@keyframes pop { 0%, 65%, 100% { transform: scale(1); } 78% { transform: scale(1.22); } 90% { transform: scale(.94); } }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

/* Dashed like a route drawn on an old chart */
.route { stroke: var(--card); stroke-width: 2.5; stroke-dasharray: 8 6; stroke-linecap: butt; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .7)); }

/* ── Intro / start screen: the front page ───────────── */
.intro {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 80px 16px 28px;
  overflow-y: auto;
  background: radial-gradient(ellipse at center, rgba(239, 226, 196, .45), rgba(90, 55, 20, .35));
  transition: opacity .45s var(--ease), visibility .45s;
}
body:not(.is-intro) .intro { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-inner { width: min(620px, 100%); margin: auto 0; display: flex; flex-direction: column; gap: 18px; }

.title-card { padding: 22px 28px 24px; text-align: center; transform: rotate(-.4deg); }

/* Issue · date · price, between a thick and a thin rule */
.dateline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 5px 2px 4px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink-2);
}
.dateline span:nth-child(2) { color: var(--ink); }

.hero {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 13vw, 92px);
  line-height: 1;
  letter-spacing: 1px;
  color: var(--ink);
  text-shadow: 0 0 1px rgba(35, 26, 20, .7);   /* ink spreading into the paper */
}
/* Masthead with an "ear" on each side, like the boxes beside an old paper's title */
.masthead {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.masthead .hero { margin: 0; font-size: clamp(36px, 9vw, 74px); }
.ear {
  padding: 6px 2px 4px;
  border: 1px solid var(--ink);
  outline: 1px solid var(--ink);
  outline-offset: 2px;
  perspective: 200px;
}
.ear-emoji {
  display: block;
  font-size: 36px;
  line-height: 1.15;
  filter: sepia(.25) drop-shadow(0 1px 1px rgba(0, 0, 0, .35));
}
.ear-emoji.flip { animation: ear-flip .45s var(--ease); }
@keyframes ear-flip { from { transform: rotateY(90deg); opacity: 0; } }
.ear small {
  display: block;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid var(--line-strong);
  font-size: 10px;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-2);
}
.tagline {
  margin: 2px 0 0;
  padding-bottom: 8px;
  border-bottom: 4px double var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-2);
}
/* Weekend special edition: a burgundy banner under the masthead */
.special {
  margin: 12px auto 0;
  padding: 6px 14px 5px;
  background: var(--burgundy);
  color: var(--on-burgundy);
  outline: 1px solid rgba(245, 234, 210, .7);
  outline-offset: -4px;
  transform: rotate(-1deg);
}
.special span { display: block; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: .85; }
.special b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold); }
.hero-sub {
  margin: 14px 0 0;
  font-family: var(--display);
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--burgundy);
}
/* Body copy in two newspaper columns, opening with a drop cap */
.lede {
  margin: 10px 0 0;
  columns: 2;
  column-gap: 22px;
  column-rule: 1px solid var(--line-strong);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}
.lede::first-letter {
  float: left;
  margin: 3px 6px 0 0;
  font-family: var(--display);
  font-size: 42px;
  line-height: .8;
  color: var(--burgundy);
}

/* Box office: the five rounds as stadium tickets and the big button */
.play-card { padding: 20px 22px 22px; }
.lineup {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;   /* tickets grow upwards like a staircase */
  gap: 10px;
  filter: drop-shadow(0 2px 2px rgba(40, 25, 10, .35));
}
.lineup li {
  --notch: calc(28px + var(--step) * 7px);   /* where the stub tears off */
  position: relative;
  background: var(--grain), var(--paper);
  text-align: center;
  /* half-circle notches on both sides at the perforation */
  -webkit-mask: radial-gradient(circle 6px at 0 var(--notch), transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 6px at 100% var(--notch), transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 6px at 0 var(--notch), transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 6px at 100% var(--notch), transparent 98%, #000) right / 51% 100% no-repeat;
}
.lineup .l-round {
  height: var(--notch);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: .4em;
  padding-bottom: 5px;
  background: var(--lvl);
  color: var(--card);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.lineup .l-stars {
  display: block;
  padding-top: 7px;
  border-top: 2px dashed rgba(35, 26, 20, .45);   /* perforation */
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--lvl);
}
.lineup .l-mult { display: block; margin-top: 3px; font-size: 24px; line-height: 1; color: var(--lvl); white-space: nowrap; }
.lineup .l-max { display: block; margin: 4px 0 9px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.lineup li.done { opacity: .5; }
.lineup li.done .l-round::after { content: " ✓"; }

.cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 20px;
  border: 1px solid var(--burgundy-deep);
  border-radius: 3px;
  background: var(--burgundy);
  color: var(--on-burgundy);
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 2px;
  text-transform: uppercase;
  outline: 1.5px solid rgba(245, 234, 210, .7);
  outline-offset: -7px;
  box-shadow: 0 3px 0 var(--burgundy-deep), 0 8px 18px -6px rgba(40, 25, 10, .55);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.cta:hover { background: var(--burgundy-deep); }
.cta:active { transform: translateY(3px); box-shadow: 0 0 0 var(--burgundy-deep), 0 4px 10px -6px rgba(40, 25, 10, .55); }
.cta kbd { font-family: var(--ui); font-size: 13px; padding: 1px 6px; border: 1px solid rgba(245, 234, 210, .7); border-radius: 2px; }
.intro-meta { margin: 14px 0 0; font-size: 13px; text-align: center; color: var(--ink-2); }
.intro-meta b { color: var(--burgundy); font-weight: 400; }

/* Streak: a flame that grows with the streak, and the freezes in hand */
.streak {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px dashed var(--pencil);
}
.streak .flame {
  flex: 0 0 auto;
  font-size: calc(30px + var(--heat, 0) * 0.7px);
  line-height: 1;
  filter: sepia(.25) drop-shadow(0 2px 2px rgba(122, 28, 42, .35));
  transform-origin: 50% 90%;
  animation: flicker 2.4s ease-in-out infinite;
}
.streak.cold .flame { filter: grayscale(1); opacity: .35; animation: none; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06, 1.1) rotate(2deg); } }
.streak-text { flex: 1; min-width: 0; text-align: left; }
.streak-text b { display: block; font-family: var(--display); font-weight: 400; font-size: 20px; line-height: 1.1; color: var(--burgundy); }
.streak.cold .streak-text b { font-size: 16px; color: var(--ink); }
.streak-text small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.freezes { flex: 0 0 auto; font-size: 22px; letter-spacing: 2px; cursor: help; filter: sepia(.3); }
.streak-line { margin: -6px 0 14px; font-size: 14px; line-height: 1.5; color: var(--ink); }
.streak-line b { font-weight: 400; color: var(--burgundy); }

/* ── Question / answer card ─────────────────────────── */
.panel {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: calc(18px + var(--safe-b));
  width: min(620px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 20px 22px 22px;
  transition: transform .45s var(--ease), opacity .3s;
}
.panel.hidden, body.is-intro .panel { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }

/* Scorecard: one box per round */
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 12px; }
.progress span { height: 9px; border: 1px solid var(--ink); background: transparent; transition: background .3s; }
.progress span.current { background: repeating-linear-gradient(45deg, var(--ink) 0 1.5px, transparent 1.5px 5px); }
.progress span.s4 { background: var(--t4); }
.progress span.s3 { background: var(--t3); }
.progress span.s2 { background: var(--t2); }
.progress span.s1 { background: var(--t1); }

/* Timer: a ruler that empties, with the clock beside it */
.timer { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.timer[hidden] { display: none; }
.timer-track {
  flex: 1;
  height: 10px;
  border: 1px solid var(--ink);
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(35, 26, 20, .4) calc(10% - 1px) 10%);
  overflow: hidden;
}
.timer-fill { height: 100%; width: 100%; background: var(--burgundy); transition: width .25s linear; }
.timer-text { min-width: 48px; font-family: var(--display); font-size: 16px; text-align: right; color: var(--ink); }
.panel.hurry .timer-fill { background: var(--t2); }
.panel.hurry .timer-text { color: var(--burgundy); animation: hurry 1s steps(2) infinite; }
@keyframes hurry { 50% { opacity: .35; } }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  padding: 1px 7px 0;
  border: 1px solid var(--ink);
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ink);
}
.tag.practice { background: var(--gold); }
.round-wrap { display: flex; align-items: center; flex-shrink: 0; }
/* Rubber stamp in the card's corner, inked in the round's colour */
.mult-badge {
  position: absolute;
  top: -40px;
  right: -14px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 3px double var(--lvl);
  border-radius: 50%;
  background: rgba(245, 234, 210, .92);
  color: var(--lvl);
  font-size: 18px;
  line-height: 1;
  transform: rotate(-12deg);
  box-shadow: 0 0 0 2px rgba(245, 234, 210, .92), 0 3px 8px rgba(40, 25, 10, .35);
  opacity: .95;
}
.round { font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); }
.round b { font-weight: 400; color: var(--ink); }

.question {
  margin: 0 0 14px;
  font-size: 20px;
  line-height: 1.32;
  text-wrap: pretty;
}

/* Hint button beside the confirm button, and what the hint gave away */
.ask-actions { display: flex; gap: 8px; }
.ask-actions .btn.primary { flex: 1; }
.btn.hint-btn { width: auto; flex: 0 0 auto; padding: 12px 14px; font-size: 13px; letter-spacing: .5px; white-space: nowrap; }
.btn.hint-btn[hidden] { display: none; }
.hint-text {
  margin: -6px 0 12px;
  padding: 6px 10px;
  border: 1px dashed var(--gold);
  background: rgba(184, 145, 63, .1);
  font-size: 14px;
  line-height: 1.4;
}
.hint-text b { font-weight: 400; color: var(--burgundy); }

.reveal-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.verdict-label {
  margin: 0 0 3px;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tier);
}
.answer { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.1; }
.answer small { font-family: var(--ui); font-size: 15px; color: var(--ink-2); }
.reveal-points { text-align: right; white-space: nowrap; color: var(--tier); }
.reveal-points .num { font-size: 48px; line-height: .9; }
.reveal-points small { margin-left: 4px; font-size: 13px; color: var(--ink-2); }

.meter { height: 9px; margin: 12px 0 6px; border: 1px solid var(--ink); overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--tier); transition: width .9s var(--ease); }
.reveal-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.reveal-meta b { font-weight: 400; color: var(--ink); font-size: 16px; }

.fact {
  margin: 12px 0 14px;
  padding: 2px 0 2px 14px;
  border-left: 4px double var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
}

/* Context: an old photo pinned beside a few lines about the place */
.context { display: flex; gap: 12px; align-items: flex-start; margin: -4px 0 14px; }
.context[hidden] { display: none; }
.context img {
  flex: 0 0 auto;
  width: 74px;
  height: 74px;
  object-fit: cover;
  border: 4px solid var(--card);
  box-shadow: 0 0 0 1px var(--line-strong), 0 3px 6px rgba(40, 25, 10, .35);
  filter: sepia(.75) contrast(.9) brightness(1.05);
  transform: rotate(-3deg);
}
.context div { min-width: 0; }
.context b { display: block; font-family: var(--display); font-weight: 400; font-size: 13px; color: var(--ink); }
.context p {
  margin: 2px 0 3px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.context a { font-size: 12px; color: var(--burgundy); }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: 3px;
  padding: 12px 18px;
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 0 rgba(35, 26, 20, .45);
  transition: transform .1s, box-shadow .1s, background .15s, color .15s;
}
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.btn.primary { background: var(--burgundy); border-color: var(--burgundy-deep); color: var(--on-burgundy); outline: 1px solid rgba(245, 234, 210, .6); outline-offset: -5px; box-shadow: 0 2px 0 var(--burgundy-deep); }
.btn.primary:not(:disabled):hover { background: var(--burgundy-deep); }
.btn.primary:disabled { background: transparent; color: var(--ink-2); cursor: default; border: 1.5px dashed var(--ink-2); outline: 0; box-shadow: none; font-family: var(--ui); font-size: 15px; text-transform: none; letter-spacing: .5px; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(35, 26, 20, .06); }
.btn.small { width: auto; padding: 7px 12px; font-size: 13px; }
.btn.big { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.floating {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  width: auto;
  transform: translateX(-50%);
  padding: 12px 24px;
  box-shadow: 0 2px 0 var(--burgundy-deep), 0 10px 22px -6px rgba(40, 25, 10, .6);
}
.btn.floating:active { transform: translate(-50%, 2px); }

/* ── Modals ──────────────────────────────────────────── */
.modal {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100% - 40px);
  padding: 26px 24px 22px;
  color: var(--text);
}
.modal[open] { animation: modal-in .3s var(--ease); }
.modal::backdrop { background: radial-gradient(ellipse at center, rgba(35, 26, 20, .35), rgba(35, 26, 20, .7)); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) rotate(-.6deg); } }
.modal-kicker {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--burgundy);
}
.modal h2 {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 4px double var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
}
.modal h3 {
  margin: 22px 0 10px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink);
}

.close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
}
.close:hover { background: var(--paper-2); }
.close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

.steps { list-style: none; margin: 0 0 16px; padding: 0; }
.steps li { display: flex; gap: 14px; padding: 11px 0; border-top: 1px dashed var(--pencil); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps p { margin: 0; line-height: 1.45; font-size: 15px; color: var(--ink); }
.steps b { font-weight: 400; color: var(--burgundy); }
.step-n { flex: 0 0 34px; font-family: var(--display); font-size: 24px; line-height: 1; color: var(--burgundy); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 18px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sq { display: inline-block; width: 11px; height: 11px; border: 1px solid var(--ink); }
.sq.t4 { background: var(--t4); } .sq.t3 { background: var(--t3); } .sq.t2 { background: var(--t2); } .sq.t1 { background: var(--t1); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 10px 8px; border: 1px solid var(--ink); }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1; }
.stat small { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-2); line-height: 1.2; }
.stat.wide { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.stat.wide small { margin: 0; font-size: 14px; }
.stat.wide b { font-size: 24px; color: var(--burgundy); }

.dist { display: flex; flex-direction: column; gap: 5px; }
.dist-row { display: grid; grid-template-columns: 86px 1fr; align-items: center; gap: 10px; font-size: 13px; }
.dist-row > span { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dist-bar {
  min-width: 28px;
  padding: 1px 8px 0;
  border: 1px solid var(--ink);
  background: rgba(35, 26, 20, .06);
  text-align: right;
  font-family: var(--display);
  font-size: 13px;
}
.dist-bar.today { background: var(--burgundy); color: var(--on-burgundy); }

/* Profile */
.modal.profile { width: min(540px, calc(100% - 28px)); overflow-y: auto; }
.muted { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.highlights .muted { grid-column: 1 / -1; margin: 6px 0 0; }
.highlight { padding: 10px 12px; border: 1px solid var(--ink); display: flex; flex-direction: column; gap: 3px; }
.highlight small { font-size: 11px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 1px; }
.highlight b { font-size: 16px; font-weight: 400; text-transform: capitalize; }
.highlight .num { font-size: 22px; color: var(--burgundy); line-height: 1; }
.meter-list { display: flex; flex-direction: column; gap: 7px; }
.meter-row { display: grid; grid-template-columns: 136px 1fr 50px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.mr-label { font-size: 14px; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-bar { height: 9px; border: 1px solid var(--ink); overflow: hidden; }
.mr-bar span { display: block; height: 100%; }
.mr-value { text-align: right; font-size: 14px; }
.mr-sub { grid-column: 1; font-size: 11px; color: var(--faint); }
.more { margin-top: 8px; }
.more summary { cursor: pointer; font-size: 14px; color: var(--burgundy); padding: 4px 0; }
.more .meter-list { margin-top: 8px; }
.profile-map { height: 220px; overflow: hidden; border: 1px solid var(--ink); background: var(--ocean); }
.h3-count { color: var(--ink-2); }
.badges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.badge-card { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px dashed var(--pencil); opacity: .6; }
.badge-card.unlocked { opacity: 1; border: 1px solid var(--ink); }
.badge-card svg { flex: 0 0 34px; width: 34px; height: 34px; padding: 6px; border-radius: 50%; border: 1px solid var(--pencil); fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.badge-card.unlocked svg { border: 3px double var(--burgundy); stroke: var(--burgundy); transform: rotate(-8deg); }
.badge-card b { display: block; font-size: 14px; font-weight: 400; }
.badge-card small { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.25; }

/* Sports passport */
.passport-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px auto 0;
  padding: 7px 14px;
  border: 1.5px solid var(--burgundy);
  border-radius: 3px;
  background: transparent;
  color: var(--burgundy);
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: background .15s;
}
.passport-btn { position: relative; }
.passport-btn:hover { background: rgba(122, 28, 42, .07); }
/* "New" tag pinned to the button's corner while there are unseen stamps */
.passport-new {
  position: absolute;
  top: -13px;
  right: -12px;
  padding: 2px 7px 1px;
  border-radius: 2px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: 1px;
  box-shadow: 0 2px 4px rgba(40, 25, 10, .4);
  transform: rotate(8deg);
  animation: nudge 2.4s ease-in-out infinite;
}
.passport-new[hidden] { display: none; }
@keyframes nudge { 0%, 80%, 100% { transform: rotate(8deg) scale(1); } 88% { transform: rotate(-4deg) scale(1.15); } }
.round-stamp {
  margin: 10px 0 0;
  padding: 6px 10px;
  border: 1.5px dashed var(--burgundy);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.round-stamp b { font-weight: 400; color: var(--burgundy); }
.passport-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.passport-count { padding: 1px 6px 0; border-radius: 2px; background: var(--burgundy); color: var(--on-burgundy); font-size: 12px; letter-spacing: .5px; }

.modal.passport { width: min(540px, calc(100% - 28px)); overflow-y: auto; }
.passport-cover {
  margin: -6px 0 6px;
  padding: 16px 14px 14px;
  border-radius: 4px;
  background: var(--grain), var(--burgundy);
  text-align: center;
  color: var(--gold);
  box-shadow: inset 0 0 0 4px var(--burgundy), inset 0 0 0 5px var(--gold), inset 0 0 30px rgba(0, 0, 0, .35);
}
.passport-emblem { display: block; font-size: 34px; line-height: 1; filter: sepia(.6) saturate(1.4) hue-rotate(-10deg) drop-shadow(0 1px 0 rgba(0, 0, 0, .4)); }
.passport-title { margin: 6px 0 0; font-family: var(--display); font-size: 26px; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.passport-sub { margin: 4px 0 0; font-size: 12px; letter-spacing: 1px; color: rgba(245, 234, 210, .8); }

/* Stamps: rubber-stamp seals, each with its own ink and tilt */
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px 10px; }
.stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 78px;
  padding: 8px 4px 6px;
  border: 2.5px double var(--stamp);
  border-radius: 10px;
  color: var(--stamp);
  text-align: center;
  transform: rotate(var(--tilt));
  opacity: .9;
}
.stamp:nth-child(3n) { border-radius: 50%; }
.stamp-icon { font-size: 26px; line-height: 1; filter: sepia(.3); }
.stamp-name { font-size: 11px; line-height: 1.1; letter-spacing: .5px; text-transform: uppercase; overflow-wrap: anywhere; }
.passport-map {
  height: 190px;
  margin-top: 14px;
  border: 1px solid var(--ink);
  background: var(--ocean);
  box-shadow: inset 0 0 30px rgba(90, 55, 20, .35);
}

/* Collections: a ticket-like row per themed set, pips for each question nailed */
.collections { display: flex; flex-direction: column; gap: 8px; }
.collection {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--pencil);
}
.collection.complete { border: 3px double var(--gold); background: rgba(184, 145, 63, .1); }
.collection-icon { font-size: 24px; filter: sepia(.3); }
.collection:not(.complete) .collection-icon { opacity: .55; }
.collection-text { flex: 1; min-width: 0; }
.collection-text b { display: block; font-family: var(--display); font-weight: 400; font-size: 14px; }
.collection-text small { display: block; font-size: 11.5px; color: var(--ink-2); }
.pips { display: flex; gap: 4px; margin-top: 5px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--ink-2); }
.pips i.on { background: var(--burgundy); border-color: var(--burgundy); }
.collection-count { font-family: var(--display); font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.collection.complete .collection-count { color: var(--gold); transform: rotate(-6deg); }
.stamp-line { padding-top: 8px; border-top: 1px dashed var(--pencil); }
.wallpaper-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px 3px;
  border: 1px solid var(--burgundy);
  border-radius: 2px;
  background: var(--burgundy);
  color: var(--on-burgundy);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .5px;
}
.wallpaper-btn:disabled { opacity: .6; cursor: progress; }

.passport-rule { margin: 18px 0 0; padding-top: 10px; border-top: 1px dashed var(--pencil); font-size: 12px; line-height: 1.4; color: var(--ink-2); }

/* Results */
.results .final { display: flex; align-items: baseline; gap: 8px; }
.final-score { font-size: 76px; line-height: .9; color: var(--burgundy); }
.final-max { font-size: 22px; color: var(--faint); }
.final-verdict { margin: 10px 0 14px; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.3; color: var(--ink); }
.tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 12px; }
.tiers span { height: 10px; border: 1px solid var(--ink); transform-origin: left; animation: grow .5s var(--ease) both; }
.tiers span:nth-child(2) { animation-delay: .08s; } .tiers span:nth-child(3) { animation-delay: .16s; }
.tiers span:nth-child(4) { animation-delay: .24s; } .tiers span:nth-child(5) { animation-delay: .32s; }
@keyframes grow { from { transform: scaleX(0); } }
.tiers .s4 { background: var(--t4); } .tiers .s3 { background: var(--t3); } .tiers .s2 { background: var(--t2); } .tiers .s1 { background: var(--t1); }

.recap { list-style: none; margin: 0 0 16px; padding: 0; }
.recap li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--pencil);
}
.recap .r-n { font-family: var(--display); font-size: 14px; color: var(--faint); }
.recap .r-place { min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap .r-sub { display: block; font-size: 12px; color: var(--ink-2); }
.recap .r-pts { font-family: var(--display); font-size: 20px; }
.recap .r-pts.s4 { color: var(--t4); } .recap .r-pts.s3 { color: var(--t3); } .recap .r-pts.s2 { color: var(--t2); } .recap .r-pts.s1 { color: var(--t1); }

.results-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 4px double var(--ink);
}
.results-foot small { font-size: 12px; color: var(--ink-2); }
.countdown { font-size: 26px; line-height: 1; }
.foot-actions { display: flex; gap: 8px; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 560px) {
  html, body { font-size: 15px; }
  .topbar { height: 52px; padding: 0 10px; }
  .brand-word { font-size: 18px; }
  .ghost-btn { width: 33px; height: 33px; }
  .intro { padding: 66px 10px calc(14px + var(--safe-b)); }
  .intro-inner { gap: 14px; }
  .title-card { padding: 18px 16px 18px; outline-offset: -7px; }
  /* On phones the ears become round stickers on the card's top corners */
  .masthead { grid-template-columns: 1fr; }
  .ear {
    position: absolute;
    top: -26px;
    width: 46px;
    height: 46px;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    outline: 0;
    background: var(--card);
    box-shadow: inset 0 0 0 2px var(--card), inset 0 0 0 3px var(--ink), 0 3px 6px rgba(40, 25, 10, .35);
  }
  .ear:first-child { left: -6px; transform: rotate(-10deg); }
  .ear:last-child { right: -6px; transform: rotate(10deg); }
  .ear small { display: none; }
  .ear-emoji { font-size: 24px; }
  .dateline { font-size: 10px; letter-spacing: .5px; }
  .dateline span:last-child { display: none; }
  .tagline { font-size: 15px; }
  .lede { columns: 1; font-size: 14px; }
  .play-card { padding: 16px 14px 16px; outline-offset: -7px; }
  .lineup { gap: 6px; margin-bottom: 16px; }
  .lineup li { --notch: calc(24px + var(--step) * 6px); }
  .lineup .l-word { display: none; }   /* just the round number on phones */
  .lineup .l-round { font-family: var(--display); font-size: 14px; }
  .lineup .l-stars { font-size: 8px; letter-spacing: 0; }
  .lineup .l-mult { font-size: 18px; }
  .lineup .l-max { font-size: 10px; }
  .cta { font-size: 18px; padding: 14px; }
  .cta kbd { display: none; }
  .panel { bottom: 0; width: 100%; border-width: 1px 0 0; outline-offset: -7px; padding: 18px 16px calc(16px + var(--safe-b)); }
  .mult-badge { width: 56px; height: 56px; font-size: 16px; top: -44px; right: 10px; }
  .question { font-size: 18px; }
  .btn.hint-btn { padding: 10px; font-size: 12px; letter-spacing: 0; }
  .ask-actions .btn.primary:disabled { padding: 10px 8px; font-size: 13px; letter-spacing: 0; }
  .answer { font-size: 19px; }
  .reveal-points .num { font-size: 40px; }
  .final-score { font-size: 62px; }
  .results-foot { flex-direction: column; align-items: stretch; }
  .foot-actions .btn { flex: 1; }
  .leaflet-control-zoom { display: none; }
  .meter-row { grid-template-columns: 110px 1fr 44px; }
  .badges { grid-template-columns: minmax(0, 1fr); }
  .stat b { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
