:root {
  --red: #c8221c;
  --red-dark: #8f1510;
  --mustard: #f5b81c;
  --mustard-soft: #ffe39a;
  --cream: #fff6e3;
  --paper: #fffdf7;
  --ink: #2a1a10;
  --ink-soft: #6b5546;
  --green: #2f7d32;
  --line: #e7d6b8;
  --radius: 14px;
  --sign-font: 'Bungee', 'Arial Black', Impact, sans-serif;
  --body-font: 'Rubik', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body-font);
  color: var(--ink);
  background-color: var(--cream);
  line-height: 1.4;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---------- sign ---------- */

.customer {
  background-image:
    linear-gradient(45deg, rgba(200, 34, 28, .06) 25%, transparent 25%, transparent 75%, rgba(200, 34, 28, .06) 75%),
    linear-gradient(45deg, rgba(200, 34, 28, .06) 25%, transparent 25%, transparent 75%, rgba(200, 34, 28, .06) 75%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  padding-bottom: 120px;
}

.sign { text-align: center; }
.awning {
  height: 34px;
  background: repeating-linear-gradient(90deg, var(--red) 0 36px, #fff 36px 72px);
  -webkit-mask: radial-gradient(18px at 18px 100%, transparent 98%, #000) 0 0 / 36px 100%;
  mask: radial-gradient(18px at 18px 100%, transparent 98%, #000) 0 0 / 36px 100%;
}
.board {
  margin: 14px 16px 0;
  padding: 18px 16px 20px;
  background: var(--red);
  color: #fff;
  border: 4px solid var(--mustard);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--red-dark), 0 12px 30px rgba(0, 0, 0, .18);
  max-width: 688px;
  margin-inline: auto;
}
.board-kicker {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--mustard);
}
.board h1 {
  margin: 6px 0 4px;
  font-family: var(--sign-font);
  font-weight: 400;
  font-size: clamp(40px, 12vw, 72px);
  line-height: .95;
  color: var(--mustard);
  text-shadow: 3px 3px 0 var(--red-dark);
}
.board h1 span { display: block; font-size: .5em; color: #fff; text-shadow: 2px 2px 0 var(--red-dark); }
.board-tag { margin: 8px 0 0; font-size: 14px; opacity: .9; }

.tip-banner {
  margin: 20px 0 0;
  padding: 12px 16px;
  background: var(--mustard-soft);
  border: 2px dashed var(--mustard);
  border-radius: var(--radius);
  font-size: 15px;
  text-align: center;
}

/* ---------- sections ---------- */

section { margin-top: 32px; }
h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 12px;
  font-family: var(--sign-font);
  font-weight: 400;
  font-size: 26px;
  color: var(--red);
}
h2 .pt {
  flex-basis: 100%;
  font-family: var(--body-font);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
h2 small {
  font-family: var(--body-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* ---------- cards ---------- */

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--line);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  overflow: hidden;
}
.card.is-on { border-color: var(--red); box-shadow: 0 3px 0 var(--red); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 { margin: 0; font-family: var(--sign-font); font-weight: 400; font-size: 22px; }
.card-desc { margin: 6px 0 14px; color: var(--ink-soft); font-size: 15px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.price {
  padding: 4px 10px;
  background: var(--ink);
  color: var(--mustard);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag-egg { background: #fff1c2; color: #8a5a00; }

.card.is-out { background: #f3ece0; }
.card.is-out > :not(.stamp) { opacity: .35; filter: grayscale(1); }
.stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-8deg);
  padding: 6px 16px 8px;
  border: 4px solid var(--red);
  border-radius: 10px;
  color: var(--red);
  background: rgba(255, 253, 247, .9);
  font-family: var(--sign-font);
  font-size: 26px;
  text-align: center;
  line-height: 1;
  z-index: 1;
  white-space: nowrap;
}
.stamp small { display: block; margin-top: 4px; font-family: var(--body-font); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

/* steppers */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.stepper button:disabled { background: #e6dccb; color: #b5a48e; }
.stepper output { min-width: 28px; text-align: center; font-weight: 800; font-size: 18px; }

/* fries */
.fries { cursor: pointer; }
.fries:hover { transform: translateY(-1px); }
.spicy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: rotate(3deg);
  box-shadow: 2px 2px 0 var(--red-dark);
}
.check { font-weight: 800; color: var(--red); }
.fries.is-on .check { color: var(--green); }

/* sauces */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 700;
}
.chip.is-on { background: var(--mustard); border-color: var(--mustard); }

/* drinks */
.drinks { display: grid; gap: 8px; }
.drink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 16px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
}
.drink.is-on { border-color: var(--red); }

/* form */
.field { display: block; margin-bottom: 12px; }
.field span { display: block; margin-bottom: 6px; font-weight: 700; }
.field em { font-weight: 400; color: var(--ink-soft); }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); }

/* order bar */
.orderbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--ink);
  color: #fff;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .2);
  z-index: 10;
}
.orderbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 688px; margin: 0 auto; }
.summary { margin: 0; font-weight: 500; font-size: 15px; min-width: 0; }
.error { max-width: 688px; margin: 0 auto; color: var(--mustard); font-weight: 700; font-size: 14px; }
.error:empty { display: none; }
.error:not(:empty) { margin-top: 8px; }

