@font-face {
  font-family: "Kaisei Decol";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/kaisei-decol-500.ttf") format("truetype");
}

@font-face {
  font-family: "Kaisei Decol";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/kaisei-decol-700.ttf") format("truetype");
}

:root {
  color-scheme: dark;
  font-family: "Kaisei Decol", "Yu Mincho", "Hiragino Mincho ProN", serif;
  background: #090705;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #090705;
}

body {
  display: grid;
  place-items: center;
}

.game-stage {
  position: relative;
  container-type: inline-size;
  width: min(100vw, calc(100vh * 9 / 16));
  aspect-ratio: 9 / 16;
  overflow: hidden;
  isolation: isolate;
  background: #17100a;
}

html.is-returning-day .game-stage {
  opacity: 0;
}

.game-stage.is-returning-door-reveal {
  opacity: 1;
  transition: opacity 1100ms ease-in-out;
}

.game-stage::after {
  content: "";
  position: absolute;
  z-index: 19;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.game-stage.is-next-day-fading::after {
  z-index: 100;
  background: #000;
  opacity: 1;
  transition: opacity 1100ms ease-in-out;
}

.game-stage.is-tasting-good-reaction::after {
  background:
    radial-gradient(circle at 22% 30%, rgba(255, 255, 224, 0.9) 0 0.45%, transparent 1.35%),
    radial-gradient(circle at 76% 25%, rgba(255, 245, 170, 0.9) 0 0.6%, transparent 1.7%),
    radial-gradient(circle at 68% 67%, rgba(255, 255, 232, 0.88) 0 0.5%, transparent 1.5%),
    radial-gradient(circle at 31% 73%, rgba(255, 221, 116, 0.86) 0 0.65%, transparent 1.8%),
    radial-gradient(circle at center, rgba(255, 221, 130, 0.24), transparent 68%);
  mix-blend-mode: screen;
  animation: tasting-good-reaction 1.95s ease-out both;
}

.game-stage.is-tasting-bad-reaction::after {
  background:
    radial-gradient(ellipse at center, transparent 24%, rgba(57, 37, 76, 0.2) 66%, rgba(31, 20, 41, 0.5)),
    rgba(89, 112, 76, 0.2);
  animation: tasting-bad-reaction 1.6s ease-in-out both;
}

@keyframes tasting-good-reaction {
  0% { opacity: 0; transform: scale(0.96); }
  18% { opacity: 1; }
  68% { opacity: 0.78; transform: scale(1.03); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes tasting-bad-reaction {
  0% { opacity: 0; }
  18% { opacity: 0.9; }
  38% { opacity: 0.5; }
  58% { opacity: 0.86; }
  100% { opacity: 0; }
}

.background-image,
.event-back,
.event-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.background-image {
  z-index: 0;
  opacity: 0;
  transition: opacity 360ms linear;
}

.background-image.is-visible {
  opacity: 1;
}

.customer-video {
  position: absolute;
  z-index: 2;
  top: 3.19cqw;
  left: 50%;
  display: block;
  width: 90.33%;
  height: 67.69cqw;
  object-fit: fill;
  pointer-events: none;
  transform: translate(-50%, -1px);
}

.customer-video[hidden] {
  display: none;
}

.customer-back {
  z-index: 3;
}

.fen-video,
.fen-back {
  position: absolute;
  left: 50%;
  bottom: 22.5%;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  transform: translateX(-50%);
}

.customer-back,
.fen-back {
  transition: opacity 420ms ease;
}

.customer-back.is-video-handoff,
.fen-back.is-video-handoff,
.event-back.is-video-handoff {
  opacity: 0 !important;
  transition: opacity 120ms linear !important;
}

.customer-back.is-crossfade-still,
.fen-back.is-crossfade-still {
  opacity: 0;
}

.customer-back.is-crossfade-still.is-visible,
.fen-back.is-crossfade-still.is-visible {
  opacity: 1;
}

.customer-video.is-crossfade-out,
.fen-video.is-crossfade-out {
  opacity: 0;
  transition: opacity 420ms ease;
}

.fen-video {
  z-index: 3;
}

.fen-back {
  z-index: 4;
}

.fen-video[hidden],
.fen-back[hidden] {
  display: none;
}

.business-hours {
  position: absolute;
  z-index: 7;
  top: -2%;
  left: 0.7%;
  width: 23%;
  color: #4a260f;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
  pointer-events: none;
  transform-origin: 48% 0;
}

.business-hours[hidden] {
  display: none;
}

.business-hours:not([hidden]) {
  animation: business-sign-enter 820ms cubic-bezier(0.2, 0.76, 0.24, 1) both;
}

@keyframes business-sign-enter {
  0% {
    transform: translateY(-105%) rotate(-3.5deg);
  }

  54% {
    transform: translateY(3%) rotate(2.8deg);
  }

  70% {
    transform: translateY(-1.2%) rotate(-1.8deg);
  }

  84% {
    transform: translateY(0.5%) rotate(0.9deg);
  }

  100% {
    transform: translateY(0) rotate(0);
  }
}

.business-time-frame {
  display: block;
  width: 100%;
  height: auto;
}

.business-hours-content {
  position: absolute;
  inset: 0;
  text-align: center;
  text-shadow:
    0 -1px 0 rgba(65, 27, 8, 0.82),
    0 1px 0 rgba(255, 239, 181, 0.46);
}

#business-time {
  position: absolute;
  top: 42%;
  left: 15%;
  display: grid;
  width: 70%;
  grid-template-columns: 1fr 1fr 0.58fr 1fr 1fr;
  color: #4a260f;
  font-size: clamp(0.66rem, 2.85vw, 0.92rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transform: translateY(-52%);
}

.time-character {
  display: block;
  width: 100%;
  text-align: center;
}

.time-colon {
  transform: translateY(-0.04em);
}

.business-hours-detail {
  position: absolute;
  top: 79%;
  left: 2.8%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 61%;
  color: #4a260f;
  font-size: clamp(0.46rem, 1.9vw, 0.62rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

#turns-until-close {
  display: inline-block;
  width: 2ch;
  font-size: 1.6em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#overtime-label {
  font-size: 1.2em;
  font-weight: 700;
  letter-spacing: 0.08em;
  transform: translateY(0.22em);
}

.material-board {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 1.8%;
  display: block;
  width: 96%;
  aspect-ratio: 1;
  padding: 0;
  gap: 0;
  transform: translateX(-50%);
  visibility: hidden;
  touch-action: none;
}

.material-board.is-active {
  visibility: visible;
}

.result-materials {
  position: absolute;
  z-index: 8;
  inset: 7% 3% auto;
  height: 27%;
  pointer-events: none;
}

.result-materials[hidden] {
  display: none;
}

.result-score {
  --score-progress: 0deg;
  position: absolute;
  z-index: 9;
  top: 75%;
  left: 50%;
  display: grid;
  width: 27cqw;
  height: 27cqw;
  box-sizing: border-box;
  padding: 2.5cqw;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fffdf0;
  font-size: 11cqw;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-shadow: 0 0.13em 0.12em rgba(45, 19, 4, 0.9);
  background: conic-gradient(
    from 0deg at 50% 50%,
    #ffe100 0deg,
    #ffbd00 var(--score-progress),
    rgba(91, 57, 31, 0.88) var(--score-progress),
    rgba(91, 57, 31, 0.88) 360deg
  );
  box-shadow:
    0 0 0 0.58cqw rgba(255, 240, 176, 0.92),
    0 0 0 1.05cqw rgba(78, 38, 13, 0.9),
    0 0.8cqw 2cqw rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.62);
  transition: opacity 260ms ease, transform 340ms cubic-bezier(0.2, 0.8, 0.25, 1.18);
  pointer-events: none;
}

.result-score::before {
  content: "";
  position: absolute;
  inset: 1.95cqw;
  border-radius: 50%;
  background: rgba(76, 37, 12, 0.94);
  box-shadow: inset 0 0.45cqw 0.85cqw rgba(31, 13, 3, 0.42);
}

.result-score::after {
  content: "";
  position: absolute;
  inset: -11cqw;
  border: 0.65cqw solid rgba(255, 239, 118, 0);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.35) rotate(-12deg);
  background:
    radial-gradient(circle at 50% 2%, #fff8b0 0 0.55cqw, transparent 0.72cqw),
    radial-gradient(circle at 82% 16%, #ffd43b 0 0.42cqw, transparent 0.62cqw),
    radial-gradient(circle at 98% 50%, #fff5a1 0 0.52cqw, transparent 0.7cqw),
    radial-gradient(circle at 82% 84%, #ffbd00 0 0.46cqw, transparent 0.66cqw),
    radial-gradient(circle at 50% 98%, #fff8b0 0 0.55cqw, transparent 0.72cqw),
    radial-gradient(circle at 18% 84%, #ffd43b 0 0.42cqw, transparent 0.62cqw),
    radial-gradient(circle at 2% 50%, #fff5a1 0 0.52cqw, transparent 0.7cqw),
    radial-gradient(circle at 18% 16%, #ffbd00 0 0.46cqw, transparent 0.66cqw);
  pointer-events: none;
}

.result-score span {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-width: 3ch;
  text-align: center;
}

.result-score.is-great-success {
  filter: drop-shadow(0 0 2.1cqw rgba(255, 225, 0, 0.95));
}

.result-score.is-great-reached {
  animation: result-score-great-reached 900ms cubic-bezier(0.16, 0.84, 0.28, 1.15);
}

.result-score.is-great-reached::after {
  animation: result-score-great-burst 980ms ease-out both;
}

.result-score[hidden] {
  display: none;
}

.result-score.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.result-score.is-decided {
  animation: result-score-decided 520ms cubic-bezier(0.16, 0.84, 0.28, 1.2);
}

.result-meal-button {
  z-index: 14;
  bottom: 2.8%;
  min-width: 58cqw;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 3cqw);
  transition: opacity 300ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.25, 1.15);
}

.result-meal-button.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.result-meal-button.is-visible:active {
  transform: translate(-50%, 0.45cqw);
}

.staff-meal-scene {
  position: absolute;
  z-index: 24;
  inset: 0;
  overflow: hidden;
  color: #fff6d9;
  background: #000;
  opacity: 0;
  transition: opacity 1200ms ease-in-out;
}

.game-stage.is-meal-transitioning .business-hours {
  animation: business-sign-exit 680ms cubic-bezier(0.55, 0.02, 0.78, 0.35) forwards;
}

@keyframes business-sign-exit {
  0% { transform: translateY(0) rotate(0); }
  22% { transform: translateY(2.5%) rotate(-2.2deg); }
  48% { transform: translateY(-12%) rotate(2.4deg); }
  100% { transform: translateY(-115%) rotate(-1deg); }
}

.staff-meal-scene[hidden] {
  display: none;
}

.staff-meal-scene.is-visible {
  opacity: 1;
}

.staff-meal-scene.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.staff-meal-next-button {
  z-index: 5;
  bottom: 3.4%;
  min-width: 56cqw;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 3cqw);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.2, 0.8, 0.25, 1.15);
}

.staff-meal-next-button.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.game-over-screen {
  position: absolute;
  z-index: 23;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f7ead0;
  background: rgba(12, 8, 6, 0);
  opacity: 0;
  transition: opacity 700ms ease, background-color 900ms ease;
}

.game-over-screen[hidden] {
  display: none;
}

.game-over-screen.is-visible {
  background: rgba(12, 8, 6, 0.78);
  opacity: 1;
}

.game-stage.is-game-over-interrupting :is(
  .fen-video,
  .fen-back,
  .customer-video,
  .customer-back,
  .event-video,
  .event-back,
  .dialogue
) {
  opacity: 0 !important;
  transition: opacity 380ms ease !important;
}

.game-over-screen.is-visible.is-restarting {
  background: #000;
  pointer-events: none;
}

.game-over-message {
  display: grid;
  width: 78%;
  gap: 2.1cqw;
  padding: 6cqw 5cqw;
  border: 0.35cqw solid rgba(226, 193, 139, 0.65);
  border-radius: 3cqw;
  text-align: center;
  background: rgba(41, 27, 18, 0.88);
  box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, 0.55);
  transform: translateY(2cqw) scale(0.96);
  opacity: 1;
  transition: opacity 520ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.25, 1.08);
}

.game-over-screen.is-visible .game-over-message {
  transform: translateY(-5cqw) scale(1);
}

.game-over-screen.is-restarting .game-over-message,
.game-over-screen.is-restarting .game-over-next-button {
  opacity: 0;
}

.game-over-message span,
.game-over-message p {
  margin: 0;
  font-size: 3.4cqw;
  line-height: 1.65;
}

.game-over-message strong {
  color: #fff4dc;
  font-size: 8.5cqw;
  letter-spacing: 0.12em;
  text-shadow: 0 0.5cqw 1cqw rgba(0, 0, 0, 0.8);
}

.game-over-next-button {
  bottom: 6%;
  min-width: 54cqw;
  white-space: nowrap;
  transition: opacity 420ms ease, transform 220ms ease;
}

.staff-meal-image,
.staff-reward-video,
.staff-meal-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.staff-meal-image {
  object-fit: cover;
  opacity: 0;
  transform: scale(1.12);
  filter: blur(1.8cqw);
  transition:
    opacity 1500ms ease,
    transform 7000ms cubic-bezier(0.16, 0.68, 0.2, 1),
    filter 5200ms ease-out;
}

.staff-meal-scene.is-image-visible .staff-meal-image {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.staff-reward-video {
  z-index: 0;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.12);
  /* Applying blur directly to a playing video flashes its compositor surface
     black on some mobile GPUs. Scale and opacity retain the reveal safely. */
  filter: none;
  transition:
    opacity 1000ms ease,
    transform 7000ms cubic-bezier(0.16, 0.68, 0.2, 1);
}

.staff-meal-scene.is-reward-dark .staff-meal-image {
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1200ms ease, transform 1200ms ease;
}

.staff-meal-scene.is-reward-video-visible .staff-reward-video {
  opacity: 1;
  /* Keep reward movies slightly overscanned so encoded edge pixels
     never become visible. This selector is exclusive to the reward scene. */
  transform: scale(1.05);
}

.staff-meal-scene.is-reward-video-visible .staff-meal-vignette::after {
  display: none;
}

.staff-meal-scene.is-reward-video-visible .staff-meal-vignette {
  opacity: 1;
}

.staff-meal-vignette {
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 24%, transparent 72%, rgba(0, 0, 0, 0.4)),
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 1400ms ease;
}

.staff-meal-vignette::after {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 3, 0.035);
  -webkit-backdrop-filter: blur(1.8cqw);
  backdrop-filter: blur(1.8cqw);
  -webkit-mask-image: radial-gradient(circle at 50% 45%, transparent 0 22%, #000 67% 100%);
  mask-image: radial-gradient(circle at 50% 45%, transparent 0 22%, #000 67% 100%);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.staff-meal-scene.is-image-visible .staff-meal-vignette {
  opacity: 1;
}

.staff-meal-scene.is-image-visible .staff-meal-vignette::after {
  animation: staff-meal-focus-in 5.8s ease-out both;
}

@keyframes staff-meal-focus-in {
  0% { opacity: 1; -webkit-backdrop-filter: blur(1.8cqw); backdrop-filter: blur(1.8cqw); }
  55% { opacity: 0.52; }
  100% { opacity: 0; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); }
}

.staff-meal-title {
  position: absolute;
  z-index: 3;
  top: 45%;
  left: 50%;
  display: grid;
  width: 82%;
  gap: 2.2cqw;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -42%) scale(0.97);
  transition: opacity 850ms ease, transform 1100ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.staff-meal-scene.is-title-visible .staff-meal-title {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.staff-meal-scene.is-title-leaving .staff-meal-title {
  opacity: 0;
  transform: translate(-50%, -57%) scale(1.02);
}

.staff-meal-title span {
  display: flex;
  align-items: center;
  gap: 3cqw;
  justify-content: center;
  color: #d9bc82;
  font-size: 3.2cqw;
  letter-spacing: 0.3em;
  text-shadow: 0 0.3cqw 1.4cqw rgba(255, 190, 86, 0.35);
}

.staff-meal-title span::before,
.staff-meal-title span::after {
  width: 11cqw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 190, 121, 0.8));
  content: "";
}

.staff-meal-title span::after {
  transform: scaleX(-1);
}

.staff-meal-title strong {
  color: #fff8e8;
  font-size: 6.1cqw;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.08em;
  white-space: pre-line;
  text-wrap: balance;
  text-shadow:
    0 0.35cqw 0.5cqw rgba(0, 0, 0, 0.9),
    0 0 2.6cqw rgba(255, 190, 86, 0.34);
}

.staff-meal-orbs {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1500ms ease 500ms;
}

.staff-meal-scene.is-image-visible .staff-meal-orbs {
  opacity: 0.78;
}

.staff-meal-orbs i {
  --orb-size: 2.2cqw;
  position: absolute;
  bottom: -8%;
  left: 12%;
  width: var(--orb-size);
  height: var(--orb-size);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 251, 212, 0.95), rgba(255, 195, 91, 0.42) 38%, transparent 72%);
  filter: blur(0.08cqw);
  animation: staff-meal-orb 8.5s ease-in-out infinite;
}

