/* Cycora: Circular Design Lab — warm restaurant aesthetic, 1280×720 viewport */

:root {
  --cream: #fdf6ec;
  --warm-white: #fffaf5;
  --terracotta: #c75b39;
  --sage: #6b8f71;
  --forest: #3d5c45;
  --honey: #e8a838;
  --sky-soft: #a8c8e6;
  --ink: #2c2420;
  --ink-muted: #5c534c;
  --tile-a: #e8dfd4;
  --tile-b: #ddd3c8;
  --wood: #8b6914;
  --wood-dark: #5c4510;
  --donate: #4a90c8;
  --compost: #5a8f4a;
  --trash-bin: #6b6560;
  --shadow: rgba(44, 36, 32, 0.18);
  --glow: rgba(232, 168, 56, 0.55);
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(165deg, #2a3d35 0%, #1e2a24 40%, #0f1512 100%);
  color: var(--ink);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}

#app {
  width: 100%;
  max-width: 1320px;
}

.title-bar {
  text-align: center;
  margin-bottom: 0.75rem;
}

.title-bar h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--cream);
  margin: 0;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0.35rem 0 0;
  color: rgba(253, 246, 236, 0.75);
  font-size: 0.95rem;
}

.game-viewport {
  width: 100%;
  max-width: 1280px;
  aspect-ratio: 1280 / 720;
  margin: 0 auto;
  background: var(--warm-white);
  border-radius: 16px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.12);
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen.hidden {
  display: none !important;
}

/* Menu */
.screen-menu {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(232, 168, 56, 0.25), transparent),
    linear-gradient(180deg, #fdf6ec 0%, #f0e4d4 100%);
}

.menu-card {
  max-width: 520px;
  padding: 2rem 2.25rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  box-shadow: 0 16px 40px var(--shadow);
  text-align: center;
}

.progression-card {
  width: min(94%, 1080px);
  max-width: 1080px;
  max-height: 94%;
  overflow: auto;
  padding: 1.15rem;
}

.map-head {
  max-width: 760px;
  margin: 0 auto 0.65rem;
}

.map-kicker {
  margin: 0 0 0.1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
}

.map-options {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  margin: 0.55rem 0 0.85rem;
}

.player-name-card {
  width: min(100%, 420px);
  margin: 0.55rem auto 0.35rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(253, 246, 236, 0.86);
  border: 1px solid rgba(107, 143, 113, 0.28);
}

.player-name-card span {
  font-family: var(--font-display);
  color: var(--forest);
  font-weight: 800;
  font-size: 0.82rem;
}

.player-name-card input {
  min-width: 0;
  border: 2px solid rgba(107, 143, 113, 0.32);
  border-radius: 8px;
  padding: 0.42rem 0.55rem;
  font-family: var(--font-body);
  font-weight: 800;
  color: var(--ink);
  background: #fff;
}

.map-options .accessibility-toggle {
  margin-top: 0;
  background: rgba(253, 246, 236, 0.8);
  border: 1px solid rgba(107, 143, 113, 0.28);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
}

.level-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.level-node {
  min-height: 118px;
  border: 2px solid rgba(107, 143, 113, 0.35);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(253, 246, 236, 0.92)),
    radial-gradient(circle at 20% 10%, rgba(232, 168, 56, 0.16), transparent 45%);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  padding: 0.58rem;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(44, 36, 32, 0.11);
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.level-node:hover {
  transform: translateY(-2px);
  border-color: var(--honey);
  box-shadow: 0 9px 20px rgba(44, 36, 32, 0.15);
}

.level-node:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}

.level-node.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.45);
}

.level-node.done {
  border-color: rgba(232, 168, 56, 0.75);
}

.level-node-icon {
  font-size: 1.65rem;
  line-height: 1;
}

.level-node-number {
  font-size: 0.62rem;
  color: var(--terracotta);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.level-node strong {
  font-family: var(--font-display);
  color: var(--forest);
  line-height: 1.08;
  font-size: 0.96rem;
}

.level-node small {
  color: var(--ink-muted);
  line-height: 1.25;
  font-size: 0.72rem;
}

.menu-card h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  color: var(--forest);
}

.menu-blurb {
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.btn-play {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 1.25rem;
  padding: 0.9rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--sage), var(--forest));
  box-shadow: 0 6px 20px var(--shadow);
  transition: transform 0.15s, filter 0.2s;
}

.btn-play:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.btn-play:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
}

/* Sister game — Eco Lab (same Cycora suite, different HTML entry) */
.menu-sister-game {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(139, 105, 20, 0.2);
}

.sister-game-link {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--forest);
  text-decoration: none;
  border-bottom: 2px solid rgba(61, 92, 69, 0.35);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.sister-game-link:hover {
  color: var(--terracotta);
  border-color: rgba(199, 91, 57, 0.55);
}

.sister-game-link:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

.sister-game-desc {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.45;
}

.difficulty-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-difficulty {
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid var(--tile-b);
  background: var(--warm-white);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-difficulty:hover {
  border-color: var(--honey);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateY(-1px);
}

.btn-difficulty:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
}

.btn-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--forest);
}

.btn-desc {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 0.2rem;
}

.accessibility-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
  cursor: pointer;
}

/* Game screen layout */
.screen-game {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: linear-gradient(180deg, #ebe3d8 0%, var(--cream) 35%, #f5ebe0 100%);
}

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.45rem 0.75rem;
  background: linear-gradient(90deg, var(--forest), #4a6b52);
  color: var(--cream);
  font-size: 0.82rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px var(--shadow);
  z-index: 20;
}

.hud-block {
  display: flex;
  gap: 0.35rem;
  align-items: baseline;
}

.hud-board-btn,
.map-board-btn {
  font-family: var(--font-display);
  font-weight: 700;
  border: 2px solid rgba(253, 246, 236, 0.5);
  border-radius: 8px;
  background: rgba(253, 246, 236, 0.16);
  color: var(--cream);
  padding: 0.18rem 0.5rem;
  cursor: pointer;
}

.hud-board-btn:hover,
.map-board-btn:hover {
  background: rgba(253, 246, 236, 0.28);
}

.map-board-btn {
  color: var(--forest);
  border-color: rgba(107, 143, 113, 0.35);
  background: rgba(253, 246, 236, 0.9);
}

.hud-label {
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.68rem;
}

.hud-value {
  font-family: var(--font-display);
  font-weight: 600;
}

.scene {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 0;
  min-height: 0;
  position: relative;
}

.screen-game.waste-phase .scene .dining-panel,
.screen-game.waste-phase .scene .kitchen-panel,
.screen-game.waste-phase .scene .scene-atmosphere {
  filter: saturate(0.65);
  opacity: 0.55;
}

.screen-game.eco-lab-phase .scene-atmosphere {
  background:
    radial-gradient(ellipse 80% 46% at 50% 12%, rgba(255, 255, 255, 0.9), transparent 58%),
    linear-gradient(180deg, rgba(236, 246, 246, 0.98) 0%, rgba(222, 233, 231, 0.92) 48%, rgba(196, 214, 211, 0.96) 100%),
    repeating-linear-gradient(90deg, rgba(70, 84, 92, 0.16) 0 22px, rgba(255, 255, 255, 0.15) 22px 44px);
}

.screen-game.eco-lab-phase .kitchen-panel,
.screen-game.eco-lab-phase .dining-panel {
  opacity: 0;
  pointer-events: none;
}

.screen-game.eco-lab-phase .chef-avatar {
  opacity: 0;
}

.screen-game.eco-lab-phase .mini-game-board {
  top: 74px;
  width: min(88%, 900px);
}

.screen-game.eco-lab-phase .mini-stage {
  width: min(100%, 860px);
}

.screen-game.eco-lab-phase .recipe-path {
  display: none;
}

.scene-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(254, 250, 244, 0.9) 0%, rgba(245, 236, 224, 0.78) 45%, rgba(238, 228, 214, 0.85) 100%),
    url("../Assets/Kitchen_Restaurant.png") center 38% / cover no-repeat;
}

