:root {
  color-scheme: dark;
  --bg: #101714;
  --bg-raise: #17241e;
  --ink: #f6f1e7;
  --muted: #d5cbbd;
  --card: #f7f1e6;
  --card-ink: #1c1612;
  --card-muted: #3d342c;
  --line: #2f4a3c;
  --amber: #f0c14b;
  --amber-ink: #1c1406;
  --focus: #ffe08a;
  --mint: #b7f0d0;
  --mint-ink: #10281c;
  --warn: #ffc9c0;
  --warn-ink: #3b1210;
  --marquee: #1d4636;
  --marquee-ink: #f6e7b2;
  --sold: #0e7a45;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 50% -10%, #1c3a2e 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.4;
}

body {
  height: 100vh;
  height: 100svh;
  max-height: 100vh;
  max-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.skip {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 40;
  transform: translateY(-150%);
  background: var(--amber);
  color: var(--amber-ink);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 750;
}

.skip:focus { transform: none; }

.top {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  max-height: 42svh;
  overflow: auto;
  display: grid;
  gap: 6px 16px;
  align-items: center;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: rgba(16, 23, 20, 0.96);
  border-bottom: 2px solid var(--line);
}

.brand__row, .hud, .goal__meta, .home-actions, .result-actions, .sheet-actions, .flash__line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.goal { position: relative; }

#goal-now {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand__row { justify-content: space-between; }

h1, h2, p { margin: 0; }

h1 { font-size: 1.35rem; letter-spacing: -0.03em; line-height: 1.15; }

.kicker, #subtitle, #announce, .hint { color: var(--muted); }

.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

#subtitle { margin-top: 2px; }

.hud { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; }

#day { font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; }

#cash {
  justify-self: end;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.65rem;
  color: var(--amber-ink);
  background: var(--amber);
  border-radius: 8px;
  padding: 4px 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.goal { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.goal__meta { justify-content: space-between; font-size: 1.05rem; font-weight: 800; }

#goal-now { font-variant-numeric: tabular-nums; }

progress.goal, progress#goal {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: #24362f;
  overflow: hidden;
}

progress#goal::-webkit-progress-bar {
  background: #24362f;
  border-radius: 999px;
}

progress#goal::-webkit-progress-value {
  background: linear-gradient(90deg, #c8922a, var(--amber));
  border-radius: 999px;
}

progress#goal::-moz-progress-bar {
  background: var(--amber);
  border-radius: 999px;
}

progress#goal.is-won::-webkit-progress-value { background: #3dbe7a; }
progress#goal.is-won::-moz-progress-bar { background: #3dbe7a; }

#announce { font-size: 0.95rem; }

button, select, input {
  font: inherit;
  color: var(--card-ink);
  background: var(--card);
  border: 2px solid #1c1612;
  border-radius: 10px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
}

button { cursor: pointer; font-weight: 750; }

#lang {
  background: #24382e;
  color: var(--ink);
  border-color: #8ee0b8;
}

button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible, progress:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button:disabled { cursor: not-allowed; opacity: 0.55; }

button:active { transform: translateY(1px); }

.flash {
  flex: 0 0 auto;
  z-index: 3;
  background: var(--bg-raise);
  color: var(--ink);
  border-bottom: 2px solid var(--line);
  padding: 8px 12px;
}

.flash strong {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 1.2rem;
  color: var(--amber);
}

.flash.is-down { box-shadow: inset 4px 0 0 var(--warn); }
.flash.is-up { box-shadow: inset 4px 0 0 var(--mint); }

.flash__sub { color: var(--muted); font-size: 0.92rem; }

main {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 12px 12px 20px;
}

.home-lead { font-size: 1.15rem; max-width: 38rem; }

.home-actions { margin-top: 12px; }

#play, #next, #replay {
  background: var(--amber);
  color: var(--amber-ink);
  border-color: #a87b12;
  min-height: 52px;
  font-size: 1.05rem;
}

#play { padding-inline: 22px; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; color: var(--ink); }

