:root {
  --ink: #f3ebe2;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: #1a120e;
  color: var(--ink);
  font-family: Georgia, "Palatino Linotype", Palatino, "Times New Roman", serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.zen-volume {
  position: fixed;
  z-index: 3;
  left: 0.85rem;
  bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #f3ebe2;
  filter:
    drop-shadow(0 1px 1px #000)
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}

.zen-sound,
.zen-full {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  cursor: pointer;
}

.zen-sound svg,
.zen-full svg {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zen-sound .icon-speaker {
  fill: currentColor;
  stroke: none;
}

.zen-sound .icon-waves {
  display: none;
}

.zen-sound .icon-mute {
  display: block;
}

.zen-sound.is-on .icon-waves {
  display: block;
}

.zen-sound.is-on .icon-mute {
  display: none;
}

.zen-sound:focus,
.zen-full:focus,
.zen-volume-label input:focus {
  outline: none;
}

.zen-sound:focus-visible,
.zen-full:focus-visible,
.zen-volume-label input:focus-visible {
  outline: 2px solid rgba(243, 235, 226, 0.9);
  outline-offset: 3px;
}

.zen-full .icon-exit {
  display: none;
}

.zen-full.is-on .icon-enter {
  display: none;
}

.zen-full.is-on .icon-exit {
  display: block;
}

.zen-volume:not(.is-on) .zen-sound {
  animation: sound-hint 2.8s ease-in-out infinite;
}

.zen-volume-label {
  display: flex;
  align-items: center;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.zen-volume-label input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 7.6rem;
  height: 1.35rem;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.zen-volume-label input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(243, 235, 226, 0.38);
}

.zen-volume-label input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #f3ebe2;
  box-shadow: 0 0 0 2px rgba(22, 16, 12, 0.55);
}

.zen-volume-label input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(243, 235, 226, 0.38);
}

.zen-volume-label input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #f3ebe2;
  box-shadow: 0 0 0 2px rgba(22, 16, 12, 0.55);
}

@keyframes sound-hint {
  0%,
  100% {
    opacity: 0.58;
  }
  50% {
    opacity: 1;
  }
}

.order-board {
  position: fixed;
  z-index: 2;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.2rem;
  padding: 0.7rem 0.85rem 0.75rem 13.2rem;
  pointer-events: none;
  color: #f3ebe2;
  font-family: Arial, Helvetica, sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
  background: linear-gradient(180deg, rgba(10, 7, 5, 0) 0%, rgba(10, 7, 5, 0.62) 24%, rgba(10, 7, 5, 0.82) 100%);
}

.order-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  font-size: 1.12rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.92;
}

.order-flag {
  flex: none;
  width: 1rem;
  height: 0.68rem;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
  background: #c4a574;
}

.order-flag[data-flag="green"] {
  background: #2ee05a;
}

.order-flag[data-flag="yellow"] {
  background: #e6c43c;
}

.order-flag[data-flag="white"] {
  background: #f6f6f6;
}

.order-flag[data-flag="checkered"] {
  background:
    linear-gradient(45deg, #111 25%, transparent 25%) 0 0 / 6px 6px,
    linear-gradient(-45deg, #111 25%, transparent 25%) 0 3px / 6px 6px,
    linear-gradient(45deg, transparent 75%, #111 75%) 3px -3px / 6px 6px,
    linear-gradient(-45deg, transparent 75%, #111 75%) -3px 0 / 6px 6px,
    #f2f0ea;
}

.order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  min-width: 11.6rem;
  padding: 0.32rem 0.62rem 0.32rem 0.4rem;
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.5);
}

.order-item:first-child {
  background: rgba(255, 210, 80, 0.18);
}

.order-item.is-winner {
  background: rgba(255, 210, 80, 0.32);
}

.order-item.is-second {
  background: rgba(210, 220, 230, 0.16);
}

.order-item.is-third {
  background: rgba(196, 132, 72, 0.2);
}

.order-item.is-charger {
  background: rgba(255, 120, 40, 0.24);
}

.order-pos {
  width: 1.6rem;
  font-size: 1.12rem;
  font-weight: 700;
  opacity: 0.75;
  text-align: right;
}

.order-item:first-child .order-pos,
.order-item.is-winner .order-pos {
  color: #ffd65c;
  opacity: 1;
}

.order-swatch {
  flex: none;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.order-num {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.order-name {
  font-size: 1.12rem;
  white-space: nowrap;
}

.order-time {
  margin-left: 0.25rem;
  font-size: 1.02rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #7ec8ff;
}

.order-time.is-up {
  color: #5dff8a;
}

.order-time.is-down {
  color: #ff8a7a;
}

.order-item.is-charger .order-time {
  color: #ffb347;
}

.order-prep {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 52rem;
  padding: 0.55rem 0.95rem;
  border-radius: 0.85rem;
  font-size: 1.22rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
  background: rgba(28, 64, 110, 0.42);
  box-shadow: inset 0 0 0 1px rgba(150, 190, 230, 0.18);
}

.order-item.order-prep:first-child,
.order-prep {
  background: rgba(28, 64, 110, 0.42);
}

@media (max-width: 860px) {
  .order-board {
    padding: 0.55rem 0.5rem 0.55rem 0.5rem;
    bottom: 3.7rem;
  }

  .order-item {
    min-width: 9.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zen-volume:not(.is-on) .zen-sound {
    animation: none;
  }
}
