/* ══ Design Tokens — Omakase Design System ════════════════════════════════ */
:root {
  /* Brand palette */
  --peri:       #8A9AD0;
  --peri-deep:  #6374B5;
  --peri-soft:  #C4CEE8;
  --peri-wash:  #E5EAF5;
  --cream:      #F5E9C9;
  --cream-soft: #FAF3DF;
  --paper:      #FBF7EC;
  --salmon:     #E4525A;
  --salmon-ink: #C63B44;
  --nori:       #4A7A4E;
  --nori-deep:  #2F5A35;
  --mustard:    #E8A936;
  --ink:        #1B1E2E;
  --body:       #2E3244;
  --muted:      #6B7088;
  --rule:       #D5D0BC;

  /* Belt surface — dark lacquer */
  --belt-bg: #231B14;

  /* Card geometry — 5:7 aspect ratio matching the physical card PNGs */
  --card-w:  120px;
  --card-h:  168px;
  --card-r:  6px;

  /* Pile dimensions (deck/trash stacks alongside belt) */
  --pile-w:  72px;
  --pile-h:  101px;

  /* Radii */
  --r-btn:  4px;
  --r-pill: 999px;

  /* Elevation — restrained, physical */
  --shadow-card:      0 1px 2px rgba(27,30,46,.08), 0 4px 16px rgba(27,30,46,.10);
  --shadow-card-lift: 0 4px 8px rgba(27,30,46,.12), 0 16px 40px rgba(27,30,46,.18);
  --shadow-modal:     0 24px 80px rgba(27,30,46,.28);

  /* Type */
  --font-d: 'Fraunces', Georgia, serif;
  --font-b: 'Inter Tight', 'Inter', sans-serif;

  /* Timing */
  --t-hover: 120ms ease-out;
  --t-state: 240ms cubic-bezier(.4,0,.2,1);

  /* Z-stack */
  --z-ctrl:    20;
  --z-overlay: 50;
  --z-modal:   100;
  --z-toast:   200;
}


/* ══ Reset ════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-b);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ══ Screen system ════════════════════════════════════════════════════════ */
.screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity 400ms ease;
  overflow: hidden;
}
.screen--active { opacity: 1; pointer-events: all; }

/* ══ Buttons ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border: none; border-radius: var(--r-btn);
  font-family: var(--font-b); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; letter-spacing: .04em;
  transition: background var(--t-hover), transform 80ms ease;
  -webkit-user-select: none; user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

.btn--primary { background: var(--peri-deep); color: var(--cream); }
.btn--primary:hover:not(:disabled) { background: #50609F; }

.btn--secondary {
  background: transparent; color: var(--body);
  border: 1px solid var(--rule);
}
.btn--secondary:hover:not(:disabled) { background: var(--peri-wash); border-color: var(--peri); }

.btn--danger {
  background: transparent; color: var(--salmon);
  border: 1.5px solid var(--salmon);
}
.btn--danger:hover:not(:disabled) { background: rgba(228,82,90,.08); }
.btn--danger.btn--check-avail { animation: check-pulse 2s ease-in-out infinite; }

.btn--ghost { background: transparent; color: var(--muted); border: 1px solid transparent; }
.btn--ghost:hover:not(:disabled) { color: var(--body); background: var(--peri-wash); }

.btn--lg { padding: 14px 28px; font-size: 15px; }
.btn--sm { padding: 6px 12px; font-size: 12px; }

/* ══ New Game — landing page ══════════════════════════════════════════════ */
#screen-newgame {
  background: var(--paper);
  align-items: center; justify-content: flex-start;
  overflow-y: auto;
}

.landing-page {
  max-width: 860px; width: 100%;
  padding: 52px 32px 80px;
  position: relative;
}

/* Header: favicon · OMAKASE · tagline */
.landing-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 48px;
}
.landing-logo-img {
  width: 44px; height: 44px; object-fit: contain;
  border-radius: 8px; display: block; flex-shrink: 0;
}
.landing-brand {
  font-size: 12px; font-weight: 700; letter-spacing: .28em;
  text-transform: uppercase; color: var(--ink); font-family: var(--font-b);
}
.landing-tagline { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Display title + description */
.landing-title {
  font-family: var(--font-d);
  font-size: clamp(56px, 9vw, 104px);
  line-height: .95; letter-spacing: -.04em; font-weight: 800;
  color: var(--ink); margin-bottom: 20px;
  font-variation-settings: "opsz" 144;
}
.landing-desc {
  font-size: 18px; line-height: 1.55; color: var(--body);
  max-width: 560px; margin-bottom: 36px;
}

/* Section labels ("Opponent", "Tutorial") */
.landing-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}