.staff-meal-orbs i:nth-child(2) { --orb-size: 1.4cqw; left: 26%; animation-delay: -5.2s; animation-duration: 10s; }
.staff-meal-orbs i:nth-child(3) { --orb-size: 3.1cqw; left: 39%; animation-delay: -2.4s; animation-duration: 12s; }
.staff-meal-orbs i:nth-child(4) { --orb-size: 1.1cqw; left: 53%; animation-delay: -7.1s; animation-duration: 9s; }
.staff-meal-orbs i:nth-child(5) { --orb-size: 2.5cqw; left: 66%; animation-delay: -3.7s; animation-duration: 11s; }
.staff-meal-orbs i:nth-child(6) { --orb-size: 1.6cqw; left: 81%; animation-delay: -6.2s; animation-duration: 9.5s; }
.staff-meal-orbs i:nth-child(7) { --orb-size: 0.9cqw; left: 90%; animation-delay: -1.3s; animation-duration: 8s; }
.staff-meal-orbs i:nth-child(8) { --orb-size: 1.9cqw; left: 5%; animation-delay: -8s; animation-duration: 13s; }

@keyframes staff-meal-orb {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  15% { opacity: 0.8; }
  48% { transform: translate3d(3.5cqw, -43cqw, 0) scale(1); }
  76% { opacity: 0.58; }
  100% { opacity: 0; transform: translate3d(-2cqw, -92cqw, 0) scale(0.75); }
}

