/* ---------------------------------------------------------------------------
   Fizz Liquids Empire — visual theme
   All colors, spacing and radii live in :root; components only consume the
   variables, so the whole look can be retuned in one place.

   Performance rule: this stylesheet is deliberately static — no animations,
   no transitions, no backdrop-filter. render() runs every tick, and every
   frame the browser repaints whatever changed; animated or blurred styles
   turn that 1 Hz refresh into constant compositing work. Instant state
   changes (class swaps, opacity flips) keep the tick cheap and the UI
   responsive, which matters more than flourish in a 1-tick-per-second game.
   --------------------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg-primary: #0b1120;
  --bg-deep: #060a15;
  --surface: rgba(30, 41, 59, 0.92);
  --surface-solid: #16213a;
  --surface-raised: rgba(15, 23, 42, 0.9);
  --border-soft: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.34);

  /* text */
  --text-primary: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;

  /* beverage accents */
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --accent-lemon: #facc15;
  --accent-primary: var(--accent-cyan);

  /* semantic states */
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;

  /* spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* depth & glow */
  --shadow-panel: 0 10px 30px rgba(2, 6, 23, 0.45);
  --glow-cyan: 0 0 12px rgba(6, 182, 212, 0.5);

  /* type */
  --font-ui: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* {
  box-sizing: border-box;
}

/* Type scale: every rem below scales from this root — the one knob for
   interface size (raise it when the dashboard needs to be easier to read). */
html {
  font-size: 17px;
}

/* Fixed gradient backdrop. It is static (painted once), so the translucent
   panels above it get the dark-glass look without backdrop-filter blur —
   blur would have to re-composite the whole page on every tick. */
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  background: var(--bg-deep);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(244, 63, 94, 0.16), transparent 60%),
    radial-gradient(900px 620px at -10% 25%, rgba(6, 182, 212, 0.18), transparent 55%),
    radial-gradient(720px 520px at 55% 115%, rgba(250, 204, 21, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-primary), var(--bg-deep));
}

::selection {
  background: rgba(6, 182, 212, 0.35);
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Header — sticky bar with brand + timeline controls
   --------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 12px;
  background: rgba(11, 17, 32, 0.94);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.6));
}

.brand-text h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  background: linear-gradient(90deg, #a5f3fc, #fda4af);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.company-title {
  display: block;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Timeline — status badge, day/night icon, digital clock, controls
   game.js toggles .open (stall open, day) and .paused on the timeline, so
   all three states are plain class swaps — no sibling selectors, no :has().
   --------------------------------------------------------------------------- */
.timeline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(51, 65, 85, 0.35), rgba(15, 23, 42, 0.5));
  border: 1px solid var(--border-soft);
}

/* Day: the timeline bar glows cyan while the stall is open. */
.timeline.open {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(15, 23, 42, 0.45));
  border-color: rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.12);
}

/* Paused: striped amber overlay so the frozen state is unmistakable. */
.timeline.paused {
  background:
    repeating-linear-gradient(45deg, rgba(251, 191, 36, 0.14) 0 6px, rgba(15, 23, 42, 0.5) 6px 12px),
    linear-gradient(135deg, rgba(51, 65, 85, 0.35), rgba(15, 23, 42, 0.5));
  border-color: rgba(251, 191, 36, 0.45);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-badge.open {
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.status-badge.closed {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.status-badge.paused {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fcd34d;
}

/* Day/night icon: the moon is the default (the game starts at 06:00,
   pre-opening) and the sun replaces it the moment the timeline is .open.
   An instant opacity swap — no cross-fade — keeps the swap free. */
.day-night {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.day-night-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0;
}

.icon-moon {
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(148, 163, 184, 0.5));
}

.timeline.open .icon-sun {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(250, 204, 21, 0.7));
}

.timeline.open .icon-moon {
  opacity: 0;
}

.clock {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text-primary);
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* "Pause at closing" checkbox in the timeline (issue #12) — a quiet label so
   it reads as a setting, not a call to action. */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.toggle input[type='checkbox'] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* Header status chips: money (green) and reputation (gold) sit left of the
   timeline, each with its own accent; all share .header-chip. */
.header-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 12px;
  line-height: 1.15;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
}

.header-chip .stat-label {
  font-size: 0.56rem;
}

.header-money {
  align-items: flex-end;
  margin-left: auto; /* brand left, chips + timeline right */
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(15, 23, 42, 0.45));
  border-color: rgba(52, 211, 153, 0.35);
}

