:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #201915;
  --cream: #fff8ed;
  --paper: rgba(255, 250, 241, 0.92);
  --glass: rgba(255, 250, 241, 0.76);
  --line: rgba(95, 67, 44, 0.2);
  --shadow: 0 24px 80px rgba(57, 32, 18, 0.34);
  --tomato: #e84f43;
  --jade: #23875f;
  --teal: #237d89;
  --plum: #6f4a8e;
  --gold: #f1bd43;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: #2b1a13;
  color: var(--ink);
}

button {
  min-height: 44px;
  border: 1px solid rgba(75, 48, 29, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.92);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 7px 18px rgba(62, 35, 19, 0.12);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(35, 125, 137, 0.72);
  box-shadow: 0 12px 26px rgba(62, 35, 19, 0.18);
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: clamp(10px, 1.6vw, 22px);
  isolation: isolate;
}

.scene-art,
.scene-vignette {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.scene-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene-vignette {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 247, 232, 0.9) 0%, rgba(255, 247, 232, 0.7) 38%, rgba(57, 31, 18, 0.12) 100%),
    linear-gradient(180deg, rgba(255, 248, 237, 0.26), rgba(43, 26, 19, 0.3));
}

.shell[data-venue="pizza"] .scene-vignette {
  background:
    linear-gradient(90deg, rgba(255, 246, 230, 0.92), rgba(255, 226, 203, 0.64) 44%, rgba(95, 30, 24, 0.18)),
    linear-gradient(180deg, rgba(255, 248, 237, 0.28), rgba(64, 24, 20, 0.32));
}

.shell[data-venue="mexican"] .scene-vignette {
  background:
    linear-gradient(90deg, rgba(255, 249, 226, 0.92), rgba(222, 247, 218, 0.58) 44%, rgba(33, 91, 60, 0.2)),
    linear-gradient(180deg, rgba(255, 248, 237, 0.26), rgba(38, 58, 28, 0.3));
}

.shell[data-venue="sushi"] .scene-vignette {
  background:
    linear-gradient(90deg, rgba(240, 251, 250, 0.94), rgba(222, 242, 245, 0.62) 44%, rgba(24, 71, 83, 0.22)),
    linear-gradient(180deg, rgba(250, 255, 253, 0.28), rgba(16, 52, 60, 0.32));
}

.shell[data-venue="brunch"] .scene-vignette {
  background:
    linear-gradient(90deg, rgba(255, 249, 234, 0.94), rgba(255, 228, 199, 0.58) 44%, rgba(107, 62, 29, 0.2)),
    linear-gradient(180deg, rgba(255, 248, 237, 0.28), rgba(82, 45, 22, 0.3));
}

.topline {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(420px, 1.05fr);
  gap: 18px;
  align-items: end;
}

.brand-lockup {
  max-width: 640px;
  padding: 8px 0 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.provenance-badge {
  width: fit-content;
  border: 1px solid rgba(255, 211, 106, 0.32);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  background: rgba(255, 244, 222, 0.72);
}

.game-titlemark {
  display: block;
  width: min(100%, 560px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(68, 28, 10, 0.24));
}

.brand-lockup h1 {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 7.4rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-shadow: 0 8px 26px rgba(255, 248, 237, 0.42);
}

.brand-lockup p:last-child {
  max-width: 560px;
  margin: 12px 0 0;
  color: #4f3828;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  font-weight: 750;
}

.stage-card {
  height: 300px;
  border: 1px solid rgba(96, 62, 37, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: #fff4e4;
  box-shadow: var(--shadow);
}

.stage-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 62% 50%;
}

.kicker,
.label {
  margin: 0;
  color: #81502a;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scorebar {
  display: grid;
  grid-template-columns: repeat(5, minmax(78px, 1fr)) 44px minmax(130px, 0.85fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 251, 244, 0.62);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.scorebar div {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.shift-start {
  min-height: 72px;
  font-size: 1rem;
}

.rules-button {
  width: 44px;
  min-width: 44px;
  min-height: 72px;
  padding: 0;
  font-size: 1.15rem;
}

.scorebar strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.34rem, 2.2vw, 2rem);
  line-height: 1;
}

.mode-picker,
.ready-venues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mode-button,
.venue-choice {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid rgba(75, 48, 29, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.84);
  color: #2b1a13;
  font-size: 0.86rem;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(62, 35, 19, 0.1);
}

.mode-button:hover {
  border-color: rgba(35, 125, 137, 0.72);
}

.buzz-footer button.is-signed-in {
  border-color: rgba(35, 125, 137, 0.72);
  background: #1d3a31;
  color: #fff8ed;
}

.mode-button.active {
  background: #1d3a31;
  border-color: #1d3a31;
  color: #fff8ed;
}

.venue-choice.active {
  background: #244e64;
  border-color: #244e64;
  color: #fff8ed;
}

.venue-choice.locked {
  color: #826d5c;
  background: rgba(255, 250, 241, 0.54);
}

.venue-choice.locked::after {
  content: "Lock";
  margin-left: 6px;
  font-size: 0.68rem;
  opacity: 0.72;
}

.record-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(460px, 100%);
}