.panel-label {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

/* Kitchen + sprite stations */
.kitchen-panel {
  padding: 0.4rem 0.5rem 0.35rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(232, 223, 212, 0.88) 0px,
      rgba(232, 223, 212, 0.88) 24px,
      rgba(221, 211, 200, 0.88) 24px,
      rgba(221, 211, 200, 0.88) 48px
    );
  border-right: 3px solid rgba(139, 105, 20, 0.28);
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kitchen-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255, 210, 160, 0.4), transparent);
  pointer-events: none;
  z-index: 1;
}

.kitchen-scene {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 0.15rem 0.2rem;
  padding: 0.15rem 0.2rem 0.35rem;
  align-items: end;
}

.kitchen-floor {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 10px;
  background:
    radial-gradient(ellipse 80% 55% at 50% 100%, rgba(139, 105, 20, 0.12), transparent),
    linear-gradient(180deg, rgba(255, 252, 248, 0.35) 0%, transparent 45%);
  pointer-events: none;
}

/* Chef walks across the whole scene (kitchen + dining) */
.chef-avatar {
  position: absolute;
  left: 10%;
  bottom: 20%;
  width: clamp(52px, 7.5vw, 86px);
  z-index: 8;
  pointer-events: none;
  transition:
    left 0.48s cubic-bezier(0.34, 1.15, 0.64, 1),
    bottom 0.48s ease;
  filter: drop-shadow(0 5px 10px rgba(44, 36, 32, 0.35));
}

.chef-sprite {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: auto;
}

.chef-avatar.asset-missing {
  width: 48px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #e8e0d8);
  box-shadow: 0 4px 12px var(--shadow);
}

.chef-avatar.asset-missing .chef-sprite {
  display: none;
}

.chef-avatar.state-chop .chef-sprite {
  animation: chef-chop-bob 0.38s ease infinite;
}

.chef-avatar.state-cook .chef-sprite {
  animation: chef-heat-pulse 1.15s ease infinite;
}

.chef-avatar.state-sink .chef-sprite {
  animation: chef-chop-bob 0.55s ease infinite;
}

@keyframes chef-chop-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes chef-heat-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12) saturate(1.05);
  }
}

/* Scene-relative chef anchors (% of .scene) */
.chef-avatar.at-fridge {
  left: 7%;
  bottom: 38%;
}

.chef-avatar.at-pantry {
  left: 16%;
  bottom: 40%;
}

.chef-avatar.at-chop {
  left: 27%;
  bottom: 38%;
}

.chef-avatar.at-stove {
  left: 8%;
  bottom: 18%;
}

.chef-avatar.at-sink {
  left: 19%;
  bottom: 20%;
}

.chef-avatar.at-plate {
  left: 30%;
  bottom: 17%;
}

.chef-avatar.at-serve {
  left: 54%;
  bottom: 16%;
}

.chef-avatar.at-waste {
  left: 42%;
  bottom: 30%;
}

/* Floating props + stations — image-first (like Utensils), typing still drives play */
.sprite-interactive {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  padding: 0.08rem 0.05rem 1.45rem;
  border-radius: 12px;
  background: transparent;
  border: 2px solid transparent;
  box-shadow: none;
  transition:
    border-color 0.22s,
    filter 0.22s,
    transform 0.15s ease;
}

.sprite-hit {
  position: absolute;
  inset: 0;
  z-index: 4;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.sprite-hit:focus {
  outline: none;
}

.sprite-hit:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

.sprite-interactive.sprite-tapped {
  transform: scale(0.98);
}

.sprite-interactive.sprite-tapped .sprite-img {
  filter: brightness(1.08);
}

.sprite-interactive.kitchen-prop-utensils {
  position: absolute;
  right: 3%;
  top: 6%;
  width: 20%;
  max-width: 76px;
  z-index: 3;
  padding-bottom: 0.2rem;
  pointer-events: auto;
}

.sprite-interactive.kitchen-prop-utensils .sprite-fx-wrap {
  min-height: clamp(40px, 8vh, 72px);
}

.sprite-interactive.kitchen-prop-utensils .sprite-img {
  max-height: clamp(44px, 9vh, 80px);
}

.station-fridge {
  grid-column: 1;
  grid-row: 1;
}

.station-pantry {
  grid-column: 2;
  grid-row: 1;
}

.station-chop {
  grid-column: 3;
  grid-row: 1;
}

.station-stove {
  grid-column: 1;
  grid-row: 2;
}

.station-sink {
  grid-column: 2;
  grid-row: 2;
}

.station-plate {
  grid-column: 3;
  grid-row: 2;
}

.sprite-fx-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  min-height: clamp(52px, 10vh, 96px);
}

.sprite-img {
  max-width: 100%;
  max-height: clamp(52px, 11vh, 104px);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  transition:
    transform 0.22s ease,
    filter 0.22s ease;
  pointer-events: none;
  user-select: none;
}

.sprite-interactive.asset-missing .sprite-img {
  display: none;
}

.sprite-interactive.asset-missing .sprite-fx-wrap::after {
  content: "";
  display: block;
  width: 72%;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--tile-a), var(--tile-b));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.sprite-interactive.active-target {
  border-color: rgba(232, 168, 56, 0.55);
  background: rgba(255, 252, 245, 0.25);
  box-shadow:
    0 0 0 1px rgba(232, 168, 56, 0.35),
    0 0 24px rgba(232, 168, 56, 0.28);
  animation: env-station-glow 1.25s ease infinite;
}