.machine {
  background: linear-gradient(180deg, #2c5344 0 46px, #173028 46px, #10241c 100%);
  border: 3px solid #d7c4a3;
  border-radius: 26px;
  padding: 10px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.machine--hero { max-width: 440px; margin: 4px auto 16px; }

.marquee {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  color: var(--marquee-ink);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 8px 8px;
}

.leds { display: flex; gap: 6px; }
.leds span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.glass {
  background:
    linear-gradient(180deg, rgba(220, 245, 232, 0.16), rgba(6, 12, 10, 0.25) 28%, rgba(6, 12, 10, 0.45)),
    #10241c;
  border: 2px solid rgba(190, 230, 210, 0.35);
  border-radius: 14px;
  padding: 10px;
}

.hero-glass {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--card-ink);
  background: var(--card);
  border-radius: 12px;
  padding: 6px 4px 8px;
  font-weight: 800;
  font-size: 0.85rem;
}

.tray { margin-top: 10px; padding: 8px 12px 4px; }
.tray__mouth {
  display: block;
  height: 22px;
  border-radius: 0 0 12px 12px;
  background: #070c0a;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.14), inset 0 -6px 10px rgba(0, 0, 0, 0.45);
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.card {
  background: var(--card);
  color: var(--card-ink);
  border: 2px solid #1c1612;
  border-radius: 16px;
  padding: 10px;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
}

.card.is-sold { box-shadow: inset 0 0 0 3px var(--sold); }

.art {
  background: linear-gradient(180deg, #e7f3ec, #c9ddd2);
  border: 2px solid #1c1612;
  border-radius: 12px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.icon { width: 72px; height: 78px; display: block; }
.coil path, .icon .handle, .icon .steam, .icon .crimp {
  fill: none;
  stroke: #3d5c4c;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.icon--e .body { fill: #2f89c5; }
.icon--e .cap { fill: #f7f1e6; stroke: #1c1612; stroke-width: 1.6; }
.icon--e .shine { fill: #d7f3fb; }
.icon--s .body { fill: #d23b3b; }
.icon--s .top { fill: #ff8d86; }
.icon--s .band { fill: #f7f1e6; }
.icon--c .body { fill: #f4efe4; stroke: #1c1612; stroke-width: 2; }
.icon--c .drink { fill: #4a2c1a; }
.icon--b .body { fill: #6b3e22; }
.icon--b .band { fill: #f0c14b; }
.icon--h .body { fill: #f0c14b; stroke: #1c1612; stroke-width: 2; }
.icon--h .mark { fill: #d23b3b; }
.icon--f .body { fill: #d63b3b; }
.icon--f .leaf { fill: #2f9e5a; }
.icon--f .stem { fill: #6b3e22; }
.icon--f .shine { fill: #ffd0d0; }

.pips { display: grid; grid-template-columns: repeat(4, 8px); gap: 3px; }
.pip { width: 8px; height: 8px; border-radius: 2px; background: #8aa396; }
.pip.is-on { background: var(--sold); }

.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card h2 { font-size: 1.15rem; }

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 44px;
  gap: 6px;
  align-items: center;
}
.price-row input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; font-size: 1rem; }
.price-row button { width: 44px; min-width: 44px; padding-inline: 0; }

.qty-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: end;
}
.qty-row button { width: 100%; }

.card .hint, .card .estimate, .card .meta { color: var(--card-muted); }
.estimate {
  background: #e7f0ea;
  color: var(--card-ink);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 750;
}
.planned { font-weight: 750; color: var(--warn-ink); background: var(--warn); border-radius: 8px; padding: 6px 8px; }
.sold {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--mint-ink);
  font-weight: 800;
}

.qty-row label { color: var(--card-ink); flex: 1 1 8rem; }
.qty-row select { width: 100%; }

.stage { display: flex; flex-direction: column; gap: 12px; }
.week { order: 0; }
.supplier { order: 1; }
.machine { order: 2; }
.coach { order: 3; }
.report { order: 4; }

.week h2 { font-size: 1.05rem; }
.week p { color: var(--muted); }
.week ol {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.week li {
  min-height: 44px;
  border-radius: 8px;
  background: #24362f;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 750;
  font-size: 0.78rem;
  line-height: 1.15;
  text-align: center;
}
.week li.is-focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.week .day--weekend { background: var(--warn); color: var(--warn-ink); }
.week .day--remote { background: var(--amber); color: var(--amber-ink); }
.week .day__tag { font-size: 0.68rem; font-weight: 700; }

.supplier {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.supplier legend { font-weight: 800; padding: 0; }
.supplier__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.supplier button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
}
.supplier button[aria-checked="true"] {
  background: var(--amber);
  color: var(--amber-ink);
  border-color: #a87b12;
}
.supplier__hint { font-size: 0.78rem; font-weight: 650; line-height: 1.25; }

.bilan { display: flex; flex-direction: column; gap: 8px; }
.bilan h2 { font-size: 1.15rem; }
.bilan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bilan li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fffaf3;
}
.bilan li.is-you { background: var(--amber); color: var(--amber-ink); }
.bilan strong { font-variant-numeric: tabular-nums; }

.mark {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.35rem;
  vertical-align: -0.05rem;
  border: 2px solid #1c1612;
}
.mark--fair { background: #f0c14b; border-radius: 50%; }
.mark--rain { background: #2f89c5; border-radius: 40% 40% 50% 50%; }
.mark--heat { background: #d23b3b; clip-path: polygon(50% 0, 100% 100%, 0 100%); border: 0; }

.coach, .report, .ticket, .note {
  background: var(--card);
  color: var(--card-ink);
  border-radius: 16px;
  padding: 12px;
}

.coach { border-left: 6px solid var(--sold); display: flex; flex-direction: column; gap: 8px; }
.coach .hint, .report .hint, .ticket .hint { color: var(--card-muted); }
.stakes {
  background: var(--amber);
  color: var(--amber-ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
}

.report { display: flex; flex-direction: column; gap: 8px; }
.report h2 { font-size: 1.05rem; }
.report__sum {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.report ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 4px; }
.wx { font-weight: 750; }

.ticket { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.score-kicker { letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; color: var(--card-muted); font-size: 0.8rem; }
#score {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.outcome-hit { background: var(--mint); color: var(--mint-ink); border-radius: 10px; padding: 8px 10px; font-weight: 800; }
.outcome-miss { background: var(--warn); color: var(--warn-ink); border-radius: 10px; padding: 8px 10px; font-weight: 800; }
.frozen {
  background: var(--warn);
  color: var(--warn-ink);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
}

.link {
  width: 100%;
  min-width: 0;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85rem;
  overflow: auto;
}

.sheet {
  width: min(100%, 460px);
  background: var(--card);
  color: var(--card-ink);
  border: 2px solid #1c1612;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(80svh, 640px);
  overflow: auto;
}

.sheet h2 { font-size: 1.2rem; }
.warn { background: var(--warn); color: var(--warn-ink); border-radius: 10px; padding: 8px 10px; font-weight: 800; }

.pick {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fffaf3;
}
.pick .icon { width: 36px; height: 40px; }

#change {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 12, 10, 0.72);
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}

.dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(16, 23, 20, 0.98);
  border-top: 2px solid var(--line);
}

#next, #replay { flex: 1 1 180px; }
#quit {
  background: #24382e;
  color: var(--ink);
  border-color: #8ee0b8;
}

#flash[hidden], #board[hidden], #result[hidden], #dock[hidden], #quit[hidden], #change[hidden], #home[hidden], #next[hidden], #replay[hidden], #board-panel[hidden], #score-form[hidden], #board-empty[hidden], #board-live[hidden], #board-seed[hidden], #dock-jumps[hidden] {
  display: none !important;
}

input, select, .card, .sheet, .report, .coach, .ticket, .note { color-scheme: light; }

@media (max-width: 899px) {
  .machine { order: 1; }
  .week { order: 2; }
  .supplier { order: 3; }
  .coach { order: 4; }
  .report { order: 5; }
  .machine-tray { display: none; }
  .is-playing .kicker,
  .is-playing #subtitle,
  .is-over .kicker,
  .is-over #subtitle {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  #quit, #next, #replay { flex: 1 1 100%; }
  .supplier__choices { grid-template-columns: 1fr; }
}

@media (min-width: 900px) {
  .top {
    grid-template-columns: minmax(240px, 0.9fr) minmax(280px, 1.1fr);
    max-width: 1080px;
    width: min(1080px, 100%);
    margin: 0 auto;
    padding-inline: 20px;
  }
  .hud { grid-column: 2; grid-row: 1; }
  #announce { grid-column: 1 / -1; }
  h1 { font-size: 1.7rem; }
  #day { font-size: 1.55rem; }
  #cash { font-size: 2rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card { grid-template-columns: 1fr; }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
    grid-template-areas:
      "week week"
      "supplier supplier"
      "machine coach"
      "machine recap";
    align-items: start;
  }
  .week { grid-area: week; order: 0; }
  .supplier { grid-area: supplier; order: 0; }
  .machine { grid-area: machine; order: 0; }
  .coach { grid-area: coach; order: 0; }
  .report { grid-area: recap; order: 0; }
  #next, #replay { flex: 0 1 240px; }
}

@media (prefers-reduced-motion: no-preference) {
  .card.is-sold .icon { animation: vend-drop 0.7s cubic-bezier(.18, .8, .2, 1); }
  .machine.is-vending .tray__mouth { animation: flap 0.7s ease; }
  .machine.is-vending .leds span { animation: blink 0.7s ease; }
  .report.is-fresh { animation: ticket 0.4s ease; }
  #score { animation: ticket 0.45s ease; }
}

@media (prefers-reduced-motion: reduce) {
  .card.is-sold .icon,
  .machine.is-vending .tray__mouth,
  .machine.is-vending .leds span,
  .report.is-fresh,
  #score,
  button:active,
  .drop,
  .coin,
  .coinburst i,
  .confetti i,
  .rain,
  .leds span,
  .mood.is-pop,
  .window.is-stockout,
  .art.is-stockout,
  .card.is-late,
  .card.is-tossed,
  .flash.is-up,
  .flash.is-down,
  .spark {
    animation: none;
    transform: none;
  }
  .confetti { display: none; }
}

@keyframes vend-drop {
  0% { transform: translateY(-12px); }
  45% { transform: translateY(8px); }
  100% { transform: translateY(0); }
}

@keyframes flap {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(7px); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  40% { opacity: 0.35; }
}

#score { color: var(--card-ink); }

.ticket label { color: var(--card-ink); }

.home-board { margin-top: 8px; }
.home-board a, .board-more a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 750;
  color: var(--amber);
}
.ticket .board-more a { color: var(--card-ink); text-decoration: underline; text-underline-offset: 3px; }

.board-panel, .score-form, #score-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.score-form, #score-form { margin: 0; }
.score-form input[type="text"], #score-form input[type="text"] { width: 100%; min-width: 0; }
#score-submit, .score-form button {
  background: var(--amber);
  color: var(--amber-ink);
  border-color: #a87b12;
}

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.board li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--card);
  color: var(--card-ink);
}
.ticket .board li { background: #fffaf3; border: 2px solid #1c1612; }
.board-name { overflow-wrap: anywhere; font-weight: 750; }
.board-score, .board-rank { font-variant-numeric: tabular-nums; font-weight: 800; }
.board-score { white-space: nowrap; }
.board form { margin: 0; grid-column: 1 / -1; }
.board button { width: 100%; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.board-page {
  display: block;
  height: auto;
  min-height: 100svh;
  max-height: none;
  overflow: auto;
}
body.board-page .top {
  position: static;
  max-height: none;
  overflow: visible;
  width: min(720px, 100%);
  margin: 0 auto;
  grid-template-columns: 1fr;
}
body.board-page main {
  overflow: visible;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 16px 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
body.board-page a.nav {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #24382e;
  color: var(--ink);
  text-decoration: none;
  font-weight: 750;
}
body.board-page .board-nav { display: flex; flex-wrap: wrap; gap: 8px; }
body.board-page #board-intro { max-width: 40rem; }

@keyframes ticket {
  from { transform: translateY(8px); }
  to { transform: none; }
}

body:not(.board-page) .top {
  padding-top: calc(58px + env(safe-area-inset-top, 0px));
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 2;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid #8ee0b8;
  background: #24382e;
  color: #f6f1e7;
  text-decoration: none;
  font-weight: 750;
  font-size: 1rem;
  line-height: 1.1;
}
.site-nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.brand__tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

#sound {
  background: #24382e;
  color: var(--ink);
  border-color: #8ee0b8;
}

.scene {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  right: 0;
  height: calc(58px + env(safe-area-inset-top, 0px));
  overflow: hidden;
  pointer-events: none;
}

.brand, .hud, #announce { position: relative; z-index: 1; }

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #7ec8ff 0%, #ffe3a3 78%, #e7c98a 100%);
}

body[data-moment="evening"] .sky {
  background: linear-gradient(180deg, #12162e 0%, #9a3d22 70%, #1a120e 100%);
}

body[data-weather="rain"] .sky {
  background: linear-gradient(180deg, #4e6478 0%, #b7c4cc 100%);
}

body[data-moment="evening"][data-weather="rain"] .sky {
  background: linear-gradient(180deg, #151c30 0%, #3c4d60 100%);
}

body[data-weather="heat"] .sky {
  background: linear-gradient(180deg, #ff9a3c 0%, #ffe08a 100%);
}

body[data-moment="evening"][data-weather="heat"] .sky {
  background: linear-gradient(180deg, #3a2048 0%, #e07a3a 70%, #2a1810 100%);
}

.sun, .moon {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  top: 8px;
}

.sun { left: 14px; background: #ffe08a; box-shadow: 0 0 16px #ffe08a; }
.moon { right: 16px; background: #f6f1e7; box-shadow: 0 0 12px #f6f1e7; }
body[data-moment="day"] .moon { display: none; }
body[data-moment="evening"] .sun { display: none; }

.rain, .heat, .spark { position: absolute; inset: 0; display: none; pointer-events: none; }
body[data-weather="rain"] .rain {
  display: block;
  background: repeating-linear-gradient(105deg, transparent 0 7px, rgba(255, 255, 255, 0.55) 7px 8px);
  animation: rain 0.7s linear infinite;
}
body[data-weather="heat"] .heat {
  display: block;
  background: repeating-linear-gradient(180deg, transparent 0 8px, rgba(255, 80, 40, 0.18) 8px 10px);
  animation: heat 1.4s ease-in-out infinite;
}
body[data-event="party"] .spark { display: block; }
.spark {
  background:
    radial-gradient(circle at 20% 40%, #f0c14b 0 3px, transparent 4px),
    radial-gradient(circle at 70% 30%, #ff8d86 0 3px, transparent 4px);
}
.spark--b {
  background:
    radial-gradient(circle at 40% 60%, #b7f0d0 0 3px, transparent 4px),
    radial-gradient(circle at 84% 50%, #ffe08a 0 3px, transparent 4px);
}

.room {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  height: 34px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.bay {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
  border-radius: 6px 6px 2px 2px;
  background: #f3e6cf;
  overflow: hidden;
  color: #1c1612;
}

.bay.is-remote { background: #f0c14b; }
.bay.is-weekend {
  background: repeating-linear-gradient(90deg, #2c2428 0 3px, #4a3a3e 3px 6px);
}
.bay.is-today { outline: 2px solid #ffe08a; outline-offset: -2px; }
.bay.is-out { background: repeating-linear-gradient(90deg, #24302c 0 4px, #1a2420 4px 8px); opacity: 0.7; }
.bay.is-out .person, .bay.is-out .chair { display: none; }

.person {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1c1612;
  flex: 0 0 auto;
}
.chair {
  width: 12px;
  height: 7px;
  border: 2px solid #1c1612;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}
.bay.is-open .chair, .bay.is-weekend .person, .bay.is-remote .person, body[data-event="remote"] .person { display: none; }
.bay.is-weekend .chair, .bay.is-remote .chair { display: block; border-color: #1c1612; }
.bay.is-weekend .chair { border-color: #f6f1e7; }

.bay__label {
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 100%;
  padding: 0 1px 1px;
  text-align: center;
  color: #1c1612;
  white-space: nowrap;
}
.bay.is-weekend .bay__label { color: #f6f1e7; }

.machine {
  background:
    linear-gradient(180deg, #3e715c 0 48px, #163028 48px 58px, #10241c 58px);
  border: 4px solid #e7d3b0;
  box-shadow:
    0 0 0 4px #1c1612,
    0 18px 36px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.14);
}

.marquee { text-shadow: 0 0 10px #f6e7b2; }
.leds span { animation: glow 1.6s ease-in-out infinite; }
.leds span:nth-child(2) { animation-delay: 0.2s; }
.leds span:nth-child(3) { animation-delay: 0.4s; }

.mood {
  margin: 0 8px 8px;
  min-height: 1.2em;
  color: #f6e7b2;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.mood.is-pop { animation: pop 0.4s ease; }

.glass {
  box-shadow:
    inset 0 0 28px rgba(190, 255, 220, 0.22),
    inset 0 10px 16px rgba(255, 255, 255, 0.08);
}

.cabinet {
  position: relative;
  margin: 0 4px 10px;
  padding: 8px;
  border-radius: 16px;
  background: #0c1914;
  box-shadow: inset 0 0 24px rgba(255, 224, 138, 0.16);
}

.windows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.window {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 12px;
  border: 2px solid rgba(230, 255, 240, 0.4);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 224, 138, 0.5), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.28));
  box-shadow: inset 0 0 16px rgba(255, 230, 160, 0.28);
  position: relative;
}

.window .icon { width: 42px; height: 46px; }
.window.is-empty {
  background: repeating-linear-gradient(135deg, #101c17 0 7px, #1a2e24 7px 14px);
  box-shadow: inset 0 0 0 2px #6d7d74;
}
.window.is-empty .coil path { stroke: #f6f1e7; }
.window.is-vending .icon { animation: vend-drop 0.7s cubic-bezier(.18, .8, .2, 1); }
.window.is-stockout { animation: shake 0.45s linear; }

.window__name, .window__void {
  color: #f6f1e7;
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1.1;
  text-align: center;
}
.window__void { letter-spacing: 0.08em; text-transform: uppercase; }
.window__flag {
  color: #3b1210;
  background: #ffc9c0;
  font-weight: 800;
  font-size: 0.68rem;
  border-radius: 999px;
  padding: 0 6px;
}
.window__count {
  min-width: 1.4rem;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #f0c14b;
  color: #1c1406;
  border-radius: 999px;
  padding: 0 6px;
}

.falls {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.drop {
  position: absolute;
  top: 28px;
  width: 36px;
  animation: product-fall 0.75s cubic-bezier(.2, .75, .2, 1) forwards;
}
.drop--0 { left: 12%; }
.drop--1 { left: 44%; }
.drop--2 { left: 74%; }
.coin {
  position: absolute;
  top: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d4, #e2a72b 58%, #7a4e0c);
  animation: coin-fall 0.7s ease-in forwards;
}
.coin-x0.coin-n0 { left: 16%; }
.coin-x0.coin-n1 { left: 22%; animation-delay: 0.08s; }
.coin-x0.coin-n2 { left: 28%; animation-delay: 0.16s; }
.coin-x1.coin-n0 { left: 46%; }
.coin-x1.coin-n1 { left: 52%; animation-delay: 0.08s; }
.coin-x1.coin-n2 { left: 58%; animation-delay: 0.16s; }
.coin-x2.coin-n0 { left: 74%; }
.coin-x2.coin-n1 { left: 80%; animation-delay: 0.08s; }
.coin-x2.coin-n2 { left: 86%; animation-delay: 0.16s; }

.art { position: relative; overflow: hidden; }
.art.is-empty {
  background: repeating-linear-gradient(135deg, #e7f3ec 0 6px, #c9ddd2 6px 12px);
}
.art.is-stockout { animation: shake 0.45s linear; }
.void-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1c1612;
}
.coinburst { position: absolute; inset: 0; pointer-events: none; }
.coinburst i {
  position: absolute;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6d4, #e2a72b 58%, #7a4e0c);
  animation: coin-pop 0.7s ease-in forwards;
}
.coinburst i:nth-child(1) { left: 18%; }
.coinburst i:nth-child(2) { left: 46%; animation-delay: 0.08s; }
.coinburst i:nth-child(3) { left: 70%; animation-delay: 0.16s; }

.stockout-flag, .late-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 800;
}
.stockout-flag { background: #ffc9c0; color: #3b1210; }
.late-flag { background: #1c1406; color: #f6f1e7; }
.card.is-late { animation: late-wobble 0.55s ease; }
.card.is-tossed { animation: shake 0.4s linear; }
.card.is-stockout { box-shadow: inset 0 0 0 3px #d23b3b; }

.flash.is-up, .flash.is-down { animation: flash-in 0.35s ease; }

.dock-jumps { display: flex; gap: 8px; width: 100%; }
.dock-jumps a {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid #8ee0b8;
  background: #24382e;
  color: #f6f1e7;
  text-decoration: none;
  font-weight: 750;
  text-align: center;
}

.ticket { position: relative; overflow: hidden; }
.ticket--hit {
  background:
    radial-gradient(420px 180px at 50% 0%, #b7f0d0, transparent 70%),
    var(--card);
}
#score { font-size: 3rem; }
.outcome-hit, .outcome-miss { font-size: 1.05rem; }

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -8px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall 1.3s ease-in forwards;
}
.confetti i:nth-child(1) { left: 6%; background: #f0c14b; }
.confetti i:nth-child(2) { left: 14%; background: #2f9e5a; animation-delay: 0.08s; }
.confetti i:nth-child(3) { left: 24%; background: #d23b3b; animation-delay: 0.16s; }
.confetti i:nth-child(4) { left: 33%; background: #2f89c5; }
.confetti i:nth-child(5) { left: 42%; background: #f0c14b; animation-delay: 0.12s; }
.confetti i:nth-child(6) { left: 51%; background: #ff8d86; animation-delay: 0.2s; }
.confetti i:nth-child(7) { left: 60%; background: #2f9e5a; }
.confetti i:nth-child(8) { left: 68%; background: #f0c14b; animation-delay: 0.1s; }
.confetti i:nth-child(9) { left: 76%; background: #d23b3b; animation-delay: 0.18s; }
.confetti i:nth-child(10) { left: 84%; background: #2f89c5; }
.confetti i:nth-child(11) { left: 91%; background: #f0c14b; animation-delay: 0.06s; }
.confetti i:nth-child(12) { left: 18%; background: #ff8d86; animation-delay: 0.22s; }

.bilan li {
  display: grid;
  grid-template-columns: minmax(4.5rem, 6.5rem) minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 0;
  padding: 6px 8px;
}
.bilan__name { font-weight: 750; }
.bilan__track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
}
.bilan__track i { display: block; height: 10px; border-radius: 2px; background: #e4d8c4; }
.bilan__track i.is-on { background: #146b45; }
.bilan li.is-you .bilan__track i.is-on { background: #8a6208; }

@media (min-width: 900px) {
  .cabinet { display: none; }
  #score { font-size: 4rem; }
  .scene { height: calc(64px + env(safe-area-inset-top, 0px)); }
  body:not(.board-page) .top { padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
  .room { height: 40px; }
}

@media (max-width: 899px) {
  #day { font-size: 1.2rem; }
  #cash { font-size: 1.5rem; }
  #score { font-size: 2.6rem; }
  .dock {
    flex-flow: column nowrap;
    align-items: stretch;
    justify-content: flex-end;
  }
  .dock-jumps, #next, #replay, #quit {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    min-width: 0;
  }
}

@keyframes glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes rain {
  from { background-position: 0 0; }
  to { background-position: 12px 18px; }
}
@keyframes heat {
  50% { opacity: 0.55; }
}
@keyframes product-fall {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(108px); opacity: 0.15; }
}
@keyframes coin-fall {
  from { transform: translateY(0); }
  to { transform: translateY(120px); opacity: 0.2; }
}
@keyframes coin-pop {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(42px); opacity: 0; }
}
@keyframes shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes late-wobble {
  40% { transform: rotate(-0.6deg); }
  70% { transform: rotate(0.6deg); }
}
@keyframes pop {
  from { transform: translateY(6px); }
  to { transform: none; }
}
@keyframes flash-in {
  from { transform: translateY(-4px); }
  to { transform: none; }
}
@keyframes confetti-fall {
  from { transform: translateY(-8px) rotate(0deg); }
  to { transform: translateY(160px) rotate(200deg); }
}
