:root {
  color-scheme: light;
  --ink: #1b1830;
  --paper: #fff8e7;
  --paper-2: #f5edda;
  --pink: #ff4f9a;
  --yellow: #ffdc45;
  --blue: #49b8ff;
  --lime: #b9f95d;
  --red: #ff594d;
  --muted: #716b72;
  --line: #1b1830;
  --shadow: 7px 7px 0 var(--ink);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", Impact, ui-sans-serif, system-ui, sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .55; }
body.modal-open { overflow: hidden; }

.paper-noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
}

.topbar, footer, main { width: min(1240px, calc(100% - 40px)); margin-inline: auto; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; font-size: 18px; font-weight: 900; letter-spacing: -.04em; }
.brand strong { background: var(--pink); color: white; padding: 5px 8px; transform: rotate(-2deg); display: inline-block; }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border: 3px solid var(--ink); border-radius: 12px; background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font-weight: 1000; transform: rotate(-5deg); }
.game-stats { display: flex; gap: 28px; }
.game-stats div { display: grid; text-align: right; }
.game-stats span { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .15em; color: var(--pink); }
.game-stats strong { font-size: 20px; }

.screen { min-height: calc(100vh - 145px); }
.home-title { font-size: clamp(52px, 6.8vw, 94px); line-height: .94; letter-spacing: -.06em; }
.quit-button { align-self: center; border: 2px solid var(--ink); border-radius: 9px; padding: 8px 12px; background: var(--paper); font-size: 11px; font-weight: 900; }
.round-loading > * { visibility: hidden; pointer-events: none; }
.challenge-card.round-loading { background: white; }
.media-placeholder { display: grid; place-items: center; min-height: 96px; padding: 16px; background: var(--paper); color: var(--pink); font-size: clamp(20px, 4vw, 54px); font-weight: 1000; text-align: center; }
.classic-visual > .media-placeholder { width: min(76%, 380px); height: 300px; border: 3px dashed var(--ink); border-radius: 24px; transform: rotate(-3deg); }
.home-screen { padding: 18px 0 80px; }
.price-ticker { width: 100vw; height: 52px; margin-left: calc(50% - 50vw); display: grid; align-items: center; overflow: hidden; white-space: nowrap; color: var(--yellow); font-size: clamp(9px, .9vw, 13px); font-weight: 1000; letter-spacing: .1em; text-transform: uppercase; }
.ticker-band { width: 102%; height: 44px; margin-left: -1%; overflow: hidden; background: var(--ink); transform: rotate(-.55deg); transform-origin: center; }
.ticker-track { width: 136vw; height: 100%; display: grid; grid-template-columns: repeat(4, 34vw); align-items: center; transform: translateX(0); will-change: transform; }
.ticker-track span { min-width: 0; padding: 0 18px; overflow: hidden; text-align: center; text-overflow: ellipsis; }
.price-ticker.is-advancing .ticker-track { transform: translateX(-34vw); transition: transform 30ms linear; }
.price-ticker.is-settling .ticker-track { animation: tickerSettle .48s cubic-bezier(.2,.8,.25,1) both; }
.hero-layout { min-height: 400px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: center; gap: 50px; padding: 48px 0 36px; position: relative; }
.eyebrow { margin: 0 0 12px; color: #d31764; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 1000; }
h1 { margin: 0; max-width: 980px; font-size: clamp(68px, 11vw, 148px); line-height: .78; letter-spacing: -.075em; font-weight: 1000; text-transform: uppercase; }
h1 em { display: inline-block; color: var(--paper); font-style: normal; -webkit-text-stroke: 3px var(--ink); text-shadow: 5px 5px 0 var(--pink); transform: rotate(-1deg); }
.hero-copy { max-width: 680px; margin: 28px 0; font-family: ui-sans-serif, system-ui, sans-serif; font-size: clamp(17px, 2vw, 21px); font-weight: 650; line-height: 1.45; }
.cart-illustration { width: 300px; height: 270px; position: relative; display: grid; place-items: center; transform: rotate(4deg); }
.cart-circle { position: absolute; width: 188px; height: 188px; border: 4px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 7px 7px 0 var(--pink); }
.cart-illustration svg { position: relative; z-index: 1; width: 300px; height: 250px; overflow: visible; color: var(--ink); filter: drop-shadow(4px 5px 0 rgba(27,24,48,.14)); }
.cart-groceries { transform-origin: 145px 100px; animation: groceriesFloat 3.4s ease-in-out infinite; }
.cart-groceries .grocery-item { vector-effect: non-scaling-stroke; }

.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 10px 0 48px; }
/* The button keeps its hit area; only the decorative surface moves on hover. */
.mode-card { --card-tilt: 0deg; appearance: none; width: 100%; min-width: 0; min-height: 286px; position: relative; display: flex; align-items: stretch; text-align: left; border: 0; border-radius: var(--radius); padding: 0; background: transparent; color: var(--ink); transform: rotate(var(--card-tilt)); }
.mode-card-surface { width: 100%; min-width: 0; min-height: inherit; position: relative; display: flex; flex-direction: column; align-items: stretch; border: 3px solid var(--ink); border-radius: inherit; padding: 26px; box-shadow: var(--shadow); overflow: hidden; pointer-events: none; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s ease, filter .2s ease; }
.mode-card:nth-child(1) { --card-tilt: -.7deg; }
.mode-card:nth-child(2) { --card-tilt: .65deg; }
.mode-card:nth-child(3) { --card-tilt: -.45deg; }
.mode-card-surface::after { content: "€ € €"; position: absolute; right: -24px; top: 35px; font-size: 64px; font-weight: 1000; opacity: .09; transform: rotate(80deg); }
.classic-card .mode-card-surface { background: var(--pink); color: var(--ink); }
.basket-card .mode-card-surface { background: var(--blue); }
.custom-card .mode-card-surface { background: var(--lime); }
.mode-card:hover { z-index: 2; }
.mode-card:hover .mode-card-surface { transform: translateY(-8px) rotate(calc(var(--card-tilt) * .45)); box-shadow: 12px 14px 0 var(--ink); filter: saturate(1.06); }
.mode-card:active .mode-card-surface { transform: translate(5px, 5px) scale(.985); box-shadow: 2px 2px 0 var(--ink); }
.mode-kicker { color: var(--yellow); text-transform: uppercase; letter-spacing: .14em; font-size: 14px; font-weight: 1000; text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 var(--ink); }
.mode-card h2, .custom-panel h2 { max-width: 100%; margin: 22px 0 0; font-size: clamp(36px, 4.15vw, 60px); line-height: .88; text-transform: uppercase; letter-spacing: -.06em; overflow-wrap: anywhere; }
.custom-card h2 { font-size: clamp(30px, 3vw, 42px); letter-spacing: -.035em; }
.mode-card p { max-width: 300px; margin: 18px 0 0; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 15px; font-weight: 650; line-height: 1.4; }
.mode-number { position: absolute; top: 20px; right: 22px; font-size: 34px; font-weight: 1000; opacity: .35; }
.mode-arrow { margin-top: auto; align-self: flex-end; width: 58px; height: 58px; transform: rotate(-7deg); transition: transform .2s ease; }
.mode-arrow svg { width: 100%; height: 100%; }
.svg-definitions { position: absolute; pointer-events: none; }
.mode-card:hover .mode-arrow { transform: translateX(5px); }
.mode-card h2 { font-family: 'Trebuchet MS', Arial, sans-serif; font-weight: 700; font-style: normal; letter-spacing: -.035em; -webkit-text-stroke: 0; text-shadow: 1px 2px 0 rgba(255,255,255,.85); }

