:root {
  --bg-top: #fff2c5;
  --bg-bottom: #ecae5e;
  --panel: rgba(255, 248, 230, 0.9);
  --panel-strong: #fff7e4;
  --line: #6f4024;
  --accent: #b84d1a;
  --accent-deep: #7f2f12;
  --olive: #7c8f39;
  --gold: #e0a436;
  --text: #2b1d12;
  --muted: #6a5648;
  --danger: #b33420;
  --danger-soft: #ffd4c6;
  --success: #6e9330;
  --shadow: 0 18px 40px rgba(90, 45, 10, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Gowun Dodum", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.game-shell {
  width: min(1520px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0 18px;
}

.top-banner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 22px;
  border: 4px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 238, 211, 0.95)),
    repeating-linear-gradient(
      -45deg,
      rgba(111, 64, 36, 0.04) 0,
      rgba(111, 64, 36, 0.04) 8px,
      transparent 8px,
      transparent 16px
    );
  box-shadow: var(--shadow);
}

.eyebrow,
h1,
h2,
h3,
.k-label,
.status-pill strong,
.stat-card strong,
.reset-btn,
.service-btn {
  font-family: "Black Han Sans", sans-serif;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-family: "Gaegu", cursive;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--accent-deep);
  text-shadow: 0 3px 0 rgba(255, 248, 228, 0.9);
}

.subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.status-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.status-pill {
  min-width: 180px;
  padding: 11px 14px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.status-pill.danger {
  background: #fff1e7;
}

.status-pill span,
.stat-card span,
.board-header span,
.customer-copy span,
.pot-caption span,
.section-title p,
.mini-stat span,
.boil-header span {
  display: block;
  font-size: 0.92rem;
  color: var(--muted);
}

.status-pill strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
}

.kitchen-layout {
  display: grid;
  grid-template-columns: 310px minmax(420px, 1fr) 280px;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  border: 4px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.customer-zone,
.side-zone {
  padding: 16px;
}

.stove-zone {
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 248, 231, 0.95), rgba(247, 221, 181, 0.97));
}

.section-title {
  margin-bottom: 12px;
}

.section-title h2,
.board-header h3 {
  margin: 0;
  font-size: 1.18rem;
}

.section-title p,
.board-header span {
  margin-top: 4px;
}

.customer-list {
  display: grid;
  gap: 8px;
}

.customer-card,
.stat-card,
.order-board,
.progress-panel,
.active-order-panel,
.rush-panel {
  border: 3px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 252, 243, 0.97);
}

.customer-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  padding: 10px;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.customer-card:hover {
  transform: translateY(-2px);
}

.customer-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 77, 26, 0.14);
}

.customer-card.critical {
  background: linear-gradient(180deg, #fff0ea, #ffe2d7);
}

.customer-card.priority {
  border-color: var(--gold);
}

.portrait-frame,
.chef-frame,
.pot-frame {
  overflow: hidden;
  border: 4px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.9), rgba(255, 227, 187, 0.85));
}

.portrait-frame {
  width: 74px;
  height: 74px;
}

.portrait-frame img,
.chef-frame img,
.pot-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.customer-copy strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.patience-wrap {
  margin-top: 6px;
}

.patience-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.progress-bar {
  margin-top: 6px;
  height: 13px;
  border: 3px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff3db;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #e88a21, #b64915);
  transition: width 0.2s linear;
}

.patience-fill.high {
  background: linear-gradient(90deg, #78a33d, #b8d56f);
}

.patience-fill.mid {
  background: linear-gradient(90deg, #ebb03d, #dd6d1a);
}

.patience-fill.low {
  background: linear-gradient(90deg, #d04c28, #8e2516);
}

.order-board,
.progress-panel,
.active-order-panel,
.rush-panel {
  margin-top: 10px;
  padding: 12px;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
}

.order-facts,
.rush-list,
.check-list {
  margin: 10px 0 0;
  padding-left: 20px;
}

.order-facts li,
.rush-list li,
.check-list li {
  margin: 5px 0;
  font-size: 0.92rem;
}

.stove-backdrop {
  position: relative;
  min-height: 410px;
  padding: 16px;
  border: 4px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 241, 209, 0.88), rgba(208, 126, 67, 0.24)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 42%);
}

.stove-backdrop::before {
  content: "";
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 22px;
  height: 68px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, #7e4729, #492815),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 14px,
      transparent 14px,
      transparent 28px
    );
}

