/* 猫咖夜班：手忙脚乱 — stylesheet. Touch-first, portrait + landscape. */

:root {
  /* Warm café palette: cream walls, caramel wood, orange accents. */
  --bg: #fff3e2;
  --bg-2: #ffe9cf;
  --panel: #fffaf2;
  --panel-2: #fde9d2;
  --line: rgba(120, 72, 30, 0.14);
  --soft: rgba(120, 72, 30, 0.06);
  --soft-2: rgba(120, 72, 30, 0.1);
  --cream: #3b2415;
  --cream-2: #6b4a32;
  --muted: #9a7a60;
  --amber: #ff8f3c;
  --amber-2: #ffb15e;
  --amber-dark: #c9611a;
  --good: #3fae63;
  --good-soft: #dff5e5;
  --bad: #e5484d;
  --bad-soft: #ffe1e1;
  --info: #2f8fc9;
  --info-soft: #dff0fb;
  --pink: #ef6f8f;
  --gold: #f5b733;
  --wood: #b8793f;
  --wood-dark: #8a5a30;
  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(120, 72, 30, 0.14);
  --btn-shadow: rgba(120, 72, 30, 0.22);
  --hit: 56px;
  --font: 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 15% -120px, rgba(255, 177, 94, 0.35), transparent 60%),
    radial-gradient(700px 380px at 95% 0%, rgba(239, 111, 143, 0.14), transparent 60%),
    linear-gradient(180deg, #fff6e9 0%, var(--bg) 60%, #ffe6c9 100%);
}

button {
  font: inherit;
  color: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

button:focus-visible,
.guest:focus-visible {
  outline: 3px solid var(--info);
  outline-offset: 2px;
}

/* Rounded corners clip hit-testing; extend every tappable control into the
   surrounding gap so edge/corner taps always land. */
.btn,
.chip,
.guest,
.cat-btn,
.perk-card,
.icon-btn {
  position: relative;
}
.btn::before,
.chip::before,
.guest::before,
.cat-btn::before,
.perk-card::before,
.icon-btn::before {
  content: '';
  position: absolute;
  inset: -3px;
}

.app {
  min-height: 100dvh;
}

/* ---------- generic ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--hit);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: linear-gradient(180deg, #fffdf9, var(--panel-2));
  color: var(--cream);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 0 var(--btn-shadow), 0 6px 14px rgba(120, 72, 30, 0.1);
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active,
.btn.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--btn-shadow);
}
.btn-primary {
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 50, 0, 0.3);
  box-shadow: 0 6px 0 var(--amber-dark), 0 12px 24px rgba(255, 143, 60, 0.35);
}
.btn-primary:active,
.btn-primary.is-pressed {
  box-shadow: 0 2px 0 var(--amber-dark);
  transform: translateY(4px);
}
.btn-gold {
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  color: #5a3a00;
  box-shadow: 0 6px 0 #c58a12, 0 12px 24px rgba(245, 183, 51, 0.35);
}
.btn-gold:active,
.btn-gold.is-pressed {
  box-shadow: 0 2px 0 #c58a12;
  transform: translateY(4px);
}
.btn-gold small {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
}
.btn-soft {
  background: linear-gradient(180deg, #fffdf9, #fff0dd);
  border-color: var(--line);
}
.btn.is-on {
  background: var(--good-soft);
  border-color: rgba(63, 174, 99, 0.5);
  color: #1f6b3a;
}
.btn-xl {
  min-height: 64px;
  font-size: 20px;
  padding: 14px 32px;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
  color: var(--cream-2);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.btn-danger {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 4px 0 #a52a2e;
}
.btn-danger-ghost {
  background: transparent;
  border-color: rgba(255, 107, 107, 0.5);
  color: var(--bad);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hit);
  height: var(--hit);
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--cream);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--cream-2);
  font-size: 13px;
  font-weight: 600;
}
.pill-perk {
  background: rgba(241, 163, 60, 0.18);
  color: var(--amber-2);
}
.muted {
  color: var(--muted);
}
.lives {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}
.life {
  color: var(--soft-2);
}
.life.on {
  color: var(--pink);
}
.stars {
  display: inline-flex;
  gap: 4px;
}
.star {
  fill: var(--soft-2);
}
.star.on {
  fill: var(--amber-2);
  filter: drop-shadow(0 0 6px rgba(255, 196, 107, 0.6));
}

/* ---------- static screens ---------- */
.screen {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  min-height: 100dvh;
  justify-content: center;
}
.title-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}
.game-title {
  margin: 0;
  font-size: clamp(38px, 9vw, 60px);
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--amber-2);
  text-shadow: 0 4px 0 rgba(120, 72, 30, 0.18);
}
.game-title span {
  display: block;
  font-size: 0.5em;
  color: var(--cream);
  letter-spacing: 0.3em;
  margin-top: 8px;
}
.tagline {
  margin: 0;
  color: var(--cream-2);
  font-size: 16px;
}
.title-actions,
.intro-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(100%, 420px);
}
.title-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.title-row .btn {
  flex: 1 1 120px;
  padding-inline: 12px;
  font-size: 15px;
}
.records {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: min(100%, 520px);
  margin: 0;
}
.records.compact {
  grid-template-columns: repeat(2, 1fr);
}
.records div {
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
}
.records dt {
  font-size: 12px;
  color: var(--muted);
}
.records dd {
  margin: 4px 0 0;
  font-weight: 700;
  font-size: 17px;
}
.footnote {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.intro-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.intro-title {
  margin: 0;
  font-size: clamp(32px, 7vw, 46px);
  color: var(--amber-2);
}
.modifier-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: min(100%, 520px);
  box-shadow: var(--shadow);
}
.modifier-name {
  font-weight: 700;
  font-size: 18px;
  color: var(--amber-2);
  margin-bottom: 6px;
}
.modifier-card p {
  margin: 0;
  color: var(--cream-2);
  line-height: 1.5;
}
.intro-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: min(100%, 520px);
}
.intro-stats li {
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.intro-stats b {
  font-size: 16px;
}
.intro-stats span {
  font-size: 12px;
  color: var(--muted);
}
.perk-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.retry-note {
  color: var(--bad);
  margin: 0;
  font-size: 14px;
}
.intro-screen.scene-dusk .intro-title { color: #ffb37a; }
.intro-screen.scene-rain .intro-title { color: #9fc3e6; }
.intro-screen.scene-festival .intro-title { color: var(--pink); }

.result-title {
  margin: 0;
  font-size: clamp(30px, 7vw, 44px);
}
.result-screen.is-pass .result-title { color: var(--good); }
.result-screen.is-fail .result-title { color: var(--bad); }
.result-target {
  font-size: 18px;
  color: var(--cream-2);
}
.result-target b {
  color: var(--amber-2);
  font-size: 26px;
}
.result-bar {
  width: min(100%, 420px);
  height: 14px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.result-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--amber-2));
  transition: width 0.8s ease;
}
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 520px);
  margin: 0;
}
.result-grid div {
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
}
.result-grid dt {
  font-size: 12px;
  color: var(--muted);
}
.result-grid dd {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
}
.verdict {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  max-width: 460px;
}

.perk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.perk-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 18px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.perk-card:hover,
.perk-card:focus-visible {
  border-color: var(--amber);
  transform: translateY(-3px);
}
.perk-card:active {
  transform: scale(0.97);
}
.perk-card b {
  font-size: 19px;
  color: var(--amber-2);
}
.perk-card span {
  color: var(--cream-2);
  font-size: 14px;
  line-height: 1.45;
}

.summary-total {
  font-size: 18px;
}
.summary-total b {
  color: var(--amber-2);
  font-size: 26px;
}
.history {
  width: min(100%, 460px);
  border-collapse: collapse;
  font-size: 14px;
}
.history th,
.history td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}
.history th {
  color: var(--muted);
  font-weight: 600;
}
.history tr.pass td:last-child { color: var(--good); }
.history tr.fail td:last-child { color: var(--bad); }

/* ---------- overlay ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 8, 16, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay[hidden] {
  display: none;
}
.overlay-card {
  width: min(100%, 420px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  text-align: center;
  animation: overlayIn 0.2s ease-out;
}
.overlay-wide {
  width: min(100%, 720px);
  text-align: left;
}
.overlay-card h3 {
  margin: 0 0 14px;
  font-size: 24px;
  color: var(--amber-2);
}
.overlay-card p {
  line-height: 1.5;
}
.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-close {
  position: sticky;
  bottom: 0;
  width: 100%;
  margin-top: 16px;
  box-shadow: 0 -12px 16px var(--panel), 0 6px 0 #a8661c;
}
.help-steps {
  padding-left: 20px;
  line-height: 1.6;
  margin: 0 0 12px;
}
.help-steps li + li {
  margin-top: 6px;
}
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.menu-family h4 {
  margin: 0 0 8px;
  color: var(--amber-2);
}
.menu-family h4 small {
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}
.menu-family ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu-family li {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 6px 10px;
}
.menu-family li div {
  display: flex;
  flex-direction: column;
}
.menu-family li span {
  font-size: 12px;
  color: var(--muted);
}

@keyframes overlayIn {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}

/* ---------- shift screen ---------- */
.shift {
  position: relative;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  grid-template-areas: 'hud' 'scene' 'skills' 'reply' 'queue' 'station';
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.shift.is-shake {
  animation: screenShake 0.35s ease;
}
.shift.is-combo-flash::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle at 50% 30%, rgba(255, 196, 107, 0.25), transparent 60%);
  animation: fadeOut 0.6s ease forwards;
}

