:root {
  --bg: #F5F2EB;
  --surface: #FFFFFF;
  --surface-2: #FAF8F3;
  --ink: #1F1D1A;
  --ink-2: #5B574F;
  --ink-3: #6E6A62; /* 4.5:1+ on cream and white (WCAG AA small text) */
  --line: rgba(31, 29, 26, .10);
  --line-2: rgba(31, 29, 26, .22);
  --accent: #C8402F;
  --good: #277953; /* 4.5:1+ on cream and white */
  --bad: #C2553B;
  --card: #FFFDF8;
  --grid: rgba(47, 107, 200, .09); /* graph-paper lines on the statement card */
  --margin-red: rgba(200, 64, 47, .4);
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 16px;
  --ad-gap: 150px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
kbd { font: 500 11px var(--font-ui); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px var(--gutter);
  max-width: 1440px;
  margin: 0 auto;
}
/* Logo B (owner's pick, 15 Oct): "Stuff" packed as tiles in a little case, then "le".
   The tiles are decoration; the link's aria-label names the game. */
.logo { display: inline-flex; align-items: baseline; gap: 3px; text-decoration: none; white-space: nowrap; } /* "le" shares the tile letters' baseline */
.logo-case {
  position: relative; display: inline-flex; padding: 2px; margin-top: 7px;
  border: 2px solid #C98A4B; border-radius: 7px; background: #FBF6EA;
}
.logo-case::before { /* the handle */
  content: ""; position: absolute; left: 50%; top: -8px; width: 22px; height: 7px; transform: translateX(-50%);
  border: 2px solid #7A4E22; border-bottom: 0; border-radius: 5px 5px 0 0;
}
.logo-case i {
  display: grid; place-items: center; width: 17px; height: 23px; padding-bottom: 3px; box-sizing: border-box;
  border-radius: 3px; font: 600 21px/1 var(--font-display); font-style: normal; color: var(--ink);
}
.logo-case i:nth-child(1) { background: #F6D5CC; }
.logo-case i:nth-child(2) { background: #CDEAEC; width: 13px; }
.logo-case i:nth-child(3) { background: #F8E6BF; }
.logo-case i:nth-child(4) { background: #DCDDF6; width: 13px; }
.logo-case i:nth-child(5) { background: #CFEBDD; width: 13px; }
.logo-le { position: relative; top: .08em; font: 600 27px/1 var(--font-display); letter-spacing: -.01em; color: var(--ink); } /* a touch below the tiles' baseline */
/* Back to the Everythingle hub: its "le" tile, the same as the site icon. */
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-text { min-width: 0; }
.hub-link { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); text-decoration: none; }
.hub-back { width: 8px; height: 14px; transition: transform .15s; }
.hub-tile {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  padding-bottom: 3px;
  border-radius: 8px;
  background: #2AA0B0;
  color: #fff;
  font: 600 19px/1 var(--font-display);
  letter-spacing: -.03em;
  transition: background .15s;
}
.hub-link:hover { color: var(--ink); }
.hub-link:hover .hub-back { transform: translateX(-2px); }
.hub-link:hover .hub-tile { background: #23899A; }
.hub-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.issue { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; flex: none; align-items: center; gap: 16px; font-size: 13px; }
.nav a, .nav button { background: none; border: 0; padding: 4px 0; text-decoration: none; color: var(--ink); }
.nav a:hover, .nav button:hover { text-decoration: underline; text-underline-offset: 3px; }
.nav-help i {
  display: none;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line-2);
  font-style: normal; line-height: 24px; text-align: center;
}
.coffee-top { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); }
@media (max-width: 520px) {
  .nav { gap: 12px; }
  .brand { gap: 10px; }
  .issue { font-size: 10px; letter-spacing: .1em; }
  .issue-arch { display: none; }
  .nav-archive { display: none; } /* Archive stays on the results screen and in the footer */
  .nav-help span { display: none; }
  .nav-help i { display: inline-block; }
}

/* Ad spots: fixed size per screen width so the page never jumps */
.ad-band { display: flex; justify-content: center; padding: 8px var(--gutter); }
.ad-band--top { margin-bottom: 8px; }
.ad-band--bottom { margin: 40px 0; }
.ad-slot { flex: none; position: relative; max-width: 100%; }
.ad-slot ins { display: block; width: 100%; height: 100%; }
.ad-slot.is-placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  background: rgba(31, 29, 26, .035);
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ad-slot.is-placeholder::after { content: "Ad · " var(--ad-label); }

.ad-slot[data-spot="top"] { width: 320px; height: 100px; --ad-label: "320 × 100"; }
.ad-slot[data-spot="bottom"] { width: 300px; height: 250px; --ad-label: "300 × 250"; }
.ad-slot--inline { width: 300px; height: 250px; --ad-label: "300 × 250"; }
.ad-slot--rail { width: 160px; height: 600px; --ad-label: "160 × 600"; }
@media (min-width: 768px) {
  .ad-slot[data-spot="top"], .ad-slot[data-spot="bottom"] { width: 728px; height: 90px; --ad-label: "728 × 90"; }
}
@media (min-width: 1280px) {
  .ad-slot[data-spot="top"] { width: 970px; height: 90px; --ad-label: "970 × 90"; }
}
.ad-inline { display: flex; justify-content: center; padding: 0 var(--gutter); margin: 24px 0 8px; }
/* Live site: a spot without an AdSense id is hidden instead of leaving a gap (js/ads.js). */
.no-ad-top .ad-band--top, .no-ad-bottom .ad-band--bottom, .no-ad-middle .rail, .no-ad-middle .ad-inline { display: none; }

/* Stage: the game stays centred exactly as it is without ads. Side ads are desktop only: they sit in
   the free space either side of the game (760px wide at most), 150px+ from it and 24px+ from the
   screen edge, and appear only once both fit. Below that the same spot is one 300 x 250 box under the game. */
.stage { position: relative; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); --game-w: 760px; }
.rail { display: none; }
@media (min-width: 1280px) { .stage { padding: 0 24px; } }
@media (min-width: 1428px) {
  .rail { display: block; position: absolute; top: 0; bottom: 0; right: calc(50% + var(--game-w) / 2 + var(--ad-gap)); }
  .rail--right { right: auto; left: calc(50% + var(--game-w) / 2 + var(--ad-gap)); }
  .rail:not(.rail--right) .ad-slot { position: sticky; top: 24px; } /* at most one sticky ad per page */
  .ad-inline { display: none; }
}
@media (min-width: 1708px) {
  .ad-slot--rail { width: 300px; --ad-label: "300 × 600"; }
}

.game { min-width: 0; max-width: var(--game-w); margin: 0 auto; }

/* Today's trip: sits between the top ad and the bag, so the bag starts 150px+ below the ad */
.trip {
  margin-top: 8px; padding: 14px 16px 12px; border-radius: 18px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(31, 29, 26, .05), 0 18px 36px -26px rgba(31, 29, 26, .35);
}
.trip-top { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.trip-top span + span { letter-spacing: .04em; text-transform: none; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.trip-title { margin: 4px 0 10px; font: 600 26px/1.1 var(--font-display); letter-spacing: -.01em; }
.tag {
  display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 7px 10px 7px 9px;
  border-radius: 9px; background: #FBF3E4; border: 1px dashed #C98A4B;
  font-size: 14px; line-height: 1.35; color: #7A4E22;
}
.tag span { color: var(--ink); }
.tag svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.tag.broken { background: #FBE7E2; border-color: #C8402F; color: #B23A2A; }
.score-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.score b { font: 600 22px/1 var(--font-display); color: #9A6A12; margin-right: 2px; }
.musts { font-weight: 600; font-size: 13px; white-space: nowrap; }
.musts.ok { color: var(--good); }

/* Play area: phone = bag, message, buttons, then the pile in a sideways strip.
   900px+ = bag on the left, buttons and pile on the right. */
.play {
  margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center;
  grid-template-areas: "bag" "msg" "head" "tray" "ctrl";
}
.play[hidden] { display: none; }
/* The two columns only group things in the markup; the grid above places each part. */
.bag-col, .side-col { display: contents; }
.bag-wrap { grid-area: bag; }
.msg { grid-area: msg; }
.tray-head { grid-area: head; }
.tray { grid-area: tray; justify-self: stretch; }
.controls { grid-area: ctrl; }
.bag-wrap { display: flex; flex-direction: column; align-items: center; }
.bag-handle { display: block; width: 110px; height: 18px; fill: none; stroke: #7A4E22; stroke-width: 5.5; stroke-linecap: round; }
.bag-shell { padding: 12px; border-radius: 18px; background: #C98A4B; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .12), 0 12px 26px -16px rgba(31, 29, 26, .55); }
.bag {
  position: relative; border-radius: 6px;
  background-color: #FBF6EA;
  background-image: linear-gradient(rgba(31, 29, 26, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 29, 26, .07) 1px, transparent 1px);
  background-size: var(--cell, 52px) var(--cell, 52px);
  outline: 2px dashed transparent; outline-offset: 5px; transition: outline-color .15s;
}
.bag.holding { outline-color: rgba(31, 29, 26, .45); }
.piece, .ghost, .hover-ring { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.cell.filled { cursor: grab; } /* only over packed items */
.piece-img { position: absolute; pointer-events: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
/* Turning: the item swings a quarter turn into place; a ↻ marks what can be turned. */
.piece-wrap { position: absolute; inset: 0; pointer-events: none; }
.spin { animation: spin-in .32s cubic-bezier(.25, 1.35, .5, 1) both; }
@keyframes spin-in { from { transform: rotate(-90deg); } }
.turn-badge {
  position: absolute; z-index: 3; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(31, 29, 26, .3); opacity: 0; transition: opacity .15s; pointer-events: none;
}
.turn-badge svg { width: 12px; height: 12px; }
@media (hover: hover) { .bag:hover .turn-badge { opacity: .95; } }
body.dragging .turn-badge { opacity: 0 !important; }
.chip-turn {
  position: absolute; z-index: 2; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.chip-turn svg { width: 13px; height: 13px; }
.chip:hover .chip-turn { color: var(--ink); border-color: var(--ink-3); }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.cells { position: absolute; inset: 0; display: grid; }
.cell { padding: 0; margin: 0; border: 0; border-radius: 4px; background: transparent; cursor: default; touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
/* Dragging: the item follows the pointer above everything; the page doesn't select text meanwhile. */
.drag-float { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; filter: drop-shadow(0 10px 14px rgba(31, 29, 26, .3)); opacity: .92; }
.drag-float .piece, .drag-float .piece-img { position: absolute; }
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.cell:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.msg { margin: 12px 0 0; min-height: 20px; max-width: 420px; text-align: center; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.msg.warn { color: #B23A2A; }

.controls { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface);
  font: 600 14px/1 var(--font-ui); color: var(--ink);
}
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:disabled { opacity: .4; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn kbd { font-size: 10px; padding: 0 4px; }
.btn-main { background: var(--ink); border-color: var(--ink); color: #fff; padding: 0 20px; }
.btn-main:hover:not(:disabled) { background: #33302b; }
@media (pointer: coarse) { .btn kbd { display: none; } }

.tray-head { margin: 14px 0 6px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.tray {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
  margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px;
  scrollbar-width: thin;
}
.chip {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-width: 86px; height: 116px; padding: 8px 8px 7px;
  position: relative; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  -webkit-tap-highlight-color: transparent; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.chip:hover { border-color: var(--ink-3); }
.chip.held { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); background: #FFFDF8; }
.chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip-art { position: relative; display: block; margin: auto 0; }
.chip-name { font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip small { font-size: 11px; line-height: 1; white-space: nowrap; }
.must { color: #B23A2A; font-weight: 600; }
.stars { color: #9A6A12; letter-spacing: .04em; }

/* Phones: the bag and the pile both above the fold (the trip card keeps the bag 150px+ from the top ad). */
@media (max-width: 899px) {
  .trip { padding: 11px 14px 10px; }
  .trip-title { font-size: 22px; margin: 2px 0 8px; }
  .tag { font-size: 13px; padding: 6px 9px 6px 8px; }
  .score-row { margin-top: 8px; }
  .score b { font-size: 20px; }
  .play { margin-top: 8px; }
  .msg { min-height: 36px; margin-top: 8px; font-size: 13px; }
  .tray-head { display: none; }
  .tray { padding-top: 2px; }
  .chip { height: 104px; }
}
@media (min-width: 900px) {
  .trip { padding: 18px 22px 14px; }
  .trip-title { font-size: 32px; }
  /* Bag, message and buttons on the left; the pile fills the right. */
  .play {
    grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "bag head" "bag tray" "msg tray" "ctrl tray";
    column-gap: 28px; align-items: start; justify-items: stretch; margin-top: 18px;
  }
  .bag-wrap, .msg, .controls { justify-self: center; }
  .controls { margin-top: 4px; }
  .tray-head { text-align: left; margin-top: 0; }
  .tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .chip { min-width: 0; height: 104px; }
}

/* Results */
.bags { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
.bags figure { margin: 0; min-width: 0; }
.bags figcaption { font-size: 12px; font-weight: 600; margin-bottom: 6px; white-space: nowrap; }
.mini-shell { padding: 5px; border-radius: 10px; background: #C98A4B; width: fit-content; }
.mini-bag {
  position: relative; border-radius: 4px; background-color: #FBF6EA;
  background-image: linear-gradient(rgba(31, 29, 26, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 29, 26, .07) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
}
.tip { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: #FBF3E4; font-size: 14px; line-height: 1.45; }
.home-head { margin: 18px 0 4px; font: 600 18px/1.2 var(--font-display); }
.home { list-style: none; margin: 0 0 16px; padding: 0; }
.home li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.home img { flex: none; width: 40px; height: 28px; object-fit: contain; }
.home-name { font-weight: 600; }
.home .stars { font-size: 12px; }
.home-note { margin-left: auto; text-align: right; font-size: 13px; color: var(--ink-2); }
.home-note.miss { color: #B23A2A; }
.total strong { color: #9A6A12; }
.panel.is-done { max-width: 500px; margin: 0 auto; }

/* Panel */
.panel {
  width: 100%;
  background: var(--surface);
  border-radius: 22px;
  padding: 16px 16px 18px;
  box-shadow: 0 1px 2px rgba(31, 29, 26, .05), 0 24px 48px -28px rgba(31, 29, 26, .35);
}
.panel-loading { margin: 0; color: var(--ink-3); font-size: 14px; }
.panel-head { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }

.btn-primary {
  height: 48px; padding: 0 20px;
  border: 0; border-radius: 12px;
  background: var(--ink); color: #fff;
  font: 600 15px var(--font-ui);
}
.btn-primary:hover { background: #33302b; }
.btn-primary.wide { width: 100%; }
.btn-secondary {
  display: grid; place-items: center;
  height: 46px; margin-top: 10px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface); color: var(--ink);
  font: 600 15px var(--font-ui); text-decoration: none;
}
.btn-secondary.wide { width: 100%; }
.panel.is-done .btn-primary { margin-top: 4px; }
.btn-secondary:hover { border-color: var(--ink); }
.linkish { border: 0; background: none; padding: 4px 0; color: var(--ink-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* Results */
.total { margin: 14px 0 0; display: flex; align-items: baseline; gap: 8px; }
.total strong { font: 600 56px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.total span { color: var(--ink-3); font-size: 15px; }
.total-line { margin: 6px 0 0; font: italic 400 17px/1.4 var(--font-display); color: var(--ink-2); }
.results { list-style: none; margin: 14px 0 16px; padding: 0; }
.results li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.results li:last-child { border-bottom: 0; }
.results .dot { width: 12px; height: 12px; border-radius: 50%; }
.results .dot.right { background: var(--good); }
.results .dot.wrong { background: var(--bad); }
.r-main { display: grid; gap: 3px; }
.r-text { font: 400 15px/1.35 var(--font-display); color: var(--ink); }
.r-src { font-size: 12px; color: var(--ink-3); text-underline-offset: 2px; }
.r-ans { text-align: right; font-weight: 600; font-size: 14px; color: color-mix(in srgb, var(--c) 70%, #000); }
.r-ans small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); }
.results li { align-items: start; }
.results .dot { margin-top: 5px; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 0; text-align: center; }
.mini-stats div { padding: 10px 4px; border-radius: 12px; background: var(--surface-2); }
.mini-stats b { display: block; font: 600 20px var(--font-ui); }
.mini-stats span { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }
.next-in { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.next-in b { font-variant-numeric: tabular-nums; color: var(--ink); }
.coffee-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 11px 14px; border-radius: 12px;
  background: color-mix(in srgb, #E3A33A 18%, #fff);
  text-decoration: none; font-weight: 500; font-size: 14px;
}
.panel-links { display: flex; justify-content: center; gap: 18px; margin-top: 14px; font-size: 13px; }
.panel-links a { color: var(--ink-2); }
/* Stats is a button but sits on the line like the links next to it: same baseline, colour and underline. */
.panel-links { align-items: baseline; }
.panel-links a, .panel-links .linkish { color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.panel-links .linkish { padding: 0; font: inherit; line-height: inherit; cursor: pointer; }
.notice { margin: 14px 0 0; font-size: 15px; color: var(--ink-2); }

/* Text sections between game and lower ads */
.about { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); color: var(--ink-2); font-size: 15px; }
.about:first-of-type { margin-top: 96px; }
.about h2 { font: 400 24px/1.25 var(--font-display); color: var(--ink); margin: 0 0 8px; }
.about--scoring { margin-top: 40px; }
.about ul { margin: 0; padding-left: 20px; }
.credits { font-size: 12px; color: var(--ink-3); }
@media (min-width: 1280px) {
  .about:first-of-type { margin-top: 120px; }
}

.footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; padding: 0 var(--gutter) 40px; font-size: 13px; color: var(--ink-3); }
.footer a { color: var(--ink-2); }

/* Dialogs and toast */
.dialog {
  width: min(460px, calc(100vw - 32px));
  border: 0; border-radius: 22px; padding: 26px 24px 22px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(31, 29, 26, .5);
}
.dialog::backdrop { background: rgba(245, 242, 235, .72); backdrop-filter: blur(4px); }
.dialog h2 { font: 400 34px/1.1 var(--font-display); margin: 4px 0 14px; }
.dialog p, .dialog li { font-size: 15px; color: var(--ink-2); }
.dialog ul { padding-left: 20px; }
.dialog strong { color: var(--ink); }
.dialog .btn-primary { margin-top: 8px; }
.help-answers { list-style: none; padding: 0 !important; display: grid; gap: 6px; margin: 0 0 14px; }
.help-answers li { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px; }
.help-answers b {
  padding: 5px 0; border-radius: 9px; text-align: center;
  background: color-mix(in srgb, var(--c) 12%, #fff);
  border: 1.5px solid color-mix(in srgb, var(--c) 55%, #fff);
  color: color-mix(in srgb, var(--c) 62%, #000);
  font: 600 15px var(--font-display);
}
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); }
.dialog-close { position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; font-size: 22px; color: var(--ink-3); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-bottom: 18px; }
.stat-grid b { display: block; font: 600 24px var(--font-ui); }
.stat-grid span { font-size: 11px; color: var(--ink-3); }
.hist { display: grid; gap: 6px; }
.hist div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); }
.hist i { display: block; height: 20px; min-width: 22px; border-radius: 6px; background: var(--ink-3); color: #fff; font-style: normal; font-size: 11px; line-height: 20px; padding: 0 7px; text-align: right; font-weight: 600; }
.hist i.top { background: var(--good); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 14px;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Phones: the Next button sits at the bottom of the screen after a pick, so the toast goes to the top */
@media (pointer: coarse) {
  .toast { top: 16px; bottom: auto; transform: translate(-50%, -20px); }
  .toast.show { transform: translate(-50%, 0); }
}

/* Archive page */
.archive { max-width: 640px; margin: 0 auto; padding: 0 var(--gutter); }
.archive h1 { font: 400 clamp(36px, 7vw, 56px)/1.05 var(--font-display); margin: 24px 0 6px; }
.archive > p { color: var(--ink-2); margin: 0 0 24px; }
.arch-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 22px; box-shadow: 0 1px 2px rgba(31, 29, 26, .05), 0 24px 48px -28px rgba(31, 29, 26, .35); }
.arch-list a { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px 20px; text-decoration: none; border-bottom: 1px solid var(--line); }
.arch-list li:last-child a { border-bottom: 0; }
.arch-list a:hover { background: var(--surface-2); }
.arch-no { font: 600 18px var(--font-display); }
.arch-date { color: var(--ink-2); font-size: 14px; }
.arch-date small { display: block; color: var(--ink-3); font-size: 12px; }
.arch-score { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; }
.arch-score.todo { color: var(--accent); font-weight: 500; }

/* Privacy and 404 pages */
.legal { max-width: 680px; margin: 24px auto 64px; padding: 0 var(--gutter); color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.legal h1 { font: 400 clamp(34px, 6vw, 48px)/1.1 var(--font-display); color: var(--ink); margin: 0 0 6px; }
.legal h2 { font: 600 19px/1.3 var(--font-ui); color: var(--ink); margin: 32px 0 8px; }
.legal-updated { font-size: 13px; color: var(--ink-3); margin: 0 0 24px; }
.legal ul { padding-left: 20px; }
.legal a { color: #2A5BAA; }

/* "Also today": links to the site's other games on the results screen */
.also:empty { display: none; }
.also { margin-top: 16px; }
.also-head { margin: 0 0 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.also-card {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  color: var(--ink); text-decoration: none;
}
.also-card + .also-card { margin-top: 8px; }
.also-card:hover { border-color: var(--ink-3); background: #fff; }
.also-card img { display: block; width: 40px; height: 40px; }
.also-text b { display: block; font: 600 18px/1.2 var(--font-display); }
.also-text small { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.also-go { font-weight: 600; font-size: 14px; white-space: nowrap; }
.also-go.done { color: var(--good); }
.also-all { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--ink-2); }

/* Read by screen readers only (the live region that announces statements and verdicts) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