.sprite-interactive.active-target .sprite-img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 14px rgba(232, 168, 56, 0.75)) drop-shadow(0 4px 8px rgba(44, 36, 32, 0.2));
}

@keyframes env-station-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 2px rgba(232, 168, 56, 0.45),
      0 0 22px rgba(232, 168, 56, 0.28),
      0 6px 18px var(--shadow);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(232, 168, 56, 0.55),
      0 0 34px rgba(232, 168, 56, 0.42),
      0 8px 22px var(--shadow);
  }
}

.sprite-interactive.flash-success .sprite-img {
  animation: flash-sprite-green 0.45s ease;
}

@keyframes flash-sprite-green {
  0% {
    filter: brightness(1);
  }
  40% {
    filter: brightness(1.18) saturate(1.08);
  }
  100% {
    filter: brightness(1);
  }
}

.fx-steam::after {
  content: "";
  position: absolute;
  bottom: 72%;
  left: 50%;
  width: 10px;
  height: 18px;
  margin-left: -5px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.65), transparent 70%);
  border-radius: 50%;
  animation: steam-rise-sprite 1s ease infinite;
  pointer-events: none;
}

.fx-sparkle::after {
  content: "✦";
  position: absolute;
  top: 8%;
  right: 12%;
  font-size: 1rem;
  color: var(--honey);
  animation: sparkle-sprite 0.85s ease infinite;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(232, 168, 56, 0.8);
}

.fx-ripple::after {
  content: "";
  position: absolute;
  inset: 10% 18% 0;
  border-radius: 50%;
  border: 2px solid rgba(110, 180, 220, 0.45);
  animation: ripple-ring 1s ease forwards;
  pointer-events: none;
}

@keyframes steam-rise-sprite {
  0% {
    opacity: 0.85;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(1.25);
  }
}

@keyframes sparkle-sprite {
  0%,
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.15) rotate(12deg);
  }
}

@keyframes ripple-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

.sprite-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--forest);
  text-align: center;
  margin-top: 0.1rem;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
  pointer-events: none;
  user-select: none;
}

.sprite-sub {
  display: block;
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  margin-top: 1px;
  pointer-events: none;
}

.prompt-anchor {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  min-height: 22px;
  width: 100%;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}

/* Dining */
.dining-panel {
  padding: 0.45rem 0.5rem 0.35rem;
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(232, 168, 56, 0.18), transparent),
    linear-gradient(180deg, rgba(232, 221, 210, 0.82) 0%, rgba(214, 202, 188, 0.78) 100%);
  position: relative;
  z-index: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dining-decor {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.25rem;
}

.menu-board {
  font-family: var(--font-display);
  font-size: 0.62rem;
  padding: 0.25rem 0.5rem;
  background: var(--wood-dark);
  color: var(--cream);
  border-radius: 4px;
  box-shadow: 0 2px 6px var(--shadow);
}

.dining-glow {
  width: 56px;
  height: 40px;
  border-radius: 8px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 220, 180, 0.5), transparent),
    linear-gradient(135deg, rgba(199, 91, 57, 0.35), rgba(139, 61, 40, 0.2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.entrance {
  flex-shrink: 0;
  height: 8px;
  margin: 0 20% 0.35rem;
  background: linear-gradient(90deg, transparent, rgba(61, 92, 69, 0.35), transparent);
  border-radius: 4px;
}

.dining-seating {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 10px;
  margin: 0 -0.1rem;
  padding: 0.2rem 0.15rem 0.1rem;
  background:
    radial-gradient(ellipse 55% 40% at 12% 88%, rgba(139, 105, 20, 0.07), transparent 55%),
    radial-gradient(ellipse 50% 45% at 88% 75%, rgba(139, 105, 20, 0.06), transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 92%, rgba(107, 143, 113, 0.05), transparent 45%),
    linear-gradient(180deg, rgba(255, 252, 248, 0.35) 0%, rgba(240, 232, 220, 0.25) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sitting-area {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 250, 245, 0.62);
  border: 1px solid rgba(139, 105, 20, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.sitting-label {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--forest);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.lounge-seat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.lounge-seat img {
  width: auto;
  max-width: 36px;
  max-height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(44, 36, 32, 0.18));
}

.tables-row {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.2rem 0.2rem;
  align-items: end;
  justify-items: center;
  min-height: 0;
  padding: 0.15rem 0.05rem;
}

.table-slot {
  width: 100%;
  max-width: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
}

.table-slot .customer-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 1px;
}

.dining-furniture {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
}

/* Same table/chair scale on every row (playable + decorative) */
.furniture-table {
  width: 94%;
  max-height: 46px;
  object-fit: contain;
  object-position: bottom center;
  z-index: 1;
  filter: drop-shadow(0 5px 8px rgba(44, 36, 32, 0.28));
}

.furniture-chair {
  width: 56%;
  max-height: 40px;
  object-fit: contain;
  margin-bottom: -6px;
  opacity: 0.95;
  z-index: 0;
  filter: drop-shadow(0 3px 6px rgba(44, 36, 32, 0.2));
}

.dining-furniture.asset-missing .furniture-table,
.dining-furniture.asset-missing .furniture-chair {
  display: none;
}

.dining-furniture.asset-missing::after {
  content: "";
  display: block;
  width: 88%;
  height: 26px;
  margin-top: 0.25rem;
  background: linear-gradient(180deg, #c4a574, #8b6914);
  border-radius: 6px 6px 4px 4px;
  box-shadow: 0 4px 0 var(--wood-dark), 0 8px 14px var(--shadow);
}

.customer {
  position: relative;
  width: 48px;
  height: 56px;
  margin-bottom: -8px;
  z-index: 2;
  transition: transform 0.5s ease, opacity 0.4s ease;
}

.customer.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.8);
}

.customer.entering {
  animation: customer-enter 0.8s ease forwards;
}

@keyframes customer-enter {
  from {
    transform: translateX(-80px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.customer-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 28px;
  border-radius: 8px 8px 6px 6px;
  box-shadow: 0 3px 8px var(--shadow);
}

.customer-head {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f0c8a8;
}

.customer-face-happy::after,
.customer-face-sad::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 5px;
  border-radius: 0 0 10px 10px;
  border: 2px solid var(--ink);
  border-top: none;
}

.customer-face-sad::after {
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  border-top: 2px solid var(--ink);
  bottom: 4px;
}

.patience-bar {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 5px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  margin-bottom: 4px;
  overflow: hidden;
}

.patience-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--sage), var(--honey));
  border-radius: 3px;
  transition: width 0.2s linear, background 0.3s;
}