.game-stage.is-staff-meal .dialogue {
  z-index: 30;
  top: 4%;
  max-width: 70%;
}

@keyframes result-score-great-reached {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  28% { transform: translate(-50%, -50%) scale(1.17); }
  48% { transform: translate(-50%, -50%) scale(0.97); }
  68% { transform: translate(-50%, -50%) scale(1.07); }
}

@keyframes result-score-great-burst {
  0% {
    opacity: 0;
    transform: scale(0.35) rotate(-12deg);
    border-color: rgba(255, 239, 118, 0.95);
    box-shadow: 0 0 0 0 rgba(255, 215, 30, 0.8);
  }
  22% { opacity: 1; }
  62% {
    opacity: 0.92;
    border-color: rgba(255, 239, 118, 0.72);
    box-shadow: 0 0 3.4cqw 1.1cqw rgba(255, 205, 18, 0.34);
  }
  100% {
    opacity: 0;
    transform: scale(1.12) rotate(8deg);
    border-color: rgba(255, 239, 118, 0);
    box-shadow: 0 0 5cqw 2cqw rgba(255, 205, 18, 0);
  }
}

@keyframes result-score-decided {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  42% { transform: translate(-50%, -50%) scale(1.2) rotate(-2deg); }
  68% { transform: translate(-50%, -50%) scale(0.96) rotate(1deg); }
}

