body.immersive:has(#kitchen:not(.hidden), #adventure:not(.hidden)) {
  background: #0c231d;
}
.immersive .top {
  max-width: none;
  min-height: 49px;
  padding: 5px clamp(10px, 2vw, 28px);
  justify-content: flex-start;
  gap: 9px;
  border-color: #d5b98538;
  background: #102d24;
}
.immersive .wallet {
  margin: 0 0 0 auto;
  gap: 6px;
}
.immersive .top .brand { color: #ffe5b9; }
.immersive .top .pill { padding: 4px 8px; font-size: 11px; }
.immersive .headline { display: none; }
.immersive main { max-width: none; padding: 0 0 12px; }
.immersive main > nav {
  margin: 0;
  padding: 4px 9px;
  border-radius: 0;
  background: #17392e;
  color: #f5e4c0;
}
.immersive .tabs button:not(.active) { color: #f0dfbe; }
.immersive .journey { margin: 0; border-radius: 0; padding: 4px 12px; }
.immersive .journey #unlockLabel { display: none; }
.screen-toggle {
  color: #f5e4c0;
  background: #244439;
  border: 1px solid #cfaf7166;
  border-radius: 7px;
  min-height: 36px;
  min-width: 39px;
  font-size: 22px;
}
body.screen-expanded main > nav { position: sticky; top: 0; z-index: 5; }
.immersive #kitchen:not(.hidden) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.immersive #kitchen .station {
  background: #142c25;
  border-radius: 0;
  border: 0;
  min-width: 0;
}
.kitchen-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-width: 0;
  color: #fff1d2;
  background: #142c25;
}
.kitchen-stage .scene {
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 0;
}
.immersive #restaurantPortrait {
  display: block;
  background-color: #102b21;
}
.immersive #restaurantPortrait::before,
.immersive #restaurantPortrait::after { content: none; }
.immersive .portrait-art {
  width: 100%;
  height: 100%;
  background: var(--panorama) center / cover no-repeat;
}
.immersive { --panorama: url('assets/restaurant-art/panorama-man.webp'); }
.immersive[data-chef="woman"] { --panorama: url('assets/restaurant-art/panorama-woman.webp'); }
.immersive.upgrade-uniform { --panorama: url('assets/restaurant-art/panorama-man-jade.webp'); }
.immersive.upgrade-uniform[data-chef="woman"] { --panorama: url('assets/restaurant-art/panorama-woman-jade.webp'); }