.header-money .stat-value {
  font-size: 1.15rem;
}

.header-reputation {
  align-items: flex-end;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(15, 23, 42, 0.45));
  border-color: rgba(251, 191, 36, 0.35);
}

.header-reputation .stat-value {
  color: #fde68a;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.4);
}

.chip-value-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------------------------------------------------------------------------
   Buttons — pill-shaped; hover is a plain color/border change (no lift, no
   press-down scale, no transitions)
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.2);
  border-color: var(--border-strong);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Pause/play: cyan while running, green while paused. */
.btn-pause {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.4);
  color: #a5f3fc;
}

.btn-pause::before {
  content: '\23F8 \FE0E';
  font-size: 0.8em;
}

.btn-pause:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.28);
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: var(--glow-cyan);
}

.timeline.paused .btn-pause {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #a7f3d0;
}

.timeline.paused .btn-pause::before {
  content: '\25B6 \FE0E';
}

/* Skip button: quiet ghost style. */
.btn-skip {
  background: transparent;
}

.btn-skip::before {
  content: '\23ED \FE0E';
  font-size: 0.85em;
}

.btn-skip:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.14);
}

/* Primary CTA (night shopping, restart). */
.btn-primary {
  min-height: 40px;
  font-weight: 700;
  color: #a5f3fc;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22), rgba(6, 182, 212, 0.08));
  border-color: rgba(6, 182, 212, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.34), rgba(6, 182, 212, 0.14));
  border-color: rgba(6, 182, 212, 0.65);
  box-shadow: var(--glow-cyan);
}

/* Recipe unlock: lemon-tinted accent. */
.btn-accent {
  min-height: 40px;
  font-weight: 700;
  color: #fde68a;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(250, 204, 21, 0.06));
  border-color: rgba(250, 204, 21, 0.4);
}

.btn-accent:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.3), rgba(250, 204, 21, 0.1));
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.18);
}

/* ---------------------------------------------------------------------------
   Main — dashboard grid: stall + log on the left, recipe + supplies right
   --------------------------------------------------------------------------- */
main {
  max-width: 90vw; /* fill most of the viewport: wide panels, readable text */
  margin: 0 auto;
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  grid-template-areas:
    'stall stall stall stall stall stall recipe recipe recipe recipe recipe recipe'
    'supplies supplies supplies supplies supplies supplies log log log log log log';
}

/* Paused: the whole board desaturates and dims slightly. game.js toggles
   .paused on <body>; the filter applies only while frozen, when nothing
   repaints anyway. */
body.paused main {
  filter: saturate(0.65) brightness(0.9);
}

/* ---------------------------------------------------------------------------
   Panels — dark glass cards with a per-panel beverage accent stripe
   --------------------------------------------------------------------------- */
.panel {
  position: relative;
  overflow: hidden;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

.panel:hover {
  border-color: var(--border-strong);
}

.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--panel-accent), transparent);
  opacity: 0.85;
}

.panel-stall {
  --panel-accent: var(--accent-cyan);
  grid-area: stall;
}

.panel-recipe {
  --panel-accent: var(--accent-lemon);
  grid-area: recipe;
}

.panel-supplies {
  --panel-accent: var(--accent-rose);
  grid-area: supplies;
}

.panel-log {
  --panel-accent: var(--text-faint);
  grid-area: log;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.panel-head h2 {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Stats — compact tiles with big mono numbers and small muted labels
   --------------------------------------------------------------------------- */
.drink-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-pill);
}

.chip-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.stat-value-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* Side-by-side stat tiles (stock, sell chance, arrival chance in the stall
   panel). auto-fit keeps the row usable when the panel gets narrow. */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.stat-money {
  color: #6ee7b7;
  text-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

/* ---------------------------------------------------------------------------
   Price slider and status lines
   --------------------------------------------------------------------------- */
.price-control {
  margin: var(--space-sm) 0;
}

.price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.price-head label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.price-value {
  font-family: var(--font-mono);
  font-size: 1.18rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.price-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.66rem;
  color: var(--text-faint);
}

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-cyan), rgba(6, 182, 212, 0.25));
  outline: none;
  cursor: pointer;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e0f2fe;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