.chef-area {
  position: absolute;
  left: 18px;
  bottom: 82px;
  display: flex;
  align-items: end;
  gap: 14px;
  z-index: 1;
}

.chef-frame {
  width: 112px;
  height: 162px;
}

.chef-bubble {
  max-width: 204px;
  padding: 10px 12px;
  border: 3px solid var(--line);
  border-radius: 20px 20px 20px 6px;
  background: rgba(255, 251, 239, 0.97);
}

.chef-bubble strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.96rem;
}

.pot-stage {
  position: absolute;
  left: 54%;
  top: 53%;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100% - 240px));
  display: grid;
  justify-items: center;
  z-index: 1;
}

.pot-light {
  width: 110px;
  height: 26px;
  margin-bottom: -6px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 130, 36, 0.95), rgba(255, 130, 36, 0));
  filter: blur(2px);
  opacity: 0.55;
}

.pot-frame {
  width: min(100%, 290px);
  aspect-ratio: 1 / 1;
  box-shadow: 0 18px 36px rgba(71, 35, 9, 0.15);
}

.pot-frame.boiling {
  animation: boilPulse 1.1s infinite ease-in-out;
}

.pot-frame.boiling img {
  filter: saturate(1.08) contrast(1.02);
}

@keyframes boilPulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.018);
  }
}

.pot-caption {
  margin-top: 10px;
  text-align: center;
}

.pot-caption strong {
  display: block;
  font-size: 1rem;
}

.boil-panel {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 190px;
  padding: 10px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 249, 238, 0.96);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.boil-panel.active {
  opacity: 1;
  transform: translateY(0);
}

.boil-header strong {
  display: block;
  margin-bottom: 4px;
}