.patience-fill.low {
  background: linear-gradient(90deg, #e8a838, var(--terracotta));
}

.order-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  min-width: 36px;
  padding: 4px 6px;
  background: #fff;
  border-radius: 8px;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px var(--shadow);
  border: 2px solid var(--sage);
  white-space: nowrap;
}

.order-bubble.empty {
  display: none;
}

.speech-order {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  background: #fff;
  padding: 2px 8px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--terracotta);
  border: 2px dashed var(--honey);
  animation: bounce-prompt 0.9s ease infinite;
}

@keyframes bounce-prompt {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

/* Invisible slot for serve-step prompt chips (delivery = guest + console, not a counter graphic) */
.serve-step-anchor {
  flex-shrink: 0;
  position: relative;
  min-height: 1.15rem;
  margin-top: 0.1rem;
  pointer-events: none;
}

.serve-step-anchor .prompt-anchor {
  position: relative;
  left: auto;
  bottom: auto;
  transform: none;
  margin-top: 0.15rem;
}

.serve-step-anchor.active-target {
  background: rgba(232, 168, 56, 0.1);
  border-radius: 10px;
  animation: env-station-glow 1.2s ease infinite;
}

/* Recovery dock (post-service circular economy redirect) */
.waste-dock,
.recovery-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 118px;
  padding: 0.45rem 0.75rem 0.4rem;
  background:
    radial-gradient(ellipse 90% 120% at 18% 0%, rgba(232, 168, 56, 0.2), transparent 55%),
    linear-gradient(180deg, rgba(253, 248, 240, 0.98), rgba(232, 224, 212, 0.98));
  border-top: 3px solid var(--honey);
  z-index: 15;
  box-shadow: 0 -10px 28px rgba(44, 36, 32, 0.15);
}

.waste-dock.hidden {
  display: none;
}

.recovery-header {
  text-align: center;
  margin-bottom: 0.15rem;
}

.recovery-network-tag {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 700;
  opacity: 0.9;
}

.waste-title {
  text-align: center;
  margin-bottom: 0.1rem;
}

.waste-hint {
  text-align: center;
  margin: 0.1rem 0 0.3rem;
  font-size: 0.76rem;
  color: var(--ink-muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.35;
}

.recovery-legend {
  max-width: 720px;
  margin: 0 auto 0.35rem;
  font-size: 0.72rem;
  color: var(--ink-muted);
  border: 1px solid rgba(107, 143, 113, 0.35);
  border-radius: 10px;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.55);
}

.recovery-legend summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--forest);
  list-style-position: outside;
}

.recovery-legend-body {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--tile-a);
}

.recovery-legend-body p {
  margin: 0 0 0.45rem;
  line-height: 1.45;
}

.recovery-legend-body strong {
  color: var(--forest);
}

.leftover-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
  margin-bottom: 0.35rem;
}

.leftover-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0.85rem;
  background: #fff;
  border-radius: 12px;
  border: 2px solid var(--tile-b);
  box-shadow: 0 4px 12px var(--shadow);
}

.leftover-icon {
  font-size: 1.75rem;
}

.leftover-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
  max-width: 200px;
}

.bins-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.bins-row-four {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recovery-channels-row {
  align-items: stretch;
}

.channel-bin {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: visible;
}

.channel-name {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--forest);
}

.channel-role {
  opacity: 0.95;
}

.bin-sprite-wrap {
  min-height: clamp(44px, 9vh, 72px);
}

.channel-bin .sprite-img {
  max-height: clamp(48px, 11vh, 80px);
}

.bin {
  position: relative;
  flex: 1;
  max-width: 128px;
  min-width: 92px;
  text-align: center;
  padding: 0.35rem 0.15rem 1.5rem;
  color: var(--forest);
}

.channel-donation {
  max-width: 136px;
  min-width: 100px;
  transform: scale(1.04);
  z-index: 2;
}

.channel-bin .prompt-anchor {
  z-index: 5;
}

.bin.active-target {
  outline: 3px solid var(--honey);
  outline-offset: 2px;
}

.channel-donation.active-target {
  outline-color: #fff;
  box-shadow:
    0 0 0 2px rgba(232, 168, 56, 0.55),
    0 0 20px rgba(232, 168, 56, 0.35);
}

.float-score-strong {
  color: #fff1c2 !important;
  font-size: 1.05rem;
  text-shadow: 0 0 12px rgba(232, 168, 56, 0.9);
  max-width: 200px;
  text-align: center;
  line-height: 1.15;
}

/* Order queue */
.order-queue {
  position: absolute;
  top: 52px;
  right: 8px;
  width: 160px;
  max-height: 140px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 12;
  border: 2px solid rgba(107, 143, 113, 0.35);
}

.queue-title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 0.25rem;
}

.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.queue-list li {
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.queue-list li:last-child {
  border-bottom: none;
}

/* Typing console */
.typing-console {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: min(92%, 560px);
  background: rgba(44, 36, 32, 0.92);
  color: var(--cream);
  border-radius: 14px;
  padding: 0.5rem 1rem 0.65rem;
  z-index: 18;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(232, 168, 56, 0.35);
}

.typing-label {
  font-size: 0.68rem;
  opacity: 0.85;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.word-display {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  min-height: 1.6em;
  display: flex;
  flex-wrap: wrap;
  gap: 0.08em;
  align-items: center;
}

.word-display .ch {
  display: inline-block;
  padding: 0.08em 0.12em;
  border-radius: 4px;
  transition: background 0.12s, color 0.12s;
}

.word-display .ch.pending {
  color: rgba(253, 246, 236, 0.45);
}

.word-display .ch.correct {
  background: rgba(107, 143, 113, 0.5);
  color: #fff;
}

.word-display .ch.wrong {
  background: rgba(199, 91, 57, 0.65);
  animation: shake-letter 0.25s ease;
}

@keyframes shake-letter {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.typing-hint {
  font-size: 0.72rem;
  margin-top: 0.35rem;
  opacity: 0.75;
}

.mini-game-board {
  position: absolute;
  left: 50%;
  top: 52px;
  transform: translateX(-50%);
  width: min(58%, 560px);
  z-index: 14;
  pointer-events: none;
}

.mini-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.38rem 0.55rem;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(107, 143, 113, 0.3);
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(44, 36, 32, 0.12);
  color: var(--ink);
}

.mini-progress span {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--terracotta);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mini-progress strong {
  font-family: var(--font-display);
  color: var(--forest);
  font-size: 1rem;
  text-align: center;
}

.mini-stage {
  margin: 0.5rem auto 0;
  width: min(100%, 460px);
}

.big-card,
.eco-card {
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(232, 168, 56, 0.55);
  border-radius: 8px;
  padding: 0.62rem 0.8rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(44, 36, 32, 0.16);
}

.big-card > span,
.eco-card .material,
.eco-card .product {
  display: inline-block;
  font-size: 2.05rem;
  line-height: 1;
}

.cycora-icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  object-fit: contain;
  vertical-align: -0.2em;
  filter: drop-shadow(0 2px 3px rgba(44, 36, 32, 0.18));
}

.big-card > span .cycora-icon,
.scanner-head .cycora-icon,
.factory-head .cycora-icon,
.ceremony-product .cycora-icon,
.leader-product .cycora-icon {
  width: 1.65em;
  height: 1.65em;
}

.big-card strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  color: var(--forest);
  font-size: 1.15rem;
}