.immersive[data-restaurant="2"] .portrait-art { box-shadow: inset 0 10vh 14vh -8vh #42aab9b3; }
.immersive[data-restaurant="3"] .portrait-art { box-shadow: inset 0 12vh 18vh -7vh #8d42c3bf; }
.immersive[data-restaurant="4"] .portrait-art { box-shadow: inset 0 12vh 18vh -7vh #da783fbf; }
.immersive[data-restaurant="5"] .portrait-art { box-shadow: inset 0 12vh 18vh -7vh #d6b953c9; }
.immersive[data-restaurant="0"] .sushi-room { display: block; }
.kitchen-stage .service-state { display: none; }
.kitchen-stage .station-head {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 10px;
  padding: 0;
}
.kitchen-stage .station-head h2 { display: none; }
.kitchen-stage .ordercard {
  min-width: 0;
  margin: 0;
  padding: 12px 15px;
  border: 1px solid #e0bd776e;
  border-radius: 10px;
  color: #fff1d2;
  background: #09241fec;
}
.kitchen-stage .ordercard .customer, .kitchen-stage .ordercard .online { display: none; }
.kitchen-stage .ordercard .recipe-title { font-size: clamp(16px, 2vw, 24px); }
.kitchen-stage .ordercard .recipe { margin: 6px 0; }
.kitchen-stage .ordercard .recipe li { padding: 3px 0; }
.kitchen-stage .ordercard .recipe li.done { color: #d7f8ab; }
.kitchen-stage .ordercard .patience { margin-top: 4px; }
.kitchen-stage .roll-preview { padding: 7px 0 0; }
.kitchen-stage .roll-preview > :first-child { color: #f5e5c9; }
.kitchen-stage .roll-preview .roll-plate { min-height: 42px; }
.kitchen-dock {
  padding: 6px 10px;
  background: linear-gradient(#2f2016ed, #1e2017);
}
.kitchen-dock .kitchen-guide,
.kitchen-dock .pausehint {
  margin: 0 0 5px;
  padding: 4px 7px;
  color: #263328;
}
.kitchen-dock .ingredients {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 4px 2px 7px;
  border: 0;
  overflow: auto;
  background: none;
  scrollbar-color: #c49c5c #261e16;
}
.kitchen-dock .ingredient {
  flex: 0 0 clamp(75px, 10vw, 136px);
  padding: 4px;
  min-height: 62px;
  background: #f1d5a2;
  border-color: #675438;
}
.kitchen-dock .ingredient.available { border-color: #f0c871; }
.immersive .kitchen-dock .ingredients { padding: 12px 8px 13px; }
.immersive .kitchen-dock .ingredient { position: relative; transition: transform .18s, box-shadow .18s, background .18s; }
.immersive .kitchen-dock .ingredient.ingredient-selected {
  transform: translateY(-5px);
  background: linear-gradient(145deg, #fffbe0, #e6f7ba);
  border: 2px solid #b7ed67;
  box-shadow: 0 4px 0 #549448, 0 0 13px #b9f281b3;
  color: #174d30;
  opacity: 1;
}
.ingredient-selected::after {
  content: '✓ ' attr(data-selected-count);
  position: absolute;
  top: -7px;
  right: -3px;
  padding: 2px 5px;
  border-radius: 12px;
  background: #28683c;
  color: white;
  font-size: 11px;
  font-weight: 800;
}
.ingredient-pop { animation: ingredient-lift .25s ease-out; }
@keyframes ingredient-lift { 0% { transform: translateY(0); } 55% { transform: translateY(-8px); } 100% { transform: translateY(-5px); } }
/* The panoramic artwork normally hides the existing expression variants. Show the
   actual happy/sad chef for the feedback interval, retaining the full scene size. */
.immersive #restaurantPortrait:is([data-mood="happy"], [data-mood="sad"], [data-mood="missed"]) {
  display: grid;
}
.immersive #restaurantPortrait:is([data-mood="happy"], [data-mood="sad"], [data-mood="missed"])::before,
.immersive #restaurantPortrait:is([data-mood="happy"], [data-mood="sad"], [data-mood="missed"])::after { content: ''; }
.immersive #restaurantPortrait:is([data-mood="happy"], [data-mood="sad"], [data-mood="missed"]) .portrait-art {
  background: var(--current-portrait) center / cover no-repeat;
}
.immersive #restaurantPortrait[data-mood="happy"] .portrait-message {
  background: #245a38;
  border-color: #fff0a3;
  box-shadow: 0 0 18px #e7da7980;
  font-size: 15px;
}
@media (prefers-reduced-motion: reduce) { .ingredient-pop { animation:none; } }
.kitchen-dock .ingredient i { height: 25px; }
.kitchen-dock .ingredient i svg { max-height: 28px; }
.kitchen-dock .actions { margin: 0; padding: 0; }
.kitchen-dock .actions button { padding: 7px 11px; }
.kitchen-management { padding: 10px 14px; }
.kitchen-management summary { cursor: pointer; }
.immersive .side { padding: 0 14px; }
.immersive .station-head,
.immersive .kitchen-management { color: #f5e6c9; }
.kitchen-management .experience-panel { color: #153c35; margin: 8px 0 0; }
.kitchen-stage:has(.chef-chop) .portrait-art { animation: counter-tap 160ms ease-out; }
.kitchen-stage:has([data-mood="happy"]) .ordercard { box-shadow: 0 0 18px #b8ea545e; }
.kitchen-stage:has([data-mood="sad"], [data-mood="missed"]) .ordercard { box-shadow: 0 0 15px #f27a6d76; }
@keyframes counter-tap { 45% { transform: scale(1.007); } }
@media (prefers-reduced-motion: reduce) {
  .kitchen-stage:has(.chef-chop) .portrait-art { animation: none; }
}

.immersive #adventure .adventure { border: 0; border-radius: 0; }
.immersive #adventure .gamewrap {
  display: flex;
  justify-content: center;
  background: #10241e;
}
.immersive #adventure canvas { object-fit: contain; }
.immersive #adventure > .sub { padding-inline: 14px; color: #f7e7c8; }
@media (min-width: 780px) and (min-aspect-ratio: 4/3) {
  .kitchen-stage {
    min-height: max(470px, calc(100dvh - 165px));
    grid-template-columns: minmax(0, 1fr) clamp(210px, 23vw, 350px);
    grid-template-rows: minmax(0, 1fr) auto;
    isolation: isolate;
  }
  .kitchen-stage .scene { position: absolute; inset: 0; z-index: -1; aspect-ratio: auto; }
  .kitchen-stage .portrait-art { background-position: center 34%; }
  .kitchen-stage .station-head { left: 10px; right: auto; top: 58px; }
  .kitchen-stage .ordercard {
    grid-area: 1 / 2;
    align-self: start;
    margin: 10px 10px 0 0;
  }
  .kitchen-dock {
    grid-area: 2 / 1 / 3 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0 12px;
  }
  .kitchen-dock .kitchen-guide,
  .kitchen-dock .pausehint { grid-column: 1 / -1; }
  .kitchen-dock .actions { align-self: center; }
  .kitchen-dock .actions button { min-width: 80px; }
  .immersive:not(.gamefocus) #adventure .adventure {
    min-height: calc(100dvh - 120px);
    display: flex;
    flex-direction: column;
  }
  .immersive:not(.gamefocus) #adventure .gamewrap {
    height: max(280px, calc(100dvh - 252px));
  }
  .immersive #adventure canvas { height: 100%; max-height: none; }
}
@media (max-width: 520px) {
  .immersive .top { flex-wrap: wrap; }
  .immersive .wallet .pill { font-size: 10px; }
}
