:root {
  --studio-surface: #192a23;
  --studio-edge: #53645a;
  --studio-accent: #e9bd73;
  --studio-muted: #bbc8bd;
  --studio-ink: #f8efd9;
  --studio-radius: 16px;
}

body:is([data-scene='lobby'], [data-scene='roll'], [data-scene='vote'], [data-scene='discussion']) {
  background:
    radial-gradient(ellipse at 18% 0%, #45543a52, transparent 51%),
    linear-gradient(147deg, #1a3129, #101d19 70%);
}

body[data-scene='night']:has(.pantry-board) {
  background:
    linear-gradient(180deg, #101c17cf, #101d1582 26%, #121f1970 47%, #111e19 89%),
    url('/assets/night-pantry.webp') center 0 / max(100%, 78rem) auto no-repeat #111e19;
}

.scene-night:not(:has(.recruitment)) .pantry-board { max-inline-size: 49rem; }

.scene-night:not(:has(.scene-utility)) > .scene-header { grid-column: 1 / -1; }

.scene-night:has(:is([data-focus='open-eyes'], [data-focus='steal-cheese'])) .host-advance {
  border-color: var(--studio-edge);
  background: var(--studio-surface);
  box-shadow: none;
  color: var(--studio-ink);
  font-size: 1rem;
}

.pantry-board {
  --table-text: var(--studio-ink);
  padding-block: 4px 12px;
}

.pantry-board::before {
  inset: 9% 0 -2%;
  background: radial-gradient(ellipse at 50% 58%, #070e0ac9 25%, #09130d4d 59%, transparent 75%);
}

.pantry-table::before {
  inset: 0;
  border: 0;
  border-radius: 0;
  background: url('/assets/walnut-table.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 14px 14px #070d0ccd);
}

.pantry-table::after {
  inset: 5% 3% 6%;
  border: 0;
  background: radial-gradient(ellipse at 42% 41%, transparent 24%, #05140f2f 75%);
  box-shadow: none;
  opacity: .53;
  transition: opacity 280ms ease;
}

.pantry-board[data-visibility='awake'] .pantry-table::after { opacity: 0; }

.pantry-board .seat-visual {
  width: min(80%, clamp(37px, 10vw, 64px));
  height: clamp(41px, 10.3vw, 68px);
}

.pantry-board .seat-cup {
  background: url('/assets/walnut-cup.webp') center / contain no-repeat;
  filter: drop-shadow(0 5px 5px #04100bde);
}

.pantry-board[data-visibility='asleep'] .seat-cup {
  filter: brightness(.82) saturate(.79) drop-shadow(0 5px 5px #04100bde);
}

.pantry-board .seat-name {
  border: 1px solid #80998a4d;
  border-radius: 7px;
  padding: .22em .48em .26em;
  background: #13241cf0;
  text-shadow: none;
  font-size: clamp(.72rem, 2.12vw, .99rem);
}

.pantry-board .seat-state { font-size: .74em; }
.pantry-board .pantry-seat[data-awake='true'] .seat-name { background: #473420; }
.pantry-board .pantry-seat[data-you='true'] { z-index: 3; width: min(34%, 13rem); }

.pantry-seat[data-you='true'] .seat-visual::before {
  bottom: 1%;
  width: 113%;
  height: 44%;
  border-color: #e9bd73;
  background: #bb8a3933;
  box-shadow: 0 0 10px #e6a05036;
}

.pantry-board .pantry-seat[data-you='true'] .seat-name {
  display: grid;
  justify-items: center;
  gap: 1px;
  border-color: #d1ad69;
  box-shadow: 0 2px 4px #080f0ba8;
}

.pantry-board .pantry-seat[data-you='true'] .seat-label {
  -webkit-line-clamp: 3;
  min-width: 0;
}

.pantry-board .seat-self {
  margin: 0;
  color: #efd094;
  font-size: .72em;
  letter-spacing: .03em;
}

.scene-night .recruitment .recruit-skip {
  grid-column: 1 / -1;
  justify-self: start;
  text-align: start;
  overflow-wrap: normal;
}

.pantry-board .pantry-center { gap: 9px; width: min(40%, 13rem); }

.pantry-board .table-platter {
  width: min(92%, 11.3rem);
  aspect-ratio: 1.59;
  border: 1px solid #ba955c;
  background:
    radial-gradient(ellipse at 46% 39%, #ab9471, #877358 55%, transparent 58%),
    linear-gradient(151deg, #e5c790, #a37d4d 54%, #edd6a4 69%, #7c5b34);
  box-shadow: inset 0 0 0 2px #f9ddae75, 0 3px #675132, 0 10px 16px #0a150ec7;
}

.pantry-center[data-cheese='covered'] .table-platter {
  border-color: transparent;
  background: none;
  box-shadow: none;
}

.pantry-board .table-platter::before,
.pantry-board .table-platter::after { content: none; }

.pantry-board .pantry-center[data-cheese='covered'] .table-platter::before,
.pantry-board .pantry-center[data-cheese='covered'] .table-platter::after { content: none; }

.platter-cover {
  position: absolute;
  z-index: 2;
  inset: -25% -4% -1%;
  background: url('/assets/brass-cloche.webp') center bottom / contain no-repeat;
  filter: drop-shadow(0 8px 8px #07110bcc);
}

.pantry-board .table-platter .cheese-token {
  inset: auto 23% 16%;
  width: 54%;
  height: 88%;
  background-image: url('/assets/alpine-wedge.webp');
  filter: drop-shadow(2px 5px 4px #382712bb);
}

.pantry-board .pantry-status {
  max-inline-size: 200%;
  padding: 3px 7px;
  border: 1px solid #849b8460;
  border-radius: 5px;
  background: #13241df0;
  font-size: clamp(.67rem, 1.75vw, .85rem);
  text-shadow: none;
  white-space: normal;
}

.pantry-steal .platter-cover {
  animation: platter-settle 550ms cubic-bezier(.25, .74, .31, 1) both;
}

.platter-cover.is-opening {
  animation: platter-lift 460ms cubic-bezier(.25, .74, .31, 1) var(--wake-delay, 0ms) both;
}

@keyframes platter-lift {
  0% { opacity: 1; transform: none; }
  44% { opacity: .96; transform: translateY(-26%) rotate(7deg); }
  100% { opacity: 0; transform: translate(28%, -48%) rotate(15deg); }
}

@keyframes platter-settle {
  0%, 22% { opacity: 0; transform: translate(24%, -14%) rotate(13deg); }
  53% { opacity: 1; transform: translate(9%, -17%) rotate(8deg); }
  79% { opacity: 1; transform: translateY(1%); }
  100% { opacity: 0; transform: none; }
}

@media (max-width: 680px) {
  body[data-scene='night']:has(.pantry-board) {
    background:
      linear-gradient(180deg, #14231ddd, #121e198a 31%, #142019ee 66%, #111e19),
      url('/assets/night-pantry-mobile.webp') center 0 / auto min(57svh, 390px) no-repeat #111e19;
  }
  .pantry-board .pantry-table::before {
    inset: 2% 0 1%;
    background-image: url('/assets/walnut-table-mobile.webp');
  }
  .pantry-board .pantry-status { padding-inline: 5px; }
}

@media (max-width: 430px) {
  .scene-night .night-choice { justify-items: stretch; justify-content: stretch; }
  .scene-night .recruitment { grid-template-columns: minmax(0, 1fr); }
}

@media (orientation: portrait) and (max-width: 375px) and (max-height: 650px) {
  .scene-night .pantry-board .pantry-table { height: 216px; }
  .pantry-board .seat-visual { height: 33px; }
  .pantry-board .pantry-center { gap: 6px; top: 46%; }
  .pantry-board .table-platter { width: min(90%, 5.7rem); }

  .scene-night[data-mode='table']:has(.night-choice):not(:has(.recruitment)) > .host-advance-dock {
    position: static;
    padding: 0;
    background: transparent;
  }
}

@media (orientation: landscape) and (max-height: 525px) {
  .scene-night:not(:has(.scene-utility)) > .scene-header { grid-area: heading; }
  .pantry-board { padding-block: 0 6px; }
  .pantry-board .seat-visual { height: clamp(30px, 9.2svh, 46px); }
  .pantry-board .pantry-center { gap: 5px; }
  .pantry-board .table-platter { width: min(86%, 6.4rem); }
  .pantry-board .pantry-status { translate: 0 -6px; }
}

@media (orientation: landscape) and (min-width: 580px) and (max-height: 465px) {
  .scene-night[data-mode='table']:has(.pantry-board):has(.host-advance-dock):not(:has(.recruitment)) {
    grid-template-areas:
      "steps steps"
      "heading board"
      "progress board"
      "utility board"
      "choice board"
      "host board";
  }

  .scene-night[data-mode='table']:has(.pantry-board):not(:has(.recruitment)) > .host-advance-dock {
    position: static;
    padding: 0;
    justify-items: start;
    background: transparent;
  }
}

:root[data-reduce-motion] :is(.pantry-steal .platter-cover, .platter-cover.is-opening) { display: none; }
@media (prefers-reduced-motion: reduce) {
  :is(.pantry-steal .platter-cover, .platter-cover.is-opening) { display: none; }
}