.big-card p,
.eco-card p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-weight: 700;
  line-height: 1.25;
}

.decision-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(232, 168, 56, 0.55);
  border-radius: 8px;
  padding: 0.55rem;
  box-shadow: 0 8px 20px rgba(44, 36, 32, 0.16);
}

.decision-card {
  min-width: 0;
  padding: 0.45rem 0.35rem;
  border-radius: 8px;
  background: rgba(61, 92, 69, 0.08);
  color: var(--ink);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.decision-card b,
.decision-card span,
.decision-card small {
  display: block;
  overflow-wrap: anywhere;
}

.decision-card b {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.decision-card small {
  color: var(--terracotta);
  margin-top: 0.12rem;
}

.decision-card i {
  display: block;
  height: 6px;
  margin-top: 0.32rem;
  border-radius: 999px;
  background: rgba(44, 36, 32, 0.16);
  overflow: hidden;
}

.decision-card i em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--terracotta), var(--honey), var(--sage));
}

.choice-row-mini {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.45rem;
}

.choice-row-mini span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.16rem 0.42rem;
  border-radius: 8px;
  background: rgba(232, 168, 56, 0.16);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.72rem;
}

.mixed-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.mixed-parts span {
  padding: 0.35rem 0.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(107, 143, 113, 0.45);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.72rem;
}

.recipe-path {
  margin: 0.45rem auto 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: min(100%, 540px);
}

.recipe-path span,
.recipe-path b,
.recipient-row-mini span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: rgba(61, 92, 69, 0.1);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.72rem;
}

.recipe-path b {
  background: transparent;
  color: var(--terracotta);
}

.eco-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45rem;
}

.eco-card p {
  grid-column: 1 / -1;
}

.industry-card {
  background:
    linear-gradient(180deg, rgba(248, 252, 250, 0.97), rgba(227, 238, 235, 0.96)),
    repeating-linear-gradient(90deg, rgba(61, 92, 69, 0.08) 0 18px, rgba(232, 168, 56, 0.08) 18px 36px);
  border: 2px solid rgba(70, 84, 92, 0.32);
  border-radius: 8px;
  padding: 0.62rem 0.8rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(44, 36, 32, 0.16);
}

.eco-lab-board {
  background:
    linear-gradient(180deg, rgba(247, 252, 251, 0.98), rgba(223, 235, 232, 0.98)),
    repeating-linear-gradient(90deg, rgba(70, 84, 92, 0.08) 0 18px, rgba(255, 255, 255, 0.08) 18px 36px);
  border: 2px solid rgba(70, 84, 92, 0.34);
  border-radius: 8px;
  padding: 0.62rem;
  box-shadow: 0 12px 28px rgba(44, 36, 32, 0.18);
  color: var(--ink);
}

.scanner-card,
.studio-board {
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(232, 241, 235, 0.98)),
    repeating-linear-gradient(90deg, rgba(232, 168, 56, 0.08) 0 18px, rgba(107, 143, 113, 0.08) 18px 36px);
  border: 2px solid rgba(107, 143, 113, 0.34);
  border-radius: 8px;
  padding: 0.65rem;
  box-shadow: 0 12px 28px rgba(44, 36, 32, 0.16);
  text-align: center;
}

.scanner-head {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--font-display);
  color: var(--forest);
}

.scanner-head span {
  font-size: 1.7rem;
}

.scanner-head em {
  font-style: normal;
  color: var(--terracotta);
  font-size: 0.72rem;
}

.scanner-window {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.6rem;
  align-items: center;
  min-height: 112px;
  margin: 0.55rem 0;
  padding: 0.55rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(44, 36, 32, 0.08);
  border: 1px solid rgba(61, 92, 69, 0.24);
}

.scanner-beam {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(232, 168, 56, 0.28), transparent);
  animation: scanner-sweep 1.2s ease infinite;
}

.scanner-scrap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff8eb;
  border: 3px solid var(--honey);
  font-size: 2.2rem;
}

.property-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.3rem;
}

.property-stack span {
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(107, 143, 113, 0.28);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.74rem;
}

.scanner-card p,
.studio-board p,
.journey-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-weight: 800;
  line-height: 1.25;
}

@keyframes scanner-sweep {
  0% {
    transform: translateX(-70%);
  }
  100% {
    transform: translateX(70%);
  }
}

.studio-table {
  display: grid;
  grid-template-columns: 1fr 1.35fr 1fr;
  gap: 0.55rem;
  align-items: stretch;
  margin: 0.55rem 0;
}

.fabric-swatch,
.pattern-grid,
.product-preview {
  min-width: 0;
  border-radius: 8px;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(107, 143, 113, 0.24);
}

.fabric-swatch span,
.product-preview span {
  display: block;
  font-size: 1.85rem;
}

.fabric-swatch b,
.product-preview b {
  display: block;
  font-family: var(--font-display);
  color: var(--forest);
  font-size: 0.78rem;
}

.product-preview small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.64rem;
  font-weight: 800;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem;
}

.pattern-grid span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 7px;
  background: rgba(232, 168, 56, 0.12);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.68rem;
}

.pattern-grid span.active {
  background: #fff8eb;
  border: 2px solid var(--honey);
  color: var(--terracotta);
}

.delivery-board {
  background:
    linear-gradient(180deg, rgba(248, 252, 250, 0.98), rgba(232, 239, 235, 0.98)),
    repeating-linear-gradient(90deg, rgba(107, 143, 113, 0.08) 0 18px, rgba(232, 168, 56, 0.08) 18px 36px);
}

.delivery-line {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.factory-head em {
  margin-left: 0.4rem;
  padding: 0.1rem 0.36rem;
  border-radius: 999px;
  background: rgba(107, 143, 113, 0.14);
  color: var(--forest);
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 800;
}

.production-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--station-count, 9), minmax(0, 1fr));
  gap: 0.24rem;
  min-height: 78px;
  padding: 0.45rem 0.35rem 0.3rem;
  overflow: hidden;
}