/* HUD */
.hud {
  grid-area: hud;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) auto auto auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
}
.hud-block {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.hud-night {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.15;
}
.hud-night-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.hud-mod {
  font-size: 11px;
  color: var(--amber-2);
  white-space: nowrap;
}
.hud-timer {
  gap: 8px;
}
.timer-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--info), #4fb3ff);
  transform-origin: left;
  transition: transform 0.2s linear;
}
.timer-text {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 15px;
  min-width: 38px;
}
.hud-timer.is-low .timer-fill {
  background: var(--bad);
}
.hud-timer.is-low .timer-text {
  color: var(--bad);
  animation: pulse 0.8s infinite;
}
.hud-score {
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  line-height: 1.1;
}
.hud-coins {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 18px;
  color: var(--amber-2);
  font-variant-numeric: tabular-nums;
}
.hud-target {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.hud-score.is-met .hud-target {
  color: var(--good);
}
.hud-combo {
  flex-direction: column;
  gap: 0;
  min-width: 52px;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--panel);
  line-height: 1.05;
  text-align: center;
}
.combo-label {
  font-size: 10px;
  color: var(--muted);
}
.combo-count {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.combo-mult {
  font-size: 11px;
  color: var(--cream-2);
}
.hud-combo[data-tier='1'] { background: rgba(122, 215, 255, 0.18); }
.hud-combo[data-tier='1'] .combo-mult { color: var(--info); }
.hud-combo[data-tier='2'] { background: rgba(111, 207, 142, 0.2); }
.hud-combo[data-tier='2'] .combo-mult { color: var(--good); }
.hud-combo[data-tier='3'] { background: rgba(255, 123, 156, 0.25); animation: pulse 1s infinite; }
.hud-combo[data-tier='3'] .combo-mult { color: var(--pink); }
.btn-pause {
  width: 46px;
  height: 46px;
}

/* Scene */
.scene-wrap {
  grid-area: scene;
  position: relative;
  height: clamp(96px, 17vh, 180px);
  border-radius: var(--radius);
  overflow: hidden;
  background: #2a1f30;
  box-shadow: inset 0 0 0 1px var(--line);
}
canvas.scene {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}
.scene-caption {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(120, 72, 30, 0.18);
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
}

/* Queue */
.queue {
  grid-area: queue;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
.guest {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 132px;
  padding: 8px 8px 12px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--cream);
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.guest.is-pressed {
  transform: scale(0.98);
}
.guest-empty-label {
  display: none;
  margin: auto;
  color: var(--muted);
  font-size: 14px;
}
.guest.is-empty {
  border-style: dashed;
  background: transparent;
}
.guest.is-empty .guest-empty-label {
  display: block;
}
.guest.is-empty .guest-body,
.guest.is-empty .patience,
.guest.is-empty .guest-badge {
  display: none;
}
.guest-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.guest-avatar {
  display: flex;
  align-items: center;
  gap: 6px;
}
.guest-avatar :is(svg, .guest-portrait) {
  width: 34px;
  height: 34px;
  flex: none;
}
.guest-portrait {
  display: block;
  width: 42px;
  height: 46px;
  flex: none;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: 14px;
  background: linear-gradient(160deg, #fff8e9, #f2d6b6);
  filter: drop-shadow(0 2px 2px rgba(83, 45, 21, 0.14));
  user-select: none;
}
.guest-portrait.mood-happy { filter: drop-shadow(0 2px 3px rgba(63, 160, 98, 0.28)); }
.guest-portrait.mood-worried { filter: saturate(0.86) drop-shadow(0 2px 2px rgba(83, 45, 21, 0.14)); }
.guest-portrait.mood-angry { filter: saturate(0.68) drop-shadow(0 2px 2px rgba(193, 64, 54, 0.24)); }
.guest-name {
  font-size: 12px;
  color: var(--cream-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.order-icon {
  flex: none;
  width: 36px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft);
  border-radius: 10px;
}
.order-icon svg {
  width: 32px;
  height: auto;
}
.order-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.order-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-recipe {
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}
.order-recipe .mini {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}
.order-recipe .mini svg {
  width: 18px;
  height: 18px;
}
.order-recipe-text {
  display: none;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.order-next {
  font-size: 11px;
  color: var(--amber-2);
}
.patience {
  margin-top: auto;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 72, 30, 0.18);
  overflow: hidden;
}
.patience-fill {
  height: 100%;
  background: var(--good);
  transform-origin: left;
  transition: transform 0.15s linear, background 0.3s ease;
}
.guest[data-mood='tense'] .patience-fill { background: var(--amber); }
.guest[data-mood='angry'] .patience-fill { background: var(--bad); }
.guest[data-mood='angry'] { border-color: rgba(255, 107, 107, 0.5); }
.guest[data-mood='angry'] .guest-avatar :is(svg, .guest-portrait) { animation: fidget 0.5s infinite; }
.guest[data-mood='angry'] .guest-avatar .guest-portrait { animation: fidget 0.5s infinite; }
.guest-badge {
  position: absolute;
  right: 8px;
  top: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(241, 163, 60, 0.2);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-2);
}
.guest-badge:empty,
.guest.is-match .guest-badge {
  display: none;
}
.guest.is-servable {
  border-color: rgba(120, 72, 30, 0.2);
}
.guest.is-match {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(111, 207, 142, 0.25), 0 0 18px rgba(111, 207, 142, 0.35);
}
.guest.is-match::after {
  content: '点我上餐';
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--good);
  color: #10301c;
  font-size: 11px;
  font-weight: 700;
}
.guest.is-leaving_happy {
  opacity: 0.55;
  border-color: rgba(111, 207, 142, 0.5);
}
.guest.is-leaving_angry {
  opacity: 0.6;
  border-color: var(--bad);
}
.guest.is-enter {
  animation: cardIn 0.3s ease-out;
}
.guest.is-flash-good {
  animation: flashGood 0.6s ease;
}
.guest.is-flash-bad {
  animation: flashBad 0.6s ease;
}

/* Station */
.station {
  grid-area: station;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-height: 0;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
}
.station.is-blocked .rows {
  filter: blur(1px) brightness(0.6);
  pointer-events: none;
}
.station-top {
  display: flex;
  gap: 12px;
  align-items: center;
}
.preview {
  --busy-ms: 700ms;
  position: relative;
  flex: none;
  width: 108px;
  height: 108px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 80%, var(--soft), transparent 70%), var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: box-shadow 0.2s ease;
  overflow: hidden;
}
.preview-cup {
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-cup svg {
  width: 84px;
  height: auto;
}
.preview.is-pop .preview-cup {
  animation: pop 0.25s ease;
}
.preview.is-complete {
  box-shadow: 0 0 0 2px var(--good), 0 0 22px rgba(111, 207, 142, 0.4);
}
.preview.is-complete .preview-cup {
  animation: readyBounce 1.2s ease-in-out infinite;
}
.preview.is-unknown {
  box-shadow: 0 0 0 2px var(--bad);
}
.preview.is-shaking .preview-cup {
  animation: shakeCup 0.14s linear infinite;
}
.preview.is-pouring .liquid {
  animation: rise var(--busy-ms) ease-out;
}
.pour-stream {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 46px;
  margin-left: -3px;
  border-radius: 0 0 6px 6px;
  opacity: 0;
  background: #8a5a3c;
}
.preview[data-base='espresso'] .pour-stream { background: #5a3420; }
.preview[data-base='milktea'] .pour-stream { background: #c89a6b; }
.preview[data-base='lemon'] .pour-stream { background: #e8b73a; }
.preview.is-pouring .pour-stream {
  opacity: 1;
  animation: pour var(--busy-ms) ease-in;
}
.preview.is-hot .steam {
  animation: steam 1.4s ease-in-out infinite;
}
.busy-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 5px;
  border-radius: 999px;
  background: var(--soft-2);
  overflow: hidden;
}
.busy-bar i {
  display: block;
  height: 100%;
  background: var(--info);
  transform-origin: left;
  transform: scaleX(0);
}
.preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.steps li {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 6px;
  border-radius: 8px;
  background: var(--soft);
  white-space: nowrap;
  overflow: hidden;
}
.steps li i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--panel-2);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}
.steps li.is-current {
  color: var(--cream);
  background: rgba(241, 163, 60, 0.18);
}
.steps li.is-current i {
  background: var(--amber);
  color: #3a2410;
}
.steps li.is-done {
  color: var(--good);
}
.steps li.is-done i {
  background: var(--good);
  color: #10301c;
}
.preview-name {
  font-size: 18px;
  font-weight: 800;
}
.preview-hint {
  font-size: 13px;
  color: var(--cream-2);
}

.rows {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr)) auto;
  gap: 6px;
  min-height: 0;
}
.row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 0;
  padding: 3px;
  border-radius: 12px;
  transition: background 0.15s ease;
}
.row.is-current {
  background: rgba(241, 163, 60, 0.1);
}
.row-label {
  flex: none;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-radius: 8px;
  background: var(--soft);
}
.row.is-current .row-label {
  color: var(--amber-2);
}
.chips {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
}
.chip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 60px;
  padding: 4px 2px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--panel-2);
  color: var(--cream);
  opacity: 0.45;
  transition: opacity 0.15s ease, transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip-icon {
  display: flex;
  height: 30px;
  align-items: center;
}
.chip-icon svg {
  width: 30px;
  height: 30px;
}
.chip-label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chip kbd {
  position: absolute;
  top: 3px;
  right: 5px;
  font: 600 9px/1 var(--font);
  color: var(--muted);
  opacity: 0;
}
.chip.is-ok {
  opacity: 1;
  background: linear-gradient(180deg, #4a3754, var(--panel-2));
  box-shadow: 0 3px 0 rgba(120, 72, 30, 0.18);
}
.chip.is-ok:active,
.chip.is-ok.is-pressed {
  transform: translateY(2px);
  box-shadow: none;
}
.chip.is-selected {
  opacity: 1;
  border-color: var(--good);
  background: rgba(111, 207, 142, 0.15);
}
.chip.is-hint {
  opacity: 1;
  border-color: var(--amber-2);
  animation: hintPulse 0.8s ease-in-out 2;
}
.chip.is-wiggle,
.btn.is-wiggle,
.cat-block.is-wiggle {
  animation: wiggle 0.3s ease;
}
.row.actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  padding: 0;
}
.btn-serve,
.btn-discard {
  flex-direction: column;
  gap: 0;
  min-height: 64px;
  line-height: 1.1;
  opacity: 0.5;
  border-radius: 14px;
}
.btn-serve span {
  font-size: 20px;
  font-weight: 800;
}
.btn-serve small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}
.btn-serve.is-ok {
  opacity: 1;
  background: linear-gradient(180deg, #86e0a4, var(--good));
  color: #10301c;
  box-shadow: 0 5px 0 #3f8e59;
  animation: readyGlow 1.2s ease-in-out infinite;
}
.btn-serve.is-ok:active,
.btn-serve.is-ok.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3f8e59;
}
.btn-discard.is-ok {
  opacity: 1;
  background: rgba(255, 107, 107, 0.16);
  color: var(--bad);
  border-color: rgba(255, 107, 107, 0.35);
}
.cat-block {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(27, 20, 32, 0.55);
}
.cat-block[hidden] {
  display: none;
}
.cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 28px;
  border-radius: 20px;
  border: 3px solid var(--amber);
  background: var(--panel);
  color: var(--cream);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 0 0 6px rgba(241, 163, 60, 0.2), var(--shadow);
  animation: catBob 0.9s ease-in-out infinite;
}
.cat-btn:active,
.cat-btn.is-pressed {
  transform: scale(0.96);
}
.cat-text b {
  color: var(--amber-2);
  font-size: 20px;
}