.result-material {
  position: absolute;
  left: var(--result-left);
  top: var(--result-top);
  width: var(--result-size);
  aspect-ratio: 1;
  opacity: 0;
  filter: drop-shadow(0 0.5cqw 0.65cqw rgba(31, 15, 5, 0.58));
  transform: translate(calc(-50% + var(--result-shift)), -72%) scale(0.62);
  transition: opacity 210ms ease-out, transform 300ms cubic-bezier(0.2, 0.8, 0.25, 1.15);
}

.result-material.is-visible {
  opacity: 1;
  transform: translate(calc(-50% + var(--result-shift)), 0) scale(1);
}

.result-material.is-consumed {
  opacity: 0;
  transform: translate(calc(-50% + var(--result-shift)), -18%) scale(0.72);
  transition: opacity 170ms ease-out, transform 210ms ease-in;
}

.result-material img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-material span {
  position: absolute;
  top: 1%;
  right: -2%;
  min-width: 1.35em;
  padding: 0.06em 0.22em 0.1em;
  border: 0.16em solid rgba(255, 252, 238, 0.94);
  border-radius: 999px;
  color: #fffdf0;
  font-size: 5.1cqw;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 0.12em 0.12em rgba(42, 18, 4, 0.92);
  background: rgba(72, 35, 12, 0.88);
  box-shadow: 0 0.12em 0.28em rgba(0, 0, 0, 0.42);
}

.material-cube.is-result-single-dismiss {
  opacity: 0;
  transition: opacity 420ms ease;
}