.belt-track {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 35px;
  height: 20px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent),
    repeating-linear-gradient(90deg, #59656b 0 18px, #728086 18px 36px);
  box-shadow: inset 0 0 0 2px rgba(44, 36, 32, 0.12);
  animation: conveyor-move 0.9s linear infinite;
}

.material-pod {
  position: absolute;
  left: var(--pod-left);
  top: 22px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #fff7e8;
  border: 2px solid var(--honey);
  box-shadow: 0 4px 12px rgba(44, 36, 32, 0.2);
  z-index: 2;
  transition: left 0.35s ease;
}

.material-pod span,
.material-pod small {
  display: block;
}

.material-pod small {
  display: none;
  font-family: var(--font-display);
  font-size: 0.55rem;
  color: var(--forest);
}

.machine-node {
  position: relative;
  min-width: 0;
  z-index: 1;
  padding: 0.18rem 0.1rem 0.28rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(70, 84, 92, 0.18);
  text-align: center;
  color: rgba(44, 36, 32, 0.62);
}

.machine-node.needed {
  background: rgba(255, 255, 255, 0.86);
  color: var(--forest);
}

.machine-node.active {
  border-color: var(--honey);
  background: #fff8eb;
  box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.22);
}

.machine-node span,
.machine-node b {
  display: block;
}

.machine-node span {
  font-size: 1rem;
  line-height: 1;
}

.machine-node b {
  margin-top: 0.1rem;
  font-family: var(--font-display);
  font-size: 0.58rem;
  overflow-wrap: anywhere;
}

.fabric-process-line .machine-node {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0.12rem 0.04rem;
}

.fabric-process-line .machine-node.needed {
  background: transparent;
}

.fabric-process-line .machine-node.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--terracotta);
}

.fabric-process-line .machine-node.active span {
  filter: drop-shadow(0 0 7px rgba(232, 168, 56, 0.72));
}

.fabric-process-line .machine-node span {
  font-size: 1.15rem;
}

.fabric-process-line .machine-node b {
  font-size: 0.56rem;
}

.fabric-process-line .machine-node > span,
.fabric-process-line .machine-node > b {
  transform: translateY(-12px);
}

.fabric-process-line {
  min-height: 98px;
  padding-top: 0.2rem;
}

.fabric-process-line .belt-track {
  top: 56px;
}

.station-machine {
  position: absolute;
  left: 50%;
  top: 52px;
  width: 44px;
  height: 20px;
  display: grid;
  place-items: center;
  transform: translate(-50%, 0);
  font-style: normal;
  z-index: 4;
}

.station-machine em {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: auto;
  height: auto;
  background: transparent;
  border: none;
  font-style: normal;
  font-size: 1.08rem;
  filter: drop-shadow(0 2px 3px rgba(44, 36, 32, 0.3));
  animation: machine-scrap-pulse 0.9s ease infinite;
}

.station-machine::before,
.station-machine::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.station-machine::before {
  left: 1px;
  right: 1px;
  top: 50%;
  height: 20px;
  transform: translateY(-50%);
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(70, 84, 92, 0.32) 0 5px, rgba(255, 255, 255, 0.18) 5px 10px),
    rgba(70, 84, 92, 0.18);
  animation: underbelt-move 0.7s linear infinite;
}

.station-machine::after {
  left: 50%;
  top: 50%;
  width: 26px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(232, 168, 56, 0.42);
  border: 1px solid rgba(199, 91, 57, 0.28);
  animation: machine-press 0.9s ease infinite;
}

.machine-wash::after {
  background: rgba(120, 185, 220, 0.48);
  border-radius: 50%;
  animation: machine-splash 0.8s ease infinite;
}

.machine-dye::after,
.machine-extract::after {
  background: rgba(199, 91, 57, 0.38);
  animation: machine-bubble 0.85s ease infinite;
}

.machine-spin::after {
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(232, 168, 56, 0.8), rgba(107, 143, 113, 0.35), rgba(232, 168, 56, 0.8));
  animation: machine-spin 0.65s linear infinite;
}

.machine-weave::after,
.machine-print::after {
  width: 28px;
  height: 14px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg, rgba(61, 92, 69, 0.65) 0 3px, transparent 3px 6px),
    rgba(232, 168, 56, 0.28);
  animation: machine-slide 0.75s ease infinite;
}

.machine-dry::after {
  background: rgba(232, 168, 56, 0.52);
  border-radius: 50%;
  animation: machine-heat 0.9s ease infinite;
}

.machine-grind::after,
.machine-mix::after {
  border-radius: 50%;
  animation: machine-shake 0.55s ease infinite;
}

@keyframes machine-scrap-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes machine-press {
  0%,
  100% {
    transform: translate(-50%, -50%) scaleX(0.92);
  }
  50% {
    transform: translate(-50%, -50%) scaleX(1.16);
  }
}

@keyframes underbelt-move {
  to {
    background-position: 10px 0;
  }
}

@keyframes machine-splash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(120, 185, 220, 0.35);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(120, 185, 220, 0);
  }
}

@keyframes machine-bubble {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.9);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.18);
  }
}

@keyframes machine-spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes machine-slide {
  0%,
  100% {
    transform: translate(-58%, -50%);
  }
  50% {
    transform: translate(-42%, -50%);
  }
}

@keyframes machine-heat {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.25);
  }
}

@keyframes machine-shake {
  0%,
  100% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  25% {
    transform: translate(-54%, -50%) rotate(-8deg);
  }
  75% {
    transform: translate(-46%, -50%) rotate(8deg);
  }
}

.lab-floor {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.55rem;
  align-items: stretch;
  margin-top: 0.35rem;
}

.processing-tank,
.product-rack,
.eco-maker {
  min-width: 0;
  border-radius: 8px;
  padding: 0.45rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(70, 84, 92, 0.22);
  text-align: center;
}

.processing-tank span,
.product-rack span {
  display: block;
  font-size: 1.6rem;
}

.processing-tank b,
.product-rack b,
.eco-maker small {
  display: block;
  font-family: var(--font-display);
  color: var(--forest);
}

.processing-tank small,
.product-rack small {
  display: block;
  margin-top: 0.15rem;
  color: var(--ink-muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.2;
}

.eco-maker {
  width: 92px;
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(255, 250, 240, 0.9);
  border-color: rgba(232, 168, 56, 0.42);
}

.eco-maker .maker-body-img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(44, 36, 32, 0.2));
}

.eco-maker .maker-product {
  position: absolute;
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 4px rgba(44, 36, 32, 0.24));
}

.eco-maker-scarf .maker-product {
  top: 25px;
  left: 42px;
}