input[type='range']::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e0f2fe;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

/* Status lines under the controls (serving, auto-restock). */
.note {
  margin: var(--space-sm) 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.note-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-status::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 6px var(--accent-cyan);
}

/* ---------------------------------------------------------------------------
   Recipe panel
   --------------------------------------------------------------------------- */
.recipe-current {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background: var(--surface-raised);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}

.recipe-current .stat-label {
  flex-basis: 100%;
}

.recipe-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.recipe-ingredients {
  font-size: 0.86rem;
}

.upgrade-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.upgrade-row .btn {
  flex: 1;
}

.panel-supplies .btn {
  width: 100%;
  margin-top: var(--space-sm);
}

/* Auto-restock zone inside the supplies panel: divider + explainer + live status. */
.production-block {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-soft);
}

.production-block .sub-head {
  margin: 0 0 4px;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-faint);
}

.production-block .note {
  margin: 0;
}

.production-block .note-status {
  margin-top: 6px;
}

/* ---------------------------------------------------------------------------
   Event log — terminal-style strip at the bottom of the board
   --------------------------------------------------------------------------- */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.log-list li {
  padding: 5px 10px;
  background: var(--surface-raised);
  border-left: 2px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.log-list::-webkit-scrollbar {
  width: 8px;
}

.log-list::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

.log-list::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------------------------------------------------------------------------
   Help icons and tooltips
   --------------------------------------------------------------------------- */
.help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
  color: #0b1120;
  background: var(--accent-cyan);
  cursor: help;
  opacity: 0.85;
}

.help-icon:hover {
  opacity: 1;
}

/* Overlay tooltips are anchored to the viewport by game.js (position:fixed
   here). They live at the root of <body>, outside any filtered ancestor. */
.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 280px;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.78rem;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.55), 0 0 0 1px rgba(6, 182, 212, 0.06);
  pointer-events: none;
  opacity: 0;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}

.tooltip-icon {
  color: var(--accent-cyan);
}

.tooltip-stats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-left: 14px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tooltip-stats div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tooltip-stats div span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Day recap toast (issue #12) — a fixed card in the bottom-right corner that
   appears at closing, so the day boundary is visible even when the player is
   idle. Static like everything else: no slide-in, just a show/hide.
   --------------------------------------------------------------------------- */
.recap-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  max-width: min(440px, calc(100vw - 32px));
  padding: var(--space-sm) var(--space-md);
  font-size: 0.84rem;
  background: var(--surface);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
}

.recap-title {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-lemon);
}

.recap-text {
  color: var(--text-primary);
}

.recap-toast .btn {
  min-height: 30px;
  padding: 3px 10px;
  font-size: 0.78rem;
}

/* ---------------------------------------------------------------------------
   Game-over overlay
   --------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: rgba(2, 6, 23, 0.88);
}

.overlay-box {
  width: 100%;
  max-width: 380px;
  padding: var(--space-lg);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(2, 6, 23, 0.6);
}

.overlay-box h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--danger);
  text-shadow: 0 0 24px rgba(244, 63, 94, 0.5);
}

.overlay-box p {
  margin: 0 0 var(--space-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   Utilities and responsive rules
   --------------------------------------------------------------------------- */
.muted {
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* game.js toggles .hidden on the skip button and the game-over overlay. */
.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      'stall recipe'
      'supplies log';
  }
}

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr;
    grid-template-areas: 'stall' 'recipe' 'supplies' 'log';
  }

  .app-header {
    gap: var(--space-sm);
  }

  .brand-text h1 {
    font-size: 0.92rem;
  }

  .timeline {
    width: 100%;
    flex-wrap: wrap;
  }

  .timeline-actions {
    margin-left: auto;
  }

  /* Comfortable touch targets on small screens. */
  .btn {
    min-height: 44px;
  }

  input[type='range'] {
    height: 8px;
  }

  input[type='range']::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 480px) {
  .timeline-actions {
    width: 100%;
  }

  .timeline-actions .btn {
    flex: 1;
  }
}