.custom-panel { scroll-margin-top: 20px; margin: 66px 0 42px; padding: clamp(24px, 5vw, 50px); border: 4px solid var(--ink); background: #fffdf6; box-shadow: 12px 12px 0 var(--blue); position: relative; }
.custom-panel::before, .custom-panel::after { content: ""; position: absolute; left: -4px; right: -4px; height: 15px; background: radial-gradient(circle at 8px 0, transparent 8px, var(--ink) 9px, var(--ink) 10px, #fffdf6 11px) repeat-x; background-size: 22px 15px; }
.custom-panel::before { top: -13px; transform: rotate(180deg); }
.custom-panel::after { bottom: -13px; }
.custom-heading { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.custom-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.basket-controls { display: contents; }
.field-card { display: grid; gap: 14px; border: 3px solid var(--ink); padding: 18px; background: var(--paper-2); font-weight: 1000; text-transform: uppercase; }
.field-card output { justify-self: end; margin-top: -30px; color: #d31764; font-size: 22px; }
select { height: 48px; border: 3px solid var(--ink); background: white; padding: 0 12px; font-weight: 900; }
input[type="range"] { width: 100%; accent-color: var(--pink); }
.stores-fieldset { margin: 22px 0; border: 3px solid var(--ink); padding: 20px; }
.stores-fieldset legend { padding: 0 10px; font-weight: 1000; text-transform: uppercase; }
.store-tools { display: flex; gap: 8px; margin-bottom: 14px; }
.store-tools button { border: 2px solid var(--ink); background: var(--yellow); padding: 7px 10px; font-weight: 900; }
.store-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.store-check { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 9px; min-width: 0; border: 2px solid var(--ink); border-left: 9px solid var(--store-color); padding: 10px; background: white; cursor: pointer; }
.store-check:has(input:checked) { background: color-mix(in srgb, var(--store-color) 14%, white); box-shadow: 2px 2px 0 var(--ink); }
.store-check input { grid-row: 1 / 3; width: 18px; height: 18px; accent-color: var(--pink); }
.store-check span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 900; }
.store-check small { color: var(--muted); }
.field-error { color: #c5003c; font-weight: 900; }

.primary-button, .secondary-button { min-height: 58px; border: 3px solid var(--ink); border-radius: 9px; padding: 0 24px; font-weight: 1000; transition: .14s ease; }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); }
.primary-button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.secondary-button { background: white; box-shadow: 4px 4px 0 var(--ink); }
.jumbo { min-width: min(100%, 360px); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
.home-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; }
.home-meta span { border: 2px solid var(--ink); background: white; padding: 7px 10px; font-size: 12px; font-weight: 900; transform: rotate(-.5deg); }
.demo-notice { color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; }

.game-screen { padding: 30px 0 70px; }
.progress-track { height: 14px; margin-bottom: 24px; border: 3px solid var(--ink); border-radius: 999px; background: white; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 10%; border-radius: 999px; background: repeating-linear-gradient(135deg, var(--pink) 0 18px, var(--yellow) 18px 36px); background-size: 52px 52px; transition: width .55s cubic-bezier(.18,.85,.25,1); animation: progressFlow .75s linear infinite; }
.challenge-card { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(340px, .68fr); height: clamp(820px, calc(100vh - 100px), 900px); border: 4px solid var(--ink); border-radius: var(--radius); background: white; box-shadow: 10px 10px 0 var(--pink); overflow: hidden; }
.challenge-card.round-updated .challenge-visual { animation: roundVisualIn .36s cubic-bezier(.2,.8,.25,1) both; }
.challenge-card.round-updated .guess-panel { animation: roundInfoIn .36s cubic-bezier(.2,.8,.25,1) both; }
.challenge-visual { min-width: 0; position: relative; display: grid; place-items: center; background: var(--paper-2); border-right: 4px solid var(--ink); overflow: auto; }
.classic-visual { width: 100%; min-height: 560px; display: grid; place-items: center; }
.store-badge { --store-color: var(--ink); position: absolute; z-index: 5; top: 18px; left: 18px; padding: 9px 14px; border: 3px solid var(--ink); border-radius: 7px; background: var(--store-color); color: white; box-shadow: 4px 4px 0 var(--ink); font-weight: 1000; transform: rotate(-2deg); }
.product-image { width: min(74%, 460px); height: min(72vh, 500px); object-fit: contain; filter: drop-shadow(13px 16px 0 rgba(27,24,48,.15)); }
.product-sprite { width: min(74%, 440px); aspect-ratio: 1; background: url("assets/grocery-products.png") no-repeat; background-size: 400% 300%; filter: drop-shadow(10px 12px 0 rgba(27,24,48,.15)); }
.guess-panel { min-height: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 34px; padding: clamp(28px, 4.5vw, 58px); overflow-y: auto; background: white; }
.guess-panel h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(32px, 3.4vw, 50px); line-height: .98; letter-spacing: -.045em; text-transform: uppercase; }
.product-size { display: inline-block; width: fit-content; margin: 18px 0 0; border: 2px solid var(--ink); background: var(--yellow); padding: 7px 10px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 17px; font-weight: 850; line-height: 1.2; }
.product-details { max-width: 36ch; margin: 10px 0 0; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; line-height: 1.45; }
#guess-form { display: grid; gap: 13px; }
#guess-form label { font-weight: 1000; text-transform: uppercase; }
.price-field { position: relative; }
.price-field input { width: 100%; height: 88px; border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); font-size: clamp(44px, 5vw, 72px); font-weight: 1000; letter-spacing: -.06em; padding: 0 60px 0 14px; box-shadow: 5px 5px 0 var(--pink); }
.price-field input::placeholder { color: rgba(27,24,48,.28); }
.price-field span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%) rotate(5deg); font-size: 34px; font-weight: 1000; }
.input-help { min-height: 18px; margin: 0; color: var(--muted); font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; }
.input-help.error { color: #c5003c; font-weight: 800; }

.basket-view { align-self: stretch; width: 100%; padding: 76px 22px 45px; overflow: auto; }
.basket-heading { display: flex; justify-content: space-between; gap: 20px; align-items: baseline; margin-bottom: 15px; }
.basket-heading strong { font-size: 22px; text-transform: uppercase; }
.basket-heading span { color: var(--muted); font-size: 11px; font-weight: 900; }
.basket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.basket-item { min-width: 0; height: 150px; display: grid; grid-template-rows: 1fr auto; border: 3px solid var(--ink); padding: 0; color: inherit; text-align: left; background: white; box-shadow: 3px 3px 0 var(--ink); overflow: hidden; cursor: zoom-in; }
.basket-item { grid-template-rows: 1fr auto auto; transition: transform .18s ease, box-shadow .18s ease; }
.basket-item:hover { z-index: 2; transform: scale(1.04); box-shadow: 6px 7px 0 var(--ink); }
.basket-item img, .basket-item .mini-sprite { width: 100%; height: 96px; padding: 7px; object-fit: contain; background-color: white; transition: transform .22s ease; }
.basket-item:hover img, .basket-item:hover .mini-sprite { transform: scale(1.18); }
.basket-item span { padding: 6px 7px 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-top: 2px solid var(--ink); font: 700 10px/1.2 ui-sans-serif, system-ui, sans-serif; }
.basket-item small { padding: 1px 7px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font: 800 9px/1.2 ui-sans-serif, system-ui, sans-serif; }
.mini-sprite { background-size: 400% 300%; }

.result-overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: rgba(27, 24, 48, .58); animation: resultOverlayIn .18s ease-out both; }
.result-card { width: min(650px, 100%); max-height: calc(100dvh - 48px); overflow: auto; position: relative; text-align: center; border: 4px solid var(--ink); border-radius: 24px; padding: clamp(30px, 6vw, 62px); background: white; box-shadow: 12px 12px 0 var(--blue); animation: resultCardIn .3s cubic-bezier(.2,.85,.25,1) both; }
.result-score { display: flex; justify-content: center; align-items: baseline; gap: 8px; margin-bottom: 28px; }
.result-score strong { color: #d31764; font-size: clamp(76px, 12vw, 126px); line-height: .85; letter-spacing: -.08em; }
.result-score span { color: var(--muted); }
.price-comparison { display: grid; grid-template-columns: 1fr 1fr; border: 3px solid var(--ink); }
.price-comparison div { display: grid; gap: 8px; padding: 19px; }
.price-comparison div + div { border-left: 3px solid var(--ink); }
.price-comparison span { font-size: 10px; font-weight: 1000; text-transform: uppercase; }
.price-comparison strong { font-size: 28px; }
.actual-price { background: var(--yellow); }
.result-difference { margin: 22px 0; font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 650; }
.result-card .primary-button { width: 100%; }
.result-card .product-details { max-width: none; margin: 0 0 20px; }

.product-preview-overlay { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; padding: 24px; background: rgba(27, 24, 48, .64); animation: resultOverlayIn .18s ease-out both; }
.product-preview-card { width: min(760px, 100%); max-height: calc(100dvh - 48px); position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr); overflow: auto; border: 4px solid var(--ink); border-radius: 24px; background: white; box-shadow: 12px 12px 0 var(--pink); animation: productPreviewIn .28s cubic-bezier(.2,.85,.25,1) both; }
.product-preview-close { position: absolute; z-index: 2; top: 12px; right: 12px; width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 50%; background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); font-size: 30px; font-weight: 1000; line-height: 1; }
.product-preview-close:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.product-preview-media { min-height: 430px; display: grid; place-items: center; overflow: hidden; border-right: 4px solid var(--ink); background: var(--paper-2); }
.product-preview-media > img, .product-preview-media > .product-preview-image { width: 88%; height: 390px; padding: 22px; object-fit: contain; background-color: white; filter: drop-shadow(9px 10px 0 rgba(27,24,48,.14)); }
.product-preview-copy { min-width: 0; align-self: center; padding: 74px 34px 40px; }
.product-preview-copy h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(34px, 4.2vw, 58px); line-height: .9; letter-spacing: -.055em; text-transform: uppercase; }
.product-preview-copy .product-details { font-size: 13px; }

