/* diner-rush: HUD, ticket rail, stations, kitchen feed, end-of-shift summary. */

body.diner-page {
  justify-content: flex-start;
  padding: 2rem calc(260px + 2.5rem) 3rem 1.25rem;
}

.diner-page > :not(.status-panel, .summary, h1, script) { width: min(860px, 100%); }

.diner-note {
  margin-bottom: 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #64748b;
}

.diner-note strong { color: #a5b4fc; font-weight: 600; }

.diner-page h2 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  margin-bottom: 0.6rem;
}

.panel-note { margin-left: 0.5rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: #334155; }
.empty { font-size: 0.78rem; color: #475569; }

/* ── HUD ── */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  margin-bottom: 1rem;
}

.hud-stat { display: flex; flex-direction: column; gap: 2px; }
.hud-value { font-family: 'Courier New', monospace; font-size: 1.15rem; font-weight: 700; color: #e2e8f0; }
.hud-value.good { color: #34d399; }
.hud-value.bad { color: #f87171; }
.hud-value.warn { color: #fbbf24; }

/* ── Ticket rail ── */
.rail-wrap, .feed-wrap {
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: #13192a;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1rem;
}

.rail {
  display: flex;
  gap: 10px;
  min-height: 150px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}

.ticket {
  flex: 0 0 168px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 4px 4px 10px 10px;
  background: #f8f5ea;
  color: #1f2937;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  border-top: 6px solid #6366f1;
  font-size: 0.72rem;
  animation: ticket-in 0.35s ease-out;
  transition: opacity 0.6s, transform 0.6s;
}

.ticket .stat-label { color: #6b7280; font-size: 0.56rem; }
.ticket.is-paused { border-top-color: #f59e0b; }
.ticket.out-served { border-top-color: #22c55e; }
.ticket.out-walked-out { border-top-color: #ef4444; background: #fbe9e9; }
.ticket.out-cancelled { border-top-color: #9ca3af; background: #ececec; }
.ticket.leaving { opacity: 0; transform: translateY(-14px) rotate(-3deg); }

@keyframes ticket-in { from { opacity: 0; transform: translateY(-20px) rotate(4deg); } }

.ticket-head { display: flex; align-items: center; gap: 6px; }
.ticket-head strong { font-family: 'Courier New', monospace; font-size: 0.95rem; }
.ticket-status { margin-left: auto; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280; }
.tag { padding: 0 5px; border-radius: 4px; background: #fde68a; color: #92400e; font-size: 0.56rem; text-transform: uppercase; }

.ticket-items { display: flex; flex-wrap: wrap; gap: 3px; margin: 2px 0 4px; }

.chip {
  padding: 1px 6px;
  border-radius: 999px;
  background: #e5e7eb;
  font-size: 0.64rem;
  white-space: nowrap;
}

.chip.extra { outline: 2px dashed #8b5cf6; }
.chip-queued { background: #e0e7ff; }
.chip-cooking, .chip-blending { background: #fed7aa; }
.chip-ready { background: #fde047; font-weight: 700; }
.chip-charring, .chip-jammed { background: #fca5a5; font-weight: 700; }
.chip-done { background: #bbf7d0; }
.chip-ruined { background: #d1d5db; text-decoration: line-through; }

.bar { height: 5px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.bar.idle { opacity: 0.4; }
.bar-fill { display: block; height: 100%; border-radius: inherit; }
.patience .bar-fill { background: linear-gradient(90deg, #ef4444, #f59e0b 40%, #22c55e); animation: drain var(--ms) linear forwards; }
.progress .bar-fill { background: #6366f1; transition: width 0.3s; }

@keyframes drain { from { width: 100%; } to { width: 0; } }

.ticket-actions { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.button.small { padding: 0.3rem 0.7rem; font-size: 0.6rem; }
.ticket .button.ghost { color: #4b5563; border-color: #d1d5db; }
.paid { font-family: 'Courier New', monospace; font-weight: 700; }
.out-served .paid { color: #15803d; }
.out-walked-out .paid, .out-cancelled .paid { color: #b91c1c; }

/* ── Stations ── */
.stations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
}

.station {
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: #13192a;
  padding: 0.7rem 0.8rem;
}

.station-grill { border-top: 3px solid #f97316; }
.station-fryer { border-top: 3px solid #facc15; }
.station-shake { border-top: 3px solid #f472b6; }

.station-head { display: flex; align-items: baseline; justify-content: space-between; }
.station-queue { font-size: 0.65rem; color: #f59e0b; }

.slots { display: flex; flex-direction: column; gap: 6px; }

.slot {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 2px 6px;
  min-height: 58px;
  padding: 6px 8px 10px;
  border-radius: 10px;
  background: #0f1422;
  border: 1px solid #1e293b;
  overflow: hidden;
}

.empty-slot { grid-template-columns: 1fr; justify-items: center; }
.slot-empty { font-size: 0.65rem; color: #334155; text-transform: uppercase; letter-spacing: 0.1em; }
.slot-dish { font-size: 1.4rem; grid-row: span 2; }
.slot-ticket { font-family: 'Courier New', monospace; font-size: 0.75rem; color: #a5b4fc; }
.slot-state { grid-column: 2; font-size: 0.66rem; color: #94a3b8; }
.slot-action { grid-column: 3; grid-row: 1 / span 2; padding: 0.45rem 0.7rem; font-size: 0.62rem; }

.slot-ready, .slot-charring, .slot-jammed { border-color: #f59e0b; box-shadow: 0 0 16px rgba(245,158,11,.35); }
.slot-charring, .slot-jammed { border-color: #ef4444; box-shadow: 0 0 18px rgba(239,68,68,.45); animation: wobble 0.35s ease-in-out infinite; }
.slot-charring .slot-state, .slot-jammed .slot-state { color: #f87171; font-weight: 700; }
.slot-ready .slot-state { color: #fbbf24; font-weight: 700; }
.slot-done { opacity: 0.6; }

@keyframes wobble { 50% { transform: translateX(1px) rotate(0.4deg); } }

.slot-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
}

.slot-bar.cook { background: #f97316; animation: fill var(--ms) linear forwards; }
.slot-bar.countdown { background: #ef4444; animation: drain var(--ms) linear forwards; }

@keyframes fill { from { width: 0; } to { width: 100%; } }

/* ── Feed ── */
.feed {
  list-style: none;
  height: 190px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.68rem;
  scrollbar-width: thin;
  scrollbar-color: #1e293b transparent;
}

.feed-entry { display: grid; grid-template-columns: 42px 1fr; gap: 8px; padding: 1px 0; color: #a5b4fc; }
.feed-time { color: #334155; }
.feed-entry.good .feed-text { color: #34d399; }
.feed-entry.warn .feed-text { color: #fbbf24; }
.feed-entry.bad .feed-text { color: #f87171; }

/* ── Summary ── */
.summary {
  margin: auto;
  width: min(520px, calc(100% - 32px));
  max-height: 80vh;
  padding: 1.2rem 1.4rem;
  border: 1px solid #334155;
  border-radius: 14px;
  background: #13192a;
  color: #e2e8f0;
}

.summary::backdrop { background: rgba(0,0,0,.6); }
.summary-total { margin-bottom: 0.8rem; color: #a5b4fc; }
.summary-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; margin-bottom: 0.6rem; }
.summary-table th { text-align: left; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; padding: 4px; }
.summary-table td { padding: 4px; border-top: 1px solid #1e293b; font-family: 'Courier New', monospace; }
.row-served td:last-child { color: #34d399; }
.row-walked-out td:last-child, .row-cancelled td:last-child { color: #f87171; }
.summary-note { font-size: 0.68rem; color: #475569; margin-bottom: 0.8rem; }

@media (max-width: 1000px) {
  body.diner-page { padding: 1.5rem 16px 2rem; }
}

@media (max-width: 700px) {
  .stations { grid-template-columns: 1fr; }
}

select {
  font: inherit;
  font-size: 0.75rem;
  padding: 4px 7px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #0f1422;
  color: #c7d2fe;
}

/* The page keeps a right-hand gutter for the status panel down to 1000px, so
   the panel stays in the corner where demo.css would otherwise move it into
   the page flow (below 1200px). */
@media (min-width: 1001px) and (max-width: 1199px) {
  body.diner-page .status-panel { position: fixed; width: 260px; margin: 0; }
}