.record-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(75, 48, 29, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.78);
  color: #4f3828;
  font-size: 0.8rem;
  font-weight: 950;
}

.coach-card {
  width: min(460px, 100%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(75, 48, 29, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.82);
  color: #4f3828;
  font-weight: 850;
}

.coach-card p {
  margin: 0;
}

.coach-card .label {
  grid-column: 1 / -1;
}

.coach-card button {
  min-height: 36px;
  padding: 6px 10px;
}

.coach-card.dismissed {
  display: none;
}

.dialog-note {
  margin: 0;
  color: #5d4635;
  font-weight: 800;
  line-height: 1.35;
}

.leaderboard-panel {
  display: grid;
  gap: 6px;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(75, 48, 29, 0.16);
  border-radius: 8px;
  background: #fffdf8;
  font-weight: 900;
}

.leaderboard-row.player {
  border-color: rgba(42, 155, 114, 0.54);
  background: #edf8f1;
}

.game {
  min-height: min(690px, calc(100vh - 190px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(96, 62, 37, 0.22);
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.shell[data-state="ready"] {
  grid-template-rows: 1fr;
  align-items: center;
}

.buzz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 251, 244, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.buzz-footer > div {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.buzz-footer a,
.buzz-footer button {
  color: inherit;
}

.buzz-home {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.buzz-home img {
  width: 40px;
  height: 40px;
  display: block;
}

.buzz-footer nav a {
  font-weight: 950;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.buzz-footer strong {
  display: block;
}

.buzz-footer p {
  grid-column: 2;
  max-width: 48rem;
  margin: 4px 0 0;
  color: #5d422e;
  font-size: 0.85rem;
  font-weight: 750;
}

.buzz-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.buzz-footer nav a,
.buzz-footer nav button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border: 1px solid rgba(75, 48, 29, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.84);
  color: #2b1a13;
  font-size: 0.86rem;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 7px 18px rgba(62, 35, 19, 0.1);
}

.buzz-footer nav a:hover,
.buzz-footer nav button:hover {
  border-color: rgba(35, 125, 137, 0.72);
}

.shell[data-state="ready"] .topline {
  min-height: calc(100vh - 44px);
  grid-template-columns: minmax(300px, 0.64fr) minmax(500px, 1fr);
  align-items: center;
}

.shell[data-state="ready"] .brand-lockup h1 {
  font-size: clamp(4rem, 6.25vw, 5.9rem);
}

.shell[data-state="ready"] .game-titlemark {
  width: min(100%, 600px);
}

.shell[data-state="ready"] .brand-lockup p:last-child {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.shell[data-state="ready"] .stage-card {
  height: min(62vh, 620px);
}

.shell[data-state="ready"] .scorebar {
  grid-column: 1;
  width: min(360px, 100%);
  grid-template-columns: 1fr;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.shell[data-state="ready"] .mode-picker {
  grid-column: 1;
  width: min(420px, 100%);
}

.shell[data-state="ready"] .ready-venues {
  grid-column: 1;
  width: min(480px, 100%);
}

.shell[data-state="ready"] .record-strip {
  grid-column: 1;
}

.shell[data-state="ready"] .coach-card {
  grid-column: 1;
}

.shell[data-state="ready"] .scorebar div {
  display: none;
}

.shell[data-state="ready"] .shift-start {
  min-height: 76px;
  font-size: 1.2rem;
}

.shell[data-state="ready"] .game {
  display: none;
}

.shell[data-state="running"] .stage-card,
.shell[data-state="ended"] .stage-card {
  display: none;
}

.shell[data-state="running"] .mode-picker,
.shell[data-state="ended"] .mode-picker,
.shell[data-state="running"] .ready-venues,
.shell[data-state="ended"] .ready-venues,
.shell[data-state="running"] .record-strip,
.shell[data-state="ended"] .record-strip,
.shell[data-state="running"] .coach-card,
.shell[data-state="ended"] .coach-card {
  display: none;
}

.shell[data-state="running"] .topline,
.shell[data-state="ended"] .topline {
  grid-template-columns: minmax(240px, 0.62fr) minmax(640px, 1.38fr);
}

.shell[data-state="running"] .brand-lockup h1,
.shell[data-state="ended"] .brand-lockup h1 {
  font-size: clamp(2.7rem, 5vw, 5rem);
}

.shell[data-state="running"] .game-titlemark,
.shell[data-state="ended"] .game-titlemark {
  width: min(100%, 390px);
}

.shell[data-state="running"] .brand-lockup p:last-child,
.shell[data-state="ended"] .brand-lockup p:last-child {
  max-width: 480px;
  font-size: 1rem;
}

.venue-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(255, 244, 224, 0.74);
  border-bottom: 1px solid var(--line);
}

.venue-tab {
  background: rgba(255, 250, 241, 0.88);
}

.venue-tab.active {
  background: #1d3a31;
  border-color: #1d3a31;
  color: #fff8ed;
}

.venue-tab.locked {
  color: #7f6957;
  background: rgba(255, 250, 241, 0.58);
}

.venue-tab.locked::after {
  content: "Lock";
  margin-left: 6px;
  font-size: 0.68rem;
  opacity: 0.7;
}

.playfield {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(430px, 1.35fr) minmax(220px, 0.68fr);
  min-height: 0;
}

.lane,
.station,
.cast,
.ingredients {
  min-width: 0;
  padding: clamp(10px, 1.2vw, 16px);
}

.station,
.cast {
  border-left: 1px solid var(--line);
}

.section-heading {
  display: flex;
  min-height: 42px;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2,
.cast h2,
.active-ticket h3,
.summary h2 {
  margin: 2px 0 0;
  letter-spacing: 0;
}

.section-heading span {
  color: #604736;
  font-size: 0.88rem;
  font-weight: 950;
  text-align: right;
}

.tickets {
  display: grid;
  max-height: 430px;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.ticket {
  display: grid;
  gap: 8px;
  width: 100%;
  min-height: 104px;
  padding: 10px;
  text-align: left;
  border: 2px solid rgba(110, 81, 54, 0.18);
  background: linear-gradient(180deg, rgba(255, 254, 249, 0.96), rgba(255, 243, 221, 0.92));
}

.ticket.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(35, 125, 137, 0.16), 0 14px 28px rgba(57, 32, 18, 0.14);
}

.ticket.urgent {
  border-color: var(--tomato);
  background: linear-gradient(180deg, #fff8f1, #ffe4dc);
}

.ticket.late {
  border-color: rgba(111, 74, 142, 0.72);
  background: linear-gradient(180deg, #fff8f1, #f1e7ff);
}

.ticket.late .timer {
  background: var(--plum);
}

.ticket-top,
.ticket-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.12;
}

.timer {
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #211914;
  color: white;
  text-align: center;
  font-weight: 950;
}

.modifier {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f5c84b;
  color: #342306;
  font-size: 0.75rem;
  font-weight: 950;
}

.steps,
.needed-steps,
.build-items {
  display: flex;
  min-height: 36px;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.step,
.build-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(32, 135, 95, 0.25);
  border-radius: 8px;
  background: #edf8f1;
  color: #164f39;
  font-size: 0.8rem;
  font-weight: 950;
}

.build-item {
  cursor: pointer;
}

.build-item::after {
  content: "×";
  margin-left: 6px;
  color: rgba(32, 25, 21, 0.42);
  font-weight: 950;
}

.food-icon {
  display: inline-block;
  font-size: 1.22em;
  line-height: 1;
}

.step .food-icon,
.build-item .food-icon {
  margin-right: 5px;
}

.step.done {
  background: #ccefdc;
  border-color: rgba(35, 135, 95, 0.62);
}

.step.missed,
.build-item.error {
  background: #ffe2dc;
  border-color: rgba(232, 79, 67, 0.72);
  color: #8d2c22;
}

.active-ticket,
.build-tray,
.host-card,
.disturbance {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid rgba(91, 59, 34, 0.18);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 30px rgba(57, 32, 18, 0.1);
}

.active-ticket {
  min-height: 150px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.94), rgba(255, 236, 208, 0.84)),
    rgba(255, 250, 241, 0.9);
}

.active-ticket h3 {
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1;
}

.active-ticket p,
.cast p {
  margin: 0;
}

.build-tray {
  grid-template-columns: 1fr;
  min-height: 86px;
}

.feedback {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e8f5f5;
  color: #155a62;
  font-weight: 900;
}

.feedback.bad {
  background: #ffe2dc;
  color: #8d2c22;
}

.feedback.good {
  background: #def3d4;
  color: #315f16;
}

.score-flash {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(35, 125, 137, 0.22);
  border-radius: 8px;
  background: #fff4c8;
  color: #694919;
  font-size: 0.82rem;
  font-weight: 950;
}

.score-flash.bump {
  animation: scoreFlash 420ms ease-out;
}

.station-actions {
  display: grid;
  grid-template-columns: 1.35fr 0.75fr;
  gap: 8px;
  margin-bottom: 10px;
}

.primary {
  background: linear-gradient(180deg, #2a9b72, #1b7558);
  border-color: #17664d;
  color: #fff;
}

.cast {
  display: grid;
  align-content: start;
  gap: 12px;
  background: rgba(255, 236, 212, 0.36);
}

.host-card {
  min-height: 170px;
}

.host-card h2 {
  font-size: clamp(1.32rem, 2.4vw, 2rem);
  line-height: 1.06;
}

.disturbance {
  background: rgba(255, 246, 225, 0.93);
}

.disturbance strong {
  font-size: 1.18rem;
}

.disturbance.active {
  border-color: rgba(232, 79, 67, 0.74);
  background: #ffe4dc;
}

.ingredients {
  padding: 12px;
  border: 1px solid rgba(91, 59, 34, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.78);
}

.ingredient-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  gap: 8px;
}

.ingredient {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 48px;
  padding: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 239, 218, 0.9));
}

.ingredient.bump,
.build-item.bump,
.ticket.bump,
.feedback.bump {
  animation: pop 180ms ease-out;
}

.served-flash {
  animation: serveFlash 420ms ease-out;
}

@keyframes pop {
  50% {
    transform: scale(1.06);
  }
}

@keyframes serveFlash {
  0% {
    box-shadow: inset 0 0 0 0 rgba(42, 155, 114, 0);
  }
  45% {
    box-shadow: inset 0 0 0 999px rgba(42, 155, 114, 0.12);
  }
}

@keyframes scoreFlash {
  0% {
    transform: scale(0.96);
    box-shadow: 0 0 0 rgba(241, 189, 67, 0);
  }

  45% {
    transform: scale(1.02);
    box-shadow: 0 12px 28px rgba(241, 189, 67, 0.34);
  }

  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.ingredient .food-icon {
  font-size: 1.8rem;
}

.ingredient-name {
  display: block;
  margin-top: 3px;
  line-height: 1.05;
}

.ingredient small {
  display: block;
  margin-top: 2px;
  color: #785d49;
  font-size: 0.66rem;
  font-weight: 950;
  line-height: 1;
}

dialog {
  width: min(520px, calc(100% - 28px));
  max-height: 92dvh;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#rulesDialog {
  overflow: auto;
}

dialog::backdrop {
  background: rgba(32, 25, 21, 0.62);
}

.summary {
  display: grid;
  gap: 14px;
  max-height: 92dvh;
  overflow: auto;
  padding: 22px;
  background: var(--cream);
}

.rules-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.rules-list li {
  color: var(--ink);
  list-style: decimal;
}

@media (max-width: 700px) {
  .summary {
    padding: 18px;
  }

  .leaderboard-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.summary-stats div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

@media (max-width: 1120px) {
  .topline,
  .playfield {
    grid-template-columns: 1fr;
  }

  .game {
    min-height: 0;
  }

  .station,
  .cast {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .tickets {
    max-height: none;
  }

  .ingredient-buttons {
    grid-template-columns: repeat(4, minmax(70px, 1fr));
  }

  .scene-vignette {
    background:
      linear-gradient(180deg, rgba(255, 247, 232, 0.96), rgba(255, 247, 232, 0.74) 46%, rgba(57, 31, 18, 0.24)),
      rgba(255, 248, 237, 0.2);
  }

  .shell[data-state="ready"] .topline {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shell[data-state="ready"] .scorebar {
    order: 2;
  }

  .shell[data-state="ready"] .stage-card {
    order: 3;
    min-height: 255px;
  }

  .shell[data-state="running"] .topline,
  .shell[data-state="ended"] .topline {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .shell {
    padding: 8px 10px;
  }

  .buzz-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .buzz-footer nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
  }

  .buzz-footer nav a,
  .buzz-footer nav button {
    min-height: 42px;
    padding: 6px 5px;
    font-size: 0.72rem;
  }

  .brand-lockup h1 {
    font-size: clamp(3rem, 15vw, 4.2rem);
  }

  .brand-lockup p:last-child {
    font-size: 0.98rem;
  }

  .shell[data-state="ready"] .shift-start {
    min-height: 64px;
  }

  .shell[data-state="running"] .brand-lockup p:last-child,
  .shell[data-state="ended"] .brand-lockup p:last-child {
    display: none;
  }

  .shell[data-state="running"] .brand-lockup h1,
  .shell[data-state="ended"] .brand-lockup h1 {
    font-size: 2.4rem;
  }

  .scorebar {
    grid-template-columns: repeat(2, 1fr);
  }

  .scorebar div:nth-child(5),
  .shift-start {
    grid-column: 1 / -1;
  }

  .venue-tabs,
  .station-actions,
  .summary-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ingredient-buttons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shell[data-state="running"],
  .shell[data-state="ended"] {
    height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
  }

  .shell[data-state="running"] .brand-lockup,
  .shell[data-state="ended"] .brand-lockup {
    display: none;
  }

  .shell[data-state="running"] .topline,
  .shell[data-state="ended"] .topline {
    display: block;
  }

  .shell[data-state="running"] .scorebar,
  .shell[data-state="ended"] .scorebar {
    grid-template-columns: repeat(5, minmax(0, 1fr)) 64px;
    gap: 4px;
    padding: 4px;
  }

  .shell[data-state="running"] .scorebar div,
  .shell[data-state="ended"] .scorebar div {
    padding: 6px 5px;
  }

  .shell[data-state="running"] .scorebar .label,
  .shell[data-state="ended"] .scorebar .label {
    font-size: 0.54rem;
    letter-spacing: 0.04em;
  }

  .shell[data-state="running"] .scorebar strong,
  .shell[data-state="ended"] .scorebar strong {
    font-size: 1.05rem;
  }

  .shell[data-state="running"] .shift-start,
  .shell[data-state="ended"] .shift-start {
    min-height: 48px;
    font-size: 0.74rem;
  }

  .shell[data-state="running"] .scorebar div:nth-child(5),
  .shell[data-state="ended"] .scorebar div:nth-child(5),
  .shell[data-state="running"] .shift-start,
  .shell[data-state="ended"] .shift-start {
    grid-column: auto;
  }

  .shell[data-state="running"] .venue-tabs,
  .shell[data-state="ended"] .venue-tabs {
    display: none;
  }

  .shell[data-state="running"] .game,
  .shell[data-state="ended"] .game {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .shell[data-state="running"] .playfield,
  .shell[data-state="ended"] .playfield {
    height: 100%;
    display: grid;
    grid-template-rows: minmax(0, 1fr) 172px;
    overflow: hidden;
  }

  .shell[data-state="running"] .station,
  .shell[data-state="ended"] .station {
    order: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto auto auto;
    gap: 6px;
    overflow: hidden;
  }

  .shell[data-state="running"] .lane,
  .shell[data-state="ended"] .lane {
    order: 2;
    min-height: 0;
    overflow: hidden;
    border-top: 1px solid var(--line);
  }

  .shell[data-state="running"] .cast,
  .shell[data-state="ended"] .cast {
    display: none;
  }

  .shell[data-state="running"] .station > .section-heading,
  .shell[data-state="ended"] .station > .section-heading {
    min-height: 24px;
    margin-bottom: 0;
  }

  .shell[data-state="running"] .station > .section-heading h2,
  .shell[data-state="ended"] .station > .section-heading h2 {
    font-size: 1.28rem;
  }

  .shell[data-state="running"] .ingredients,
  .shell[data-state="ended"] .ingredients {
    order: 1;
    padding: 8px;
  }

  .shell[data-state="running"] .ingredients .section-heading,
  .shell[data-state="ended"] .ingredients .section-heading {
    display: none;
  }

  .shell[data-state="running"] .ingredient-buttons,
  .shell[data-state="ended"] .ingredient-buttons {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 5px;
  }

  .shell[data-state="running"] .ingredient,
  .shell[data-state="ended"] .ingredient {
    min-height: 46px;
    padding: 4px 2px;
  }

  .shell[data-state="running"] .ingredient .food-icon,
  .shell[data-state="ended"] .ingredient .food-icon {
    font-size: 1.38rem;
  }

  .shell[data-state="running"] .ingredient-name,
  .shell[data-state="running"] .ingredient small,
  .shell[data-state="ended"] .ingredient-name,
  .shell[data-state="ended"] .ingredient small {
    display: none;
  }

  .shell[data-state="running"] .active-ticket,
  .shell[data-state="ended"] .active-ticket {
    order: 2;
    min-height: 118px;
    padding: 10px;
    margin: 0;
  }

  .shell[data-state="running"] .active-ticket h3,
  .shell[data-state="ended"] .active-ticket h3 {
    font-size: 1.4rem;
  }

  .shell[data-state="running"] .active-ticket p:not(.label),
  .shell[data-state="ended"] .active-ticket p:not(.label) {
    display: none;
  }

  .shell[data-state="running"] .step,
  .shell[data-state="running"] .build-item,
  .shell[data-state="ended"] .step,
  .shell[data-state="ended"] .build-item {
    width: 40px;
    min-height: 38px;
    padding: 4px;
  }

  .shell[data-state="running"] .step .food-icon,
  .shell[data-state="running"] .build-item .food-icon,
  .shell[data-state="ended"] .step .food-icon,
  .shell[data-state="ended"] .build-item .food-icon {
    margin-right: 0;
    font-size: 1.28rem;
  }

  .shell[data-state="running"] .build-item::after,
  .shell[data-state="ended"] .build-item::after {
    margin-left: 2px;
    font-size: 0.74rem;
  }

  .shell[data-state="running"] .step-name,
  .shell[data-state="ended"] .step-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .shell[data-state="running"] .build-tray,
  .shell[data-state="ended"] .build-tray {
    order: 3;
    min-height: 78px;
    padding: 9px;
    margin: 0;
  }

  .shell[data-state="running"] .feedback,
  .shell[data-state="ended"] .feedback {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.9rem;
  }

  .shell[data-state="running"] .station-actions,
  .shell[data-state="ended"] .station-actions {
    order: 4;
    grid-template-columns: 1.25fr 0.75fr;
    margin-bottom: 0;
  }

  .shell[data-state="running"] .lane .section-heading,
  .shell[data-state="ended"] .lane .section-heading {
    min-height: 24px;
    margin-bottom: 6px;
  }

  .shell[data-state="running"] .lane h2,
  .shell[data-state="ended"] .lane h2 {
    font-size: 1.15rem;
  }

  .shell[data-state="running"] .tickets,
  .shell[data-state="ended"] .tickets {
    max-height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 5px;
    overflow: hidden;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .shell[data-state="running"] .ticket,
  .shell[data-state="ended"] .ticket {
    min-width: 0;
    min-height: 48px;
    max-height: 54px;
    gap: 3px;
    padding: 5px;
  }

  .shell[data-state="running"] .ticket h3,
  .shell[data-state="ended"] .ticket h3 {
    max-width: 105px;
    font-size: 0.72rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .shell[data-state="running"] .timer,
  .shell[data-state="ended"] .timer {
    min-width: 34px;
    padding: 2px 5px;
    font-size: 0.72rem;
  }

  .shell[data-state="running"] .ticket .steps,
  .shell[data-state="ended"] .ticket .steps {
    min-height: 20px;
    gap: 3px;
    overflow: hidden;
  }

  .shell[data-state="running"] .ticket .step,
  .shell[data-state="ended"] .ticket .step {
    width: 22px;
    min-height: 20px;
    border-radius: 6px;
  }

  .shell[data-state="running"] .ticket .step .food-icon,
  .shell[data-state="ended"] .ticket .step .food-icon {
    font-size: 0.9rem;
  }

  .shell[data-state="running"] .ticket-meta,
  .shell[data-state="ended"] .ticket-meta {
    display: none;
  }
}