.eco-maker-tote .maker-product {
  right: 7px;
  bottom: 30px;
}

.eco-maker-apron .maker-product {
  left: 50%;
  top: 34px;
  transform: translateX(-50%) scale(1.05);
}

.eco-maker-jacket .maker-product,
.eco-maker-shirt .maker-product,
.eco-maker-dress .maker-product,
.eco-maker-shorts .maker-product,
.eco-maker-uniform .maker-product,
.eco-maker-waistcoat .maker-product {
  left: 50%;
  top: 32px;
  transform: translateX(-50%) scale(1.08);
}

.eco-maker-fabric .maker-product,
.eco-maker-discovery .maker-product,
.eco-maker-batch .maker-product,
.eco-maker-kit .maker-product {
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) scale(1.05);
}

.eco-maker-pouch .maker-product {
  right: 9px;
  bottom: 28px;
  transform: rotate(-8deg);
}

.eco-maker-purse .maker-product {
  right: 6px;
  bottom: 30px;
  transform: rotate(-6deg) scale(1.02);
}

.eco-maker-blanket .maker-product {
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) scale(1.18);
}

.eco-maker-finished {
  box-shadow: 0 0 0 3px rgba(232, 168, 56, 0.18);
}

.factory-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-family: var(--font-display);
  color: var(--forest);
}

.factory-head span {
  font-size: 1.6rem;
}

.factory-belt {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
}

.conveyor-line.industrial {
  min-height: 38px;
  border: 2px solid rgba(70, 84, 92, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent),
    repeating-linear-gradient(90deg, #526068 0 16px, #6f7e85 16px 32px);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  animation: conveyor-move 0.9s linear infinite;
}

@keyframes conveyor-move {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 32px 0;
  }
}

.industry-card p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-weight: 800;
  line-height: 1.25;
}

.maker-wearing {
  position: relative;
  width: 86px;
  min-height: 78px;
  margin: 0.45rem auto 0;
  display: grid;
  place-items: center;
}

.maker-body {
  font-size: 3rem;
  line-height: 1;
}

.worn-product {
  position: absolute;
  right: 4px;
  bottom: 18px;
  font-size: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(44, 36, 32, 0.25));
}

.maker-wearing small {
  grid-column: 1;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  color: var(--forest);
  font-weight: 700;
}

.conveyor-line {
  min-height: 32px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, rgba(61, 92, 69, 0.16) 0 14px, rgba(232, 168, 56, 0.16) 14px 28px),
    rgba(253, 246, 236, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: var(--forest);
  font-family: var(--font-display);
}

.recipient-row-mini {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.mini-customer .speech-order {
  display: block;
}

.float-score-weak {
  color: #ffb0a0 !important;
}

.game-viewport.large-prompts .word-display {
  font-size: 1.65rem;
}

.game-viewport.high-contrast .word-display .ch.pending {
  color: #fff;
  text-shadow: 0 0 2px #000;
}

.game-viewport.high-contrast .sprite-interactive.active-target,
.game-viewport.high-contrast .bin.active-target {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Dialogue */
.dialogue-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 100px;
  background: linear-gradient(180deg, rgba(61, 92, 69, 0.95), rgba(45, 68, 52, 0.98));
  color: var(--cream);
  padding: 0.65rem 1.25rem 0.75rem;
  z-index: 25;
  border-top: 3px solid var(--honey);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.dialogue-panel.hidden {
  display: none;
}

.dialogue-speaker {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--honey);
  margin-bottom: 0.25rem;
}

.dialogue-text {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 720px;
}

.dialogue-continue {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  opacity: 0.8;
}

.dialogue-continue kbd {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* FX layer */
.fx-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.float-score {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--honey);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  animation: float-up 1s ease forwards;
  width: min(72vw, 520px);
  text-align: center;
  line-height: 1.18;
  transform: translateX(-50%);
}

@keyframes float-up {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-36px);
  }
}

.phase-overlay {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 32, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 28;
  animation: fade-in 0.4s ease;
}

.phase-overlay .banner {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--cream);
  text-align: center;
  padding: 1rem 2rem;
  background: rgba(61, 92, 69, 0.95);
  border-radius: 16px;
  border: 3px solid var(--honey);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Results */
.screen-results {
  background: rgba(44, 36, 32, 0.88);
  backdrop-filter: blur(6px);
}

.results-card {
  max-width: 620px;
  max-height: 92%;
  overflow: auto;
  padding: 2rem;
  background: var(--warm-white);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.results-card h2 {
  font-family: var(--font-display);
  color: var(--forest);
  margin: 0 0 0.5rem;
}

.stars {
  font-size: 1.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}

.results-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  text-align: left;
}

.results-stats li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--tile-a);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.results-extra {
  margin: 0.7rem 0 1rem;
  text-align: left;
}

.results-product-preview {
  display: flex;
  justify-content: center;
  margin: 0.45rem 0;
}

.results-product-preview:empty {
  display: none;
}

.achievement-ceremony {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.55rem;
  align-items: center;
  margin: 0.65rem 0;
  padding: 0.65rem;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.95), rgba(235, 246, 239, 0.9));
  border: 2px solid rgba(232, 168, 56, 0.45);
}

.ceremony-product {
  min-width: 0;
  padding: 0.55rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(107, 143, 113, 0.24);
  text-align: center;
}

.community-recipient {
  min-width: 0;
  padding: 0.55rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(107, 143, 113, 0.24);
  text-align: center;
}

.community-recipient span {
  display: block;
  font-size: 2rem;
}

.community-recipient b {
  display: block;
  font-family: var(--font-display);
  color: var(--forest);
}

.community-recipient small {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-muted);
  font-weight: 800;
  line-height: 1.2;
}

.ceremony-product span {
  display: block;
  font-size: 2.2rem;
}

.ceremony-product b,
.ceremony-message strong {
  display: block;
  font-family: var(--font-display);
  color: var(--forest);
}

.ceremony-product small {
  display: block;
  margin-top: 0.12rem;
  color: var(--ink-muted);
  font-weight: 800;
}

.ceremony-arrow {
  color: var(--terracotta);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
}

.ceremony-message {
  grid-column: 1 / -1;
  text-align: center;
}

.ceremony-message p {
  margin: 0.18rem 0 0;
  color: var(--ink-muted);
  font-weight: 800;
}

.badge-row,
.leader-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin-top: 0.45rem;
}

.badge-row span,
.leader-badges span {
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: rgba(232, 168, 56, 0.18);
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.68rem;
}

.leaderboard-preview {
  margin: 0.55rem 0;
  padding: 0.55rem;
  border-radius: 8px;
  background: rgba(61, 92, 69, 0.08);
  border: 1px solid rgba(107, 143, 113, 0.24);
}

