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

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #111;
  color: #eee;
  font-family: monospace;
  overflow: hidden;
}

#dining-room {
  height: 40%;
  background: #1a1a2e;
  position: relative;
  overflow: hidden;
}

.dining-event {
  position: absolute;
  bottom: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  will-change: transform, opacity;
}

.dining-event svg {
  width: min(12vw, 56px);
  height: auto;
}

.dining-event__caption {
  font-size: clamp(9px, 1.5vw, 13px);
  color: #a0a0c0;
  white-space: nowrap;
}

.dining-event--left {
  left: 15%;
  transform: translateX(-120vw);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.dining-event--left.is-visible  { transform: translateX(0); }
.dining-event--left.is-exiting  { transform: translateX(120vw); }

.dining-event--right {
  right: 15%;
  transform: translateX(120vw);
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.dining-event--right.is-visible  { transform: translateX(0); }
.dining-event--right.is-exiting  { transform: translateX(-120vw); }

.dining-event--fade {
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.dining-event--fade.is-visible  { opacity: 1; }
.dining-event--fade.is-exiting  { opacity: 0; }

#tony-permanent {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.9s ease, transform 0.9s ease;
  z-index: 2;
}

#tony-permanent.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#tony-permanent svg {
  width: min(16vw, 76px);
  height: auto;
}

#tony-counter {
  font-family: monospace;
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  font-weight: bold;
  color: #d4a840;
  text-shadow: 0 0 10px rgba(212, 168, 64, 0.7);
  min-width: 2ch;
  text-align: center;
  display: block;
}

@keyframes counter-pulse {
  0%   { transform: scale(1.7); opacity: 0.5; }
  100% { transform: scale(1);   opacity: 1; }
}

.counter-tick {
  animation: counter-pulse 0.25s ease-out;
}

#kitchen {
  height: 60%;
  background: #1e1209;
  display: flex;
  flex-direction: column;
}

#kitchen-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

#kitchen-banner {
  flex-shrink: 0;
  text-align: center;
  font-size: clamp(1.4rem, 6vw, 3.2rem);
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 0.06em;
  padding: 0.4rem 1rem 0.8rem;
}

#bowl-svg {
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.station-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#bowl-prompt {
  font-size: clamp(0.55rem, 1.8vw, 0.85rem);
  color: #ccc;
  letter-spacing: 0.08em;
  text-align: center;
}

.station-item svg {
  width: min(38vw, 200px);
  height: auto;
}

.demand {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  z-index: 10;
  background: rgba(8, 6, 4, 0.88);
  border: 1px solid #3a3a5a;
  border-radius: 6px;
  padding: 10px 14px;
}

.demand svg {
  width: min(14vw, 60px);
  height: auto;
}

.demand__label {
  font-family: monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-weight: bold;
  color: #d4a840;
}

.demand__quote {
  font-size: clamp(0.6rem, 1.6vw, 0.8rem);
  color: #a0a0c0;
  white-space: nowrap;
  font-style: italic;
  text-align: center;
  max-width: 140px;
}

.demand--phone {
  bottom: 20%;
  left: 6%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.demand--phone.is-visible {
  opacity: 1;
  transform: scale(1);
}

.demand--vig {
  bottom: 20%;
  right: 6%;
  opacity: 0;
  transform: translateX(120%);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.demand--vig.is-visible {
  opacity: 1;
  transform: translateX(0);
}

#vig-tab {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: monospace;
  font-size: clamp(0.6rem, 1.8vw, 0.85rem);
  color: #8a8a6a;
  pointer-events: none;
  letter-spacing: 0.05em;
}

/* ── Phase 3 palette ── */
body.phase-3 #dining-room {
  background: #160e06;
}

body.phase-3 #kitchen {
  background: #14100a;
}

body.phase-3 #kitchen-stage {
  background: #1c1408;
  border-top: 3px solid #3a2a14;
}

body.phase-3 #kitchen-banner {
  color: #a08828;
}

body.phase-3 #vig-tab {
  color: #b09050;
}

/* ── Sitdown scene ── */
.sitdown-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sitdown-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 6%;
  margin-bottom: -4px;
}

.sitdown-tony {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.sitdown-tony svg {
  width: min(16vw, 72px);
  height: auto;
  display: block;
}

.sitdown-table {
  height: 22%;
  background: #241808;
  border-top: 3px solid #4a3020;
  flex-shrink: 0;
}

.shame-score {
  font-family: monospace;
  font-size: clamp(0.5rem, 1.4vw, 0.7rem);
  color: #d4a840;
  opacity: 0.55;
  letter-spacing: 0.05em;
}

.sitdown-quote {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 12, 4, 0.92);
  border: 1px solid #4a4a6a;
  border-radius: 3px;
  padding: 3px 7px;
  font-family: monospace;
  font-size: clamp(0.5rem, 1.3vw, 0.68rem);
  color: #d4a840;
  white-space: nowrap;
  pointer-events: none;
  animation: quote-fade 1.8s ease-out forwards;
}

@keyframes quote-fade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Phase 3 transition ── */
#transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

#transition-overlay.t-flash { background: rgba(255, 255, 255, 0.92); }
#transition-overlay.t-black { background: #000; }

#dining-room.t-zoom,
#kitchen.t-zoom {
  transform: scale(1.15);
  transform-origin: center center;
  transition: none !important;
}

#dining-room.t-zoom-2,
#kitchen.t-zoom-2 {
  transform: scale(1.3);
  transform-origin: center center;
  transition: none !important;
}

/* ── Phase 4 completion ── */
#completion-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.completion-prompt {
  font-family: monospace;
  font-size: clamp(1.8rem, 6vw, 3.5rem);
  color: #ffd700;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.55);
  padding: 1rem 2rem;
  -webkit-tap-highlight-color: transparent;
  animation: prompt-pulse 2s ease-in-out infinite;
}

@keyframes prompt-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