/* Toast + FX */
.toast {
  position: absolute;
  left: 50%;
  top: calc(52px + env(safe-area-inset-top));
  transform: translate(-50%, -8px);
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 14, 26, 0.92);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.is-bad { border-color: var(--bad); color: #ffb3b3; }
.toast.is-good { border-color: var(--good); color: #b9f0cb; }
.toast.is-warn { border-color: var(--amber); color: var(--amber-2); }
.toast.is-hint { border-color: var(--info); color: #cdeeff; white-space: normal; text-align: center; }
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  overflow: hidden;
}
.popup {
  position: absolute;
  transform: translate(-50%, 0);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 18px;
  color: var(--amber-2);
  text-shadow: 0 2px 0 rgba(60, 36, 20, 0.55);
  white-space: nowrap;
}
.popup small {
  font-size: 12px;
  color: var(--cream);
}
.popup-combo {
  color: var(--pink);
  font-size: 20px;
  background: rgba(20, 14, 26, 0.85);
}
.popup-bad {
  color: var(--bad);
  font-size: 15px;
  background: rgba(20, 14, 26, 0.85);
}
.fly-drink {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 8px rgba(60, 36, 20, 0.45));
}

/* ---------- keyframes ---------- */
@keyframes pulse {
  50% { opacity: 0.55; }
}
@keyframes fadeOut {
  to { opacity: 0; }
}
@keyframes pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
@keyframes readyBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes readyGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
@keyframes shakeCup {
  0% { transform: translateX(-4px) rotate(-6deg); }
  50% { transform: translateX(4px) rotate(6deg); }
  100% { transform: translateX(-4px) rotate(-6deg); }
}
@keyframes rise {
  from { transform: translateY(46px); }
  to { transform: translateY(0); }
}
@keyframes pour {
  0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
  15% { transform: scaleY(1); }
  85% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0); transform-origin: top; opacity: 0; }
}
@keyframes steam {
  0% { transform: translateY(0); opacity: 0.2; }
  50% { opacity: 0.8; }
  100% { transform: translateY(-6px); opacity: 0; }
}
@keyframes hintPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 196, 107, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(255, 196, 107, 0); }
}
@keyframes wiggle {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(3px, -1px); }
}
@keyframes cardIn {
  from { transform: translateX(24px); opacity: 0; }
}
@keyframes flashGood {
  30% { background: rgba(111, 207, 142, 0.35); }
}
@keyframes flashBad {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); background: rgba(255, 107, 107, 0.35); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); background: rgba(255, 107, 107, 0.35); }
  80% { transform: translateX(4px); }
}
@keyframes fidget {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes catBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ---------- responsive ---------- */
@media (min-width: 560px) {
  .order-recipe-text {
    display: inline;
  }
  .guest-avatar :is(svg, .guest-portrait) {
    width: 40px;
    height: 40px;
  }
  .chip kbd {
    opacity: 0.6;
  }
}

@media (min-width: 760px) {
  .guest-body {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }
  .guest-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .guest-avatar {
    flex-direction: column;
    align-items: center;
  }
  .guest-avatar :is(svg, .guest-portrait) {
    width: 48px;
    height: 48px;
  }
  .order-recipe-text {
    display: none;
  }
}

@media (min-width: 1000px) {
  .order-recipe-text {
    display: inline;
  }
}

/* Landscape: scene + queue on the left, station on the right. */
@media (orientation: landscape) and (min-width: 720px) {
  .shift {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 44%);
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    grid-template-areas:
      'hud hud'
      'scene station'
      'skills station'
      'reply station'
      'queue station';
    gap: 10px;
    padding-inline: 12px;
  }
  .hud-night-title {
    font-size: 16px;
  }
  .hud-mod {
    font-size: 12px;
  }
  .scene-wrap {
    height: auto;
    aspect-ratio: 8 / 3;
    max-height: 42vh;
  }
  .queue {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-columns: auto;
    align-content: start;
  }
  .guest {
    min-height: 132px;
  }
  .station {
    align-self: start;
    max-width: 640px;
    width: 100%;
    justify-self: end;
  }
  .preview {
    width: 124px;
    height: 124px;
  }
  .preview-cup svg {
    width: 96px;
  }
  .rows {
    grid-template-rows: repeat(3, minmax(64px, 100px)) auto;
    align-content: start;
  }
  .order-recipe-text {
    display: inline;
  }
}

/* Short landscape (phones held sideways): compact everything uniformly. */
@media (orientation: landscape) and (max-height: 560px) {
  .shift {
    gap: 6px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
  }
  .hud {
    min-height: 40px;
  }
  .scene-wrap {
    height: 84px;
    aspect-ratio: auto;
    max-height: none;
  }
  .guest {
    min-height: 84px;
    padding: 6px 6px 8px;
  }
  .guest-avatar :is(svg, .guest-portrait) {
    width: 28px;
    height: 28px;
  }
  .order-icon {
    width: 30px;
    height: 34px;
  }
  .order-icon svg {
    width: 26px;
  }
  .order-name {
    font-size: 13px;
  }
  .station {
    padding: 6px;
    gap: 6px;
    align-self: stretch;
  }
  .station-top {
    gap: 8px;
  }
  .preview {
    width: 72px;
    height: 72px;
  }
  .preview-cup svg {
    width: 56px;
  }
  .steps {
    display: none;
  }
  .preview-name {
    font-size: 15px;
  }
  .preview-hint {
    font-size: 12px;
  }
  .rows {
    gap: 4px;
    grid-template-rows: auto auto auto auto;
    align-content: start;
  }
  .row {
    padding: 2px;
    gap: 4px;
  }
  .chips {
    gap: 4px;
  }
  .chip {
    min-height: 42px;
    gap: 0;
  }
  .chip-icon {
    height: 20px;
  }
  .chip-icon svg {
    width: 20px;
    height: 20px;
  }
  .chip-label {
    font-size: 10px;
  }
  .chip kbd {
    display: none;
  }
  .btn-serve,
  .btn-discard {
    min-height: 46px;
  }
  .btn-serve span {
    font-size: 16px;
  }
  .btn-serve small {
    display: none;
  }
}

/* Tablets in portrait: give the extra height to the scene, not the buttons. */
@media (orientation: portrait) and (min-width: 700px) {
  .shift {
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    gap: 12px;
    padding-inline: 16px;
  }
  .scene-wrap {
    height: auto;
    min-height: 160px;
  }
  .guest {
    min-height: 160px;
  }
  .guest-avatar :is(svg, .guest-portrait) {
    width: 56px;
    height: 56px;
  }
  .order-icon {
    width: 48px;
    height: 54px;
  }
  .order-icon svg {
    width: 42px;
  }
  .order-name {
    font-size: 17px;
  }
  .preview {
    width: 132px;
    height: 132px;
  }
  .preview-cup svg {
    width: 100px;
  }
  .rows {
    grid-template-rows: repeat(3, minmax(76px, 104px)) auto;
    align-content: start;
  }
  .chip-icon {
    height: 38px;
  }
  .chip-icon svg {
    width: 38px;
    height: 38px;
  }
  .chip-label {
    font-size: 14px;
  }
}

/* Short portrait phones. */
@media (orientation: portrait) and (max-height: 760px) {
  .scene-wrap {
    height: clamp(84px, 13vh, 130px);
  }
  .guest {
    min-height: 118px;
  }
  .chip {
    min-height: 52px;
  }
  .preview {
    width: 92px;
    height: 92px;
  }
  .preview-cup svg {
    width: 70px;
  }
}
@media (orientation: portrait) and (max-height: 660px) {
  .scene-wrap {
    height: 72px;
  }
  .guest {
    min-height: 104px;
  }
  .chip {
    min-height: 46px;
  }
  .chip-icon {
    height: 22px;
  }
  .chip-icon svg {
    width: 22px;
    height: 22px;
  }
  .preview-info .steps {
    display: none;
  }
}

@media (max-width: 480px) {
  /* Four queue slots on a phone: stack the order bubble vertically. */
  .queue[data-slots='4'] .guest {
    padding: 6px 6px 10px;
  }
  .queue[data-slots='4'] .order {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .queue[data-slots='4'] .order-name {
    white-space: normal;
    line-height: 1.15;
    font-size: 13px;
  }
  .queue[data-slots='4'] .guest-name {
    display: none;
  }
}

@media (max-width: 420px) {
  .hud {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
    gap: 6px;
  }
  .hud-night-title {
    font-size: 13px;
  }
  .hud-mod {
    font-size: 10px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .steps {
    gap: 3px;
  }
  .steps li {
    font-size: 11px;
    padding: 3px 4px;
    gap: 3px;
  }
  .guest-name {
    display: none;
  }
  .records,
  .intro-stats,
  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .perk-grid {
    grid-template-columns: 1fr;
  }
  .perk-card {
    min-height: 96px;
    padding: 14px 16px;
  }
  .menu-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 380px) {
  .row-label {
    width: 16px;
    font-size: 11px;
  }
  .chips,
  .row {
    gap: 4px;
  }
  .chip-label {
    font-size: 11px;
  }
  .btn-serve small {
    display: none;
  }
}

/* ---------- reduced motion (body class is set from settings + system preference) ---------- */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}
.reduce-motion .preview.is-complete {
  box-shadow: 0 0 0 3px var(--good);
}
.reduce-motion .pour-stream {
  opacity: 0 !important;
}

/* =====================================================================
   Iteration 2: goals, tray, greet, vague orders, regulars, cat placement,
   boosters, roadmap, decorations, tutorial coach
   ===================================================================== */

/* Goal strip over the scene */
.goal-strip {
  position: absolute;
  left: 8px;
  top: 8px;
  right: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  pointer-events: none;
}
.goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: rgba(20, 12, 24, 0.72);
  border: 1px solid var(--soft-2);
  color: var(--cream-2);
  font-size: 11px;
  line-height: 1.2;
  backdrop-filter: blur(4px);
  pointer-events: auto;
}
.goal-chip .goal-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.goal-chip .goal-progress {
  font-variant-numeric: tabular-nums;
  color: var(--amber-2);
}
.goal-chip .goal-progress:empty {
  display: none;
}
.goal-mark {
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid rgba(120, 72, 30, 0.2);
  flex: none;
}
.goal-mark svg {
  width: 12px;
  height: 12px;
}
.goal-chip[data-state='done'] {
  border-color: rgba(111, 207, 142, 0.6);
  color: #d7f6e1;
}
.goal-chip[data-state='done'] .goal-mark {
  background: var(--good);
  border-color: var(--good);
  color: #10301c;
}
.goal-chip[data-state='failed'] {
  opacity: 0.6;
  text-decoration: line-through;
}
.goal-chip[data-state='failed'] .goal-mark {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.goal-stars {
  color: var(--muted);
  font-weight: 700;
}
.goal-stars svg {
  width: 13px;
  height: 13px;
}
.goal-stars.is-on {
  color: var(--amber-2);
  border-color: rgba(241, 163, 60, 0.6);
}
.goal-chip.is-flash {
  animation: flashGood 0.7s ease;
}

/* Banner (rush / last call) */
.banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 8px 22px;
  border-radius: 999px;
  background: rgba(20, 12, 24, 0.85);
  border: 2px solid var(--amber);
  color: var(--amber-2);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1);
  white-space: nowrap;
}
.banner.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.banner.is-last {
  border-color: var(--bad);
  color: #ffb3b3;
}