.leaderboard-preview > strong {
  display: block;
  text-align: center;
  color: var(--forest);
  font-family: var(--font-display);
  margin-bottom: 0.35rem;
}

.leaderboard-preview-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.24rem 0;
  border-top: 1px solid rgba(107, 143, 113, 0.18);
}

.leaderboard-preview-row span,
.leaderboard-preview-row em {
  color: var(--terracotta);
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 800;
}

.result-section {
  margin-top: 0.55rem;
}

.result-section > strong,
.full-loop-card > strong {
  display: block;
  font-family: var(--font-display);
  color: var(--forest);
  margin-bottom: 0.32rem;
  text-align: center;
}

.result-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.38rem;
}

.result-item-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem;
  align-items: center;
  padding: 0.38rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(107, 143, 113, 0.24);
  background: rgba(255, 255, 255, 0.65);
}

.result-item-card span {
  font-size: 1.25rem;
}

.result-item-card b {
  font-size: 0.72rem;
  line-height: 1.18;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.result-item-card.small b {
  font-size: 0.68rem;
}

.full-loop-card {
  padding: 0.48rem;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 248, 235, 0.92), rgba(235, 246, 239, 0.86));
  border: 2px solid rgba(232, 168, 56, 0.38);
}

.loop-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.22rem;
  align-items: center;
  justify-content: center;
}

.loop-strip span {
  padding: 0.14rem 0.34rem;
  border-radius: 999px;
  background: #fff;
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.66rem;
}

.loop-strip b {
  color: var(--terracotta);
}

.results-flavor {
  font-size: 0.88rem;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.btn-primary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.65rem 1.75rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--terracotta), #a84830);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.results-next-prompt {
  margin: 0.5rem 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.results-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.results-actions .btn-primary.results-next-level {
  display: block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-secondary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 1.5rem;
  border: 2px solid var(--tile-a);
  border-radius: 12px;
  background: var(--warm-white);
  color: var(--ink);
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--tile-a);
}

.footer-hint {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: rgba(253, 246, 236, 0.55);
}

.footer-hint kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.footer-hint .footer-deck-link {
  color: rgba(200, 235, 210, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-hint .footer-deck-link:hover {
  color: #fff;
}

.leaderboard-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(44, 36, 32, 0.72);
  backdrop-filter: blur(4px);
}

.leaderboard-modal.hidden {
  display: none;
}

.leaderboard-card {
  width: min(94%, 1040px);
  max-height: 92%;
  overflow: auto;
  border-radius: 12px;
  background: var(--warm-white);
  border: 3px solid rgba(232, 168, 56, 0.55);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

.leaderboard-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, #fffaf4, #f4eadc);
  border-bottom: 2px solid rgba(232, 168, 56, 0.28);
}

.leaderboard-head h2 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--forest);
}

.leaderboard-close {
  font-family: var(--font-display);
  font-weight: 700;
  border: 2px solid rgba(107, 143, 113, 0.35);
  border-radius: 8px;
  background: #fff;
  color: var(--forest);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.leaderboard-body {
  padding: 0.9rem;
}

.leaderboard-table {
  display: grid;
  gap: 0.55rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: auto minmax(130px, 1.1fr) repeat(7, minmax(82px, 1fr));
  gap: 0.55rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(107, 143, 113, 0.24);
}

.rank-pill {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #fff3d5;
  color: var(--terracotta);
  font-family: var(--font-display);
  font-weight: 800;
  border: 2px solid rgba(232, 168, 56, 0.45);
}

.leader-product {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem;
  align-items: center;
}

.leader-product span {
  grid-row: span 2;
  font-size: 1.8rem;
}

.leader-product b,
.leaderboard-row strong {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 0.82rem;
}

.leader-product small,
.leader-label {
  display: block;
  color: var(--ink-muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.leader-badges {
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 0;
}

.empty-board {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  min-height: 240px;
  text-align: center;
}

.empty-board span {
  font-size: 2.5rem;
}

.empty-board strong {
  font-family: var(--font-display);
  color: var(--forest);
}

.empty-board p {
  margin: 0;
  color: var(--ink-muted);
  font-weight: 800;
}

/* Prompt chip (floating over anchors) */
.prompt-chip {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 8px;
  background: linear-gradient(180deg, #fff9f0, #ffe8c8);
  color: var(--terracotta);
  border-radius: 8px;
  border: 2px solid var(--honey);
  box-shadow: 0 2px 8px var(--shadow);
  animation: bounce-prompt 1s ease infinite;
  white-space: nowrap;
}

.game-viewport.large-prompts .prompt-chip {
  font-size: 0.88rem;
  padding: 4px 10px;
}

.prompt-chip-sub {
  display: block;
  font-size: 0.55rem;
  font-weight: 600;
  margin-top: 2px;
  opacity: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leftover-card-recovery {
  border-color: rgba(232, 168, 56, 0.45);
  background: linear-gradient(135deg, #fff 0%, #fffaf3 100%);
}

.float-score-weak {
  opacity: 0.95;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .game-viewport {
    aspect-ratio: auto;
    height: calc(100vh - 128px);
    min-height: 560px;
  }

  .level-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-node {
    min-height: 106px;
  }

  .mini-game-board {
    top: 46px;
    width: min(94%, 520px);
  }

  .mini-progress strong {
    font-size: 0.88rem;
  }

  .scene {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .kitchen-panel {
    border-right: none;
    border-bottom: 3px solid rgba(139, 105, 20, 0.25);
  }

  .order-queue {
    position: fixed;
    top: auto;
    bottom: 200px;
    right: 6px;
    width: 130px;
    max-height: 100px;
  }

  .tables-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-card {
    width: min(92%, 420px);
    padding: 1rem;
    border-radius: 8px;
  }

  .stars {
    margin-bottom: 0.45rem;
  }

  .results-stats {
    margin-bottom: 0.55rem;
  }

  .results-stats li {
    padding: 0.22rem 0;
  }

  .result-card-grid {
    grid-template-columns: 1fr;
  }

  .achievement-ceremony,
  .leaderboard-row {
    grid-template-columns: 1fr;
  }

  .ceremony-arrow {
    transform: rotate(90deg);
  }

  .leader-product {
    grid-template-columns: auto 1fr;
  }

  .screen-game.eco-lab-phase .mini-game-board {
    width: min(96%, 620px);
  }

  .production-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-height: 154px;
  }

  .belt-track {
    top: 72px;
  }

  .lab-floor {
    grid-template-columns: 1fr;
  }

  .scanner-window,
  .studio-table {
    grid-template-columns: 1fr;
  }

  .results-flavor {
    margin-bottom: 0.65rem;
  }
}
