:root {
  color-scheme: dark;
  --page: #111513;
  --surface: #19201e;
  --strong: #242c29;
  --ink: #f7f5ed;
  --muted: #9fa9a4;
  --line: #37423e;
  --yellow: #f5c85d;
  --coral: #ef756d;
  --mint: #69d5ae;
  --blue: #78aee0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; min-height: 100%; background: var(--page); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; }
.shell { min-height: 100svh; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 62px; border-bottom: 1px solid var(--line); padding: 8px clamp(14px, 3vw, 34px); background: #151a18; }
.back-link, .brand { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 850; }
.back-link { justify-self: start; min-height: 40px; color: var(--muted); text-decoration: none; }
.brand { justify-self: center; white-space: nowrap; }
.brand-mark { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 5px; background: var(--yellow); color: #161812; font-size: 13px; }
.language-button { justify-self: end; width: 42px; height: 36px; border: 1px solid var(--line); border-radius: 5px; background: var(--strong); color: var(--yellow); cursor: pointer; font-size: 11px; font-weight: 950; }
.screen-heading p, .game-heading p, .guess-copy p, .price-control p, .reveal-panel p { margin: 0; color: var(--mint); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.setup-screen, .final-screen { width: min(980px, calc(100% - 36px)); margin: auto; padding: clamp(44px, 7vw, 76px) 0 70px; }
.screen-heading { margin-bottom: 32px; }
.screen-heading h1 { margin: 5px 0 9px; font-size: clamp(40px, 6.3vw, 68px); line-height: 1; letter-spacing: 0; }
.screen-heading > span { color: var(--muted); font-size: 15px; }
.mode-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.mode-option { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.mode-option:hover, .mode-option:focus-visible, .mode-option.is-active { border-color: var(--yellow); background: var(--strong); }
.mode-icon { grid-row: 1 / 3; display: grid; width: 52px; height: 52px; place-items: center; border-radius: 5px; background: var(--yellow); color: #161812; font-size: 16px; font-weight: 950; }
.mode-option strong { align-self: end; font-size: 16px; }
.mode-option small { align-self: start; margin-top: 3px; color: var(--muted); }
.setup-row { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 24px; padding-top: 22px; }
.setting { display: grid; gap: 8px; }
.setting > span { color: var(--muted); font-size: 11px; font-weight: 850; text-transform: uppercase; }
.segments { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.segments button { min-width: 58px; min-height: 43px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 900; }
.segments button:last-child { border-right: 0; }
.segments button:hover, .segments button:focus-visible, .segments button.is-active { background: var(--mint); color: #111713; }
.reference-note { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: 11px; }
.reference-note > span:first-child { display: grid; width: 24px; height: 24px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--mint); font-weight: 900; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; border: 1px solid transparent; border-radius: 6px; padding: 0 18px; cursor: pointer; font-size: 13px; font-weight: 900; }
.button.primary { border-color: var(--yellow); background: var(--yellow); color: #181912; }
.button.secondary { border-color: var(--line); background: var(--strong); color: var(--ink); }
.button:disabled { cursor: not-allowed; opacity: .38; }
.button:hover:not(:disabled), .button:focus-visible:not(:disabled) { filter: brightness(1.08); }
.play-screen { padding-bottom: 84px; }
.round-bar { display: flex; align-items: center; justify-content: space-between; min-height: 62px; border-bottom: 1px solid var(--line); padding: 8px clamp(16px, 4vw, 50px); background: var(--surface); }
.round-bar > div { display: flex; flex-direction: column; gap: 2px; }
.round-bar span { color: var(--mint); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.round-bar strong { color: var(--muted); font-size: 12px; }
.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; width: min(1120px, calc(100% - 36px)); margin: 26px auto 18px; }
.game-heading h1 { margin: 4px 0 0; font-size: clamp(28px, 4vw, 46px); line-height: 1.04; letter-spacing: 0; }
.game-heading > span { flex: none; color: var(--yellow); font-size: 12px; font-weight: 900; }
.offer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; width: min(1120px, calc(100% - 36px)); margin: auto; }
.offer-card { position: relative; display: grid; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; padding: 0; background: var(--surface); cursor: pointer; text-align: left; }
.offer-card:hover:not(:disabled), .offer-card:focus-visible:not(:disabled) { border-color: var(--yellow); transform: translateY(-2px); }
.offer-card:disabled { cursor: default; }
.offer-visual { display: grid; min-height: 142px; place-content: center; justify-items: center; gap: 5px; background: var(--visual, var(--strong)); }
.offer-visual > span { font-size: 50px; filter: drop-shadow(0 7px 10px rgba(0, 0, 0, .2)); }
.offer-visual small { color: rgba(255, 255, 255, .78); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.offer-copy { display: flex; min-height: 104px; flex-direction: column; padding: 13px; }
.offer-copy small { margin-bottom: 4px; color: var(--mint); font-size: 9px; font-weight: 900; text-transform: uppercase; }
.offer-copy strong { font-size: 15px; line-height: 1.18; }
.offer-copy span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.selection-badge { position: absolute; top: 9px; right: 9px; display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid var(--page); border-radius: 50%; background: var(--yellow); color: #151712; font-size: 12px; font-weight: 950; }
.offer-card.is-selected { opacity: .62; }
.offer-card.is-revealed { opacity: 1; }
.offer-card.is-correct { border-color: var(--mint); }
.actual-price { display: block; margin-top: auto; padding-top: 9px; color: var(--yellow) !important; font-size: 17px !important; font-weight: 950; }
.order-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: min(1120px, calc(100% - 36px)); margin: 12px auto 0; }
.order-slot { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; min-height: 44px; border: 1px dashed var(--line); border-radius: 5px; padding: 6px 8px; color: var(--muted); font-size: 10px; }
.order-slot b { color: var(--yellow); font-size: 13px; }
.order-slot strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.guess-game { width: min(1050px, calc(100% - 36px)); margin: 34px auto; }
.guess-offer { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 34px; border-bottom: 1px solid var(--line); padding-bottom: 30px; }
.offer-visual--large { min-height: 210px; border-radius: 8px; }
.offer-visual--large > span { font-size: 82px; }
.guess-copy h1 { margin: 6px 0 9px; font-size: clamp(34px, 5vw, 58px); line-height: 1.03; letter-spacing: 0; }
.guess-copy > span { color: var(--muted); font-size: 14px; }
.price-control { display: grid; justify-items: center; padding: 28px 0; }
.price-control output { margin: 5px 0 16px; color: var(--yellow); font-size: clamp(42px, 7vw, 70px); font-weight: 950; line-height: 1; }
.price-control input { width: min(700px, 100%); accent-color: var(--yellow); cursor: pointer; }
.stepper { display: grid; grid-template-columns: repeat(4, 64px); gap: 7px; margin-top: 18px; }
.stepper button { min-height: 44px; border: 1px solid var(--line); border-radius: 5px; background: var(--strong); cursor: pointer; font-weight: 950; }
.stepper button:hover, .stepper button:focus-visible { border-color: var(--yellow); }
.reveal-panel { width: min(1120px, calc(100% - 36px)); margin: 18px auto 0; border-top: 1px solid var(--line); padding: 18px 0; text-align: center; }
.reveal-panel h1 { margin: 4px 0; font-size: 30px; }
.reveal-panel > span { color: var(--muted); }
.action-bar { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 130px 1fr 150px; align-items: center; gap: 20px; min-height: 72px; border-top: 1px solid var(--line); padding: 10px max(20px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(21, 26, 24, .97); backdrop-filter: blur(14px); }
.action-bar > div { display: flex; min-width: 0; flex-direction: column; gap: 2px; text-align: center; }
.action-bar span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.action-bar strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.action-bar .button span { color: inherit; font-size: 13px; text-transform: none; }
.final-score { display: grid; justify-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px; text-align: center; }
.final-score > span { color: var(--mint); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.final-score strong { color: var(--yellow); font-size: 72px; line-height: 1; }
.final-score small { margin-top: 6px; color: var(--muted); }
.recap-list { display: grid; }
.recap-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.recap-row > span:first-child { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 5px; background: var(--strong); }
.recap-row strong { display: block; }
.recap-row small { color: var(--muted); }
.recap-row > b { color: var(--yellow); }
.final-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 24px; }
:focus-visible { outline: 3px solid rgba(105, 213, 174, .75); outline-offset: 3px; }

@media (max-width: 850px) {
  .offer-grid { grid-template-columns: repeat(3, 1fr); }
  .order-strip { grid-template-columns: repeat(5, minmax(110px, 1fr)); overflow-x: auto; padding-bottom: 5px; }
  .offer-card:nth-child(n+4) { grid-column: span 1; }
}

@media (max-width: 620px) {
  .topbar { grid-template-columns: auto 1fr auto; padding-inline: 12px; }
  .brand { font-size: 11px; }
  .setup-screen, .final-screen { width: calc(100% - 28px); padding-top: 38px; }
  .screen-heading h1 { font-size: 39px; }
  .mode-picker { grid-template-columns: 1fr; }
  .setup-row { grid-template-columns: 1fr; align-items: stretch; gap: 16px; }
  .setup-row .button { width: 100%; }
  .game-heading { align-items: start; flex-direction: column; gap: 7px; margin-top: 19px; }
  .game-heading h1 { font-size: 29px; }
  .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .offer-grid .offer-card:last-child { grid-column: 1 / -1; }
  .offer-visual { min-height: 105px; }
  .offer-visual > span { font-size: 40px; }
  .offer-copy { min-height: 87px; padding: 10px; }
  .offer-copy strong { font-size: 13px; }
  .offer-copy > span:not(.actual-price) { display: none; }
  .guess-offer { grid-template-columns: 105px minmax(0, 1fr); gap: 15px; padding-bottom: 22px; }
  .offer-visual--large { min-height: 115px; }
  .offer-visual--large > span { font-size: 48px; }
  .guess-copy h1 { font-size: 28px; }
  .guess-copy > span { font-size: 12px; }
  .stepper { grid-template-columns: repeat(4, 1fr); width: 100%; }
  .round-bar { padding-inline: 14px; }
  .round-bar .button { width: 44px; padding: 0; }
  .round-bar .button span:last-child { display: none; }
  .action-bar { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; padding-inline: 12px; }
  .action-bar #undo-button { width: 44px; padding: 0; }
  .action-bar #undo-button span:last-child { display: none; }
  .action-bar #action-button { padding-inline: 13px; }
  .final-actions { align-items: stretch; flex-direction: column-reverse; }
}