/* Actions row: serve / shelve / greet / discard */
.row.actions {
  grid-template-columns: 2fr 1.2fr 1.1fr 0.8fr;
}
.btn-shelve,
.btn-greet {
  flex-direction: column;
  gap: 0;
  min-height: 64px;
  line-height: 1.1;
  opacity: 0.5;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.btn-shelve span,
.btn-greet .greet-label {
  font-size: 15px;
  font-weight: 800;
}
.btn-shelve small,
.btn-greet small {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}
.btn-shelve.is-ok {
  opacity: 1;
  background: linear-gradient(180deg, #8fd6ff, var(--info));
  color: #0d2a3a;
  box-shadow: 0 5px 0 #3c86a8;
}
.btn-shelve.is-ok:active,
.btn-shelve.is-ok.is-pressed {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #3c86a8;
}
.btn-greet {
  background: var(--panel-2);
  color: var(--cream);
}
.btn-greet .greet-icon {
  display: inline-flex;
  color: var(--amber-2);
}
.btn-greet .greet-icon svg {
  width: 20px;
  height: 20px;
}
.btn-greet.is-ok {
  opacity: 1;
  border-color: rgba(241, 163, 60, 0.5);
}
.btn-greet.is-cooling {
  opacity: 0.7;
}
.greet-fill {
  position: absolute;
  inset: 0;
  background: rgba(120, 72, 30, 0.18);
  transform-origin: bottom;
  transform: scaleY(0);
  pointer-events: none;
}
.btn-greet > *:not(.greet-fill) {
  position: relative;
  z-index: 1;
}

/* Tray */
.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  min-width: 0;
}
.tray-label {
  font-size: 11px;
  color: var(--muted);
  flex: none;
}
.tray-slots {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.tray-slot {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  flex: 1;
  border-radius: 10px;
  border: 1.5px dashed var(--soft-2);
  background: rgba(120, 72, 30, 0.16);
}
.tray-slot.is-empty {
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
}
.tray-slot:not(.is-empty) {
  border-style: solid;
  border-color: rgba(120, 72, 30, 0.2);
  background: var(--panel-2);
}
.tray-slot.is-wanted {
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(111, 207, 142, 0.25);
}
.tray-serve {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 2px 4px 2px 6px;
  border: 0;
  border-radius: 10px 0 0 10px;
  background: transparent;
  color: var(--cream);
  font: inherit;
  text-align: left;
}
.tray-serve svg {
  width: 26px;
  height: auto;
  flex: none;
}
.tray-name {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tray-discard {
  flex: none;
  width: 32px;
  min-height: 44px;
  border: 0;
  border-left: 1px solid var(--soft-2);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 107, 107, 0.12);
  color: var(--bad);
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
}
.tray-serve:active,
.tray-discard:active {
  filter: brightness(1.2);
}
.tray.is-flash .tray-slots {
  animation: flashGood 0.6s ease;
}

/* Guest cards: tags, vague orders, regulars */
.guest-name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.guest-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guest-tags {
  display: inline-flex;
  gap: 3px;
  flex: none;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 700;
}
.tag svg {
  width: 10px;
  height: 10px;
}
.tag-regular {
  background: rgba(241, 163, 60, 0.22);
  color: var(--amber-2);
}
.tag-paw {
  background: rgba(255, 123, 156, 0.2);
  color: var(--pink);
  padding: 0 4px;
}
.guest.is-regular {
  border-color: rgba(241, 163, 60, 0.55);
  background: linear-gradient(180deg, #4a3542, var(--panel));
}
.guest.is-vague .order-icon {
  background: rgba(255, 196, 107, 0.12);
}
.guest.is-vague .order-name {
  white-space: normal;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--cream);
}
.order-ask {
  color: var(--amber-2);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.guest.is-tray-match::after {
  content: '托盘有这杯';
  background: var(--info);
  color: #0d2a3a;
}
.guest.is-flash-perfect {
  animation: flashPerfect 0.8s ease;
}
@keyframes flashPerfect {
  0% { box-shadow: 0 0 0 0 rgba(255, 241, 168, 0); }
  30% { box-shadow: 0 0 0 6px rgba(255, 241, 168, 0.8), 0 0 30px rgba(255, 241, 168, 0.6); }
  100% { box-shadow: 0 0 0 0 rgba(255, 241, 168, 0); }
}
.popup-perfect {
  color: #fff1a8;
  font-size: 18px;
  text-shadow: 0 2px 0 #7a5a00, 0 0 12px rgba(255, 241, 168, 0.8);
}
.popup-goal {
  color: #d7f6e1;
  font-size: 13px;
  background: rgba(20, 12, 24, 0.85);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--good);
  white-space: nowrap;
}
.toast.is-story {
  border-color: var(--amber);
  color: var(--cream);
  white-space: normal;
  text-align: center;
}

/* Tutorial coach */
.coach {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(241, 163, 60, 0.22), rgba(241, 163, 60, 0.08));
  border: 1.5px solid rgba(241, 163, 60, 0.6);
  color: var(--cream);
  font-size: 13px;
  line-height: 1.35;
}
.coach[hidden] {
  display: none;
}
.coach-text {
  flex: 1;
  min-width: 0;
}
.coach-skip {
  flex: none;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(120, 72, 30, 0.2);
  background: rgba(120, 72, 30, 0.2);
  color: var(--cream-2);
  font: inherit;
  font-size: 12px;
}
.coach.is-flash {
  animation: flashGood 0.6s ease;
}
.chip.is-coach,
.btn.is-coach {
  box-shadow: 0 0 0 3px var(--amber), 0 0 18px rgba(241, 163, 60, 0.6);
  animation: hintPulse 1s ease-in-out infinite;
}

/* Roadmap */
.roadmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}
.road-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--soft);
  text-align: center;
  min-width: 0;
}
.road-node::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  width: 8px;
  height: 2px;
  background: var(--line);
}
.road-node:last-child::after {
  display: none;
}
.road-num {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--panel-2);
  color: var(--cream-2);
  font-weight: 800;
  font-size: 13px;
}
.road-title {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.road-title-short {
  display: none;
}
.road-mod {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.road-node.is-done {
  border-color: rgba(111, 207, 142, 0.45);
}
.road-node.is-done .road-num {
  background: var(--good);
  color: #10301c;
}
.road-node.is-current {
  border-color: var(--amber);
  background: rgba(241, 163, 60, 0.12);
  box-shadow: 0 0 0 3px rgba(241, 163, 60, 0.2);
}
.road-node.is-current .road-num {
  background: var(--amber);
  color: #3a2100;
}
.road-node.is-locked {
  opacity: 0.55;
}
.mini-stars {
  display: inline-flex;
  gap: 1px;
  color: var(--soft-2);
}
.mini-stars i {
  display: inline-flex;
}
.mini-stars svg {
  width: 11px;
  height: 11px;
}
.mini-stars i.on {
  color: var(--amber-2);
}
.roadmap.is-compact .road-title,
.roadmap.is-compact .road-mod {
  display: none;
}
.roadmap.is-compact .road-node {
  padding: 6px 2px;
}

/* Intro panels */
.goal-panel,
.place-panel,
.booster-panel,
.regular-panel,
.story-panel {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
}
.goal-panel h3,
.place-panel h3,
.booster-panel h3,
.regular-panel h3,
.story-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.goal-panel h3 small,
.place-panel h3 small,
.booster-panel h3 small {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}
.goal-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.goal-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 14px;
}
.goal-list li svg {
  width: 16px;
  height: 16px;
  color: var(--amber-2);
}
.goal-list li span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.goal-list li.is-main {
  background: rgba(241, 163, 60, 0.12);
}
.spot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.spot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 150px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--cream);
  text-align: center;
  position: relative;
}
.spot-card svg {
  width: 54px;
  height: auto;
}
.spot-name {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.spot-cat {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.spot-cat small {
  font-weight: 500;
  color: var(--amber-2);
}
.spot-effect {
  font-size: 11px;
  line-height: 1.3;
  color: var(--cream-2);
}
.spot-card.is-selected {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(241, 163, 60, 0.25);
  transform: translateY(-2px);
}
.spot-card.is-selected::after {
  content: '选另一个位置互换';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--amber);
  color: #3a2100;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.booster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.booster-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  padding: 10px 10px 8px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel-2);
  color: var(--cream);
  text-align: left;
}
.booster-card b {
  font-size: 14px;
  color: var(--amber-2);
}
.booster-card span {
  font-size: 11px;
  color: var(--cream-2);
  line-height: 1.3;
}
.booster-count {
  position: absolute;
  top: 6px;
  right: 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.booster-card em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
}
.booster-card.is-active {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(111, 207, 142, 0.2);
}
.booster-card.is-empty {
  opacity: 0.45;
}
.regular-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.regular-list li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.regular-list :is(svg, .guest-portrait) {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--soft);
}
.regular-list div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.regular-list b {
  font-size: 14px;
}
.regular-list small {
  color: var(--amber-2);
  font-size: 11px;
}
.regular-list span {
  color: var(--muted);
  font-size: 12px;
}
.tutorial-note {
  font-size: 13px;
}

/* Result: goal checklist, story beats */
.goal-check {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.goal-check li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-size: 14px;
  text-align: left;
}
.goal-check li i {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.goal-check li.is-done i {
  background: var(--good);
  color: #10301c;
}
.goal-check li.is-failed i {
  background: rgba(255, 107, 107, 0.25);
  color: var(--bad);
}
.goal-check li.is-failed b {
  color: var(--muted);
}
.goal-check li span {
  font-size: 11px;
  color: var(--amber-2);
  white-space: nowrap;
}
.story-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.story-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.story-list :is(svg, .guest-portrait) {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--soft);
}
.story-list b {
  font-size: 14px;
}
.story-list p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cream-2);
}
.story-list li.is-sad p {
  color: var(--muted);
}
.story-list .epilogue {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(241, 163, 60, 0.12);
  color: var(--amber-2);
}
.decor-hint {
  font-size: 12px;
}

