:root {
  color-scheme: dark;
  --bg: #211714;
  --panel: #2c211d;
  --panel-2: #392820;
  --counter: #75513a;
  --paper: #fff0d2;
  --ink: #fff4e4;
  --muted: #d1bda0;
  --line: rgba(255, 244, 228, 0.14);
  --red: #d84231;
  --green: #5ec978;
  --gold: #f4ba4d;
  --blue: #5fa8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Tahoma, Arial, sans-serif;
  background:
    linear-gradient(rgba(33, 23, 20, 0.86), rgba(33, 23, 20, 0.96)),
    repeating-linear-gradient(90deg, #2a1e1a 0 32px, #241916 32px 64px);
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 11px 14px;
  background: var(--red);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app {
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hud {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.brand p {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
}

h2 {
  margin-bottom: 10px;
  font-size: 1.04rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 9px;
  width: min(560px, 100%);
}

.stats div,
.customer-zone,
.make-line,
.receipt-panel,
.toast {
  border: 1px solid var(--line);
  background: rgba(44, 33, 29, 0.94);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.stats div {
  padding: 11px;
  border-radius: 8px;
  box-shadow: none;
}

.stats span,
.receipt small,
.toast,
.customer-card p {
  color: var(--muted);
}

.stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.shop {
  display: grid;
  grid-template-columns: 300px minmax(540px, 1fr) 330px;
  gap: 16px;
  align-items: start;
}

.customer-zone,
.make-line,
.receipt-panel {
  min-height: 650px;
  overflow: hidden;
}

.customer-zone {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 209, 108, 0.08), transparent 36%),
    rgba(44, 33, 29, 0.94);
}

.speech {
  min-height: 148px;
  margin-bottom: 12px;
  padding: 15px;
  border-radius: 12px 12px 12px 4px;
  background: var(--paper);
  color: #3d281d;
  line-height: 1.55;
  font-weight: 800;
  position: relative;
}

.speech::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 28px;
  border: 12px solid transparent;
  border-top-color: var(--paper);
}

.timer,
.bake-meter {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.timer div,
.bake-meter div {
  height: 100%;
  width: 100%;
  background: var(--green);
}

.customer-card {
  display: grid;
  place-items: center;
  gap: 14px;
  margin: 28px 0 16px;
  text-align: center;
}

.customer-face {
  position: relative;
  width: 150px;
  height: 180px;
  border-radius: 48% 48% 42% 42%;
  background: linear-gradient(180deg, #d69b6e, #b56f48);
  border: 4px solid rgba(49, 27, 18, 0.28);
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.28));
}

.customer-face .hair {
  position: absolute;
  inset: -10px 10px auto;
  height: 48px;
  border-radius: 40px 40px 18px 18px;
  background: #3d271f;
}

.eye {
  position: absolute;
  top: 78px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #20120d;
}

.eye.left {
  left: 48px;
}

.eye.right {
  right: 48px;
}

.mouth {
  position: absolute;
  left: 58px;
  bottom: 48px;
  width: 34px;
  height: 14px;
  border-bottom: 4px solid #5d2c21;
  border-radius: 0 0 999px 999px;
}

.customer-face.angry .mouth {
  border-bottom: 0;
  border-top: 4px solid #5d2c21;
  bottom: 40px;
}

#nextCustomerButton {
  width: 100%;
}

.make-line {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%),
    rgba(44, 33, 29, 0.94);
}

.station-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.station-tabs button {
  border-radius: 0;
  background: #34241f;
  color: var(--muted);
}

.station-tabs button.active {
  background: var(--gold);
  color: #28180d;
}

.worktop {
  min-height: 410px;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 44%, rgba(244, 186, 77, 0.1), transparent 34%),
    linear-gradient(180deg, #8a6042, #5e3d2c);
}

.pizza-board,
.oven-view {
  width: min(430px, 94%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pizza-board {
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    #9c7353;
  background-size: 44px 44px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.08);
}

.pizza {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 36%, #f7d483, #d99b45 68%, #a96d2c 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.sauce-layer,
.cheese-layer,
.topping-layer,
.cut-layer {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  pointer-events: none;
}

.sauce-layer.on {
  background: radial-gradient(circle, rgba(207, 52, 38, 0.88), rgba(150, 28, 22, 0.88));
}

.cheese-layer.on {
  inset: 28px;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 238, 165, 0.95) 0 13px, transparent 14px),
    radial-gradient(circle at 65% 28%, rgba(255, 238, 165, 0.95) 0 15px, transparent 16px),
    radial-gradient(circle at 42% 64%, rgba(255, 238, 165, 0.95) 0 18px, transparent 19px),
    radial-gradient(circle at 72% 70%, rgba(255, 238, 165, 0.95) 0 12px, transparent 13px),
    rgba(255, 218, 99, 0.72);
}

.topping {
  position: absolute;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  transform: translate(-50%, -50%);
}

.topping-pepperoni,
.topping-mushroom,
.topping-olive,
.topping-basil {
  width: 34px;
  height: 34px;
  font-size: 1.55rem;
}

.cut-line {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 3px;
  height: 284px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  transform-origin: 50% 50%;
  box-shadow: 0 0 0 1px rgba(72, 42, 22, 0.16);
}

.oven-view {
  display: none;
}

.oven-view.active {
  display: grid;
}

.pizza-board.hidden {
  display: none;
}

.oven-mouth {
  width: 360px;
  height: 250px;
  display: grid;
  place-items: center;
  border: 12px solid #151515;
  border-radius: 120px 120px 22px 22px;
  background: radial-gradient(circle at 50% 70%, #ffc45f, #dd4832 52%, #381610 72%);
  font-size: 6rem;
  animation: heat 0.5s infinite alternate;
}

.bake-meter {
  width: 360px;
  margin-top: 18px;
}

.tools {
  padding: 14px;
  background: #2e211d;
}

.ingredients {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.ingredient {
  min-height: 62px;
  background: #443026;
}

.ingredient span {
  display: block;
  font-size: 1.28rem;
}

.actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.actions button:nth-child(3) {
  background: var(--gold);
  color: #2b1a0f;
}

.actions button:nth-child(4) {
  background: var(--blue);
}

.actions button:nth-child(5) {
  background: var(--green);
  color: #102014;
}

.receipt-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  align-content: start;
  box-shadow: none;
}

.receipt {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.receipt-row,
.shop-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-row:last-child,
.shop-row:last-child {
  border-bottom: 0;
}

.receipt-row.done {
  color: #9ff0b2;
}

.shop-row button {
  background: var(--blue);
}

.toast {
  min-height: 48px;
  margin-top: 14px;
  padding: 13px 16px;
  box-shadow: none;
}

.toast.success {
  color: #9ff0b2;
}

.toast.danger {
  color: #ff9a8d;
}

@keyframes heat {
  from { filter: brightness(1); }
  to { filter: brightness(1.2); }
}

@media (max-width: 1120px) {
  .hud,
  .shop {
    display: grid;
    grid-template-columns: 1fr;
  }

  .customer-zone,
  .make-line,
  .receipt-panel {
    min-height: auto;
  }

  .receipt-panel {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .app {
    padding: 10px;
  }

  .stats,
  .ingredients,
  .actions,
  .receipt-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .pizza {
    width: 250px;
    height: 250px;
  }

  .oven-mouth,
  .bake-meter {
    width: 270px;
  }
}