/* CTA row */
.landing-cta {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 28px; margin-bottom: 20px;
}
.btn--salmon { background: var(--salmon); color: #fff; }
.btn--salmon:hover:not(:disabled) { background: var(--salmon-ink); }

/* Tutorial video */
.landing-video {
  position: relative; aspect-ratio: 16/9;
  background: #000; border: 1px solid var(--ink);
  overflow: hidden; margin-bottom: 32px;
}
.landing-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Shop link */
.landing-shop { padding-bottom: 20px; }

/* Shared utility */
.newgame__label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .20em; color: var(--salmon);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.newgame__label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.link-arrow {
  font-size: 12px; font-weight: 600; text-decoration: none;
  color: var(--peri-deep); border-bottom: 1px solid currentColor;
  padding-bottom: 1px; transition: color var(--t-hover);
}
.link-arrow:hover { color: var(--peri); }

/* jp-tab — colored badges matching physical card labels */
.jp-tab {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 6px; border-radius: 2px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  font-family: var(--font-b); flex-shrink: 0;
}
.jp-tab--mustard { background: var(--mustard);   color: var(--ink); }
.jp-tab--salmon  { background: var(--salmon);    color: #fff; }
.jp-tab--nori    { background: var(--nori);      color: var(--cream); }
.jp-tab--peri    { background: var(--peri-soft); color: var(--peri-deep); }

/* ── Opponent tile grid (4 columns, 1px rule gaps) ── */
.agent-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--rule);
  border: 1px solid var(--rule);
}
.agent-card {
  position: relative;
  background: var(--paper); border: 0;
  padding: 18px 16px; font-family: var(--font-b); color: inherit;
  cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 10px; min-height: 160px;
  transition: background var(--t-hover);
}
.agent-card:hover { background: var(--cream-soft); }
.agent-card--active { background: var(--cream-soft) !important; }
.agent-card--active::before {
  content: ""; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: var(--salmon);
}
.agent-card__top {
  display: flex; justify-content: space-between; align-items: flex-start;
}
.agent-card__jp {
  font-family: 'Shippori Mincho', 'Yu Mincho', serif;
  font-size: 22px; color: var(--peri-deep); line-height: 1;
}
.agent-card__footer { margin-top: auto; }
.agent-card__name  { font-size: 14px; font-weight: 700; color: var(--ink); }
.agent-card__dots  { display: flex; gap: 4px; margin-top: 6px; }
.diff-dot          { width: 6px; height: 6px; border-radius: 50%; background: rgba(27,30,46,.18); }
.diff-dot--on      { background: var(--salmon); }
.agent-card__diff {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; padding: 2px 6px; border-radius: 99px;
}
.diff--beginner { background: rgba(74,122,78,.12);  color: var(--nori-deep); }
.diff--unranked { background: rgba(107,112,136,.12); color: var(--muted); }
.diff--expert   { background: rgba(99,116,181,.12);  color: var(--peri-deep); }
.mcts-options {
  background: var(--paper); border-radius: 6px; padding: 12px 16px;
  border: 1px solid var(--rule);
}
.slider-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--peri-deep); }
.slider-val { font-family: var(--font-d); font-size: 15px; color: var(--peri-deep); min-width: 30px; font-variant-numeric: tabular-nums; }
.rules-toggle { width: 100%; justify-content: center; margin-top: -4px; }
.rules-panel {
  background: var(--paper); border-radius: 6px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--rule);
}
.rules-sets { display: flex; flex-direction: column; gap: 10px; }
.rules-set {
  font-size: 12px; color: var(--body);
  border-left: 3px solid var(--salmon); padding-left: 10px; line-height: 1.6;
}
.rules-set__header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 1px;
}
.rules-set strong { color: var(--ink); }
.rules-note {
  font-size: 11px; color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--rule); padding-top: 10px;
}

/* ── Landing page additions ─────────────────────────────────────────────── */

/* Sans-serif title override */
.landing-title--sans {
  font-family: var(--font-b);
  font-weight: 900;
  font-size: clamp(72px, 12vw, 128px);
  line-height: 0.9;
  color: var(--ink);
  margin-bottom: 32px;
}
.landing-title-dot { color: var(--salmon); }

/* Physical game link in tagline */
.landing-tagline-sep { margin: 0 6px; opacity: 0.4; }
.landing-shop-link {
  color: var(--salmon); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
}
.landing-shop-link:hover { color: var(--salmon-ink); }

/* "IS-MCTS+" superscript */
.landing-sup { font-size: 8px; font-weight: 700; vertical-align: super; }

/* 3-column agent grid variant */
.agent-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Agent card sushi image */
.agent-card__img-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 8px 0;
}
.agent-card__sushi-img {
  height: 100px; width: auto; object-fit: contain; border-radius: 3px;
  transition: filter 150ms ease;
}
.agent-card:not(.agent-card--active) .agent-card__sushi-img {
  filter: grayscale(25%) opacity(0.8);
}

/* Dots + sims row inside agent-card */
.agent-card__meta {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
}
.agent-card__sims {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}

/* How-to-play image grid */
.landing-rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.landing-rules-step {
  background: var(--cream-soft); border: 1px solid var(--rule);
  border-radius: 4px; overflow: hidden;
}
.landing-rules-step img { width: 100%; display: block; }
.landing-rules-step span {
  display: block; padding: 8px 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}