/* Title: decorations panel */
.decor-panel {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
}
.decor-panel summary {
  cursor: pointer;
  font-size: 14px;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.decor-panel summary b {
  color: var(--amber-2);
}
.decor-list {
  margin: 10px 0 4px;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.decor-list li {
  display: flex;
  flex-direction: column;
  padding: 6px 8px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 12px;
  color: var(--muted);
}
.decor-list li b {
  color: var(--cream-2);
  font-size: 13px;
}
.decor-list li.is-on {
  background: rgba(111, 207, 142, 0.12);
}
.decor-list li.is-on b {
  color: #d7f6e1;
}
.inline-list {
  display: inline-flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}
.inline-list small {
  color: var(--muted);
}
.records dd svg {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  color: var(--amber-2);
}
.summary-total svg {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  color: var(--amber-2);
}
.perk-grid.is-four {
  grid-template-columns: repeat(2, 1fr);
}
.help-cats {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.help-cats li {
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-cats li div {
  display: flex;
  flex-direction: column;
}
.help-cats li span {
  font-size: 13px;
  color: var(--cream-2);
}

.btn-shelve span,
.btn-greet .greet-label,
.btn-discard span {
  white-space: nowrap;
}
.btn-shelve,
.btn-greet,
.btn-discard {
  padding-left: 4px;
  padding-right: 4px;
}
@media (max-width: 560px) {
  .row.actions {
    grid-template-columns: 1.5fr 1fr 1fr 0.8fr;
    gap: 6px;
  }
  .btn-serve span {
    font-size: 17px;
  }
  .btn-serve small {
    display: none;
  }
  .btn-shelve small,
  .btn-greet small {
    display: none;
  }
  .btn-greet .greet-icon svg {
    width: 18px;
    height: 18px;
  }
  .spot-grid {
    gap: 6px;
  }
  .spot-card {
    min-height: 136px;
    padding: 8px 4px;
  }
  .spot-card svg {
    width: 44px;
  }
  .spot-effect {
    font-size: 10px;
  }
  .road-mod {
    display: none;
  }
  .goal-chip .goal-label {
    max-width: none;
  }
}
@media (max-width: 420px) {
  .guest-name {
    display: flex;
  }
  .guest-name-text {
    display: none;
  }
  .booster-grid {
    grid-template-columns: 1fr;
  }
  .booster-card {
    min-height: 0;
  }
  .btn-shelve span,
  .btn-greet .greet-label {
    font-size: 13px;
  }
  .btn-shelve small,
  .btn-greet small,
  .btn-discard span {
    font-size: 9px;
  }
  .perk-grid.is-four {
    grid-template-columns: 1fr;
  }
  .goal-list li span {
    display: none;
  }
}
@media (max-width: 560px) {
  .road-title-full {
    display: none;
  }
  .road-title-short {
    display: inline;
  }
}
@media (max-width: 380px) {
  .road-title {
    display: none;
  }
  .btn-shelve small {
    display: none;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .goal-strip {
    top: 4px;
    left: 4px;
  }
  .goal-chip {
    font-size: 10px;
    padding: 2px 7px 2px 5px;
  }
  .coach {
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.25;
  }
  .coach-skip {
    min-height: 28px;
    font-size: 11px;
  }
  /* Tray moves next to the preview name to save a row. */
  .preview-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'name tray' 'hint tray';
    column-gap: 8px;
    align-items: center;
  }
  .preview-info .steps {
    display: none;
  }
  .preview-name {
    grid-area: name;
  }
  .preview-hint {
    grid-area: hint;
  }
  .tray {
    grid-area: tray;
    margin-top: 0;
  }
  .tray-label {
    display: none;
  }
  .tray-slot,
  .tray-serve,
  .tray-discard {
    min-height: 36px;
  }
  .tray-serve svg {
    width: 20px;
  }
  .btn-shelve,
  .btn-greet,
  .btn-discard {
    min-height: 46px;
  }
  .btn-shelve small,
  .btn-greet small {
    display: none;
  }
  .btn-shelve span,
  .btn-greet .greet-label {
    font-size: 13px;
  }
  .btn-greet .greet-icon svg {
    width: 16px;
    height: 16px;
  }
}

/* Short portrait phones (e.g. 375x667): keep the whole station on screen. */
@media (orientation: portrait) and (max-height: 720px) {
  .shift {
    gap: 6px;
    padding-top: calc(4px + env(safe-area-inset-top));
  }
  .hud {
    min-height: 40px;
  }
  .scene-wrap {
    height: 80px;
  }
  .guest {
    min-height: 100px;
    padding: 6px 6px 10px;
  }
  .guest-avatar :is(svg, .guest-portrait) {
    width: 30px;
    height: 30px;
  }
  .order-icon {
    width: 32px;
    height: 36px;
  }
  .order-icon svg {
    width: 28px;
  }
  .station {
    padding: 6px;
    gap: 6px;
  }
  .preview {
    width: 72px;
    height: 72px;
  }
  .preview-cup svg {
    width: 56px;
  }
  .preview-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: 'name tray' 'hint tray';
    column-gap: 8px;
    align-items: center;
    gap: 2px 8px;
  }
  .preview-info .steps {
    display: none;
  }
  .preview-name {
    grid-area: name;
    font-size: 15px;
  }
  .preview-hint {
    grid-area: hint;
    font-size: 12px;
  }
  .tray {
    grid-area: tray;
    margin-top: 0;
  }
  .tray-label {
    display: none;
  }
  .tray-slot,
  .tray-serve,
  .tray-discard {
    min-height: 36px;
  }
  .coach {
    padding: 4px 8px;
    font-size: 11.5px;
    line-height: 1.25;
  }
  .coach-skip {
    min-height: 28px;
    font-size: 11px;
  }
  .rows {
    gap: 4px;
  }
  .row {
    padding: 2px;
    gap: 4px;
  }
  .chips {
    gap: 4px;
  }
  .chip {
    min-height: 44px;
    gap: 0;
  }
  .chip-icon {
    height: 22px;
  }
  .chip-icon svg {
    width: 22px;
    height: 22px;
  }
  .chip-label {
    font-size: 10.5px;
  }
  .chip kbd {
    display: none;
  }
  .btn-serve,
  .btn-discard,
  .btn-shelve,
  .btn-greet {
    min-height: 48px;
  }
  .btn-serve span {
    font-size: 16px;
  }
  .btn-serve small,
  .btn-shelve small,
  .btn-greet small {
    display: none;
  }
}

/* =====================================================================
   Iteration 3 theme layer: warm café look, hero, growth book, events.
   ===================================================================== */

/* ---------- generic panels ---------- */
.screen h3,
.screen h4 {
  color: var(--cream);
}
.screen h3 small,
.screen h4 small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}
.muted {
  color: var(--muted);
}
.pill {
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--cream-2);
  box-shadow: 0 2px 0 var(--btn-shadow);
}
.pill-relaxed {
  background: var(--good-soft);
  color: #1f6b3a;
  border-color: rgba(63, 174, 99, 0.4);
}
.bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: var(--soft-2);
  overflow: hidden;
  margin-top: 4px;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-2), var(--amber));
  transition: width 0.4s ease;
}
.bar.is-done i {
  background: linear-gradient(90deg, #7fdc9b, var(--good));
}

/* ---------- title hero ---------- */
.title-screen {
  gap: 14px;
}
.hero {
  position: relative;
  width: 100%;
  padding: 18px 12px 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, #ffd9a8 0%, #ffe7c8 55%, #fff5e8 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), var(--shadow);
  overflow: hidden;
  text-align: center;
}
.hero-sky {
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background:
    radial-gradient(60px 60px at 82% 30%, #fff1b8 0 40%, transparent 42%),
    radial-gradient(10px 10px at 20% 25%, #fff 0 30%, transparent 35%),
    radial-gradient(8px 8px at 35% 12%, #fff 0 30%, transparent 35%);
  opacity: 0.9;
}
.hero-art {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 128px;
}
.hero-art::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  box-shadow: 0 6px 0 rgba(138, 90, 48, 0.25);
}
.hero-cat {
  position: relative;
  z-index: 1;
  display: inline-flex;
  margin-bottom: 8px;
}
.hero-cat-a {
  animation: heroBob 3.4s ease-in-out infinite;
}
.hero-cat-b {
  animation: heroBob 3.4s ease-in-out infinite 0.8s;
}
.hero-cat-c {
  animation: heroBob 3.4s ease-in-out infinite 1.6s;
}
.hero-cup {
  position: relative;
  z-index: 2;
  margin-bottom: 10px;
  filter: drop-shadow(0 8px 10px rgba(120, 72, 30, 0.25));
}
@keyframes heroBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.reduce-motion .hero-cat {
  animation: none;
}
.title-screen .game-title {
  margin: 4px 0 0;
  color: var(--amber-dark);
  text-shadow: 0 2px 0 #fff, 0 6px 14px rgba(255, 143, 60, 0.3);
}
.title-screen .game-title span {
  color: var(--cream);
  text-shadow: none;
}
.title-screen .tagline {
  margin: 4px auto 0;
  color: var(--cream-2);
}
.title-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.title-row .btn {
  flex: 1 1 calc(50% - 4px);
  min-height: 48px;
  font-size: 15px;
  padding: 8px 10px;
}
.unlock-hint {
  margin: 0;
  text-align: center;
  font-size: 13px;
}

/* ---------- daily + progress ---------- */
.daily-panel,
.progress-panel,
.events-panel,
.result-section,
.book-section {
  width: 100%;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.daily-panel h3,
.events-panel h3,
.result-section h3,
.book-section h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.daily-list,
.events-list,
.milestone-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daily-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
}
.daily-list li i {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--amber);
  box-shadow: 0 2px 0 var(--btn-shadow);
}
.daily-list li.is-done i {
  background: var(--good);
  color: #fff;
}
.daily-list li.is-done b {
  color: var(--muted);
  text-decoration: line-through;
}
.daily-list li span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.daily-panel.is-compact .daily-list li .bar {
  height: 6px;
}
.progress-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.progress-main {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px 8px 6px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  border-radius: 14px;
}
.progress-main:active {
  background: var(--soft);
}
.progress-main b {
  display: block;
  font-size: 16px;
}
.progress-main span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.chev {
  font-style: normal;
  font-size: 24px;
  color: var(--muted);
}
.ring {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
}
.ring svg {
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: var(--soft-2);
  stroke-width: 7;
}
.ring-fg {
  fill: none;
  stroke: var(--amber);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}
.ring b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: var(--cream);
}
.ring b small {
  font-size: 10px;
}
.records {
  width: 100%;
}
.records div {
  background: var(--soft);
  border-radius: 12px;
}
.records dd {
  color: var(--cream);
}

/* ---------- intro ---------- */
.modifier-card {
  background: linear-gradient(180deg, #fff, var(--panel-2));
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.modifier-card .intro-stats {
  margin: 12px 0 0;
}
.modifier-card .intro-stats li {
  background: rgba(255, 255, 255, 0.7);
}
.intro-stats b {
  color: var(--cream);
}
.menu-fams {
  font-size: 15px !important;
}
.goal-panel,
.place-panel,
.booster-panel,
.regular-panel,
.story-panel {
  background: var(--panel);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.goal-list li {
  background: var(--soft);
}
.goal-list li.is-main {
  background: #fff4de;
  border: 1.5px solid rgba(255, 143, 60, 0.4);
}
.goal-list li b {
  color: var(--cream);
}
.events-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
}
.events-list li span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.events-panel .muted {
  margin: 8px 0 0;
  font-size: 12px;
}
.spot-card,
.booster-card,
.perk-card {
  background: linear-gradient(180deg, #fff, var(--panel-2));
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--btn-shadow);
  color: var(--cream);
}
.spot-card.is-selected {
  border-color: var(--amber);
  box-shadow: 0 4px 0 var(--amber-dark), 0 0 0 4px rgba(255, 143, 60, 0.2);
}
.spot-level {
  font-size: 10px;
  color: var(--amber-dark);
  font-weight: 700;
}
.booster-card.is-active {
  border-color: var(--good);
  background: var(--good-soft);
}
.perk-card em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 12px;
  color: var(--amber-dark);
}
.intro-actions .title-row {
  width: 100%;
}
.intro-actions .title-row .btn {
  flex: 1 1 30%;
}
.retry-note {
  background: var(--bad-soft);
  color: #8a2a2d;
}
.tutorial-note {
  background: var(--info-soft);
  color: #1f5f84;
  padding: 8px 12px;
  border-radius: 12px;
}

/* ---------- result ---------- */
.result-screen .result-title {
  color: var(--cream);
}
.result-screen.is-fail .result-title {
  color: var(--bad);
}
.result-stars .stars .star {
  width: 40px;
  height: 40px;
  fill: #e6d6c2;
}
.result-stars .stars .star.on {
  fill: var(--gold);
  filter: drop-shadow(0 3px 0 #c58a12);
  animation: starPop 0.5s cubic-bezier(.3,1.6,.5,1) both;
}
.result-stars .stars .star.on:nth-child(2) {
  animation-delay: 0.15s;
}
.result-stars .stars .star.on:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes starPop {
  from {
    transform: scale(0.2) rotate(-30deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}
.result-bar {
  background: var(--soft-2);
}
.verdict {
  color: var(--cream);
  font-weight: 600;
}
.goal-check li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  grid-template-areas: 'mark label value' 'mark bar bar';
  align-items: center;
  column-gap: 8px;
  background: var(--soft);
  color: var(--cream);
}
.goal-check li i {
  grid-area: mark;
  background: #fff;
  color: var(--good);
  box-shadow: 0 2px 0 var(--btn-shadow);
}
.goal-check li.is-failed i {
  color: var(--bad);
}
.goal-check li b {
  grid-area: label;
}
.goal-check li span {
  grid-area: value;
  color: var(--muted);
}
.goal-check li .bar {
  grid-area: bar;
  margin-top: 6px;
}
.goal-check li .near {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bad-soft);
  color: #a52a2e;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}
.daily-check li.is-new {
  background: #fff4de;
  border: 1.5px solid rgba(255, 143, 60, 0.4);
}
.daily-check li.is-new span {
  color: var(--amber-dark);
  font-weight: 700;
}
.result-grid div {
  background: var(--panel);
  border: 1.5px solid var(--line);
}
.result-grid dd {
  color: var(--cream);
}
.milestone-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'label value' 'bar bar';
  align-items: center;
  gap: 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
}
.milestone-list li b {
  grid-area: label;
}
.milestone-list li span {
  grid-area: value;
  font-size: 12px;
  color: var(--muted);
}
.milestone-list li .bar {
  grid-area: bar;
  margin-top: 6px;
}
.completion-line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
}
.completion-line b {
  display: block;
  font-size: 15px;
}
.completion-line span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.story-list li {
  background: var(--soft);
}

/* ---------- growth book ---------- */
.book-screen {
  gap: 14px;
}
.book-head {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
}
.book-head h2 {
  margin: 0 0 2px;
  font-size: 24px;
}
.book-head span {
  font-size: 12px;
  line-height: 1.4;
}
.book-family h4 {
  margin: 10px 0 6px;
  font-size: 14px;
  color: var(--cream-2);
}
.book-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}
.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
  text-align: center;
  min-width: 0;
}
.book-card b {
  font-size: 13px;
  line-height: 1.2;
}
.book-card b small {
  font-weight: 500;
  color: var(--amber-dark);
}
.book-card small {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.3;
}
.book-card .mini-stars i {
  color: #e6d6c2;
}
.book-card .mini-stars i.on {
  color: var(--gold);
}
.book-card.lv-0 {
  background: var(--soft);
  box-shadow: none;
}
.book-card.lv-0 .book-art {
  opacity: 0.45;
  filter: grayscale(1);
}
.book-card.lv-3 {
  border-color: rgba(245, 183, 51, 0.6);
  background: linear-gradient(180deg, #fff, #fff6dc);
}
.book-card.is-regular {
  border-color: rgba(255, 143, 60, 0.4);
}
.book-art {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
}
.book-art :is(svg, .guest-portrait) {
  max-height: 56px;
}
.decor-art {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--soft-2);
  color: var(--amber-dark);
}
.lv-3 .decor-art {
  background: var(--good);
  color: #fff;
}
.book-grid.guests .book-art :is(svg, .guest-portrait) {
  width: 52px;
  height: 52px;
}