.material-cube.is-result-counted-away {
  z-index: 10;
  opacity: 0;
  transform: translateY(-108%) scale(0.82);
  transition: opacity 360ms ease, transform 420ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

.difficulty-select {
  position: absolute;
  z-index: 8;
  bottom: 5%;
  left: 50%;
  display: grid;
  width: 88%;
  gap: 1.8cqw;
  transform: translateX(-50%);
}

.difficulty-select[hidden] {
  display: none;
}

.difficulty-button {
  display: grid;
  grid-template-columns: 31% 1fr;
  align-items: center;
  min-height: 13cqw;
  padding: 0.9cqw 1.8cqw;
  border: 0.55cqw solid #633515;
  border-radius: 1.5cqw;
  color: #3b1d0d;
  font: inherit;
  background:
    radial-gradient(circle at 3.5% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    radial-gradient(circle at 96.5% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    repeating-linear-gradient(2deg, rgba(87, 44, 14, 0.08) 0 0.3cqw, transparent 0.35cqw 1.1cqw),
    linear-gradient(#e8bd78, #c98742);
  box-shadow:
    0 0.3cqw 0 #48230d,
    0 1.2cqw 2.4cqw rgba(22, 8, 2, 0.42),
    inset 0 0.3cqw rgba(255, 235, 188, 0.58),
    inset 0 -0.35cqw rgba(86, 39, 13, 0.24);
  cursor: pointer;
}

.difficulty-button:active {
  box-shadow:
    0 0.1cqw 0 #48230d,
    0 0.55cqw 1.2cqw rgba(22, 8, 2, 0.38),
    inset 0 0.2cqw rgba(255, 235, 188, 0.42);
  transform: translateY(0.45cqw);
}

.difficulty-button:focus-visible {
  outline: 3px solid #fff4be;
  outline-offset: 3px;
}

.difficulty-name {
  font-size: 4.1cqw;
  font-weight: 700;
  white-space: nowrap;
  text-shadow:
    0 -0.15cqw rgba(43, 17, 5, 0.72),
    0 0.15cqw rgba(255, 220, 158, 0.52);
}

.tasting-choice {
  position: absolute;
  z-index: 12;
  bottom: 7%;
  left: 50%;
  display: flex;
  width: 76%;
  gap: 3cqw;
  transform: translateX(-50%);
}

.tasting-choice[hidden] {
  display: none;
}

.tasting-choice-button {
  flex: 1;
  min-height: 13cqw;
  padding: 1.1cqw 2cqw;
  border: 0.55cqw solid #633515;
  border-radius: 1.5cqw;
  color: #3b1d0d;
  font: inherit;
  font-size: 4.6cqw;
  font-weight: 700;
  background:
    radial-gradient(circle at 8% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    radial-gradient(circle at 92% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    repeating-linear-gradient(2deg, rgba(87, 44, 14, 0.08) 0 0.3cqw, transparent 0.35cqw 1.1cqw),
    linear-gradient(#e8bd78, #c98742);
  box-shadow:
    0 0.3cqw 0 #48230d,
    0 1.2cqw 2.4cqw rgba(22, 8, 2, 0.45),
    inset 0 0.3cqw rgba(255, 235, 188, 0.58),
    inset 0 -0.35cqw rgba(86, 39, 13, 0.24);
  cursor: pointer;
}

.tasting-choice-button:active,
.tasting-choice-button.is-selected {
  box-shadow:
    0 0.1cqw 0 #48230d,
    0 0.55cqw 1.2cqw rgba(22, 8, 2, 0.4),
    inset 0 0.2cqw rgba(255, 235, 188, 0.42);
  transform: translateY(0.4cqw);
}

.tasting-choice-button:focus-visible {
  outline: 3px solid #fff1b8;
  outline-offset: 4px;
}

.difficulty-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.difficulty-icons img {
  display: block;
  width: 9.2cqw;
  height: 9.2cqw;
  margin-left: -1.2cqw;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(55, 25, 7, 0.35));
}

.difficulty-icons img:first-child {
  margin-left: 0;
}

.material-cube {
  position: absolute;
  width: calc(100% / 6);
  height: calc(100% / 6);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
  transition:
    top 360ms cubic-bezier(0.2, 0.72, 0.24, 1),
    left 420ms cubic-bezier(0.2, 0.72, 0.24, 1);
}

.material-cube.is-gravity-moving {
  /* Position is committed immediately; visual travel uses a compositor-friendly
     transform animation created by JavaScript. */
  transition: left 420ms cubic-bezier(0.2, 0.72, 0.24, 1);
  will-change: transform;
}

.material-cube.is-playable {
  cursor: pointer;
}

.material-cube.is-playable .cube-back,
.material-cube.is-playable .cube-front {
  border-color: rgba(255, 255, 255, 0.76);
  filter: brightness(1.04);
}

.material-cube.is-isolated:not(.is-empty) .cube-back {
  border-color: rgba(67, 60, 56, 0.58);
  background: rgba(50, 45, 42, 0.52);
}

.material-cube.is-isolated:not(.is-empty) .cube-front {
  border-color: rgba(67, 60, 56, 0.62);
  background-color: transparent;
}

.material-cube.is-isolated:not(.is-empty) .glass-edge {
  opacity: 0.68;
  filter: brightness(0.32) saturate(0.55);
}

.material-board.is-tasting-locked .material-cube {
  cursor: default;
}

.material-board.is-tasting-locked .material-cube:not(.is-empty) .cube-back {
  border-color: rgba(69, 63, 59, 0.56);
  background: rgba(54, 49, 46, 0.5);
}

.material-board.is-tasting-locked .material-cube:not(.is-empty) .cube-front {
  border-color: rgba(72, 66, 62, 0.58);
  background-color: transparent;
}

.material-board.is-tasting-locked .material-cube:not(.is-empty) .glass-edge {
  opacity: 0.66;
  filter: brightness(0.34) saturate(0.58);
}

.material-board.is-tasting-pick-mode .material-cube.is-tasting-removable {
  cursor: pointer;
}

.material-board.is-tasting-locked.is-tasting-pick-mode
  .material-cube.is-tasting-removable:not(.is-empty) .cube-back {
  border-color: rgba(255, 255, 255, 0.76);
  background: rgba(241, 235, 224, 0.62);
  filter: brightness(1.04);
}

.material-board.is-tasting-locked.is-tasting-pick-mode
  .material-cube.is-tasting-removable:not(.is-empty) .cube-front {
  border-color: rgba(255, 255, 255, 0.76);
  background-color: transparent;
  filter: brightness(1.04);
}

.material-board.is-tasting-locked.is-tasting-pick-mode
  .material-cube.is-tasting-removable:not(.is-empty) .glass-edge {
  opacity: 1;
  filter: none;
}

.cube-back,
.cube-front,
.cube-material,
.glass-edge,
.cube-count,
.cube-selection {
  position: absolute;
  display: block;
  pointer-events: none;
}

.cube-count {
  z-index: 6;
  right: 8%;
  bottom: 5%;
  min-width: 1.35em;
  min-height: 1.35em;
  padding: 0.08em 0.22em 0.12em;
  border-radius: 999px;
  color: #fff;
  font-family: "Kaisei Decol", sans-serif;
  font-size: clamp(0.68rem, 3.5vw, 1.1rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: none;
  background: rgba(80, 45, 22, 0.84);
  box-shadow: none;
}

.cube-count:empty {
  display: none;
}

.cube-selection {
  display: none;
  z-index: 7;
  inset: 2%;
  border: clamp(2px, 0.72vw, 3px) solid #fff;
  border-radius: 13%;
  opacity: 0;
  background: transparent;
  box-shadow: none;
  transition:
    inset 240ms ease,
    border-width 220ms ease,
    opacity 180ms ease,
    border-color 220ms ease,
    border-radius 240ms ease;
}

.material-cube.is-selected .cube-selection {
  inset: 0;
  opacity: 1;
  box-shadow: none;
}

.material-cube.is-selected .cube-back,
.material-cube.is-selected .cube-front {
  inset: 0;
  border-color: #fff;
  border-radius: 11%;
  box-shadow: none;
}

.material-cube.is-selected.connect-top .cube-back,
.material-cube.is-selected.connect-top .cube-front {
  top: -1px;
  border-top-width: 0;
  border-top-color: transparent;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.material-cube.is-selected.connect-right .cube-back,
.material-cube.is-selected.connect-right .cube-front {
  right: -1px;
  border-right-width: 0;
  border-right-color: transparent;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.material-cube.is-selected.connect-bottom .cube-back,
.material-cube.is-selected.connect-bottom .cube-front {
  bottom: -1px;
  border-bottom-width: 0;
  border-bottom-color: transparent;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.material-cube.is-selected.connect-left .cube-back,
.material-cube.is-selected.connect-left .cube-front {
  left: -1px;
  border-left-width: 0;
  border-left-color: transparent;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.material-cube.is-target .cube-selection {
  background: transparent;
  box-shadow: none;
}

.material-cube.connect-top .cube-selection {
  border-top-width: 0;
  border-top-color: transparent;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.material-cube.connect-right .cube-selection {
  border-right-width: 0;
  border-right-color: transparent;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.material-cube.connect-bottom .cube-selection {
  border-bottom-width: 0;
  border-bottom-color: transparent;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.material-cube.connect-left .cube-selection {
  border-left-width: 0;
  border-left-color: transparent;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.material-cube.is-selected.connect-top .cube-selection {
  top: -1px;
}

.material-cube.is-selected.connect-right .cube-selection {
  right: -1px;
}

.material-cube.is-selected.connect-bottom .cube-selection {
  bottom: -1px;
}

.material-cube.is-selected.connect-left .cube-selection {
  left: -1px;
}

.cube-back {
  z-index: 1;
  inset: 4%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16%;
  background: rgba(241, 235, 224, 0.62);
  box-shadow:
    inset 0 0 9px rgba(71, 48, 32, 0.35),
    inset 2px 2px 4px rgba(255, 255, 255, 0.48),
    inset -2px -2px 4px rgba(68, 45, 30, 0.28);
  transition:
    inset 240ms ease,
    background-color 260ms ease,
    border-width 220ms ease,
    border-color 220ms ease,
    border-radius 240ms ease,
    box-shadow 220ms ease;
}

.cube-material {
  z-index: 2;
  inset: 13%;
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: none;
  transition: opacity 120ms ease, transform 150ms ease;
}

.material-cube.is-empty .cube-material {
  opacity: 0;
  transform: scale(0.68);
}

.material-cube.is-selected .cube-material {
  animation: selected-material-wiggle 460ms ease-in-out var(--wiggle-delay) infinite alternate;
  transform-origin: 50% 72%;
}

@keyframes selected-material-wiggle {
  from {
    transform: translateY(1.5%) rotate(-1.2deg) scale(1.01);
  }

  to {
    transform: translateY(-1.5%) rotate(1.2deg) scale(1.025);
  }
}

.cube-front {
  z-index: 3;
  inset: 4%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 16%;
  background:
    radial-gradient(circle at 24% 18%, rgba(255, 255, 255, 0.38), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 44%);
  box-shadow:
    inset 1px 1px 2px rgba(255, 255, 255, 0.72),
    inset -1px -1px 2px rgba(71, 49, 33, 0.25);
  transition:
    inset 240ms ease,
    background-color 260ms ease,
    border-width 220ms ease,
    border-color 220ms ease,
    border-radius 240ms ease,
    box-shadow 220ms ease;
}

.glass-edge {
  z-index: 4;
  opacity: 1;
  transition: opacity 190ms ease, transform 220ms ease, filter 260ms ease;
}

.material-cube.is-selected .glass-edge {
  will-change: opacity, transform;
}

.edge-top,
.edge-bottom {
  left: 3%;
  width: 94%;
  height: 10%;
  clip-path: polygon(6% 0, 94% 0, 100% 100%, 0 100%);
}

.edge-top {
  top: 1%;
  border-radius: 38% 38% 15% 15%;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.7) 35%,
    rgba(151, 139, 126, 0.35) 72%,
    rgba(255, 255, 255, 0.62)
  );
  transform-origin: center top;
}

.edge-bottom {
  bottom: 1%;
  border-radius: 15% 15% 38% 38%;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.9),
    rgba(176, 165, 151, 0.48) 42%,
    rgba(86, 63, 45, 0.28) 74%,
    rgba(255, 255, 255, 0.56)
  );
  transform-origin: center bottom;
}

.edge-left,
.edge-right {
  top: 3%;
  width: 10%;
  height: 94%;
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 94%);
}

.edge-left {
  left: 1%;
  border-radius: 38% 15% 15% 38%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95),
    rgba(255, 255, 255, 0.68) 38%,
    rgba(119, 101, 85, 0.34) 72%,
    rgba(255, 255, 255, 0.56)
  );
  transform-origin: left center;
}

.edge-right {
  right: 1%;
  border-radius: 15% 38% 38% 15%;
  background: linear-gradient(
    to left,
    rgba(255, 255, 255, 0.88),
    rgba(193, 184, 172, 0.58) 40%,
    rgba(79, 56, 40, 0.3) 74%,
    rgba(255, 255, 255, 0.48)
  );
  transform-origin: right center;
}

.material-cube.is-selected.connect-top .edge-top {
  opacity: 0;
  transform: scaleY(0.05);
}

.material-cube.is-selected.connect-right .edge-right {
  opacity: 0;
  transform: scaleX(0.05);
}

.material-cube.is-selected.connect-bottom .edge-bottom {
  opacity: 0;
  transform: scaleY(0.05);
}

.material-cube.is-selected.connect-left .edge-left {
  opacity: 0;
  transform: scaleX(0.05);
}

.material-cube.is-selected.connect-left .edge-top,
.material-cube.is-selected.connect-right .edge-top,
.material-cube.is-selected.connect-left .edge-bottom,
.material-cube.is-selected.connect-right .edge-bottom {
  border-radius: 0;
}

.material-cube:focus-visible {
  z-index: 6;
  outline: 3px solid #fff;
  outline-offset: -3px;
}

.material-cube:active .cube-front {
  transform: translateY(1px) scale(0.98);
}

.material-cube.is-initial-dropping {
  animation: initial-cube-drop var(--drop-duration) cubic-bezier(0.2, 0.72, 0.24, 1) var(--drop-delay) both;
}

.material-cube.is-refill-dropping {
  animation: initial-cube-drop var(--drop-duration) cubic-bezier(0.2, 0.72, 0.24, 1) var(--drop-delay) both;
}

.material-cube:is(.is-initial-dropping, .is-refill-dropping) .cube-back {
  border-color: rgba(67, 60, 56, 0.58);
  background: rgba(50, 45, 42, 0.52);
}

.material-cube:is(.is-initial-dropping, .is-refill-dropping) .cube-front {
  border-color: rgba(67, 60, 56, 0.62);
  background-color: transparent;
}

.material-cube:is(.is-initial-dropping, .is-refill-dropping) .glass-edge {
  opacity: 0.68;
  filter: brightness(0.32) saturate(0.55);
}

.material-cube.is-being-removed {
  z-index: 9;
  pointer-events: none;
  animation: empty-cube-drop-away 540ms cubic-bezier(0.42, 0, 0.88, 0.48) forwards;
  will-change: transform, opacity;
}

@keyframes empty-cube-drop-away {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }

  15% {
    opacity: 1;
    transform: translateY(-13%) rotate(var(--drop-lift-tilt));
  }

  76% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate(var(--drop-drift-x), 700%)
      rotate(var(--drop-final-tilt));
  }
}

.moving-material {
  position: absolute;
  z-index: 8;
  display: block;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: none;
  will-change: transform, opacity;
}

/* Lightweight cube-state rendering on every device. White/black state changes
   must not interpolate filters or multi-layer shadows across the whole board. */
.material-cube .cube-back,
.material-cube .cube-front {
  filter: none !important;
  box-shadow: none !important;
  transition: none !important;
}

.material-cube .cube-selection {
  transition: none !important;
}

.material-cube .glass-edge {
  filter: none !important;
  transition: none !important;
}

.material-cube.is-selected .cube-material {
  animation: none;
}

.material-board.is-board-animating .moving-material,
.material-board.is-board-animating .cube-material {
  filter: none;
}

.material-board.is-board-animating .cube-back,
.material-board.is-board-animating .cube-front {
  box-shadow: none;
}

.tasting-gift-material {
  position: absolute;
  z-index: 14;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(30, 13, 5, 0.55));
  will-change: transform, opacity;
}

@keyframes initial-cube-drop {
  0% {
    opacity: 0;
    transform: translateY(var(--spawn-y));
  }

  8% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.event-back {
  z-index: 9;
  pointer-events: none;
}

.event-dimmer {
  position: absolute;
  z-index: 8;
  inset: 0;
  background: rgba(5, 3, 2, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease;
}

.event-dimmer.is-visible {
  opacity: 1;
}

.event-dimmer[hidden] {
  display: none;
}

.event-back.is-foreground-cover {
  z-index: 11;
}

.event-back.is-opening-sign {
  /* The opening still is a true poster behind the video. The video remains
     transparent until its first presented frame, then covers this still. */
  z-index: 9;
  opacity: 0;
  transition: opacity 650ms ease;
}

.event-back.is-opening-sign.is-visible {
  opacity: 1;
}

.event-back.is-opening-sign.is-video-handoff {
  opacity: 0;
  transition: opacity 180ms linear;
}

.event-back.is-tasting-crossfade {
  opacity: 0;
  transition: opacity 850ms ease-in-out;
}

.event-back.is-tasting-crossfade.is-tasting-crossfade-visible {
  opacity: 1;
}

.event-video.is-tasting-crossfade-out {
  opacity: 0;
  transition: opacity 850ms ease-in-out;
}

.event-video {
  z-index: 10;
  pointer-events: none;
}

.event-video.is-awaiting-first-frame {
  opacity: 0;
}

.event-video.is-opening-fade-out {
  opacity: 0;
  transition: opacity 700ms ease;
}

.event-back.is-fading,
.event-video.is-fading {
  opacity: 0;
  transition: opacity 1s linear;
}

.event-video[hidden] {
  display: none;
}

.dialogue {
  --dialogue-background: #fff8e1;
  position: absolute;
  z-index: 20;
  top: 1.8%;
  left: 50%;
  width: max-content;
  max-width: 62%;
  padding: 0.62em 0.88em 0.68em;
  border: 0.55cqw solid rgba(83, 45, 21, 0.9);
  border-radius: 4.4cqw;
  color: #3c2415;
  font-size: 3.65cqw;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.025em;
  background: var(--dialogue-background);
  box-shadow: 0 0.45rem 1.2rem rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
}

.dialogue[hidden] {
  display: none;
}

.dialogue::after {
  position: absolute;
  right: 10%;
  bottom: -2.6cqw;
  width: 4.4cqw;
  height: 4.4cqw;
  border-right: 0.55cqw solid rgba(83, 45, 21, 0.9);
  border-bottom: 0.55cqw solid rgba(83, 45, 21, 0.9);
  background: var(--dialogue-background);
  content: "";
  transform: rotate(45deg);
}

.dialogue.is-speaker-fen::after {
  right: 10%;
  left: auto;
}

.dialogue.is-speaker-customer::after {
  right: auto;
  left: 10%;
}

.dialogue.is-fen-offscreen-right::after {
  right: -4.6cqw;
  bottom: -1px;
  left: auto;
  width: 9.2cqw;
  height: 4.6cqw;
  box-sizing: border-box;
  border: 0;
  border-bottom: 0.55cqw solid rgba(83, 45, 21, 0.9);
  background: var(--dialogue-background);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  filter: none;
  transform: none;
}

.dialogue.is-fen-offscreen-right::before {
  position: absolute;
  z-index: 1;
  left: 100%;
  bottom: calc(4.6cqw - 1px);
  width: 6.5cqw;
  height: 0.55cqw;
  border-radius: 999px;
  background: rgba(83, 45, 21, 0.9);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.dialogue.is-arrow-traveling::after {
  animation: dialogue-arrow-travel 2s ease-in-out forwards;
}

.dialogue.is-customer-arrow-exiting::after {
  right: auto;
  animation: customer-dialogue-arrow-exit 2.6s ease-in-out forwards;
}

@keyframes dialogue-arrow-travel {
  from {
    right: 10%;
  }

  to {
    right: calc(100% - 2.4rem);
  }
}

@keyframes customer-dialogue-arrow-exit {
  from {
    left: 10%;
  }

  to {
    left: 84%;
  }
}

.dialogue-reserve,
.dialogue-text {
  margin: 0;
}

.dialogue-reserve {
  visibility: hidden;
}

.dialogue-text {
  position: absolute;
  inset: 0.62em 0.88em 0.68em;
}

.dialogue-character {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.08em);
  transition: opacity 130ms ease-out, transform 160ms ease-out;
}

.dialogue-character.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.start-button {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 8%;
  min-width: 38cqw;
  padding: 0.8em 1.4em;
  border: 0.55cqw solid #633515;
  border-radius: 1.5cqw;
  color: #3b1d0d;
  font: inherit;
  font-size: 4.7cqw;
  letter-spacing: 0.08em;
  text-shadow:
    0 -0.15cqw rgba(43, 17, 5, 0.72),
    0 0.15cqw rgba(255, 220, 158, 0.52);
  background:
    radial-gradient(circle at 7% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    radial-gradient(circle at 93% 50%, #4a260f 0 0.46cqw, #a76b31 0.5cqw 0.72cqw, transparent 0.76cqw),
    repeating-linear-gradient(2deg, rgba(87, 44, 14, 0.08) 0 0.3cqw, transparent 0.35cqw 1.1cqw),
    linear-gradient(#e8bd78, #c98742);
  box-shadow:
    0 0.3cqw 0 #48230d,
    0 1.2cqw 2.4cqw rgba(22, 8, 2, 0.45),
    inset 0 0.3cqw rgba(255, 235, 188, 0.58),
    inset 0 -0.35cqw rgba(86, 39, 13, 0.24);
  transform: translateX(-50%);
  cursor: pointer;
}

.title-logo {
  position: absolute;
  z-index: 11;
  top: 3.2cqw;
  left: 50%;
  width: 90%;
  height: auto;
  pointer-events: none;
  transform: translateX(-50%);
  transform-origin: center top;
  filter: drop-shadow(0 1.2cqw 1.5cqw rgba(15, 5, 0, 0.46));
  animation: title-logo-enter 900ms cubic-bezier(0.18, 0.78, 0.25, 1) both;
}

.title-logo[hidden] {
  display: none;
}

.title-logo.is-leaving {
  animation: title-logo-leave 520ms ease-in both;
}

@keyframes title-logo-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -6cqw) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes title-logo-leave {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -2.5cqw) scale(0.985);
  }
}

.start-button:active {
  box-shadow:
    0 0.1cqw 0 #48230d,
    0 0.55cqw 1.2cqw rgba(22, 8, 2, 0.4),
    inset 0 0.2cqw rgba(255, 235, 188, 0.42);
  transform: translate(-50%, 0.45cqw);
}

.start-button:focus-visible {
  outline: 3px solid #fff1b8;
  outline-offset: 4px;
}

.load-status {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: 7.5%;
  display: grid;
  min-width: 42cqw;
  padding: 2.2cqw 5cqw 2.4cqw;
  border: 0.38cqw solid rgba(91, 46, 16, 0.92);
  border-radius: 1.5cqw;
  color: #44220f;
  text-align: center;
  background:
    repeating-linear-gradient(2deg, rgba(87, 44, 14, 0.07) 0 0.3cqw, transparent 0.35cqw 1.1cqw),
    linear-gradient(#efd096, #c98b4a);
  box-shadow:
    0 0.28cqw 0 #48230d,
    0 0.9cqw 2cqw rgba(22, 8, 2, 0.34),
    inset 0 0.25cqw rgba(255, 240, 202, 0.65);
  transform: translateX(-50%);
  animation: load-status-breathe 1.8s ease-in-out infinite;
}

.load-status-title {
  font-family: "Kaisei Decol", serif;
  font-size: 4.5cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.load-status-detail {
  margin-top: 0.7cqw;
  color: rgba(68, 34, 15, 0.78);
  font-size: 2.45cqw;
  letter-spacing: 0.08em;
}

.load-status-track {
  display: flex;
  justify-content: center;
  gap: 1.25cqw;
  height: 2.8cqw;
  margin-top: 1.25cqw;
}

.load-status-track i {
  width: 2.15cqw;
  height: 2.15cqw;
  border-radius: 48% 48% 55% 55%;
  background: #75401e;
  opacity: 0.2;
  transform: translateY(0.45cqw) rotate(-8deg) scale(0.72);
  animation: load-paw-step 1.25s ease-in-out infinite;
}

.load-status-track i:nth-child(2) { animation-delay: 0.13s; }
.load-status-track i:nth-child(3) { animation-delay: 0.26s; }
.load-status-track i:nth-child(4) { animation-delay: 0.39s; }
.load-status-track i:nth-child(5) { animation-delay: 0.52s; }

@keyframes load-paw-step {
  0%, 62%, 100% { opacity: 0.2; transform: translateY(0.45cqw) rotate(-8deg) scale(0.72); }
  28% { opacity: 0.92; transform: translateY(0) rotate(8deg) scale(1); }
}

@keyframes load-status-breathe {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-0.3cqw); }
}

.load-status[hidden] {
  display: none;
}

body.is-app-suspended *,
body.is-app-suspended *::before,
body.is-app-suspended *::after {
  animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
  .business-hours:not([hidden]) {
    animation: none;
  }

  .start-button {
    transition: none;
  }

  .title-logo,
  .title-logo.is-leaving {
    animation-duration: 1ms;
  }

  .load-status,
  .load-status-track i {
    animation: none;
  }

  .dialogue-character {
    transition: none;
  }

  .dialogue.is-arrow-traveling::after {
    animation-duration: 1ms;
  }

  .material-cube.is-initial-dropping {
    animation-duration: 1ms;
  }

  .material-cube.is-refill-dropping {
    animation-duration: 1ms;
  }

  .material-cube.is-selected .cube-material {
    animation: none;
  }
}
/* Settings ----------------------------------------------------------- */
.settings-button {
  position: absolute;
  z-index: 120;
  top: 1.8cqw;
  right: 1.8cqw;
  width: 10cqw;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 0.7cqw 0.65cqw rgba(30, 13, 4, 0.42));
  transition: transform 160ms ease, filter 160ms ease;
}

.settings-button:hover,
.settings-button:focus-visible {
  transform: scale(1.07) rotate(8deg);
  filter: drop-shadow(0 0.8cqw 0.8cqw rgba(30, 13, 4, 0.55)) brightness(1.05);
}

.settings-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.settings-overlay {
  position: absolute;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 4cqw 5cqw;
  background: rgba(8, 5, 3, 0.72);
  backdrop-filter: blur(0.45cqw);
  animation: settings-dim-in 180ms ease-out both;
}

.settings-overlay[hidden] { display: none; }

.settings-panel {
  width: min(76cqw, 720px);
  max-height: 94%;
  overflow: auto;
  padding: 5.4cqw 6cqw 4.8cqw;
  border: 0.65cqw solid #5a2d13;
  border-radius: 3.2cqw;
  color: #3e210f;
  background:
    linear-gradient(90deg, rgba(112, 57, 20, 0.11) 1px, transparent 1px) 0 0 / 7cqw 100%,
    linear-gradient(180deg, #edc982, #d9a85f 48%, #c98d45);
  box-shadow:
    inset 0 0 0 0.35cqw rgba(255, 236, 179, 0.72),
    inset 0 -1.2cqw 2.2cqw rgba(91, 40, 12, 0.2),
    0 2cqw 5cqw rgba(0, 0, 0, 0.55);
  animation: settings-panel-in 240ms cubic-bezier(.2,.8,.25,1.08) both;
}

.settings-panel h2 {
  margin: 0 0 3.6cqw;
  text-align: center;
  font-size: 6.2cqw;
  letter-spacing: 0.12em;
  color: #4b260f;
  text-shadow: 0 0.2cqw rgba(255, 232, 171, 0.8), 0 -0.18cqw rgba(68, 27, 7, 0.28);
}

.settings-volume-list { display: grid; gap: 2.8cqw; }

.settings-range-row {
  display: grid;
  grid-template-columns: 12cqw 1fr 8cqw;
  align-items: center;
  gap: 2.3cqw;
  font-size: 3.75cqw;
  font-weight: 800;
}

.settings-range-row input {
  width: 100%;
  height: 5cqw;
  accent-color: #7a3c18;
  cursor: pointer;
}

.settings-range-row input::-webkit-slider-runnable-track {
  height: 1.15cqw;
  border-radius: 1cqw;
}

.settings-range-row input::-webkit-slider-thumb {
  width: 4cqw;
  height: 4cqw;
  margin-top: -1.42cqw;
}

.settings-range-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.settings-toggle-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2.5cqw;
  margin-top: 4.3cqw;
  padding: 3.1cqw;
  border: 0.3cqw solid rgba(91, 44, 17, 0.48);
  border-radius: 1.8cqw;
  background: rgba(255, 236, 188, 0.38);
  cursor: pointer;
}

.settings-toggle-row strong { display: block; font-size: 3.85cqw; }
.settings-toggle-row small { display: block; margin-top: 0.7cqw; font-size: 2.45cqw; line-height: 1.4; font-weight: 650; }
.settings-toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.settings-toggle-row i {
  position: relative;
  width: 10.5cqw;
  height: 5.6cqw;
  border: 0.3cqw solid #613014;
  border-radius: 5cqw;
  background: #775d49;
  box-shadow: inset 0 0.5cqw 0.9cqw rgba(36, 15, 5, 0.35);
}
.settings-toggle-row i::after {
  content: "";
  position: absolute;
  top: 0.48cqw;
  left: 0.58cqw;
  width: 4cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f7deb0;
  box-shadow: 0 0.25cqw 0.45cqw rgba(40, 18, 5, 0.4);
  transition: transform 180ms ease;
}
.settings-toggle-row input:checked + i { background: #9b5c24; }
.settings-toggle-row input:checked + i::after { transform: translateX(4.95cqw); }

.settings-credits {
  margin-top: 3.5cqw;
  padding-top: 2.5cqw;
  border-top: 0.25cqw solid rgba(84, 39, 13, 0.45);
}
.settings-credits h3 { margin: 0 0 1.7cqw; text-align: center; font-size: 3.25cqw; }
.settings-credits dl { margin: 0; font-size: 2.5cqw; line-height: 1.6; }
.settings-credits dl div { display: grid; grid-template-columns: 11cqw 1fr; gap: 1.8cqw; }
.settings-credits dt { font-weight: 900; }
.settings-credits dd { margin: 0; }

.settings-close {
  display: block;
  min-width: 31cqw;
  margin: 3.5cqw auto 0;
  padding: 2.2cqw 5.5cqw;
  border: 0.45cqw solid #4f260e;
  border-radius: 1.4cqw;
  color: #3d1d0c;
  background: linear-gradient(#e8bb6d, #b87532);
  box-shadow: inset 0 0.35cqw rgba(255, 229, 166, 0.72), 0 0.7cqw 0 #6b3517;
  font: inherit;
  font-size: 4cqw;
  font-weight: 900;
  cursor: pointer;
}
.settings-close:active { transform: translateY(0.45cqw); box-shadow: inset 0 0.25cqw rgba(255,229,166,.6), 0 0.25cqw 0 #6b3517; }

@keyframes settings-dim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes settings-panel-in { from { opacity: 0; transform: translateY(-3cqw) scale(.96); } to { opacity: 1; transform: none; } }
