/* Blind Chef. Panels, buttons, the top bar and toasts come from
   ../shared/arcade.css, linked first. Everything here is the split screen:
   a kitchen on one side of the room and a ticket on the other. */

#start .join-row { margin-bottom: 12px; }

#play {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

#play .topbar { flex: 0 0 auto; }

.clock {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  color: #ffd076;
  background: rgba(20, 14, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 9px 14px;
}
.clock.urgent { color: #ff9d8a; border-color: rgba(255, 130, 110, 0.55); animation: pulse 1s infinite; }
@keyframes pulse { 50% { background: rgba(120, 30, 30, 0.55); } }

#panes {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pane-tag {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.pane-tag b { font-size: 0.95rem; color: #ffd076; }
.pane-tag span { font-size: 0.8rem; color: #9d8bb5; letter-spacing: 0.04em; }

/* ───────── the kitchen ───────── */
.stage {
  flex: 1;
  min-height: 200px;
  border-radius: 16px;
  overflow: hidden;
  background: #1a1220;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  touch-action: none;
}

.kitchen-canvas { display: block; width: 100%; height: 100%; }

/* A flash on the frame instead of a toast, so the Cook is not reading popups
   while the clock runs. */
.stage.good { animation: flash-good 0.5s ease; }
.stage.bad { animation: flash-bad 0.7s ease; }
@keyframes flash-good { from { box-shadow: inset 0 0 0 4px rgba(143, 211, 168, 0.9); } }
@keyframes flash-bad { from { box-shadow: inset 0 0 0 5px rgba(230, 90, 60, 0.95); } }

.cook-bar, .heat-row {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.tool, .heat, .serve {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 12px;
  cursor: pointer;
  color: #f3ecdf;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 8px;
}
.tool { flex: 1; }
.tool:active, .heat:active, .serve:active { transform: scale(0.97); }
.tool.on { background: #ffd076; color: #241a10; border-color: #ffd076; }
.tool:disabled, .heat:disabled, .serve:disabled { opacity: 0.4; cursor: default; }

.heat-row { align-items: center; }
.heat-label { font-size: 0.8rem; color: #9d8bb5; letter-spacing: 0.08em; text-transform: uppercase; }
.heat { flex: 1; }
.heat[data-heat="low"].on { background: #7a8f5a; color: #16130c; border-color: #7a8f5a; }
.heat[data-heat="medium"].on { background: #d99a3c; color: #211606; border-color: #d99a3c; }
.heat[data-heat="high"].on { background: #d94f2c; color: #fff1e8; border-color: #d94f2c; }

/* Inert until the ticket is actually finished, so the gold means something. */
.serve {
  flex: 0 0 auto;
  width: 100%;
  font-size: 1.05rem;
  padding: 14px 18px;
  color: #8d7ea5;
  background: rgba(255, 255, 255, 0.05);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}
.serve.ready {
  color: #241a10;
  background: #ffd076;
  border: none;
  animation: ready 1.1s infinite;
}
@keyframes ready { 50% { box-shadow: 0 0 0 6px rgba(255, 208, 118, 0.22); } }

/* ───────── the ticket ───────── */
.ticket {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px;
}

.ticket li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.98rem;
  line-height: 1.35;
  color: #cbbfe0;
}
.ticket li .no {
  flex: 0 0 1.4em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #7d6c95;
}
.ticket li .txt { flex: 1; }
.ticket li .hint {
  display: block;
  margin-top: 3px;
  font-size: 0.84rem;
  color: #9d8bb5;
  font-style: italic;
}
.ticket li .of { font-size: 0.8rem; color: #ffd076; font-weight: 700; white-space: nowrap; }

.ticket li.now {
  background: rgba(255, 208, 118, 0.14);
  border-color: #ffd076;
  color: #f3ecdf;
  font-weight: 600;
}
.ticket li.now .no { color: #ffd076; }
.ticket li.done { opacity: 0.45; }
.ticket li.done .txt { text-decoration: line-through; }
.ticket li.done .hint { display: none; }

/* ───────── what actually went in ───────── */
.pot-box {
  flex: 0 0 auto;
  max-height: 34%;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.pot-box h3 {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #9d8bb5;
  margin-bottom: 8px;
}
.pot-box h3 i { font-style: normal; color: #ffd076; }

.potlist {
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.potlist:empty::after {
  content: "Empty. Get talking.";
  font-size: 0.88rem;
  color: #6f6087;
}
.potlist li {
  font-size: 0.88rem;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.potlist li.bad {
  color: #ffb3a3;
  background: rgba(200, 60, 40, 0.24);
  border-color: rgba(255, 120, 100, 0.6);
  font-weight: 600;
}

/* ───────── practice: both halves, one screen ───────── */
body.practice #panes { overflow-y: auto; }
body.practice .pane { flex: 0 0 auto; }
body.practice .stage { flex: 0 0 auto; height: 32vh; min-height: 190px; }
body.practice .tool, body.practice .heat { padding: 10px 6px; font-size: 0.85rem; }
body.practice .serve { padding: 11px 18px; }
body.practice .ticket li { padding: 9px 13px; font-size: 0.92rem; }
body.practice .ticket { flex: 0 0 auto; overflow: visible; }
body.practice .pot-box { max-height: none; }
body.practice .pane + .pane { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 12px; }

/* ───────── waiting your turn ───────── */
.pane.watching .stage, .pane.watching .cook-bar, .pane.watching .heat-row { pointer-events: none; }

/* ───────── the tally between orders ───────── */
.final { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.final-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.95rem;
}
.final-row b { color: #ffd076; font-size: 1.1rem; }
.final-row.bad b { color: #ff9d8a; }
.verdict { margin-bottom: 20px; font-size: 0.95rem; line-height: 1.5; color: #cbbfe0; }

@media (max-width: 430px) {
  #play .topbar { flex-wrap: wrap; }
  #play #tally { order: 3; flex-basis: 100%; }
}

@media (min-width: 780px) {
  body.practice #panes { max-width: 1040px; flex-direction: row; align-items: stretch; }
  body.practice .pane { flex: 1; min-width: 0; }
  body.practice .stage { flex: 1; height: auto; }
  body.practice .pane + .pane { border-top: none; padding-top: 0; }
}