/* ---------- shift: event card ---------- */
.event-card {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 64px;
  z-index: 30;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  grid-template-areas: 'icon body' 'actions actions';
  gap: 8px 10px;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fffdf8, #fff1dc);
  border: 2px solid var(--amber);
  box-shadow: 0 10px 0 var(--amber-dark), 0 18px 40px rgba(120, 72, 30, 0.3);
  color: var(--cream);
}
.event-card[hidden] {
  display: none;
}
.event-card.is-flash {
  animation: eventIn 0.4s cubic-bezier(.3,1.5,.5,1) both;
}
@keyframes eventIn {
  from {
    transform: translateY(-20px) scale(0.92);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.event-icon {
  grid-area: icon;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.event-stolen {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: inline-flex;
  padding: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 var(--btn-shadow);
  transform: rotate(-15deg);
}
.event-stolen svg {
  width: 26px;
  height: 26px;
}
.event-gold {
  filter: drop-shadow(0 0 6px rgba(245, 183, 51, 0.9));
}
.event-body {
  grid-area: body;
  min-width: 0;
}
.event-title {
  display: block;
  font-size: 17px;
  margin-bottom: 2px;
}
.event-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--cream-2);
}
.event-timer {
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--soft-2);
  overflow: hidden;
}
.event-timer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--bad));
  transform-origin: left;
}
.event-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 8px;
}
.event-actions .btn {
  min-height: 48px;
  font-size: 16px;
  padding: 8px 10px;
}
.btn-event-accept {
  background: linear-gradient(180deg, var(--amber-2), var(--amber));
  color: #fff;
  text-shadow: 0 1px 0 rgba(120, 50, 0, 0.3);
  box-shadow: 0 4px 0 var(--amber-dark);
}
.btn-event-accept:active {
  box-shadow: 0 1px 0 var(--amber-dark);
}
.shift.has-event .queue,
.shift.has-event .station {
  filter: saturate(0.85);
}
.banner.is-gold {
  background: linear-gradient(90deg, #ffe08a, var(--gold));
  color: #5a3a00;
}
.banner.is-event {
  background: linear-gradient(90deg, var(--amber-2), var(--amber));
  color: #fff;
}

/* ---------- shift: guests / tags / chips ---------- */
.guest {
  background: linear-gradient(180deg, #fff, #fff4e6);
  border-color: var(--line);
  box-shadow: 0 4px 0 var(--btn-shadow);
}
.guest.is-empty {
  background: var(--soft);
  box-shadow: none;
  border-style: dashed;
}
.guest.is-vip {
  background: linear-gradient(180deg, #fff9e3, #ffe9a6);
  border-color: var(--gold);
  box-shadow: 0 4px 0 #c58a12, 0 0 0 3px rgba(245, 183, 51, 0.25);
}
.guest.is-delivery {
  background: linear-gradient(180deg, #eef7ff, #d9ecfb);
  border-color: var(--info);
}
.tag-vip {
  background: var(--gold);
  color: #5a3a00;
}
.tag-delivery {
  background: var(--info);
  color: #fff;
}
.tag-addon {
  background: var(--pink);
  color: #fff;
}
.chip.is-stolen {
  opacity: 0.35;
  text-decoration: line-through;
  background: repeating-linear-gradient(45deg, var(--soft) 0 6px, transparent 6px 12px);
}
.chip.is-stolen::after {
  content: '🐾';
  position: absolute;
  right: 4px;
  top: 2px;
  font-size: 12px;
}
.station.is-chasing .rows {
  filter: blur(1px) brightness(0.9);
  pointer-events: none;
}
.hud-score.is-bump {
  animation: bump 0.35s cubic-bezier(.3,1.6,.5,1);
}
@keyframes bump {
  50% {
    transform: scale(1.18);
  }
}
.hud-combo.is-break {
  animation: breakShake 0.45s ease;
  background: var(--bad-soft) !important;
  color: var(--bad);
}
@keyframes breakShake {
  0%,
  100% {
    transform: none;
  }
  20% {
    transform: translateX(-4px) rotate(-3deg);
  }
  40% {
    transform: translateX(4px) rotate(3deg);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}
.fly-coin {
  position: absolute;
  z-index: 25;
  display: inline-flex;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(120, 72, 30, 0.3));
}
.fly-star {
  color: var(--gold);
}
.fly-star svg {
  width: 20px;
  height: 20px;
}

/* ---------- shift chrome recolour ---------- */
.hud-block {
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
  color: var(--cream);
}
.hud-night-title,
.combo-count,
.coins,
.timer-text {
  color: var(--cream);
}
.hud-mod,
.combo-label,
.hud-target {
  color: var(--muted);
}
.hud-score.is-met {
  background: var(--good-soft);
  border-color: rgba(63, 174, 99, 0.5);
}
.hud-combo[data-tier='1'] {
  background: #fff4de;
}
.hud-combo[data-tier='2'] {
  background: #ffe6c2;
}
.hud-combo[data-tier='3'] {
  background: linear-gradient(180deg, #ffe08a, var(--gold));
}
.timer-bar {
  background: var(--soft-2);
}
.timer-fill {
  background: linear-gradient(90deg, var(--good), #9be3b1);
}
.hud-timer.is-low .timer-fill {
  background: linear-gradient(90deg, var(--bad), #ff9b9b);
}
.btn-pause {
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
  color: var(--cream);
}
.scene-wrap {
  box-shadow: 0 4px 0 var(--btn-shadow), inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}
.station {
  background: linear-gradient(180deg, #fffdf9, #fff1dd);
  border: 1.5px solid var(--line);
  box-shadow: 0 4px 0 var(--btn-shadow);
}
.preview {
  background: radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.9), transparent 70%), #ffe9cf;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--muted);
}
.preview-name {
  color: var(--cream);
}
.preview-hint {
  color: var(--muted);
}
.steps li {
  background: var(--soft);
  color: var(--muted);
}
.steps li.is-current {
  background: var(--amber);
  color: #fff;
}
.steps li.is-done {
  background: var(--good-soft);
  color: #1f6b3a;
}
.row-label {
  color: var(--muted);
}
.row.is-current {
  background: rgba(255, 143, 60, 0.1);
}
.chip {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
  color: var(--cream);
  opacity: 0.55;
}
.chip.is-ok {
  opacity: 1;
}
.chip.is-selected {
  border-color: var(--amber);
  background: #fff4de;
}
.chip:active,
.chip.is-pressed {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--btn-shadow);
}
.chip kbd {
  background: var(--soft);
  color: var(--muted);
}
.chip-label {
  color: var(--cream);
}
.btn-serve {
  background: linear-gradient(180deg, #7fdc9b, var(--good));
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 60, 20, 0.3);
  box-shadow: 0 5px 0 #2a7d47;
}
.btn-serve:not(.is-ok) {
  opacity: 0.5;
}
.btn-serve.is-ok:active {
  box-shadow: 0 1px 0 #2a7d47;
}
.btn-shelve {
  background: linear-gradient(180deg, #fff, var(--panel-2));
  color: var(--cream);
}
.btn-greet {
  background: linear-gradient(180deg, #fff, #ffe7d6);
  color: var(--cream);
}
.btn-greet.is-ok {
  border-color: var(--amber);
}
.btn-discard {
  background: #fff;
  color: var(--bad);
  border-color: rgba(229, 72, 77, 0.3);
}
.greet-fill {
  background: rgba(120, 72, 30, 0.18);
}
.tray-slot {
  background: #fff;
  border-color: var(--line);
}
.tray-slot.is-empty {
  background: var(--soft);
  color: var(--muted);
}
.tray-slot.is-wanted {
  border-color: var(--good);
  background: var(--good-soft);
}
.tray-label,
.tray-name {
  color: var(--cream-2);
}
.coach {
  background: linear-gradient(90deg, #fff4de, #fffaf2);
  border-color: var(--amber);
  color: var(--cream);
}
.coach-skip {
  background: #fff;
  color: var(--cream-2);
  border: 1.5px solid var(--line);
}
.goal-chip {
  background: rgba(255, 255, 255, 0.92);
  color: var(--cream);
  box-shadow: 0 2px 0 var(--btn-shadow);
}
.goal-chip[data-state='done'] {
  background: var(--good-soft);
  color: #1f6b3a;
}
.goal-chip[data-state='failed'] {
  background: var(--bad-soft);
  color: #a52a2e;
}
.scene-caption {
  background: rgba(59, 36, 21, 0.6);
  color: #fff;
}
.toast {
  background: #fff;
  color: var(--cream);
  border: 1.5px solid var(--line);
  box-shadow: 0 6px 18px rgba(120, 72, 30, 0.22);
}
.toast.is-bad {
  border-color: var(--bad);
  color: #a52a2e;
}
.toast.is-good {
  border-color: var(--good);
  color: #1f6b3a;
}
.toast.is-warn {
  border-color: var(--amber);
  color: var(--amber-dark);
}
.toast.is-hint {
  border-color: var(--info);
  color: #1f5f84;
}
.toast.is-story {
  border-color: var(--pink);
  color: #9a2f4e;
}
.popup-coin {
  color: var(--amber-dark);
  text-shadow: 0 1px 0 #fff;
}
.popup-perfect {
  color: #c58a12;
}
.popup-bad {
  color: var(--bad);
}
.popup-combo {
  color: var(--amber-dark);
}
.popup-goal {
  background: var(--good);
  color: #fff;
}
.cat-block {
  background: rgba(255, 244, 222, 0.96);
}
.cat-btn {
  background: #fff;
  color: var(--cream);
  border: 2px solid var(--amber);
  box-shadow: 0 5px 0 var(--amber-dark);
}
.overlay {
  background: rgba(59, 36, 21, 0.45);
}
.overlay-card {
  background: var(--panel);
  color: var(--cream);
  border: 1.5px solid var(--line);
}
.menu-family li,
.help-cats li {
  background: var(--soft);
}
.history th,
.history td {
  border-color: var(--line);
}
.history tr.pass td {
  color: var(--cream);
}
.summary-total,
.perk-strip {
  color: var(--cream-2);
}
.pill-perk {
  background: #fff4de;
  color: var(--amber-dark);
  border-color: rgba(255, 143, 60, 0.4);
}
.road-node {
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
}
.road-num {
  background: var(--soft-2);
  color: var(--cream);
}
.road-node.is-done .road-num {
  background: var(--good);
  color: #fff;
}
.road-node.is-current {
  border-color: var(--amber);
  box-shadow: 0 3px 0 var(--amber-dark), 0 0 0 3px rgba(255, 143, 60, 0.2);
}
.road-node.is-current .road-num {
  background: var(--amber);
  color: #fff;
}
.road-node.is-locked {
  opacity: 0.55;
}
.road-node::after {
  background: var(--line);
}
.mini-stars i {
  color: #e6d6c2;
}
.mini-stars i.on {
  color: var(--gold);
}
.footnote {
  color: var(--muted);
}

/* ---------- responsive tweaks for the new bits ---------- */
@media (max-width: 420px) {
  .title-row .btn {
    font-size: 14px;
    padding: 8px 6px;
  }
  .event-card {
    top: 56px;
    padding: 10px;
    gap: 6px 8px;
  }
  .event-desc {
    font-size: 12px;
  }
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .event-card {
    top: 48px;
    left: 50%;
    right: auto;
    width: min(560px, 92vw);
    transform: translateX(-50%);
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas: 'icon body actions';
    padding: 8px 10px;
  }
  .event-card.is-flash {
    animation: none;
  }
  .event-actions {
    grid-template-columns: 1fr;
    align-content: center;
  }
  .event-actions .btn {
    min-height: 44px;
    min-width: 76px;
    padding: 6px 12px;
    font-size: 15px;
  }
  .event-desc {
    font-size: 11.5px;
  }
}
@media (min-width: 900px) {
  .screen {
    max-width: 760px;
  }
  .book-screen {
    max-width: 900px;
  }
  .event-card {
    left: 50%;
    right: auto;
    width: 560px;
    transform: translateX(-50%);
  }
}

/* ---------- iteration 3 polish ---------- */
@media (min-width: 900px) {
  .hud {
    grid-template-columns: minmax(160px, 260px) minmax(0, 1fr) auto auto auto;
    gap: 12px;
  }
  .hud-night-title {
    font-size: 16px;
  }
  .hud-mod {
    font-size: 12px;
  }
}
.spot-card .spot-cat {
  margin-bottom: 4px;
}
.spot-card b {
  position: relative;
  z-index: 1;
  background: var(--panel);
  padding: 0 4px;
  border-radius: 6px;
}

/* ---------- iteration 4: group order board ---------- */
.group-board[hidden] {
  display: none;
}
.shift.has-group {
  grid-template-rows: auto auto auto auto auto auto minmax(0, 1fr);
  grid-template-areas: 'hud' 'scene' 'group' 'skills' 'reply' 'queue' 'station';
}
.group-board {
  grid-area: group;
  min-width: 0;
}
.group-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  padding: 8px 10px 9px;
  border-radius: 16px;
  border: 2px solid #c98cf0;
  background: linear-gradient(180deg, #fbf1ff, #f3e3ff);
  box-shadow: 0 4px 0 #b878dd;
  color: var(--cream);
  text-align: left;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.group-main:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #b878dd;
}
.group-board.is-wanted .group-main {
  border-color: var(--good);
  box-shadow: 0 0 0 3px rgba(63, 174, 99, 0.3), 0 4px 0 #b878dd;
}
.group-board.is-urgent .group-main {
  border-color: var(--bad);
  animation: groupPulse 0.8s ease-in-out infinite;
}
@keyframes groupPulse {
  50% {
    box-shadow: 0 0 0 4px rgba(224, 82, 82, 0.25), 0 4px 0 #b878dd;
  }
}
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
}
.group-badge {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #9b5de5;
  color: #fff;
  font-size: 14px;
}
.group-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.group-count b {
  font-size: 18px;
  color: #7a3fc0;
}
.group-cups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.group-cup {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-areas: 'art name' 'art recipe';
  align-items: center;
  column-gap: 6px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(155, 93, 229, 0.25);
  min-width: 0;
}
.group-cup svg {
  grid-area: art;
  width: 40px;
  height: 40px;
}
.group-cup b {
  grid-area: name;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-cup small {
  grid-area: recipe;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-cup.is-done {
  background: var(--good-soft);
  border-color: rgba(63, 174, 99, 0.45);
}
.group-cup.is-done svg {
  opacity: 0.55;
}
.group-check {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
}
.group-check svg {
  width: 12px;
  height: 12px;
  opacity: 1;
}
.group-timer {
  height: 8px;
  border-radius: 999px;
  background: rgba(155, 93, 229, 0.18);
  overflow: hidden;
}
.group-timer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9b5de5, #c98cf0);
  transform-origin: left;
  transition: transform 0.2s linear;
}
.group-board.is-urgent .group-timer i {
  background: linear-gradient(90deg, var(--bad), #ff9a7a);
}
.group-reward {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
.group-reward span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 4px;
  border-radius: 8px;
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}
.group-reward span b {
  font-size: 11px;
  color: var(--cream-2);
}
.group-reward span.is-next {
  background: #fff;
  color: #7a3fc0;
  outline: 1.5px solid rgba(155, 93, 229, 0.4);
}
.group-reward span.is-next b {
  color: #7a3fc0;
}
.group-reward span.is-got {
  background: var(--good-soft);
  color: var(--good);
}
.group-reward span.is-got b {
  color: var(--good);
}
.group-board.is-flash .group-main {
  animation: eventIn 0.4s cubic-bezier(.3,1.5,.5,1) both;
}
.group-board.is-flash-good .group-main {
  animation: flashGood 0.5s ease;
}
.group-board.is-flash-bad .group-main {
  animation: flashBad 0.5s ease;
}
.btn-serve.is-group {
  background: linear-gradient(180deg, #d9b8ff, #c08cf2);
  border-color: #a86de0;
  box-shadow: 0 4px 0 #8a4fc9;
  color: #3a1f5e;
}
.event-group {
  display: inline-flex;
}
.event-group :is(svg, .guest-portrait) {
  width: 30px;
  height: 30px;
  margin-right: -10px;
}
.banner.is-celebrate {
  background: linear-gradient(90deg, #ffd25a, #ff9ac8, #9b5de5);
  color: #fff;
  font-size: 18px;
}
.shift.is-celebrate::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(circle at 50% 30%, rgba(201, 140, 240, 0.35), transparent 60%);
  animation: fadeOut 1.2s ease forwards;
}
.shift.has-group .scene-wrap {
  max-height: 118px;
}
@media (max-width: 600px) and (orientation: portrait) {
  .shift.has-group .scene-wrap {
    height: 84px;
    max-height: 84px;
  }
  .shift.has-group .group-cup small,
  .shift.has-group .group-reward {
    display: none;
  }
  .shift.has-group .group-main {
    padding: 6px 8px 7px;
    gap: 5px;
  }
  .shift.has-group .group-cup {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-areas: 'art name';
    padding: 4px 5px;
  }
  .shift.has-group .group-cup svg {
    width: 32px;
    height: 32px;
  }
  .shift.has-group .group-head {
    font-size: 14px;
  }
  .shift.has-group .group-count b {
    font-size: 16px;
  }
  .shift.has-group .coach {
    display: none;
  }
}
@media (max-width: 600px) and (max-height: 720px) and (orientation: portrait) {
  .shift.has-group .scene-wrap {
    height: 64px;
    max-height: 64px;
  }
  .shift.has-group .guest {
    min-height: 88px;
  }
  .shift.has-group .goal-strip {
    display: none;
  }
}
@media (orientation: landscape) and (min-width: 720px) {
  .shift.has-group {
    grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
    grid-template-areas:
      'hud hud'
      'scene station'
      'group station'
      'skills station'
      'reply station'
      'queue station';
  }
  .shift.has-group .scene-wrap {
    max-height: 30vh;
  }
}
@media (orientation: landscape) and (max-height: 560px) {
  .shift.has-group .scene-wrap {
    height: 64px;
    max-height: 64px;
  }
  .shift.has-group .group-reward,
  .shift.has-group .group-cup small,
  .shift.has-group .goal-strip {
    display: none;
  }
  .shift.has-group .group-main {
    padding: 6px 8px 7px;
    gap: 5px;
  }
  .shift.has-group .group-cup {
    grid-template-columns: 30px minmax(0, 1fr);
    grid-template-areas: 'art name';
    padding: 3px 5px;
  }
  .shift.has-group .group-cup svg {
    width: 30px;
    height: 30px;
  }
  .shift.has-group .guest {
    min-height: 68px;
  }
  .shift.has-group .queue {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(68px, auto);
  }
}

/* ---------- iteration 4: replay hooks ---------- */
.gains-panel,
.next-card {
  width: 100%;
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1.5px solid var(--line);
  box-shadow: 0 3px 0 var(--btn-shadow);
  text-align: left;
}
.gains-panel h3 {
  margin: 0 0 8px;
  font-size: 15px;
}
.gains-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.gains-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
  animation: cardIn 0.4s ease both;
}
.gains-list li i,
.next-list li i {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  font-style: normal;
  font-size: 14px;
  color: var(--amber-dark);
  flex: none;
  box-shadow: 0 2px 0 var(--btn-shadow);
}
.gain-decor i,
.kind-decor i {
  color: #7a3fc0;
}
.gain-story i,
.kind-story i {
  color: var(--info);
}
.gain-cat i,
.kind-cat i {
  color: #c2731f;
}
.gain-stars i {
  color: var(--gold);
}
.next-card {
  border-color: rgba(255, 143, 60, 0.55);
  background: linear-gradient(180deg, #fff6e6, var(--panel));
  position: relative;
  overflow: hidden;
}
.next-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--amber), var(--gold));
}
.next-card-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}
.next-card-kicker {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--amber-dark);
  font-weight: 700;
}
.next-card-head b {
  font-size: 18px;
}
.next-list li {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas: 'icon label value' 'icon bar bar';
  background: #fff;
  border: 1.5px solid var(--line);
}
.next-list li i {
  grid-area: icon;
}
.decor-reveal {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff1cf, #ffe3f1);
  border: 2px solid var(--gold);
  text-align: left;
  animation: revealIn 0.7s cubic-bezier(.3,1.5,.5,1) both;
}
.decor-reveal-art {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  animation: revealSpin 1.2s ease 0.2s both;
}
.decor-reveal-art svg {
  width: 26px;
  height: 26px;
}
.decor-reveal b {
  display: block;
  font-size: 16px;
}
.decor-reveal span {
  font-size: 13px;
  color: var(--cream-2);
}
@keyframes revealIn {
  from { transform: translateY(-12px) scale(0.96); opacity: 0; }
}
@keyframes revealSpin {
  0% { transform: rotate(-30deg) scale(0.6); }
  60% { transform: rotate(10deg) scale(1.15); }
  100% { transform: rotate(0) scale(1); }
}
.reduce-motion .decor-reveal,
.reduce-motion .decor-reveal-art,
.reduce-motion .gains-list li {
  animation: none;
}
.title-side,
.intro-columns,
.result-columns,
.book-columns,
.intro-col,
.result-col,
.book-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.intro-columns,
.result-columns,
.book-columns {
  display: contents;
}

/* ---------- iteration 4: wide desktop layouts (>= 1100px) ---------- */
@media (min-width: 1100px) {
  .screen {
    max-width: 1180px;
    padding-inline: 32px;
  }
  /* Title: hero + actions on the left, progress on the right. */
  .title-screen {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    grid-template-areas: 'hero side' 'actions side' 'foot side';
    align-items: start;
    column-gap: 36px;
    row-gap: 20px;
    justify-content: center;
    align-content: center;
  }
  .title-screen .hero {
    grid-area: hero;
  }
  .title-screen .title-actions {
    grid-area: actions;
    max-width: none;
  }
  .title-screen .footnote {
    grid-area: foot;
  }
  .title-side {
    grid-area: side;
    gap: 16px;
    max-height: calc(100dvh - 48px);
    overflow: auto;
    padding: 4px;
    scrollbar-width: thin;
  }
  /* Intro: rules + goals + cats | events + regulars + boosters */
  .intro-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 20px;
    align-items: start;
    width: 100%;
  }
  .intro-col {
    gap: 16px;
  }
  /* Result: goals + stats + stories | next card + daily + completion */
  .result-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 20px;
    align-items: start;
    width: 100%;
  }
  .result-col {
    gap: 16px;
  }
  /* Growth book: milestones + daily sidebar | codex grids */
  .book-screen {
    max-width: 1280px;
  }
  .book-columns {
    display: grid;
    grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.6fr);
    gap: 20px;
    align-items: start;
    width: 100%;
  }
  .book-col-side {
    position: sticky;
    top: 16px;
  }
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }
  /* Shift: bigger café + guests on the left, station stays crisp on the right. */
  .shift {
    grid-template-columns: minmax(0, 1fr) minmax(480px, 40%);
    gap: 14px;
    padding-inline: 20px;
    max-width: 1680px;
    margin: 0 auto;
    width: 100%;
  }
  .shift .scene-wrap {
    max-height: 52vh;
    aspect-ratio: 8 / 3;
  }
  .shift.has-group .scene-wrap {
    max-height: 36vh;
  }
  .shift .queue {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .shift .guest {
    min-height: 150px;
  }
  .shift .guest-avatar :is(svg, .guest-portrait) {
    width: 64px;
    height: 64px;
  }
  .shift .guest-name {
    font-size: 16px;
  }
  .shift .order-name {
    font-size: 17px;
  }
  .shift .order-icon svg {
    width: 56px;
    height: 56px;
  }
  .shift .goal-strip {
    font-size: 14px;
  }
  .shift .scene-caption {
    font-size: 14px;
  }
  .station {
    max-width: none;
  }
  .event-card {
    width: 640px;
  }
}
@media (min-width: 1100px) {
  .book-head {
    width: auto;
    max-width: 680px;
    margin: 0 auto;
  }
  .shift .order-recipe-text {
    white-space: normal;
    line-height: 1.25;
  }
}

/* ---------- iteration 5: routes, skills, replies, themes, weather ---------- */
.skill-row {
  grid-area: skills;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.skill-btn {
  min-height: 48px;
  min-width: 44px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 2px solid #e2c7a4;
  background: #fff8ee;
  box-shadow: 0 3px 0 #e2c7a4;
  color: #3a2a22;
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.skill-btn b {
  font-size: 13px;
  line-height: 1.2;
}
.skill-btn small {
  font-size: 11px;
  color: #7a5b45;
  line-height: 1.2;
}
.skill-btn.is-ok {
  border-color: #e09a3e;
  box-shadow: 0 3px 0 #c47d28;
}
.skill-btn.is-used {
  opacity: 0.55;
  box-shadow: none;
}
.reply-card {
  grid-area: reply;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff4e4;
  border: 2px solid #e7c49a;
}
.reply-card[hidden] {
  display: none;
}
.reply-copy {
  flex: 1 1 140px;
  min-width: 0;
}
.reply-copy b {
  display: block;
  font-size: 14px;
}
.reply-lines {
  margin: 2px 0 0;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.35;
  color: #5c4636;
}
.reply-actions {
  display: flex;
  flex: 1 1 180px;
  gap: 8px;
  min-width: 0;
}
.reply-btn {
  flex: 1;
  min-height: 48px;
  min-width: 44px;
}
.btn-finish {
  min-height: 48px;
  min-width: 72px;
  background: #f3d48a;
  border-color: #d7ae55;
  box-shadow: 0 4px 0 #c4923b;
}
.btn-finish[hidden] {
  display: none;
}
.route-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(720px, 100%);
}
.route-card {
  min-height: 96px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid #e2c7a4;
  background: #fff8ee;
  box-shadow: 0 4px 0 #e2c7a4;
  text-align: left;
  font: inherit;
  color: #3a2a22;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.route-card b {
  font-size: 18px;
}
.route-preview,
.route-risk {
  font-size: 14px;
  line-height: 1.4;
}
.route-risk {
  color: #9a4a32;
}
.meta-next {
  background: #fff8ee;
  border: 2px solid #e7c49a;
  border-radius: 16px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}
.meta-next h3 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.meta-next b {
  font-size: 18px;
}
.meta-progress {
  color: #7a5b45;
  font-size: 13px;
}
.meta-next p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.theme-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.theme-btn {
  min-height: 44px;
}
.route-banner {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff1d8;
  display: grid;
  gap: 2px;
}
.route-banner em {
  color: #9a4a32;
  font-style: normal;
}
.scene-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.shift.is-rush .scene-wrap {
  box-shadow: inset 0 0 0 3px rgba(255, 150, 40, 0.55), inset 0 0 48px rgba(255, 140, 40, 0.35);
  animation: rushPulse 1.1s ease-in-out infinite;
}
.shift.is-rush .scene-wrap::after {
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 170, 50, 0.5), transparent 62%);
  animation: rushPulse 1.1s ease-in-out infinite;
}
.shift.is-rain .scene-wrap {
  box-shadow: inset 0 0 0 3px rgba(90, 140, 200, 0.75), inset 0 0 56px rgba(40, 80, 150, 0.45);
  animation: lightning 7.5s linear infinite;
}
.shift.is-rain .scene-wrap::after {
  /* The illustrated café is indoors. Confine the animated storm layer to
     the large window on the right instead of washing across the whole room. */
  inset: 0 4% 52% 65%;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(20, 50, 100, 0.28), rgba(20, 40, 80, 0.04) 70%),
    repeating-linear-gradient(-16deg, transparent 0 12px, rgba(226, 238, 255, 0.48) 12px 14px);
  background-size: 100% 100%, 36px 72px;
  animation: rainSlide 0.48s linear infinite;
  mix-blend-mode: screen;
}
.shift.is-festival .scene-wrap {
  box-shadow: inset 0 0 0 3px rgba(255, 120, 160, 0.55), inset 0 0 48px rgba(255, 190, 80, 0.35);
  animation: festivalGlow 1.6s ease-in-out infinite;
}
.shift.is-festival .scene-wrap::after {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 190, 70, 0.55), transparent 42%),
    radial-gradient(circle at 82% 16%, rgba(255, 80, 140, 0.45), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 220, 120, 0.35) 18px 22px, transparent 22px 40px);
  animation: festivalGlow 1.6s ease-in-out infinite;
}
@keyframes rushPulse {
  50% { box-shadow: inset 0 0 0 3px rgba(255, 190, 70, 0.8), inset 0 0 70px rgba(255, 120, 20, 0.45); }
}
@keyframes festivalGlow {
  50% { box-shadow: inset 0 0 0 3px rgba(255, 210, 90, 0.8), inset 0 0 64px rgba(255, 80, 140, 0.4); }
}
@keyframes rainSlide {
  to { background-position: 0 0, -18px 72px; }
}
@keyframes lightning {
  0%, 86%, 100% { box-shadow: inset 0 0 0 3px rgba(90, 140, 200, 0.75), inset 0 0 56px rgba(40, 80, 150, 0.45); }
  88% { box-shadow: inset 0 0 0 3px #f4fbff, inset 0 0 80px rgba(255, 255, 255, 0.72); }
}
.preview.is-pouring {
  transform: translateY(2px) scale(1.04);
}
.preview.is-pouring .pour-stream {
  opacity: 1;
  height: 54px;
}
.preview.is-sealing {
  filter: saturate(1.2);
}
.preview.is-thud {
  animation: cupThud 0.28s ease;
}
@keyframes cupThud {
  30% { transform: translateY(6px) scale(0.96); }
  100% { transform: none; }
}
body[data-theme='lantern'] .hero-sky {
  background: linear-gradient(180deg, #ffb15a, #c45a4a);
}
body[data-theme='neon'] .hero-sky {
  background: linear-gradient(180deg, #14081f, #6a1b9a);
}
body[data-theme='ink'] .hero-sky {
  background: linear-gradient(180deg, #ece7dc, #9aa0a6);
}
.reduce-motion .shift.is-rush .scene-wrap,
.reduce-motion .shift.is-festival .scene-wrap,
.reduce-motion .shift.is-rain .scene-wrap,
.reduce-motion .shift.is-rush .scene-wrap::after,
.reduce-motion .shift.is-festival .scene-wrap::after,
.reduce-motion .shift.is-rain .scene-wrap::after,
.reduce-motion .preview.is-thud,
.reduce-motion .preview.is-pouring {
  animation: none;
  transform: none;
}
@media (min-width: 800px) {
  .route-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) and (orientation: portrait) {
  .scene-wrap {
    height: 72px;
  }
  .skill-btn b {
    font-size: 12px;
  }
  .reply-lines {
    font-size: 12px;
  }
}

/* Mobile scene-first layout: the café is part of play, not a thin banner. */
@media (max-width: 600px) and (orientation: portrait) {
  .shift {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .scene-wrap,
  .shift.has-group .scene-wrap {
    height: 190px;
    min-height: 190px;
    max-height: 190px;
    aspect-ratio: 8 / 3;
  }
  canvas.scene {
    object-position: center center;
  }
  .scene-caption {
    left: 12px;
    bottom: 10px;
    padding: 4px 10px;
    font-size: 13px;
    background: rgba(59, 36, 21, 0.72);
  }
}

@media (max-width: 600px) and (orientation: portrait) and (max-height: 720px) {
  .scene-wrap,
  .shift.has-group .scene-wrap {
    height: 160px;
    min-height: 160px;
    max-height: 160px;
  }
}

/* Illustrated customer portraits */
.regular-list .guest-portrait,
.story-list .guest-portrait { object-position: 50% 10%; }
.book-grid.guests .book-art .guest-portrait { width: 52px; height: 52px; }
.event-rider .guest-portrait { width: 48px; height: 48px; }
.event-group .guest-portrait { object-position: 50% 10%; }
@media (max-width: 420px) {
  .guest-name-text {
    display: block;
    max-width: 44px;
    font-size: 11px;
    line-height: 1.1;
  }
  .guest-tags .tag:not(.tag-paw) {
    max-width: 40px;
    overflow: hidden;
  }
}