/* Drawer set: header row + card image strip */
.drawer__set-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.drawer__set-header strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.drawer__set-price { font-size: 12px; color: var(--muted); }
.drawer__set-cards {
  display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px;
}
.drawer__set-cards img {
  height: 96px; width: auto; flex-shrink: 0; border-radius: 2px;
  object-fit: contain;
}

/* ══ Game screen layout ═══════════════════════════════════════════════════ */
#screen-game {
  display: grid;
  grid-template-rows: 44px auto 1fr 62px auto 52px;
  background: var(--paper);
}

/* Topbar — on-brand periwinkle */
.topbar {
  grid-row: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: var(--peri-deep);
  border-bottom: 1px solid rgba(99,116,181,.25);
  z-index: var(--z-ctrl);
}
.topbar__logo {
  font-family: var(--font-d); font-size: 20px; color: var(--cream);
  letter-spacing: .06em; font-variation-settings: "opsz" 144;
}
.topbar__center { display: flex; align-items: baseline; gap: 6px; }
.topbar__label { font-size: 10px; text-transform: uppercase; letter-spacing: .14em; color: rgba(245,233,201,.55); }
.topbar__turn {
  font-family: var(--font-d); font-size: 20px; font-weight: 600;
  color: var(--cream); font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 144;
}
.topbar__right { display: flex; align-items: center; gap: 10px; }
#btn-menu { color: rgba(245,233,201,.65); border-color: transparent; }
#btn-menu:hover { color: var(--cream); background: rgba(255,255,255,.15); }

