/* Layout concept: one "receipt" column; each card is a shelf tag you answer on, the results screen
   prints like a grocery receipt. Rewards are stamped like store stickers. Phones get one narrow column;
   wide screens (760px+) get bigger cards with two-column reveals and receipts, and the margins left
   and right stay free for Google's side rail ads (shown from 1240px). */
:root {
  --paper: #eef1ec;        /* thermal-paper grey-green page */
  --card: #ffffff;
  --ink: #1b2330;          /* navy receipt ink */
  --muted: #5d6776;
  --line: #d3d9d1;
  --tag: #ffd23f;          /* shelf-tag yellow, the one accent */
  --tag-ink: #1b2330;
  --stamp: #3946b4;        /* date-stamp ink for years */
  --good: #23905a;
  --bad: #cf3439;
  --focus: #3946b4;
  --shadow: 0 1px 0 rgba(27, 35, 48, 0.06), 0 8px 24px -12px rgba(27, 35, 48, 0.25);

  /* Reward tiers, best to worst */
  --t-exact: #6b3fd8; --t-scanner: #23905a; --t-sharp: #1b7f9c; --t-ballpark: #a57800;
  --t-shock: #c45512; --t-off: #c62f34; --t-none: #6b7480;

  /* Illustration palette: drawn on a light sticker disc in both themes, so one set serves both */
  --i-disc: #e3eae4; --i-line: #1b2330; --i-shell: #fbf7ee; --i-carton: #b9c4cf; --i-crust: #e2a556;
  --i-tray: #c9d2dc; --i-meat: #e2707a; --i-fat: #f7cdc4; --i-sticker: #ffd23f; --i-white: #ffffff;
  --i-blue: #3b6fd6; --i-red: #d9443f; --i-dark: #2c3442; --i-roast: #d88b43; --i-shine: #f2c28c;
  --i-banana: #f2c932; --i-banana2: #f8dc5c; --i-stem: #7a5a2e; --i-bean: #6e4b33; --i-bean-dark: #573a27;
  --i-potato: #c38f55; --i-potato2: #d5a46a; --i-bacon: #d65558;
  --i-cheese: #f2b233; --i-cheese-top: #f7cd63; --i-cheese-hole: #d98f1c; --i-cheese2: #f8c64a;
  --i-pink: #f2a1b4; --i-wheat: #b97a3e; --i-sack: #ece2cc; --i-grain: #d9a441; --i-pasta: #ecc76a;
  --i-pasta-line: #c99a3a; --i-bean-red: #9b3a2f; --i-steak: #b9434b; --i-pork: #eaa49d; --i-ham: #e6858a;
  --i-ham-glaze: #b9545b; --i-lettuce: #9ccc5a; --i-lettuce-vein: #5f9a2e; --i-tomato: #e2473c;
  --i-shine-red: #f39a8f; --i-leaf: #4f9a3a; --i-lemon: #f6d33a; --i-grapefruit: #f2875c;
  --i-grapefruit-in: #f8b5a0; --i-straw: #e03b4a; --i-seed: #f8e08e; --i-orange: #f39a2b;
  --i-orange-light: #fbc77e; --i-cookie: #d8a05c; --i-cookie2: #e3b679; --i-choc: #4e321e;
  --i-chipbag: #2f7fd1; --i-chip: #f2c45a; --i-chip-line: #d19a2a; --i-sugar-shade: #e3e7ee;
  --i-sugar-side: #cfd6e1; --i-diesel: #2e9a5b; --i-diesel-dark: #1d5f39; --i-flame: #3b7be8;
  --i-flame-light: #9cc3ff; --i-barrel: #5c6c7e; --i-oil: #e3a83a;

  --f-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11151b; --card: #1a2029; --ink: #edf0ea; --muted: #9aa4b1; --line: #2b333f;
    --tag: #ffd23f; --tag-ink: #1b2330; --stamp: #9aa6ff; --good: #3fbf7f; --bad: #f05a5e; --focus: #9aa6ff;
    --t-exact: #b49bff; --t-scanner: #3fbf7f; --t-sharp: #4cc3e0; --t-ballpark: #e6b52a;
    --t-shock: #f08a45; --t-off: #f05a5e; --t-none: #8d96a3;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11151b; --card: #1a2029; --ink: #edf0ea; --muted: #9aa4b1; --line: #2b333f;
  --tag: #ffd23f; --tag-ink: #1b2330; --stamp: #9aa6ff; --good: #3fbf7f; --bad: #f05a5e; --focus: #9aa6ff;
  --t-exact: #b49bff; --t-scanner: #3fbf7f; --t-sharp: #4cc3e0; --t-ballpark: #e6b52a;
  --t-shock: #f08a45; --t-off: #f05a5e; --t-none: #8d96a3;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}
[data-tier="exact"] { --tc: var(--t-exact); }
[data-tier="scanner"] { --tc: var(--t-scanner); }
[data-tier="sharp"] { --tc: var(--t-sharp); }
[data-tier="ballpark"] { --tc: var(--t-ballpark); }
[data-tier="shock"] { --tc: var(--t-shock); }
[data-tier="off"] { --tc: var(--t-off); }
[data-tier="none"] { --tc: var(--t-none); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
.app {
  max-width: 30rem;
  margin: 0 auto;
  padding-block: 0.75rem 2.5rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.brand { font: 800 1.9rem/1 var(--f-display); letter-spacing: 0.01em; margin: 0; display: flex; align-items: baseline; }
.brand .then {
  background: var(--tag); color: var(--tag-ink); padding: 0.05em 0.18em 0; margin-right: 0.04em;
  border-radius: 3px; transform: rotate(-2deg); display: inline-block;
}
.brand-block { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.top-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.45rem; font: 400 0.75rem/1.2 var(--f-mono); color: var(--muted); }
.top-meta span + span::before { content: "·"; margin-right: 0.45rem; }
.top-actions { display: flex; gap: 0.5rem; flex: none; }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center; cursor: pointer;
  font: 700 0.95rem/1 var(--f-body); color: var(--ink);
}
.icon-btn svg { width: 1.1rem; height: 1.1rem; display: block; }
.icon-btn .snd-off, .icon-btn.off .snd-on { display: none; }
.icon-btn.off .snd-off { display: block; }
.icon-btn.off { color: var(--muted); }

/* Progress */
.progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.3rem; }
.progress span { height: 0.4rem; border-radius: 2px; background: var(--line); }
.progress span.current { background: var(--ink); }
.progress span[data-tier] { background: var(--tc); }

/* Card */
.card {
  background: var(--card); border-radius: 10px; box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; position: relative;
}
.eyebrow {
  font: 700 0.72rem/1.3 var(--f-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted);
  display: flex; justify-content: space-between; gap: 0.5rem;
}
.eyebrow span:last-child { text-align: right; }
.item-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: center; }
.ih-text { min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.ih-extra { grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column; gap: 1rem; margin-top: 0.25rem; }
.item-label { font: 700 2.35rem/1.02 var(--f-display); margin: 0; text-wrap: balance; }
.item-label.small { font-size: 2rem; }
.item-unit { color: var(--muted); font-size: 0.9rem; margin: 0; }
.illo { width: 5.5rem; height: 5.5rem; border-radius: 50%; background: var(--i-disc); display: grid; place-items: center; flex: none; }
.illo svg { width: 82%; height: 82%; display: block; }
.illo.sm { width: 2.3rem; height: 2.3rem; }
.illo.sm svg { width: 86%; height: 86%; }
.illo.xs { width: 2.2rem; height: 2.2rem; }
.illo.xs svg { width: 86%; height: 86%; }
.stamp {
  align-self: flex-start; font: 700 1.6rem/1 var(--f-mono); color: var(--stamp);
  border: 2.5px solid var(--stamp); border-radius: 6px; padding: 0.3rem 0.6rem 0.25rem;
  transform: rotate(-3deg); letter-spacing: 0.04em;
}
.question { font: 600 1.05rem/1.3 var(--f-body); margin: 0; }

/* Intro */
.intro .item-label { font-size: 2rem; }
.lineup { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(3.6rem, 1fr)); gap: 0.5rem; }
.lineup li { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; font: 700 0.62rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.intro-note { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Card timer (15 s, 30 s for Sort and Basket) */
.timer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; margin-top: -0.25rem; }
.timer { height: 0.45rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.timer-fill { display: block; height: 100%; width: 100%; background: var(--stamp); border-radius: inherit; }
.timer-num { font: 700 0.85rem/1 var(--f-mono); min-width: 3ch; text-align: right; font-variant-numeric: tabular-nums; color: var(--stamp); }
.timer-row.low .timer-fill { background: var(--bad); }
.timer-row.low .timer-num { color: var(--bad); }

/* Price tag */
.tag {
  align-self: flex-start; background: var(--tag); color: var(--tag-ink);
  font: 800 2.6rem/1 var(--f-display); padding: 0.35rem 0.75rem 0.25rem 1.1rem;
  border-radius: 4px 10px 10px 4px; position: relative; font-variant-numeric: tabular-nums; min-width: 6.5ch;
}
.tag::before {
  content: ""; position: absolute; left: 0.4rem; top: 50%; width: 0.38rem; height: 0.38rem;
  border-radius: 50%; background: var(--card); transform: translateY(-50%);
}
.tag small { font: 700 0.8rem/1 var(--f-mono); letter-spacing: 0.04em; margin-left: 0.4rem; }

/* Answer forms */
.answer { display: flex; flex-direction: column; gap: 0.75rem; }
.price-field {
  display: flex; align-items: center; gap: 0.25rem; border: 2px solid var(--ink); border-radius: 8px;
  padding: 0.15rem 0.75rem; background: var(--paper);
}
.price-field span { font: 700 2rem/1 var(--f-display); color: var(--muted); }
.price-field input {
  border: 0; background: transparent; outline: none; width: 100%; min-width: 0;
  font: 700 2.2rem/1.2 var(--f-display); font-variant-numeric: tabular-nums; padding: 0.2rem 0;
}
.price-field:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.year-field { display: flex; flex-direction: column; gap: 0.5rem; }
.year-readout { font: 700 2.4rem/1 var(--f-mono); color: var(--stamp); text-align: center; }
.year-field input[type="range"] { width: 100%; accent-color: var(--stamp); height: 2rem; }
.year-ends { display: flex; justify-content: space-between; font: 400 0.75rem/1 var(--f-mono); color: var(--muted); }
.hint { font-size: 0.82rem; color: var(--muted); margin: 0; min-height: 1.2em; }
.hint.error { color: var(--bad); }
.cart { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.cart li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; align-items: center; font-weight: 600; }
.card.answered .cart { display: none; }   /* the reveal lists the same items with their prices */
.sort-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.sort-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.7rem 0.3rem 0.6rem;
  border: 2px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; min-width: 0;
}
.sort-tile .illo.sm { width: 3rem; height: 3rem; }
.sort-name { font: 600 0.82rem/1.15 var(--f-body); text-align: center; overflow-wrap: anywhere; }
.sort-rank { font: 800 1.2rem/1 var(--f-display); min-height: 1.2rem; color: var(--stamp); }
.sort-tile[aria-pressed="true"] { border-color: var(--stamp); background: color-mix(in srgb, var(--stamp) 10%, var(--card)); }

.btn {
  border: 0; border-radius: 8px; cursor: pointer; padding: 0.85rem 1rem;
  font: 700 1rem/1.15 var(--f-body); background: var(--ink); color: var(--paper); transition: transform 0.08s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.accent { background: var(--tag); color: var(--tag-ink); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

/* Reveal */
.reveal { display: flex; flex-direction: column; gap: 0.85rem; }
.reveal-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.yours { font: 400 0.85rem/1.35 var(--f-mono); color: var(--muted); }
.yours b { color: var(--ink); }
.tier-slot { display: flex; flex-direction: column; gap: 0.5rem; min-height: 5.4rem; }
.tier { position: relative; display: flex; flex-direction: column; gap: 0.45rem; }
.badge {
  align-self: flex-start; display: inline-flex; align-items: baseline; gap: 0.6rem;
  padding: 0.35rem 0.8rem 0.3rem; border-radius: 6px; border: 2.5px solid var(--tc);
  background: color-mix(in srgb, var(--tc) 13%, var(--card)); color: var(--tc);
  position: relative; overflow: hidden;
}
.badge-name { font: 800 1.45rem/1 var(--f-display); text-transform: uppercase; letter-spacing: 0.03em; }
.badge-pts { font: 700 1rem/1 var(--f-mono); font-variant-numeric: tabular-nums; }
.ladder { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; max-width: 16rem; }
.ladder span { height: 0.4rem; border-radius: 2px; background: var(--line); }
.ladder span.on { background: var(--tc); opacity: 0.55; }
.ladder span.here { opacity: 1; height: 0.6rem; margin-top: -0.1rem; }
.tier-line { margin: 0; font: 400 0.85rem/1.3 var(--f-mono); color: var(--muted); }
.hot { align-self: flex-start; display: inline-flex; gap: 0.35rem; align-items: center; font: 700 0.85rem/1 var(--f-mono); color: var(--t-shock); }
.burst { position: absolute; left: 4.5rem; top: 1.1rem; width: 0; height: 0; pointer-events: none; }
.burst span {
  position: absolute; width: 11px; height: 11px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: var(--tag); border: 2px solid var(--i-line); opacity: 0;
}
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--f-mono); }
.sorted { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.sorted li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 0.6rem; align-items: center; font: 400 0.9rem/1.3 var(--f-mono); }
.sorted li b { font-variant-numeric: tabular-nums; }
.sorted .mark { font-weight: 700; width: 1.2rem; text-align: center; }
.sorted li[data-ok="yes"] .mark { color: var(--good); }
.sorted li[data-ok="no"] .mark { color: var(--bad); }
.sorted .total-line { grid-template-columns: minmax(0, 1fr) auto; border-top: 2px dashed var(--line); padding-top: 0.4rem; font-weight: 700; }
.fact { margin: 0; font-size: 0.95rem; line-height: 1.45; }
.source { font: 400 0.72rem/1.4 var(--f-mono); color: var(--muted); margin: 0; }

/* Results receipt: the receipt itself + Share, then everything around it */
.receipt { gap: 0.9rem; }
.receipt-main, .receipt-side { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.receipt-title { text-align: center; font: 700 0.8rem/1.4 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.total { text-align: center; font: 800 4.2rem/0.9 var(--f-display); font-variant-numeric: tabular-nums; }
.total small { font-size: 1.6rem; color: var(--muted); }
.squares { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.squares span { width: 1.45rem; height: 1.45rem; border-radius: 4px; background: var(--tc); }
.squares span[data-tier="exact"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--tc); }
.haul { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; }
.chip {
  display: inline-flex; gap: 0.3rem; align-items: baseline; border: 1.5px solid var(--tc, var(--line));
  color: var(--tc, var(--ink)); background: color-mix(in srgb, var(--tc, var(--line)) 10%, var(--card));
  border-radius: 999px; padding: 0.22rem 0.6rem; font: 700 0.72rem/1.2 var(--f-mono);
}
.hot-chip { --tc: var(--t-shock); }
.lines { list-style: none; margin: 0; padding: 0.75rem 0; border-top: 2px dashed var(--line); border-bottom: 2px dashed var(--line); display: flex; flex-direction: column; gap: 0.55rem; }
.lines li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.1rem 0.65rem; align-items: center; font: 400 0.82rem/1.35 var(--f-mono); }
.lines li .illo { grid-row: span 2; }
.lines li .what { min-width: 0; }
.lines li .pts { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--tc); }
.lines li .detail { grid-column: 2 / -1; color: var(--muted); font-size: 0.75rem; }

/* Level / XP */
.xp { display: flex; flex-direction: column; gap: 0.4rem; position: relative; }
.xp-head { display: flex; justify-content: space-between; gap: 0.5rem; font: 700 0.85rem/1.2 var(--f-mono); }
.xp-gain { color: var(--stamp); }
.xp-bar { height: 0.65rem; background: var(--line); border-radius: 999px; overflow: hidden; }
.xp-fill { display: block; height: 100%; background: var(--stamp); border-radius: inherit; transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.xp-next { margin: 0; font: 400 0.75rem/1.3 var(--f-mono); color: var(--muted); }
.levelup { margin: 0; font: 800 1.35rem/1.1 var(--f-display); color: var(--t-exact); }
.xp .burst { left: 50%; top: 0.6rem; }

/* Compare: score distribution of today's players */
.compare { display: flex; flex-direction: column; gap: 0.4rem; border-top: 2px dashed var(--line); padding-top: 0.9rem; }
.compare h3, .aisles h3 { margin: 0; font: 700 0.72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.compare .verdict { margin: 0; font: 600 1rem/1.35 var(--f-body); }
.compare .verdict b { font: 800 1.35rem/1 var(--f-display); }
.note { margin: 0; font: 400 0.75rem/1.4 var(--f-mono); color: var(--muted); }
.dist { width: 100%; height: auto; display: block; }
.dist text { font-family: var(--f-mono); }
.versus { text-align: center; font: 600 0.95rem/1.4 var(--f-body); margin: 0; }

/* Stats + collection */
.statbox { display: flex; flex-direction: column; gap: 0.55rem; border-top: 2px dashed var(--line); padding-top: 0.9rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; }
.stats div { display: flex; flex-direction: column; gap: 0.15rem; }
.stats b { font: 800 1.6rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stats span { font: 400 0.65rem/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.collection-title { margin: 0.2rem 0 0; font: 700 0.72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.collection { display: flex; flex-wrap: wrap; gap: 0.35rem; }

/* Extra aisles */
.aisles { display: flex; flex-direction: column; gap: 0.6rem; border-top: 2px dashed var(--line); padding-top: 0.9rem; }
.aisle-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.aisle-list > li:not(.aisle-li), .aisle-btn {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.6rem; align-items: center;
  padding: 0.5rem 0.65rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper);
}
.aisle-btn { width: 100%; text-align: left; cursor: pointer; border-color: var(--ink); }
.aisle-list .what { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.aisle-list .what b { font: 700 1rem/1.15 var(--f-body); }
.aisle-list .what span { font: 400 0.72rem/1.2 var(--f-mono); color: var(--muted); }
.aisle-lock, .aisle-go, .aisle-score { font: 700 0.75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.aisle-lock { color: var(--muted); border: 1.5px dashed var(--muted); border-radius: 999px; padding: 0.3rem 0.55rem; }
.aisle-go { color: var(--tag-ink); background: var(--tag); border-radius: 999px; padding: 0.35rem 0.7rem; }
.aisle-score { color: var(--good); font-size: 0.9rem; }
.proto-note { margin: 0; font: 400 0.8rem/1.4 var(--f-mono); color: var(--muted); border-left: 3px solid var(--tag); padding-left: 0.6rem; }
.aisle-ad {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.4rem; padding: 0 0.85rem; cursor: pointer;
  font: 700 0.75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 999px; white-space: nowrap;
}
.aisle-ad:active { transform: translateY(1px); }
.play-icon { width: 0; height: 0; border-style: solid; border-width: 0.32rem 0 0.32rem 0.52rem; border-color: transparent transparent transparent currentColor; }
.pass-btn { font-size: 0.85rem; line-height: 1.25; }
.toast.info { color: var(--muted); font-weight: 400; min-height: 0; }

/* Ads: labelled display slot (kept away from buttons) and the prototype's ad placeholders */
.ad-slot {
  margin-block: 0.75rem; padding: 0.55rem 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  display: flex; flex-direction: column; gap: 0.4rem; min-height: 120px;
}
.ad-label { margin: 0; font: 400 0.62rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.ad-slot.placeholder { background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--line) 40%, transparent) 10px 20px); }
.ad-slot.placeholder p:last-child { margin: auto; max-width: 16rem; font: 400 0.75rem/1.4 var(--f-mono); color: var(--muted); text-align: center; }
/* Prototype placeholders for Google's overlay ads: side rails (wide screens) and a bottom anchor */
.sim-rail { display: none; }
.sim-anchor {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: flex; justify-content: center; align-items: center;
  padding: 6px 3rem calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--card);
  border-top: 1px solid var(--line); box-shadow: 0 -8px 20px -14px rgba(0, 0, 0, 0.45);
}
.sim-anchor-ad, .sim-rail {
  border: 1px dashed var(--muted); border-radius: 4px; flex-direction: column; justify-content: center; align-items: center;
  gap: 0.3rem; text-align: center; padding: 0.4rem;
  background: repeating-linear-gradient(135deg, var(--card) 0 10px, color-mix(in srgb, var(--line) 45%, var(--card)) 10px 20px);
}
.sim-anchor-ad { display: flex; width: 320px; max-width: 100%; height: 50px; }
.sim-text { margin: 0; font: 400 0.68rem/1.3 var(--f-mono); color: var(--muted); }
.sim-close {
  position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; font: 400 1.1rem/1 var(--f-body);
}
body.has-anchor { padding-bottom: 72px; }
body.has-anchor .reveal-next, body.has-anchor .btn-row { scroll-margin-bottom: 124px; }

.ad-sim .card { align-items: center; text-align: center; }
.ad-sim .card:focus { outline: none; }
.ad-sim .proto-note { text-align: left; }
.ad-count {
  width: 4.2rem; height: 4.2rem; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center;
  font: 700 1.7rem/1 var(--f-mono); font-variant-numeric: tabular-nums;
}

.countdown { text-align: center; font: 400 0.85rem/1.4 var(--f-mono); color: var(--muted); margin: 0; }
.countdown b { color: var(--ink); font-variant-numeric: tabular-nums; }
.share-fallback { width: 100%; min-height: 7rem; font: 400 0.85rem/1.4 var(--f-mono); border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem; background: var(--paper); }
.toast { text-align: center; font: 600 0.85rem/1.3 var(--f-body); color: var(--good); min-height: 1.2em; margin: 0; }

/* Overlays: how to play, day pass, ad breaks */
.overlay, .sheet {
  position: fixed; inset: 0; background: rgba(17, 21, 27, 0.55); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  z-index: 20;
}
.overlay .card, .sheet .card { max-width: 26rem; width: 100%; }
.overlay h2, .sheet h2 { font: 800 2rem/1 var(--f-display); margin: 0; }
.sheet p { margin: 0; }
.steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.steps li::marker { font-family: var(--f-mono); font-weight: 700; }

.foot { display: flex; flex-direction: column; gap: 0.4rem; align-items: center; text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1rem; font: 400 0.78rem/1.4 var(--f-mono); }
.foot-links a { color: var(--muted); }
.more-link { font: 600 0.92rem/1.3 var(--f-body); color: var(--stamp); text-underline-offset: 2px; white-space: nowrap; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: 400 0.75rem/1.4 var(--f-mono); text-align: left; }

/* Motion: every reward tier has its own entrance */
@media (prefers-reduced-motion: no-preference) {
  .card.enter { animation: slide-in 0.25s ease-out; }
  .tag.pop { animation: pop 0.3s ease-out; }
  .badge[data-tier="exact"] { animation: stamp 0.55s cubic-bezier(.2, 1.4, .4, 1) both; }
  .badge[data-tier="scanner"] { animation: fade 0.2s ease-out both; }
  .badge[data-tier="scanner"]::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 22%; left: -30%;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bad) 55%, transparent), transparent);
    animation: scan 0.7s ease-in-out 0.1s 2;
  }
  .badge[data-tier="sharp"] { animation: flip 0.45s ease-out both; transform-origin: 50% 0; }
  .badge[data-tier="ballpark"] { animation: bounce 0.6s ease-out both; }
  .badge[data-tier="shock"] { animation: shake 0.5s ease-in-out both; }
  .badge[data-tier="off"] { animation: droop 0.6s ease-out both; }
  .badge[data-tier="none"] { animation: fade 0.5s ease-out both; }
  .ladder span.on { animation: fill 0.25s ease-out both; }
  .ladder span:nth-child(2) { animation-delay: 0.05s; } .ladder span:nth-child(3) { animation-delay: 0.1s; }
  .ladder span:nth-child(4) { animation-delay: 0.15s; } .ladder span:nth-child(5) { animation-delay: 0.2s; }
  .ladder span:nth-child(6) { animation-delay: 0.25s; }
  .burst span { animation: coin 0.9s ease-out var(--d) forwards; }
  .hot .flame { display: inline-block; animation: flicker 0.5s ease-in-out infinite alternate; }
  .chart polyline.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 0.9s ease-out forwards; }
  .levelup { animation: stamp 0.55s cubic-bezier(.2, 1.4, .4, 1) both; }
}
@keyframes slide-in { from { transform: translateY(6px); } to { transform: none; } }
@keyframes pop { 0% { transform: scale(0.92) rotate(-2deg); } 100% { transform: none; } }
@keyframes stamp { 0% { transform: scale(1.9) rotate(-8deg); opacity: 0; } 55% { transform: scale(0.95) rotate(2deg); opacity: 1; } 100% { transform: none; } }
@keyframes scan { from { left: -30%; } to { left: 110%; } }
@keyframes flip { from { transform: perspective(400px) rotateX(85deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bounce { 0% { transform: translateY(-14px); opacity: 0; } 40% { transform: translateY(0); opacity: 1; } 65% { transform: translateY(-5px); } 100% { transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-2deg); } 40% { transform: translateX(6px) rotate(2deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes droop { 0% { transform: translateY(-6px); opacity: 0; } 60% { transform: rotate(3deg); opacity: 1; } 100% { transform: rotate(1.5deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fill { from { transform: scaleX(0); } to { transform: none; } }
@keyframes coin { 0% { transform: translate(0, 0) scale(0.4); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 0; } }
@keyframes flicker { from { transform: rotate(-8deg) scale(1); } to { transform: rotate(8deg) scale(1.15); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Mouse and trackpad: hover feedback */
@media (hover: hover) {
  .btn:hover:not(:disabled) { filter: brightness(1.08); }
  .btn.secondary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, transparent); filter: none; }
  .icon-btn:hover, .sim-close:hover { border-color: var(--muted); }
  .sort-tile:hover { border-color: var(--muted); }
  .aisle-btn:hover, .aisle-ad:hover { filter: brightness(1.08); }
  .linkish:hover { color: var(--ink); }
}

/* Wide screens: tablets and computers */
@media (min-width: 760px) {
  .app { max-width: 52rem; padding-block: 1.25rem 3rem; gap: 1.25rem; }
  .brand { font-size: 2.4rem; }
  .top-meta { font-size: 0.8rem; }
  .card { padding: 1.75rem 2rem 2rem; gap: 1.15rem; }
  .item-label { font-size: 3rem; }
  .item-label.small { font-size: 2.5rem; }
  .item-head { column-gap: 2rem; align-items: start; }
  .item-head > .illo { grid-column: 2; grid-row: 1 / span 2; width: 8.5rem; height: 8.5rem; align-self: center; }
  .ih-extra { grid-column: 1; }
  .question { font-size: 1.2rem; }
  .stamp { font-size: 1.8rem; }
  .tag { font-size: 3rem; }
  .answer.is-price { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.75rem; row-gap: 0.5rem; }
  .answer.is-price .price-field { grid-column: 1; grid-row: 1; }
  .answer.is-price .btn { grid-column: 2; grid-row: 1; min-width: 10rem; }
  .answer.is-price .hint { grid-column: 1 / -1; grid-row: 2; }
  .answer.is-year .btn, .answer.is-sort .btn { align-self: flex-end; min-width: 14rem; }
  .sort-tile { padding: 1rem 0.5rem 0.8rem; }
  .sort-tile .illo.sm { width: 4.2rem; height: 4.2rem; }
  .sort-name { font-size: 0.95rem; }
  .cart li { font-size: 1.05rem; }
  .intro .item-label { font-size: 2.6rem; }
  .lineup { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .lineup .illo.xs { width: 3.2rem; height: 3.2rem; }
  .intro .btn { align-self: flex-start; min-width: 16rem; }
  .reveal {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); column-gap: 2rem; row-gap: 0.85rem; align-items: start;
    grid-template-areas: "head viz" "tier viz" "fact viz" "next viz";
  }
  .reveal-head { grid-area: head; }
  .tier-slot { grid-area: tier; }
  .reveal-viz { grid-area: viz; align-self: center; }
  .reveal .fact { grid-area: fact; }
  .reveal-next { grid-area: next; }
  .total { font-size: 5rem; }
  .compare .dist { max-width: 30rem; }
  .sim-anchor-ad { width: 728px; height: 90px; }
  body.has-anchor { padding-bottom: 112px; }
}
/* Short laptop screens: tighter spacing so the main button stays above the bottom ad */
@media (min-width: 760px) and (max-height: 820px) {
  .app { padding-block: 0.75rem 2rem; gap: 0.9rem; }
  .brand { font-size: 2.1rem; }
  .card { padding: 1.25rem 1.75rem 1.5rem; gap: 0.9rem; }
  .item-label { font-size: 2.5rem; }
  .item-label.small { font-size: 2.2rem; }
  .item-head > .illo { width: 7rem; height: 7rem; }
  .card.answered .item-head > .illo { width: 5rem; height: 5rem; }
  .stamp { font-size: 1.5rem; }
  .tag { font-size: 2.6rem; }
  .reveal { row-gap: 0.65rem; }
  .total { font-size: 4.2rem; }
}
@media (min-width: 900px) {
  .receipt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 2.25rem; align-items: start; }
  .receipt-side > :first-child { border-top: 0; padding-top: 0; }
}
/* Side rails only where they fit beside the 52rem column without touching it */
@media (min-width: 1240px) {
  .sim-rail {
    display: flex; position: fixed; z-index: 5; top: 88px; width: 160px; height: min(600px, calc(100vh - 88px - 124px));
  }
  .sim-rail.left { left: 12px; }
  .sim-rail.right { right: 12px; }
}
@media (min-width: 1560px) {
  .sim-rail { width: 300px; }
}