.summary-screen { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 60px 0 90px; position: relative; text-align: center; }
.summary-finished { margin: 0 0 28px; padding: 12px 24px; border: 3px solid var(--ink); border-radius: 12px; background: var(--pink); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); font-size: clamp(18px, 2.2vw, 26px); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; transform: rotate(-2deg); }
.summary-screen h1 { font-size: clamp(60px, 9vw, 112px); }
.summary-stats { padding: 12px 18px; border: 3px solid var(--ink); border-radius: 12px; background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font-weight: 900; transform: rotate(-1deg); margin: 0 0 28px; }
.summary-screen .final-score { background: var(--yellow); border: 4px solid var(--ink); border-radius: 24px; padding: 24px 30px; box-shadow: 9px 9px 0 var(--pink); transform: rotate(-2deg); }
/* Gentle idle motion follows the score count-up, independently of the entrance effects. */
.summary-screen:not([hidden]) .summary-finished { animation: summarySway 6s 1.2s ease-in-out infinite; }
.summary-screen:not([hidden]) #final-score { display: inline-block; transform-origin: center; animation: scoreBreathe 4.8s 1.2s ease-in-out infinite; }
.share-message-panel { width: min(100%, 640px); display: grid; justify-items: center; gap: 14px; margin: 24px 0 0; padding: 22px; border: 3px solid var(--ink); border-radius: var(--radius); background: white; box-shadow: 5px 5px 0 var(--blue); }
.share-message-panel label { font-weight: 800; }
.share-message-panel textarea { width: 100%; min-width: 0; min-height: 190px; resize: vertical; border: 2px solid var(--ink); border-radius: 10px; padding: 12px; font: 500 14px/1.5 system-ui, sans-serif; background: var(--paper); }
.share-message-panel textarea:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }
@keyframes summarySway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(1deg); } }
@keyframes scoreBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025); } }
.summary-comparison { margin: 10px 0 0; font: 700 11px/1.5 system-ui, sans-serif; }
.summary-screen.high-score h1 { animation: highScoreTitle .72s cubic-bezier(.2,.85,.25,1) both; }
.final-score { margin-top: 38px; display: flex; align-items: baseline; gap: 12px; }
.final-score strong { color: #d31764; font-size: clamp(82px, 14vw, 154px); line-height: .8; letter-spacing: -.08em; text-shadow: 5px 5px 0 var(--yellow); }
.final-score span { color: var(--muted); font-size: 18px; font-weight: 900; }
.summary-screen.high-score .final-score { animation: highScorePulse .85s .35s cubic-bezier(.2,.85,.25,1) both; }
.score-celebration { position: absolute; inset: 70px 0 auto; height: 360px; pointer-events: none; overflow: hidden; }
.score-spark { --x: 50%; --delay: 0ms; position: absolute; left: var(--x); top: 45%; width: 10px; height: 28px; border: 2px solid var(--ink); background: var(--spark, var(--yellow)); opacity: 0; animation: scoreSpark 1s var(--delay) cubic-bezier(.15,.8,.25,1) both; }
.results-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); justify-content: center; gap: 12px; margin: 12px 0 32px; }
.result-chip { min-width: 0; overflow: hidden; border: 3px solid var(--ink); border-radius: 15px; background: white; box-shadow: 4px 4px 0 var(--ink); }
.result-chip:nth-child(3n+1) .result-chip-media { background: #fff1a9; }
.result-chip:nth-child(3n+2) .result-chip-media { background: #d6f0ff; }
.result-chip:nth-child(3n) .result-chip-media { background: #ffe0ee; }
.result-chip:nth-child(3n+2) { transform: rotate(.45deg); }
.result-chip:nth-child(3n) { transform: rotate(-.45deg); }
.result-chip-media { position: relative; height: 130px; display: grid; place-items: center; overflow: hidden; background: var(--paper-2); border-bottom: 3px solid var(--ink); }
.result-chip-media > img, .result-chip-media > .mini-sprite { width: 100%; height: 100%; padding: 7px; object-fit: contain; }
.result-chip-media.collage { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.result-chip-media.collage > img, .result-chip-media.collage > .mini-sprite { min-width: 0; height: 65px; padding: 3px; }
.more-products { position: absolute; right: 5px; bottom: 5px; border: 2px solid var(--ink); background: var(--pink); color: white; padding: 3px 5px; }
.result-chip-copy { padding: 12px; }
.result-chip-copy span, .result-chip-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.result-chip-copy span { color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.result-chip-copy strong { display: block; margin: 7px 0 3px; color: #d31764; }
.result-chip-copy small { font-family: ui-sans-serif, system-ui, sans-serif; color: var(--muted); }
.summary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.seed-label { max-width: 100%; margin-top: 28px; padding: 10px 16px; border: 2px dashed var(--muted); border-radius: 10px; background: rgba(255,255,255,.6); color: var(--muted); font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.seed-label code { color: var(--ink); font-size: 13px; font-weight: 800; }
.seed-label { min-width: 0; max-width: min(780px, 100%); line-height: 1.6; }
.seed-label code { max-width: 100%; cursor: copy; display: inline-block; margin-top: 5px; word-break: break-all; }
.seed-label code:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.custom-settings { margin: 0; padding: 0; border: 0; min-width: 0; transition: opacity .15s ease; }
.custom-settings:disabled .field-card, .custom-settings:disabled .store-check { background: #eeece8; color: #77727a; border-color: #aaa5ab; box-shadow: none; }
.custom-settings:disabled legend, .custom-settings:disabled .store-tools { color: #77727a; }
.custom-settings:disabled output { color: #77727a; }
.custom-settings:disabled input, .custom-settings:disabled select { cursor: not-allowed; }
.custom-settings:disabled .store-tools button { opacity: 1; color: #77727a; background: #eeece8; border-color: #aaa5ab; cursor: not-allowed; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.seed-import { margin: 28px 0; padding: 20px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper); }
.seed-toggle { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 850; }
.seed-toggle input { width: 20px; height: 20px; accent-color: var(--pink); }
.seed-input-label { display: block; margin: 16px 0 6px; font-size: 12px; font-weight: 800; }
#seed-input { width: 100%; min-height: 82px; padding: 10px; resize: vertical; border: 2px solid var(--ink); border-radius: 8px; font: 12px/1.5 monospace; }
#seed-status { margin: 8px 0 0; font: 12px/1.5 system-ui, sans-serif; }
#seed-status.error { color: #b90036; font-weight: 750; }

footer { min-height: 64px; display: flex; align-items: center; justify-content: space-between; border-top: 3px solid var(--ink); color: var(--muted); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
footer a { color: inherit; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 22px; transform: translate(-50%, 25px) rotate(-2deg); opacity: 0; pointer-events: none; border: 3px solid var(--ink); background: var(--yellow); padding: 12px 18px; box-shadow: 5px 5px 0 var(--ink); font-weight: 1000; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }

@keyframes tickerSettle {
  0% { transform: translateX(-3vw); }
  20% { transform: translateX(2.1vw); }
  42% { transform: translateX(-1.35vw); }
  61% { transform: translateX(.85vw); }
  78% { transform: translateX(-.42vw); }
  90% { transform: translateX(.18vw); }
  100% { transform: translateX(0); }
}
@keyframes groceriesFloat { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-1deg); } }
@keyframes progressFlow { to { background-position: 52px 0; } }
@keyframes highScoreTitle { 0% { transform: translateY(22px) scale(.94); opacity: 0; } 68% { transform: translateY(-4px) scale(1.02); opacity: 1; } 100% { transform: none; } }
@keyframes highScorePulse { 0% { transform: scale(.88); opacity: .2; } 65% { transform: scale(1.055) rotate(-1deg); opacity: 1; } 100% { transform: none; } }
@keyframes scoreSpark { 0% { transform: translate(0,0) rotate(0); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rotation)); opacity: 0; } }
@keyframes resultOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes resultCardIn { from { opacity: 0; transform: translateY(24px) scale(.96) rotate(-.6deg); } to { opacity: 1; transform: none; } }
@keyframes productPreviewIn { from { opacity: 0; transform: scale(.9) rotate(-1deg); } to { opacity: 1; transform: none; } }
@keyframes roundVisualIn { from { opacity: .12; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes roundInfoIn { from { opacity: .12; transform: translateX(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 920px) {
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .custom-card { grid-column: 1 / -1; }
  .store-options { grid-template-columns: repeat(3, 1fr); }
  .challenge-card { height: auto; grid-template-columns: 1fr; }
  .challenge-visual { border-right: 0; border-bottom: 4px solid var(--ink); max-height: none; }
  .classic-visual { min-height: 50vh; }
  .basket-view { max-height: 68vh; }
  .guess-panel { overflow: visible; }
  .results-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 220px)); }
}

@media (max-width: 620px) {
  .topbar, footer, main { width: min(100% - 24px, 1240px); }
  .topbar { min-height: 68px; }
  .brand > span:last-child { display: inline; font-size: 11px; white-space: nowrap; }
  .brand { gap: 8px; }
  .brand strong { padding: 4px 5px; }
  .brand-mark { width: 43px; height: 43px; }
  .topbar:has(.game-stats:not([hidden])) .brand { gap: 5px; }
  .topbar:has(.game-stats:not([hidden])) .brand-mark { width: 36px; height: 36px; }
  .topbar:has(.game-stats:not([hidden])) .brand > span:last-child { max-width: 90px; font-size: 9px; white-space: normal; }
  .game-stats { gap: 15px; }
  .game-stats strong { font-size: 16px; }
  .price-ticker { font-size: 8px; letter-spacing: .04em; }
  .ticker-track span { padding: 0 7px; white-space: normal; line-height: 1.25; font-size: 8px; letter-spacing: 0; }
  .hero-layout { min-height: 0; grid-template-columns: 1fr; padding: 42px 0 28px; }
  h1 { font-size: clamp(55px, 18vw, 86px); }
  .home-title { font-size: clamp(42px, 11vw, 68px); }
  h1 em { -webkit-text-stroke-width: 2px; text-shadow: 3px 3px 0 var(--pink); }
  .cart-illustration { width: 230px; height: 205px; justify-self: center; margin-top: -18px; }
  .cart-illustration svg { width: 230px; height: 195px; }
  .cart-circle { width: 145px; height: 145px; }
  .mode-grid, .custom-grid { grid-template-columns: 1fr; }
  .mode-card, .basket-card, .custom-card { min-height: 280px; transform: rotate(var(--card-tilt)); }
  .custom-card h2 { font-size: clamp(28px, 8vw, 40px); white-space: nowrap; }
  .store-options { grid-template-columns: 1fr 1fr; }
  .custom-heading { align-items: flex-start; }
  .challenge-card { box-shadow: 6px 6px 0 var(--pink); }
  .classic-visual { min-height: 43vh; }
  .product-image, .product-sprite { width: min(76%, 330px); height: min(38vh, 340px); }
  .guess-panel { padding: 28px 20px; }
  .game-stats { gap: 8px; }
  .quit-button { padding: 6px; font-size: 9px; }
  .summary-screen .final-score { padding: 20px 16px; gap: 7px; }
  .summary-screen .final-score strong { font-size: clamp(58px, 19vw, 100px); }
  .summary-screen .final-score span { font-size: 14px; }
  .game-stats span { font-size: 8px; letter-spacing: .06em; }
  .basket-view { padding: 72px 12px 38px; }
  .basket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .basket-heading { align-items: flex-start; flex-direction: column; }
  .price-comparison { grid-template-columns: 1fr; }
  .price-comparison div + div { border-left: 0; border-top: 3px solid var(--ink); }
  .result-overlay { align-items: end; padding: 12px; }
  .result-card { max-height: calc(100dvh - 24px); padding: 26px 20px 22px; box-shadow: 7px 7px 0 var(--blue); }
  .result-score { margin-bottom: 20px; }
  .result-score strong { font-size: clamp(66px, 24vw, 96px); }
  .product-preview-overlay { align-items: end; padding: 12px; }
  .product-preview-card { max-height: calc(100dvh - 24px); grid-template-columns: 1fr; box-shadow: 7px 7px 0 var(--pink); }
  .product-preview-media { min-height: 310px; border-right: 0; border-bottom: 4px solid var(--ink); }
  .product-preview-media > img, .product-preview-media > .product-preview-image { width: 82%; height: 290px; padding: 14px; }
  .product-preview-copy { padding: 28px 22px 24px; }
  .product-preview-copy h2 { font-size: clamp(30px, 10vw, 46px); }
  .results-grid { max-width: 460px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; }
  .result-chip-media { height: 120px; }
  .summary-actions { width: 100%; }
  .summary-actions button { width: 100%; }
  footer { gap: 10px; }
}

@media (max-width: 380px) {
  .topbar:has(.game-stats:not([hidden])) .brand > span:last-child { max-width: 88px; white-space: normal; }
  .topbar:has(.game-stats:not([hidden])) .brand { gap: 5px; }
  .topbar:has(.game-stats:not([hidden])) .brand-mark { width: 36px; height: 36px; }
  .topbar:has(.game-stats:not([hidden])) .brand > span:last-child { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .summary-screen .summary-finished, .summary-screen #final-score, .summary-screen.high-score h1, .summary-screen.high-score .final-score, .ticker-track, .cart-groceries, .progress-track span, .score-spark, .result-overlay, .result-card, .product-preview-overlay, .product-preview-card, .challenge-visual, .guess-panel { animation: none !important; transition: none !important; }
}

/* Private beta uses the same prospectus palette with a single focused form. */
.beta-screen { width: min(100% - 36px, 600px); min-height: 100vh; margin: auto; padding: 64px 0 30px; display: grid; align-content: center; justify-items: center; gap: 26px; }
.beta-card { width: 100%; min-width: 0; padding: clamp(24px, 5vw, 44px); border: 3px solid var(--ink); border-radius: 24px; background: var(--paper); box-shadow: 10px 10px 0 var(--pink); }
.beta-sticker { display: inline-block; margin: 0 0 24px; padding: 9px 14px; border: 2px solid var(--ink); border-radius: 8px; background: var(--yellow); transform: rotate(-3deg); font-weight: 900; font-size: 13px; text-transform: uppercase; }
.beta-brand { font-weight: 1000; font-size: clamp(16px, 4vw, 24px); }
.beta-brand span { background: var(--pink); padding: 3px 6px; }
.beta-card h1 { margin: 24px 0; font-size: clamp(60px, 13vw, 90px); }
.beta-intro, .beta-note, .beta-caption { font: 600 15px/1.5 system-ui, sans-serif; }
.beta-card form { display: grid; gap: 12px; margin: 26px 0; }
.beta-card label { font-weight: 900; }
.beta-card input[type="password"] { width: 100%; min-width: 0; padding: 16px; border: 3px solid var(--ink); border-radius: 12px; background: white; font: 600 20px/1.2 system-ui, sans-serif; }
.beta-error { color: #a41148; font: 700 14px/1.4 system-ui, sans-serif; margin: 0; }
.beta-error:empty { display: none; }
.beta-note { margin-bottom: 0; color: var(--muted); }
.beta-caption { text-align: center; font-size: 13px; }