/* Opponent zone */
.opp-zone {
  grid-row: 2;
  display: flex; align-items: center;
  padding: 8px 16px; gap: 12px;
  background: var(--cream-soft);
  border-bottom: 1px solid var(--rule);
  min-height: 72px;
}
.opp-zone__info { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.opp-hand { display: flex; gap: 5px; align-items: center; justify-content: center; overflow: hidden; flex: 1; }

/* Small face-down card backs for opponent hand */
.card-back {
  width: 52px; height: 73px;
  border-radius: 4px; flex-shrink: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.card-back img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.player-label { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: .01em; }
.player-label--ai { color: var(--muted); font-weight: 500; }
.score-box { display: flex; align-items: baseline; gap: 5px; }
.score-box__label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.score-box__value {
  font-family: var(--font-d); font-size: 18px; font-weight: 600;
  color: var(--salmon);
  font-variation-settings: "opsz" 144;
  font-variant-numeric: tabular-nums;
  transition: color 300ms ease;
}
.score-box__value.ticking { animation: score-tick 300ms ease-out; }
.hand-count { font-size: 11px; color: var(--muted); }

/* ══ Belt section — deck | belt | trash ══════════════════════════════════ */
.belt-section {
  grid-row: 3;
  display: flex; flex-direction: row; align-items: center;
  justify-content: center; gap: 10px;
  background: var(--belt-bg);
  padding: 8px 12px;
  overflow: hidden;
}

/* Deck / Trash pile zones */
.pile-zone {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; flex-shrink: 0;
}
.pile-stack {
  width: var(--pile-w); height: var(--pile-h);
  border-radius: var(--card-r);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.pile-card-img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  border-radius: var(--card-r);
}
.pile-stack--trash {
  cursor: pointer;
  transition: box-shadow var(--t-hover);
}
.pile-stack--trash:hover { box-shadow: var(--shadow-card-lift); }
.pile-info {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.pile-label {
  font-size: 8px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .16em; color: rgba(200,169,110,.4);
}
.pile-count {
  font-family: var(--font-d); font-size: 13px; font-weight: 600;
  color: rgba(200,169,110,.65); font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 144;
}
.pile-empty {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: rgba(200,169,110,.2);
  border: 1.5px dashed rgba(200,169,110,.18);
  border-radius: var(--card-r);
}
/* Deck pile: simulate a stack of cards with pseudo-elements */
.pile-zone--deck .pile-stack::before {
  content: ''; position: absolute;
  inset: 0; border-radius: var(--card-r);
  background: var(--peri);
  transform: translate(2px, -2px);
  z-index: -1; opacity: .5;
}
.pile-zone--deck .pile-stack::after {
  content: ''; position: absolute;
  inset: 0; border-radius: var(--card-r);
  background: var(--peri);
  transform: translate(4px, -4px);
  z-index: -2; opacity: .3;
}

/* Belt center */
.belt-center {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
}
.belt-track {
  display: flex; flex-direction: column;
  width: 100%; max-width: 840px;
  background: #1A1510;
  border-radius: 10px; padding: 8px 12px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.55), 0 0 0 1px rgba(200,169,110,.08);
}
.belt-rail {
  height: 3px; border-radius: 2px; margin: 2px 0;
  background: linear-gradient(90deg, transparent, rgba(200,169,110,.14) 30%, rgba(200,169,110,.28) 50%, rgba(200,169,110,.14) 70%, transparent);
}
.belt-slots {
  display: flex; gap: 8px; justify-content: center;
  padding: 8px 4px;
  overflow-x: auto; scrollbar-width: none;
}
.belt-slots::-webkit-scrollbar { display: none; }
.belt-slot { width: var(--card-w); height: var(--card-h); flex-shrink: 0; position: relative; }
.belt-slot:last-child::after {
  content: '→';
  position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  color: rgba(200,169,110,.28); font-size: 11px;
}
.belt-labels {
  display: flex; justify-content: space-between;
  padding: 0 4px; margin-top: 4px;
  width: 100%; max-width: 840px;
}
.belt-label-new, .belt-label-old { font-size: 9px; color: rgba(200,169,110,.28); }

/* Phase bar */
.phase-bar {
  grid-row: 4;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
  padding: 0 20px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.phase-bar--flash { animation: phase-flash 450ms ease; }
@keyframes phase-flash {
  0%   { background: var(--paper); }
  35%  { background: var(--peri-wash); }
  100% { background: var(--paper); }
}

.phase-pips { display: flex; align-items: center; gap: 6px; }
.phase-step  { display: flex; flex-direction: column; align-items: center; gap: 3px; }

.phase-pip {
  width: 28px; height: 28px; border-radius: 50%;
  background: transparent; border: 2px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
  transition: all var(--t-state); flex-shrink: 0;
}
.phase-step__label {
  font-size: 8px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); transition: color var(--t-state);
  white-space: nowrap;
}
.phase-pip--active {
  background: var(--salmon); border-color: var(--salmon-ink); color: #fff;
  box-shadow: 0 0 0 3px rgba(228,82,90,.18);
}
.phase-pip--done {
  background: var(--peri-wash); border-color: var(--peri); color: var(--peri-deep);
}
.phase-step:has(.phase-pip--active) .phase-step__label { color: var(--salmon-ink); font-weight: 700; }
.phase-step:has(.phase-pip--done)   .phase-step__label { color: var(--peri-deep); }

.phase-sep { color: var(--rule); font-size: 14px; margin-bottom: 14px; }
.phase-msg {
  font-size: 12px; color: var(--muted); font-style: italic;
  max-width: 300px; text-align: right;
  transition: opacity 200ms ease;
}
.phase-msg--highlight { color: var(--salmon-ink); font-style: normal; font-weight: 600; }

/* Player zone */
.player-zone {
  grid-row: 5;
  display: flex; flex-direction: column;
  background: var(--cream-soft);
  border-top: 1px solid var(--rule);
  padding: 8px 16px 6px;
}
.player-zone__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.passive-effects {
  display: flex; gap: 5px; flex-wrap: wrap;
  margin-bottom: 4px; min-height: 0;
}
.effect-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; padding: 2px 8px; border-radius: 99px;
}
.effect-badge--mustard { background: rgba(232,169,54,.18); color: #9a6a00; border: 1px solid rgba(232,169,54,.35); }
.effect-badge--peri    { background: rgba(99,116,181,.14); color: var(--peri-deep); border: 1px solid rgba(99,116,181,.28); }
.effect-badge--nori    { background: rgba(74,122,78,.14);  color: var(--nori-deep); border: 1px solid rgba(74,122,78,.28); }
.effect-badge--salmon  { background: rgba(228,82,90,.10);  color: var(--salmon);   border: 1px solid rgba(228,82,90,.22); }

.player-hand {
  display: flex; gap: 8px;
  justify-content: center;
  overflow-x: auto; overflow-y: visible;
  padding: 20px 4px 12px;
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}

/* Controls */
.controls {
  grid-row: 6;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--paper); padding: 8px 16px;
  border-top: 1px solid var(--rule);
}
/* Score in controls: sits left of buttons on desktop */
.controls .score-box { gap: 6px; }
.controls .score-box__label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.controls .score-box__value { font-size: 18px; }

/* ══ Card component — image only, full 5:7 face ═══════════════════════════ */
.card {
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--card-r);
  background: var(--cream);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  cursor: pointer; position: relative;
  display: block; overflow: hidden;
  transition: transform var(--t-hover), box-shadow var(--t-hover);
  -webkit-user-select: none; user-select: none;
  flex-shrink: 0;
}
.card__img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}

/* Action / passive hooks — kept for JS targeting, no visual left border */
.card--action  {}
.card--passive {}

/* Hover — only on true pointer devices to avoid sticky hover on mobile */
@media (hover: hover) {
  .card:not(.card--disabled):not(.card--no-hover):hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-lift);
  }
}

/* States */
.card--selected {
  outline: 2px solid var(--peri-deep);
  outline-offset: 2px;
  transform: translateY(-8px) !important;
  box-shadow: var(--shadow-card-lift) !important;
  z-index: 5;
}
.card--valid-target {
  outline: 2px solid var(--nori) !important;
  outline-offset: 2px;
  animation: pulse-valid 1.4s ease-in-out infinite;
  cursor: pointer;
}
.card--playable {
  cursor: pointer;
}
.card--disabled {
  opacity: .45; cursor: default; pointer-events: none;
}
.card--disabled::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(251,247,236,.4); border-radius: var(--card-r);
}
.card--entering { animation: card-slide-in .25s ease both; }

/* Mini card (game over hands) */
.card-mini {
  width: 44px; height: 62px;
  border-radius: 4px; overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}