.btn-primary, .btn-secondary, .btn-ghost {
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}
.btn-primary { border: 0; background: var(--mustard); color: var(--ink); box-shadow: 0 3px 0 #b88500; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #b88500; }
.btn-primary:disabled { background: #5a4a3e; color: #a8968a; box-shadow: none; }
.btn-secondary { display: block; margin: 16px auto 0; border: 2px solid var(--red); background: var(--paper); color: var(--red); }
.btn-ghost { border: 2px solid currentColor; background: transparent; }
.small { padding: 8px 14px; font-size: 14px; }

/* my orders strip */
.my-orders { display: grid; gap: 8px; margin-top: 16px; }
.my-order {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: left;
}
.my-order span { margin-left: auto; font-weight: 700; color: var(--red); }
.my-order.status-ready { background: #dff3d8; border-color: var(--green); }

/* ---------- customer ticket ---------- */

#ticket { padding-top: 24px; }
.ticket {
  position: relative;
  padding: 24px 20px 28px;
  background: var(--paper);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  text-align: center;
  -webkit-mask: radial-gradient(8px at 50% 100%, transparent 98%, #000) 50% 100% / 20px 100% repeat-x;
  mask: radial-gradient(8px at 50% 100%, transparent 98%, #000) 50% 100% / 20px 100% repeat-x;
}
.ticket-kicker { margin: 0; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); font-size: 13px; }
.ticket-no { margin: 4px 0 0; font-family: var(--sign-font); font-size: 72px; line-height: 1; color: var(--red); }
.ticket-name { margin: 6px 0 20px; font-size: 18px; font-weight: 700; }

.track { list-style: none; margin: 0 auto 20px; padding: 0; max-width: 320px; text-align: left; }
.track li { position: relative; padding: 6px 0 6px 32px; color: #b5a48e; font-weight: 500; }
.track li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.track li.past { color: var(--ink-soft); }
.track li.past::before { background: currentColor; }
.track li.now { color: var(--red); font-weight: 800; font-size: 18px; }
.track li.now::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 5px rgba(200, 34, 28, .2); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(200, 34, 28, 0); } }

.ticket-lines {
  list-style: none;
  margin: 0;
  padding: 16px 0 0;
  border-top: 2px dashed var(--line);
  text-align: left;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 15px;
}
.ticket-lines li { padding: 3px 0; }
.ticket-lines .note, .chef-ticket .note { font-style: italic; color: var(--ink-soft); }
.ticket-tip { margin: 16px 0 0; padding-top: 12px; border-top: 2px dashed var(--line); font-size: 14px; color: var(--ink-soft); }

/* ---------- chef ---------- */

.chef { background: #1f140c; color: var(--cream); min-height: 100vh; padding-bottom: 40px; }
.chef-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  background: var(--red);
  border-bottom: 4px solid var(--mustard);
}
.chef-kicker { margin: 0; font-weight: 800; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--mustard); }
.chef-bar h1 { margin: 0; font-family: var(--sign-font); font-weight: 400; font-size: 26px; color: #fff; }
.chef-actions { display: flex; gap: 8px; }
.chef .btn-ghost { color: #fff; }

.prep { margin-top: 20px; }
.chef h2 { color: var(--mustard); font-size: 20px; }
.prep-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prep-chip { padding: 8px 14px; border-radius: 999px; background: #3a281b; font-size: 16px; }
.prep-chip b { color: var(--mustard); }
.muted { color: #a8968a; }

.board-cols { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
@media (max-width: 860px) { .board-cols { grid-template-columns: 1fr; } }
.col { margin-top: 16px; }
.col h2 .count:not(:empty) {
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--mustard);
  color: var(--ink);
  font-family: var(--body-font);
  font-weight: 800;
  font-size: 14px;
}
.col[data-status="ready"] h2 { color: #8fd18a; }
.tickets { display: grid; gap: 12px; align-content: start; }
.empty { margin: 0; color: #6b5546; }

.chef-ticket {
  padding: 14px 16px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  border-top: 6px solid var(--mustard);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.col[data-status="grilling"] .chef-ticket { border-top-color: var(--red); }
.col[data-status="ready"] .chef-ticket { border-top-color: var(--green); }
.chef-ticket.is-fresh { animation: arrive 1s ease-in-out 3; }
@keyframes arrive { 50% { box-shadow: 0 0 0 6px var(--mustard), 0 6px 16px rgba(0, 0, 0, .3); } }
.chef-ticket header { display: flex; align-items: baseline; gap: 10px; }
.t-no { font-family: var(--sign-font); font-size: 24px; color: var(--red); }
.t-name { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-time { margin-left: auto; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.chef-ticket ul { list-style: none; margin: 10px 0; padding: 10px 0 0; border-top: 2px dashed var(--line); font-size: 17px; }
.chef-ticket li { padding: 2px 0; }
.chef-ticket .l-burger { font-weight: 800; }
.chef-ticket .l-sauce { color: var(--ink-soft); font-size: 15px; }
.chef-ticket footer { display: flex; justify-content: flex-end; gap: 8px; }
.chef-ticket .btn-ghost { color: var(--ink-soft); }

.done { margin-top: 32px; }
.done summary { cursor: pointer; font-weight: 800; color: #a8968a; padding: 8px 0; }
.tickets-done { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 8px 0 16px; opacity: .7; }
.danger { color: #ff8a80 !important; }

.offline {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  background: var(--mustard);
  color: var(--ink);
  border-radius: 999px;
  font-weight: 700;
}

/* QR modal */
.qr-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 12, 6, .85);
  z-index: 20;
}
.qr-modal[hidden] { display: none; }
.qr-card {
  width: min(460px, 100%);
  padding: 24px;
  background: var(--red);
  border: 4px solid var(--mustard);
  border-radius: 20px;
  text-align: center;
  color: #fff;
}
.qr-card h2 { justify-content: center; color: var(--mustard); font-size: 30px; margin: 4px 0 16px; text-shadow: 2px 2px 0 var(--red-dark); }
.qr-card { max-height: 100%; overflow-y: auto; }
.qr { width: min(100%, 58vh); margin: 0 auto; padding: 12px; background: #fff; border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr-url { margin: 14px 0 0; font-family: ui-monospace, Menlo, monospace; font-size: 15px; word-break: break-all; }
.qr-note { margin: 4px 0 0; font-weight: 700; color: var(--mustard); }
.qr-card .btn-secondary { margin-top: 16px; }