.boil-bar .progress-fill {
  background: linear-gradient(90deg, #f0ca5e, #d14d1f);
}

.active-order-panel {
  margin-top: 12px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.mini-stat {
  padding: 8px;
  border: 2px solid rgba(111, 64, 36, 0.18);
  border-radius: 16px;
  background: #fffaf0;
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

.freshness-box {
  display: none;
  margin-top: 10px;
}

.freshness-box.active {
  display: block;
}

.freshness-fill {
  background: linear-gradient(90deg, #7ea53e, #d14d1f);
}

.ingredient-tray {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ingredient-btn {
  padding: 10px 8px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fff8e9, #ffdca6);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 5px 0 rgba(111, 64, 36, 0.18);
}

.ingredient-btn:hover:not(:disabled) {
  transform: translateY(-3px);
}

.ingredient-btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 4px 0 rgba(111, 64, 36, 0.18);
}

.ingredient-btn.next {
  background: linear-gradient(180deg, #ffe08b, #f5af32);
}

.ingredient-btn.done {
  background: linear-gradient(180deg, #bfd68a, #7c9c41);
  color: #1f1d11;
}

.ingredient-btn.wrong {
  background: linear-gradient(180deg, #ffc9bb, #ef845d);
  animation: wrongShake 0.28s;
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  75% {
    transform: translateX(4px);
  }
}

.ingredient-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.k-label {
  display: block;
  font-size: 0.96rem;
}

.e-label {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
  color: var(--muted);
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 8px;
  margin-top: 10px;
}

.service-btn,
.reset-btn {
  width: 100%;
  padding: 12px 10px;
  border: 3px solid var(--line);
  border-radius: 18px;
  color: #fff8ec;
  cursor: pointer;
}

.service-btn {
  background: linear-gradient(180deg, #7ea53e, #567821);
  font-size: 0.95rem;
}

.service-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.reset-btn {
  margin-top: 10px;
  background: linear-gradient(180deg, #d5652b, #a53d16);
  font-size: 0.95rem;
}

.reset-btn.secondary {
  margin-top: 0;
  background: linear-gradient(180deg, #d7b17e, #b07a3b);
  color: #382517;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stat-card {
  padding: 10px;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.check-list li.done {
  color: var(--olive);
  font-weight: 700;
}

.check-list li.current {
  color: var(--accent);
  font-weight: 700;
}

.rush-panel {
  margin-top: 10px;
}

@media (max-width: 1180px) {
  .kitchen-layout {
    grid-template-columns: 1fr;
  }

  .pot-stage {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: 100%;
    margin: 0 auto;
    padding-top: 18px;
  }

  .chef-area {
    position: relative;
    left: auto;
    bottom: auto;
    margin-bottom: 28px;
  }

  .stove-backdrop {
    min-height: auto;
  }

  .boil-panel {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-top: 18px;
  }
}

@media (max-width: 760px) {
  .game-shell {
    width: min(100% - 18px, 1520px);
    padding-top: 8px;
    padding-bottom: 84px;
  }

  .top-banner {
    flex-direction: column;
    padding: 14px;
    gap: 10px;
  }

  .status-board {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-pill {
    min-width: 0;
    padding: 10px;
  }

  .customer-zone,
  .stove-zone,
  .side-zone {
    padding: 12px;
  }

  .kitchen-layout {
    gap: 12px;
  }

  .stove-zone {
    order: 1;
  }

  .customer-zone {
    order: 2;
  }

  .side-zone {
    order: 3;
  }

  .section-title {
    margin-bottom: 10px;
  }

  .section-title p,
  .subtitle,
  .customer-copy span,
  .pot-caption span,
  .boil-header span,
  .board-header span {
    display: none;
  }

  .section-title h2,
  .board-header h3 {
    font-size: 1.08rem;
  }

  .customer-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .customer-card {
    grid-template-columns: 56px 1fr auto;
    min-width: 0;
    gap: 8px;
    padding: 8px;
  }

  .portrait-frame {
    width: 56px;
    height: 56px;
    border-width: 3px;
  }

  .chef-area {
    position: relative;
    display: grid;
    grid-template-columns: 68px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .chef-frame {
    width: 68px;
    height: 88px;
    border-width: 3px;
  }

  .chef-bubble {
    max-width: 100%;
    padding: 10px 12px;
    font-size: 0.85rem;
    border-width: 2px;
  }

  .chef-bubble strong {
    margin-bottom: 2px;
    font-size: 0.9rem;
  }

  .stove-backdrop {
    padding: 12px;
    min-height: auto;
  }

  .stove-backdrop::before {
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 48px;
  }

  .pot-stage {
    padding-top: 0;
    gap: 8px;
  }

  .pot-frame {
    width: min(100%, 210px);
    border-width: 3px;
    border-radius: 18px;
  }

  .pot-caption {
    max-width: 240px;
    margin-top: 4px;
  }

  .pot-caption strong {
    font-size: 0.98rem;
  }

  .boil-panel {
    margin-top: 8px;
    padding: 10px;
    border-width: 2px;
  }

  .active-order-panel {
    margin-top: 10px;
  }

  .mini-stats,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mini-stat,
  .stat-card {
    padding: 8px;
    border-radius: 14px;
  }

  .mini-stat strong,
  .stat-card strong {
    margin-top: 4px;
    font-size: 0.92rem;
  }

  .ingredient-tray {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .ingredient-btn {
    min-height: 58px;
    padding: 9px 8px;
    border-width: 2px;
    border-radius: 14px;
    box-shadow: 0 4px 0 rgba(111, 64, 36, 0.16);
  }

  .k-label {
    font-size: 0.92rem;
  }

  .e-label {
    margin-top: 2px;
    font-size: 0.68rem;
  }

  .action-row {
    position: sticky;
    bottom: 8px;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255, 244, 223, 0.96);
    backdrop-filter: blur(8px);
  }

  .service-btn,
  .reset-btn,
  .reset-btn.secondary {
    margin-top: 0;
    min-height: 48px;
    padding: 10px 8px;
    border-width: 2px;
    font-size: 0.86rem;
  }

  .order-board,
  .order-board,
  .rush-panel,
  .progress-panel {
    display: none;
  }

  .active-order-panel {
    padding: 10px;
  }

  .patience-wrap {
    margin-top: 4px;
  }

  .patience-head {
    font-size: 0.72rem;
  }

  .progress-bar {
    margin-top: 4px;
    height: 12px;
    border-width: 2px;
  }

  .reset-btn:not(.secondary) {
    margin-top: 10px;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 1.5rem;
  }

  .status-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .status-pill span {
    font-size: 0.68rem;
  }

  .status-pill strong {
    margin-top: 4px;
    font-size: 0.82rem;
  }

  .top-banner {
    padding: 12px;
  }

  .customer-copy strong {
    font-size: 0.9rem;
  }

  .mini-stats,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ingredient-btn {
    min-height: 54px;
  }

  .board-header {
    gap: 4px;
  }
}