.card-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ══ Action card play overlay ════════════════════════════════════════════ */
.action-play-overlay {
  position: fixed; inset: 0;
  background: rgba(27,30,46,.52);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  animation: overlay-in 180ms ease forwards;
}
.action-play-overlay--out { animation: overlay-out 300ms ease forwards; }
@keyframes overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { from { opacity: 1; } to { opacity: 0; } }

.action-play-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  animation: card-fly-in 380ms cubic-bezier(.2,0,.2,1.5) forwards;
}
@keyframes card-fly-in {
  from { transform: scale(.55) translateY(50px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.action-play-card {
  width: 160px; height: 224px;
  border-radius: var(--card-r);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.action-play-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.action-play-card-name {
  font-family: var(--font-d); font-size: 15pt; font-weight: 600;
  color: var(--cream); text-align: center;
  letter-spacing: -.02em; font-variation-settings: "opsz" 144;
}
.action-play-desc {
  font-family: var(--font-b); font-size: 10pt;
  color: rgba(245,233,201,.75); text-align: center;
  max-width: 260px; line-height: 1.45;
}

/* ══ Thinking overlay ════════════════════════════════════════════════════ */
.thinking-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(27,30,46,.38); backdrop-filter: blur(2px);
  z-index: var(--z-overlay);
}
.thinking-overlay[hidden] { display: none; }
.thinking-overlay__box {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 10px; padding: 20px 32px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: var(--shadow-modal);
}
.thinking-overlay__text {
  font-family: var(--font-d); font-size: 15px;
  color: var(--muted); font-style: italic;
  font-variation-settings: "opsz" 144;
}
.thinking-dots { display: flex; gap: 6px; }
.thinking-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--peri-deep);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: .2s; }
.thinking-dots span:nth-child(3) { animation-delay: .4s; }

/* ══ Modals ══════════════════════════════════════════════════════════════ */
.modal-bg {
  position: absolute; inset: 0;
  background: rgba(27,30,46,.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--z-modal);
}
.modal-bg[hidden] { display: none; }
.modal {
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 4px; padding: 24px;
  max-width: 500px; width: 92%;
  max-height: calc(100vh - 32px);
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
  border-top: 3px solid var(--salmon);
}
.modal__title {
  font-family: var(--font-d); font-size: 20px; font-weight: 600;
  color: var(--ink); margin-bottom: 6px;
  letter-spacing: -.02em; font-variation-settings: "opsz" 144;
}
.modal__instr { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.modal__cards {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin-bottom: 16px;
  max-height: min(46vh, 340px);
  overflow-y: auto;
}
.modal__cards--scroll { max-height: 280px; overflow-y: auto; }
.modal__footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.modal__footer--right { justify-content: flex-end; }
.modal__count { font-family: var(--font-d); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Chef position modal */
.chefs-pos-body {
  display: flex; flex-direction: column; gap: 20px;
  margin-bottom: 12px;
  flex: 1; min-height: 0; overflow-y: auto;
  padding-right: 4px;
}
.chefs-pos-row {
  display: flex; gap: 16px; align-items: center;
  padding: 12px; background: var(--cream-soft);
  border-radius: 6px; border: 1px solid var(--rule);
}
.chefs-pos-slider { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.chefs-pos-slider label { font-size: 12px; color: var(--muted); font-weight: 500; }
.chefs-pos-slider input[type=range] { width: 100%; accent-color: var(--peri-deep); }
.chefs-pos-display {
  font-family: var(--font-d); font-size: 15px; color: var(--peri-deep);
  font-variant-numeric: tabular-nums;
}
.chefs-pos-hint { font-size: 10px; color: var(--muted); font-style: italic; }

/* Action choice overlay (click action card -> choose Play / Exchange|Skip) */
.action-choice-overlay {
  position: fixed; inset: 0;
  background: rgba(27,30,46,.56);
  display: flex; align-items: center; justify-content: center;
  z-index: 520;
  animation: overlay-in 180ms ease forwards;
}
.action-choice-overlay--out { animation: overlay-out 220ms ease forwards; }
.action-choice-panel {
  width: min(92vw, 380px);
  max-height: calc(100vh - 20px);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--mustard);
  border-radius: 8px;
  box-shadow: var(--shadow-modal);
  padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.action-choice-title {
  font-family: var(--font-d); font-size: 18px; font-weight: 600;
  color: var(--ink); letter-spacing: -.02em; text-align: center;
}
.action-choice-desc {
  font-size: 12px; color: var(--muted); text-align: center;
  line-height: 1.4;
}
.action-choice-card {
  width: min(52vw, 188px);
  aspect-ratio: 5 / 7;
  border-radius: var(--card-r);
  overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-card-lift);
  flex-shrink: 0;
}
.action-choice-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.action-choice-actions {
  width: 100%;
  display: flex; gap: 8px;
}
.action-choice-actions .btn {
  flex: 1;
  justify-content: center;
}

/* Drawer */
.drawer-bg { position: absolute; inset: 0; background: rgba(27,30,46,.45); z-index: var(--z-modal); }
.drawer-bg[hidden] { display: none; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(300px, 92vw);
  background: rgba(251,247,236,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--rule);
  display: flex; flex-direction: column; padding: 14px 16px; gap: 0;
  overflow: hidden;
}
.drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px;
}
.drawer__close {
  background: none; border: none;
  color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.drawer__close:hover { color: var(--body); }
.drawer__body { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; min-height: 0; }
.drawer__divider {
  border: none; border-top: 1px solid var(--rule);
  margin: 12px 0;
}
.drawer__sets-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); margin-bottom: 8px;
}
.drawer__set {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 10px;
}
.drawer__set strong {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.drawer__set span {
  font-size: 11px; color: var(--muted); line-height: 1.5;
}
.drawer__link {
  font-size: 12px; font-weight: 600; text-decoration: none; color: var(--peri-deep);
  padding: 6px 0; border-bottom: 1px solid currentColor;
  display: block; width: fit-content;
  transition: color var(--t-hover);
}
.drawer__link:hover { color: var(--peri); }

/* ══ Game over ════════════════════════════════════════════════════════════ */
#screen-gameover {
  background: var(--paper);
  align-items: center; justify-content: center;
  overflow-y: auto;
}
.gameover {
  width: 100%; max-width: 560px;
  padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.gameover__verdict {
  font-family: var(--font-d); font-size: 40px; font-weight: 600;
  color: var(--ink); text-align: center;
  letter-spacing: -.025em; font-variation-settings: "opsz" 144;
  animation: verdict-in .6s cubic-bezier(.2,0,.2,1.5) both;
}
@keyframes verdict-in {
  from { opacity: 0; transform: scale(.72); }
  to   { opacity: 1; transform: scale(1); }
}
.gameover__scores {
  display: flex; align-items: center; gap: 20px; width: 100%; justify-content: center;
}
.gameover__player-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex: 1; background: var(--cream-soft); border-radius: 6px;
  padding: 16px 12px; border: 1.5px solid var(--rule);
}
.gameover__player-card.winner { border-color: var(--salmon); }
.gameover__who { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.gameover__pts {
  font-family: var(--font-d); font-size: 30px; font-weight: 600;
  color: var(--salmon); font-variant-numeric: tabular-nums;
  letter-spacing: -.03em; font-variation-settings: "opsz" 144;
}
.gameover__mini-hand { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 200px; }
.gameover__vs { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.gameover__breakdown {
  width: 100%; background: var(--cream-soft); border-radius: 6px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; border: 1px solid var(--rule);
}
.gameover__breakdown-line { display: flex; justify-content: space-between; color: var(--muted); }
.gameover__breakdown-line.set-line { color: var(--salmon-ink); font-weight: 600; }
.gameover__actions { display: flex; gap: 12px; }

/* ══ Toast ════════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  z-index: var(--z-toast); pointer-events: none;
}
.toast {
  background: var(--ink); border-radius: 4px;
  padding: 8px 16px; font-size: 13px; color: var(--cream);
  box-shadow: 0 4px 16px rgba(27,30,46,.28);
  animation: toast-in .24s ease both;
  font-family: var(--font-b); letter-spacing: .01em;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ══ Game ending banner ══════════════════════════════════════════════════ */
.game-ending-banner {
  position: absolute; top: 44px; left: 0; right: 0;
  background: var(--salmon); text-align: center; padding: 7px;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .06em;
  z-index: var(--z-ctrl);
}

/* ══ Animations ══════════════════════════════════════════════════════════ */
@keyframes pulse-valid {
  0%,100% { box-shadow: var(--shadow-card), 0 0 0 1px rgba(74,122,78,.4); }
  50%     { box-shadow: var(--shadow-card), 0 0 0 3px rgba(74,122,78,.7); }
}
@keyframes score-tick {
  0%  { color: var(--mustard); transform: scale(1.18); }
  60% { color: var(--mustard); transform: scale(1.06); }
  100%{ color: var(--salmon);  transform: scale(1); }
}
@keyframes dot-bounce {
  0%,80%,100% { transform: scale(.6); opacity: .4; }
  40%         { transform: scale(1);  opacity: 1; }
}
@keyframes check-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(228,82,90,.35); }
  50%     { box-shadow: 0 0 0 6px rgba(228,82,90,0); }
}
@keyframes card-slide-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══ Scrollbar ════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { height: 4px; width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }

/* ══ Belt deal animation (new card slides in from deck, others shift) ════ */
@keyframes deal-shift-right {
  from { transform: translateX(-130px); }
  to   { transform: translateX(0); }
}
.card--deal-shift {
  animation: deal-shift-right 420ms cubic-bezier(.2,.8,.4,1) both;
}

/* ══ Pending action card — gold glow, needs confirm click ═══════════════ */
.card--pending {
  transform: translateY(-16px) scale(1.1) !important;
  box-shadow: var(--shadow-card-lift),
              0 0 0 2px var(--mustard),
              0 0 20px rgba(232,169,54,.4) !important;
  z-index: 6;
  outline: none !important;
  cursor: pointer !important;
}

/* Opponent hand card highlight during AI pick */
.card-back--ai-pick {
  outline: 3px solid var(--mustard);
  outline-offset: 2px;
  transform: translateY(-14px);
  transition: transform 200ms ease;
  z-index: 5;
  position: relative;
}

/* AI belt target — pulsing salmon ring */
.card--ai-target {
  outline: 3px solid var(--salmon) !important;
  outline-offset: 3px;
  animation: pulse-ai-target 0.9s ease-in-out infinite;
}
@keyframes pulse-ai-target {
  0%, 100% { box-shadow: var(--shadow-card), 0 0 0 2px rgba(228,82,90,.25); }
  50%       { box-shadow: var(--shadow-card-lift), 0 0 0 8px rgba(228,82,90,.08); }
}

/* ══ Reduced motion ══════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ══ Mobile portrait (≤600px) ═════════════════════════════════════════════
   Layout: opp-hand row | belt (1fr) | [hand · score+buttons]
   Topbar becomes floating burger. Phase bar removed.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  :root {
    /* Belt/hand cards use dynamic sizing — no fixed --card-w/h override */
    --pile-w: 72px;
    --pile-h: 101px;
  }

  /* 3-row / 2-col: [opp-hand] | [belt 1fr] | [hand · buttons 1fr] */
  #screen-game {
    grid-template-rows: 50px 1fr 1fr;
    grid-template-columns: 1fr auto;
  }

  /* Topbar → floating burger only, taken out of grid */
  .topbar {
    position: fixed;
    top: 8px; right: 10px;
    background: transparent; border: none; padding: 0;
    z-index: var(--z-overlay);
  }
  .topbar__logo   { display: none; }
  .topbar__center { display: none; }
  #btn-menu {
    background: rgba(27,30,46,0.65);
    color: var(--cream);
    border-radius: 6px;
    width: 34px; height: 34px;
    padding: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
  }
  .game-ending-banner { top: 0; }

  /* Row 1: Opponent card backs, centered, dark belt bg */
  .opp-zone {
    grid-row: 1; grid-column: 1 / -1;
    display: flex; justify-content: center; align-items: center;
    padding: 5px 0;
    background: var(--belt-bg);
    border-bottom: 1px solid rgba(200,169,110,.10);
    min-height: 0;
  }
  .opp-zone__info { display: none; }
  #opp-hand .card-back { width: 28px; height: 39px; }

  /* Phase bar: removed */
  .phase-bar { display: none; }

  /* Row 2: Belt — fills its entire row, no dead space */
  .belt-section {
    grid-row: 2; grid-column: 1 / -1;
    padding: 0; gap: 0;
    align-items: stretch; /* all children fill full row height */
  }
  /* Pile zones: vertically center their content within the tall row */
  .pile-zone {
    justify-content: center;
    padding: 10px 8px;
  }
  /* Belt center: column flex so belt-track can flex-grow */
  .belt-center {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  /* Belt track: grows to fill the row height, cards centered inside */
  .belt-track {
    flex: 1;
    border-radius: 0;
    padding: 4px 8px;
    display: flex; flex-direction: column; justify-content: center;
  }
  /* Belt slots: fill track height, stretch children so cards fill height */
  .belt-slots {
    flex: 1;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    padding: 4px;
    gap: 6px;
    overflow-x: auto;
  }
  /* Belt slot/card: explicit clamped size to prevent runaway stretching */
  .belt-slot {
    width: clamp(58px, 18vw, 84px);
    aspect-ratio: 5 / 7;
    height: auto;
    flex: 0 0 auto;
  }
  .belt-section .card { width: 100%; height: 100%; aspect-ratio: auto; }
  .belt-labels { display: none; }

  /* Row 3 col 1: Player hand — bigger cards, vertically centered */
  .player-zone {
    grid-row: 3; grid-column: 1;
    display: flex; flex-direction: column;
    justify-content: center;
    padding: 0;
    border-top: 1px solid var(--rule);
    overflow: hidden;
  }
  .player-zone__header { display: none; }
  .passive-effects     { display: none; }
  .player-hand {
    flex: 1;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    padding: 8px 10px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  /* Hand cards: explicit clamped size to avoid a single oversized card */
  .player-hand .card {
    width: clamp(66px, 22vw, 98px);
    height: auto;
    aspect-ratio: 5 / 7;
    flex: 0 0 auto;
  }

  /* Row 3 col 2: Score + action buttons — fixed narrow width */
  .controls {
    grid-row: 3; grid-column: 2;
    flex-direction: column; height: auto;
    width: 70px; min-width: 70px;
    padding: 8px 6px; gap: 8px;
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
    justify-content: center; align-items: stretch;
  }
  .controls .score-box {
    flex-direction: column; align-items: center;
    gap: 1px; padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
  }
  .controls .score-box__label { font-size: 9px; }
  .controls .score-box__value { font-size: 18px; }
  .controls .btn { padding: 8px 4px; font-size: 11px; }

  #toast-container { bottom: 8px; }

  /* Landing page */
  .agent-grid, .agent-grid--3 { grid-template-columns: repeat(3, 1fr); }
  .landing-cta { flex-direction: column; align-items: stretch; }
  .landing-cta .btn { justify-content: center; }
  .landing-title--sans { font-size: clamp(52px, 14vw, 80px); margin-bottom: 24px; }
  .landing-rules-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .agent-card__sushi-img { height: 72px; }

  /* Game over: stack content cleanly on narrow screens */
  #screen-gameover {
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
  }
  .gameover {
    max-width: 100%;
    padding: 20px 12px 24px;
    gap: 14px;
  }
  .gameover__verdict {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1.05;
  }
  .gameover__scores {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .gameover__vs {
    font-size: 12px;
    align-self: center;
  }
  .gameover__player-card {
    width: 100%;
    padding: 12px 10px;
  }
  .gameover__pts { font-size: 26px; }
  .gameover__mini-hand { max-width: 100%; }
  .gameover__breakdown {
    padding: 10px 12px;
    font-size: 11px;
    gap: 5px;
  }
  .gameover__actions {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .gameover__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ══ Landscape phones (horizontal mobile) ════════════════════════════════════
   Same structure, tuned for larger touch targets
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) and (max-height: 500px) and (orientation: landscape) {
  :root {
    --card-w: 54px;
    --card-h: 76px;
    --pile-w: 34px;
    --pile-h: 48px;
  }

  #screen-game {
    grid-template-rows: 36px 1fr auto;
    grid-template-columns: 1fr auto;
  }

  .topbar { position: fixed; top: 4px; right: 8px; background: transparent; border: none; padding: 0; z-index: var(--z-overlay); }
  .topbar__logo   { display: none; }
  .topbar__center { display: none; }
  #btn-menu {
    background: rgba(27,30,46,0.65); color: var(--cream); border-radius: 6px;
    width: 28px; height: 28px; padding: 0; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
  }
  .game-ending-banner { top: 0; }

  .opp-zone { grid-row: 1; grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; padding: 3px 0; background: var(--belt-bg); min-height: 0; border-bottom: 1px solid rgba(200,169,110,.08); }
  .opp-zone__info { display: none; }
  #opp-hand .card-back { width: 24px; height: 34px; }

  .phase-bar { display: none; }

  .belt-section { grid-row: 2; grid-column: 1 / -1; padding: 8px; gap: 6px; align-items: center; }
  .belt-center  { flex: 1; min-width: 0; overflow: hidden; }
  .belt-track   { padding: 5px 8px; }
  .belt-rail    { margin: 0; }
  .belt-slots   { align-items: center; justify-content: center; justify-content: safe center; gap: 5px; overflow-x: auto; }
  .belt-slot    { width: var(--card-w); height: var(--card-h); }
  .belt-section .card { width: 100%; height: 100%; aspect-ratio: auto; }
  .belt-labels  { display: none; }

  .player-zone { grid-row: 3; grid-column: 1; padding: 4px 0; border-top: 1px solid var(--rule); overflow: hidden; }
  .player-zone__header { display: none; }
  .passive-effects     { display: none; }
  .player-hand { justify-content: center; justify-content: safe center; padding: 4px 8px 5px; gap: 6px; }
  .player-hand .card   { width: calc(var(--card-w) * 1.35); height: calc(var(--card-h) * 1.35); }

  .controls { grid-row: 3; grid-column: 2; flex-direction: column; height: auto; padding: 4px 8px; gap: 4px; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); justify-content: center; align-items: stretch; }
  .controls .score-box { flex-direction: column; align-items: center; gap: 0; padding-bottom: 4px; border-bottom: 1px solid var(--rule); }
  .controls .score-box__label { font-size: 8px; }
  .controls .score-box__value { font-size: 14px; }
  .controls .btn { padding: 4px 10px; font-size: 10px; }

  #toast-container { bottom: 6px; }

  .modal {
    width: 96%;
    max-height: calc(100vh - 8px);
    padding: 14px;
  }
  .modal__title { font-size: 17px; }
  .modal__instr { font-size: 12px; margin-bottom: 10px; }
  .chefs-pos-row { padding: 8px; gap: 10px; }
  .chefs-pos-body { gap: 10px; }

  .action-choice-panel {
    width: min(95vw, 520px);
    max-height: calc(100vh - 10px);
    padding: 10px;
  }
  .action-choice-card { width: min(26vh, 120px); }
  .action-choice-title { font-size: 16px; }
  .action-choice-desc { font-size: 11px; }

  /* Game over: compact but readable in short landscape */
  #screen-gameover {
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
  }
  .gameover {
    max-width: 100%;
    padding: 10px 12px 12px;
    gap: 10px;
  }
  .gameover__verdict { font-size: 26px; }
  .gameover__scores {
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
  }
  .gameover__player-card {
    padding: 8px 8px;
    min-width: 0;
  }
  .gameover__pts { font-size: 20px; }
  .gameover__mini-hand { max-width: 100%; }
  .gameover__breakdown {
    padding: 8px 10px;
    font-size: 10px;
    gap: 4px;
  }
  .gameover__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .gameover__actions .btn {
    width: 100%;
    justify-content: center;
  }
}
