/* Zaboca track page: the menu page's sand and chocolate, for a customer's phone at the table. */
:root {
  --sand: #dac2a8;
  --sand-light: #e8d6c1;
  --cream: #f7eee3;
  --choc: #47210c;
  --choc-soft: #6b3f25;
  --muted: #7b5a44;
  /* The same status colours as the apps and the TV board. */
  --new: #2563eb;
  --progress: #f59e0b;
  --ready: #db2777;
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--sand); color: var(--choc);
  font: 400 16px/1.45 Jost, "Century Gothic", Futura, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 28px 16px 8px; }
.logo-link { display: inline-block; color: inherit; text-decoration: none; }
.logo { display: block; width: min(170px, 46vw); height: auto; margin: 0 auto; }
h1 { margin: 6px 0 0; font: 600 1.3rem/1.2 Jost, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.live {
  display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 5px 13px;
  border-radius: 999px; background: rgba(71, 33, 12, .08); color: var(--choc-soft); font-size: .82rem; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: #3f9a57; animation: pulse 2s infinite; }
.live.offline .dot { background: #c98a1f; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 154, 87, .55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(63, 154, 87, 0); } }

main { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 16px 16px 24px; }

/* ── Picking the table ──────────────────────────────────────────────────────── */
.panel { background: var(--cream); border-radius: var(--radius); padding: 20px 18px 22px; box-shadow: 0 10px 22px -16px rgba(71, 33, 12, .55); }
.panel h2 { margin: 0 0 12px; font: 600 1.15rem/1.25 Jost, sans-serif; }
.table-form { display: flex; gap: 10px; }
.table-form input {
  flex: 1; min-width: 0; padding: 12px 16px; border-radius: 14px; border: 1.5px solid rgba(71, 33, 12, .18);
  background: var(--sand-light); color: var(--choc); font: inherit; outline: none;
}
.table-form input::placeholder { color: var(--muted); }
.table-form input:focus { border-color: var(--choc); }
.table-form button {
  flex: none; padding: 0 22px; border-radius: 14px; border: 0; background: var(--choc); color: var(--sand-light);
  font: 600 1rem Jost, sans-serif; letter-spacing: .04em; cursor: pointer;
}
.table-form button:disabled { opacity: .6; cursor: default; }
.problem { margin: 10px 0 0; color: #b4232c; font-weight: 500; }
.hint { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.off { text-align: center; }
.off h2 { margin-bottom: 0; }

/* ── The chosen table ───────────────────────────────────────────────────────── */
.place {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius); background: var(--choc); color: var(--sand-light);
}
.place-label { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.place h2 { margin: 2px 0 0; font: 600 1.5rem/1.15 Jost, sans-serif; overflow-wrap: anywhere; }
.change {
  flex: none; padding: 8px 14px; border-radius: 999px; border: 1.5px solid rgba(232, 214, 193, .5); background: transparent;
  color: var(--sand-light); font: 500 .9rem Jost, sans-serif; cursor: pointer;
}
#orders { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }

.order {
  --c: var(--new);
  position: relative; overflow: hidden; padding: 16px 18px 18px 22px; border-radius: var(--radius); background: var(--cream);
  box-shadow: 0 10px 22px -16px rgba(71, 33, 12, .55);
}
.order::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--c); }
.order[data-status="IN_PROGRESS"] { --c: var(--progress); }
.order[data-status="READY"] { --c: var(--ready); }
.order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.num { font: 700 1.6rem/1 Jost, sans-serif; font-variant-numeric: tabular-nums; }
.order[data-status="READY"] .num { color: var(--ready); }
.time { color: var(--muted); font-size: .85rem; }
.message { margin: 6px 0 0; font-weight: 600; color: var(--choc-soft); }
.order[data-status="READY"] .message { color: var(--ready); }

/* Three steps with labels: received, preparing, ready. */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 0; padding: 0; }
.steps li { position: relative; padding-top: 22px; text-align: center; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.steps li::before {
  content: ""; position: absolute; top: 2px; left: 50%; width: 14px; height: 14px; margin-left: -7px; z-index: 1;
  border-radius: 50%; background: var(--cream); border: 2.5px solid rgba(71, 33, 12, .25);
}
.steps li::after { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 3px; background: rgba(71, 33, 12, .15); }
.steps li:first-child::after { display: none; }
.steps li.done { color: var(--choc); }
.steps li.done::before { background: var(--c); border-color: var(--c); }
.steps li.done::after { background: var(--c); }
.steps li.now::before { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 25%, transparent); }
.order[data-status="IN_PROGRESS"] .steps li.now::before { animation: working 1.6s ease-in-out infinite; }
@keyframes working { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 10%, transparent); } }

.items { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed rgba(71, 33, 12, .2); color: var(--choc-soft); }
.items li { display: flex; gap: 8px; padding: 2px 0; }
.items b { min-width: 28px; color: var(--choc); }

/* Just became ready: glow so the customer notices. */
.order.arrived { animation: arrived 1.4s ease-in-out 3; }
@keyframes arrived { 50% { box-shadow: 0 0 0 4px var(--ready), 0 0 28px 4px rgba(219, 39, 119, .45); } }

.empty { text-align: center; color: var(--muted); padding: 28px 12px 8px; }
.empty strong { display: block; margin-bottom: 6px; color: var(--choc); font-size: 1.05rem; }
.empty button {
  margin-top: 14px; padding: 10px 20px; border-radius: 999px; border: 0; background: var(--choc); color: var(--sand-light);
  font: 600 .95rem Jost, sans-serif; cursor: pointer;
}
.skeleton {
  height: 150px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--sand-light) 40%, var(--cream) 50%, var(--sand-light) 60%) 0 0 / 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.footer { text-align: center; padding: 4px 16px 32px; color: var(--muted); font-size: .9rem; }
.footer a { color: var(--choc); font-weight: 500; }
.footer-brand { margin: 10px 0 0; letter-spacing: .3em; text-transform: uppercase; font-size: .8rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root.dark-theme {
  --sand: #281a12;
  --sand-light: #3a271c;
  --cream: #1f140e;
  --choc: #dac2a8;
  --choc-soft: #c4a98a;
  --muted: #a38d7a;
  color-scheme: dark;
}

.dark-theme .order {
  background: linear-gradient(145deg, #684f3a, #57402f);
  border: 1px solid rgba(232, 214, 193, .22);
  box-shadow: 0 .5rem 1.1rem rgba(0, 0, 0, .24), inset 0 1px rgba(255, 244, 230, .035);
}
.dark-theme .order .num,
.dark-theme .order .items b {
  color: #f1dfca;
}
.dark-theme .order .time {
  color: #c4a98a;
}
.dark-theme .order .items {
  border-top-color: rgba(232, 214, 193, .22);
  color: #e1c7a8;
}
.dark-theme .order .steps li::before {
  background: #57402f;
  border-color: rgba(232, 214, 193, .4);
}
.dark-theme .order .steps li::after {
  background: rgba(232, 214, 193, .2);
}
.dark-theme .order .steps li.done::after {
  background: var(--c);
}

/* A cafe without a logo shows its name instead (cafe.js, data-cafe-wordmark). */
.wordmark { display: grid; gap: .25em; justify-items: center; text-align: center; color: var(--choc); font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; line-height: 1.05; }
.wordmark small { font-size: .36em; font-weight: 500; letter-spacing: .3em; color: var(--choc-soft, var(--muted)); }
.wordmark small:empty { display: none; }
.wordmark { font-size: clamp(1.6rem, 7vw, 2.2rem); }
