@import url('https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@75..125,400..900&display=swap');

/* Deli tag: the whole page is the mustard tag, the ticket is the white stub with a punched hole. */
:root {
  --mustard: #f2b705;
  --mustard-deep: #d9a000;
  --paper: #fffdf7;
  --ink: #2b1d12;
  --ink-soft: #6f5b48;
  --rye: #7a4a1c;
  --ready: #1f7a4d;
  --fail: #b3261e;
  --r: 16px;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh; display: flex; flex-direction: column; color: var(--ink);
  background: var(--mustard);
  background-image: radial-gradient(rgba(43,29,18,.08) 1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.wrap { width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 18px 44px; flex: 1; }

.mast { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 34px; }
.mast small { font-size: 13px; font-weight: 600; color: var(--rye); }

h2 { font-size: 40px; line-height: .98; font-weight: 900; font-stretch: 112%; letter-spacing: -.035em; margin: 34px 0 10px; }
p.lede { color: var(--rye); margin: 0 0 24px; font-size: 16px; line-height: 1.4; max-width: 34ch; }

/* recipe tags */
.choices { display: grid; gap: 12px; margin: 0 0 22px; padding: 0; list-style: none; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.choice label {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 14px;
  padding: 16px 18px 16px 14px; border-radius: var(--r);
  background: var(--paper); border: 3px solid transparent;
  box-shadow: 0 6px 0 rgba(43,29,18,.18);
  transition: transform .08s, box-shadow .08s, border-color .12s;
}
.choice label::before { /* punched hole */
  content: ""; width: 14px; height: 14px; border-radius: 50%; margin-left: 4px;
  background: var(--mustard); box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.choice label strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.choice label span { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 3px; }
.choice label em { /* check */
  font-style: normal; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--ink);
  display: grid; place-items: center; color: transparent; font-weight: 900; transition: background .12s, color .12s;
}
.choice input:checked + label { border-color: var(--ink); }
.choice input:checked + label em { background: var(--ink); color: var(--mustard); }
.choice input:active + label { transform: translateY(3px); box-shadow: 0 3px 0 rgba(43,29,18,.18); }
.choice input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: 3px; }

.field { margin: 0 0 22px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--rye); margin-bottom: 6px; }
.field input {
  width: 100%; font: inherit; font-size: 18px; padding: 13px 14px; border-radius: 12px;
  border: 3px solid transparent; background: var(--paper); color: var(--ink);
  box-shadow: 0 4px 0 rgba(43,29,18,.18);
}
.field input:focus { border-color: var(--ink); outline: none; }

.btn {
  width: 100%; padding: 19px; border: 0; border-radius: var(--r);
  background: var(--ink); color: var(--mustard); font-size: 20px; font-weight: 900; letter-spacing: -.01em;
  box-shadow: 0 6px 0 rgba(43,29,18,.35);
}
.btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(43,29,18,.35); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.err { color: var(--fail); font-weight: 600; font-size: 15px; margin: 12px 0 0; min-height: 1.2em; }

/* ------------------------------------------------------------------ ticket stub */
.stub {
  position: relative; margin: 26px 0 0; background: var(--paper); border-radius: var(--r);
  padding: 26px 22px 24px; text-align: center;
  box-shadow: 0 10px 0 rgba(43,29,18,.2);
}
.stub::before { /* punched hole */
  content: ""; position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--mustard); box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}
.stub .tear { /* perforation between number and QR */
  height: 0; border-top: 3px dashed rgba(43,29,18,.25); margin: 18px -22px 18px; position: relative;
}
.stub .tear::before, .stub .tear::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--mustard);
}
.stub .tear::before { left: -12px; } .stub .tear::after { right: -12px; }
.stub .order-word { font-size: 14px; font-weight: 700; color: var(--rye); margin-top: 22px; }
.stub .num { font-size: clamp(120px, 44vw, 200px); line-height: .86; font-weight: 900; font-stretch: 75%; letter-spacing: -.05em; }
.stub .what { font-size: 22px; font-weight: 800; margin: 10px 0 2px; letter-spacing: -.01em; }
.stub .who { color: var(--ink-soft); font-size: 15px; }
.stub .qr { display: inline-block; padding: 10px; background: #fff; border-radius: 12px; border: 3px solid var(--ink); }
.stub .qr img { display: block; width: min(60vw, 240px); height: auto; image-rendering: pixelated; transition: opacity .3s; }
.stub .state { font-size: 18px; font-weight: 800; margin: 16px 0 0; min-height: 1.4em; }
.stub .hint { color: var(--ink-soft); font-size: 14px; margin: 4px 0 0; }
.stub .stamp { /* rotated READY stamp */
  position: absolute; right: 14px; top: 70px; transform: rotate(-14deg); padding: 6px 12px;
  border: 4px solid var(--ready); color: var(--ready); border-radius: 8px; font-weight: 900; font-size: 26px;
  letter-spacing: .04em; opacity: 0; transition: opacity .25s, transform .25s;
}
.stub[data-status="building"] .qr { border-color: var(--mustard-deep); }
.stub[data-status="building"] .state { color: var(--rye); }
.stub[data-status="building"] .state::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.stub[data-status="done"] .qr { border-color: var(--ready); }
.stub[data-status="done"] .qr img { opacity: .15; }
.stub[data-status="done"] .state { color: var(--ready); }
.stub[data-status="done"] .stamp { opacity: 1; transform: rotate(-14deg) scale(1); }
.stub[data-status="failed"] .state, .stub[data-status="expired"] .state { color: var(--fail); }
.stub[data-status="expired"] .qr img { opacity: .15; }

/* ------------------------------------------------------------------ placard */
.placard { text-align: center; }
.placard .stub { margin-top: 30px; padding-top: 44px; }
.placard h2 { font-size: 42px; margin-top: 0; }
.placard canvas, .placard img { width: min(76vw, 400px); height: auto; border: 4px solid var(--ink); border-radius: 12px; padding: 8px; background: #fff; }
.placard .url { color: var(--ink-soft); font-size: 14px; word-break: break-all; margin-top: 12px; }
@media print { body { background: #fff; } .mast, .noprint { display: none; } .stub { box-shadow: none; border: 3px solid var(--ink); } }

/* ------------------------------------------------------------------ station (big screen) */
.station { flex: 1; display: grid; grid-template-columns: 1.35fr 1fr; min-height: 100dvh; }
.station .now { padding: 5vh 5vw; display: flex; flex-direction: column; justify-content: center; }
.station .now .label { font-size: clamp(20px, 2.4vw, 32px); font-weight: 800; color: var(--rye); }
.station .now .num { font-size: clamp(140px, 27vw, 380px); line-height: .86; font-weight: 900; font-stretch: 75%; letter-spacing: -.05em; margin-top: 1vh; }
.station .now .what { font-size: clamp(28px, 3.8vw, 56px); font-weight: 900; letter-spacing: -.02em; margin-top: 1.5vh; }
.station .now .who { font-size: clamp(20px, 2.2vw, 30px); color: var(--rye); margin-top: 4px; }
.station .now .bar { height: 18px; background: rgba(43,29,18,.15); border-radius: 9px; margin-top: 4vh; overflow: hidden; }
.station .now .bar i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 9px; transition: width .6s linear; }
.station .now.idle .num { opacity: .22; }
.station .now.idle .what { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.station .side { padding: 5vh 4vw; background: var(--paper); border-left: 14px solid var(--ink); }
.station .side h3 { font-size: clamp(20px, 2.2vw, 30px); margin: 0 0 12px; font-weight: 900; }
.station .side ul { list-style: none; margin: 0; padding: 0; }
.station .side li { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0; border-bottom: 3px dashed rgba(43,29,18,.2); font-size: clamp(18px, 2.1vw, 28px); }
.station .side li b { font-size: 1.35em; font-weight: 900; font-stretch: 78%; margin-right: 8px; }
.station .side li.failed { color: var(--fail); }
.station .side .ok { color: var(--ready); font-weight: 800; }
.station .side .waiting { margin-top: 4vh; font-size: clamp(18px, 2vw, 26px); font-weight: 700; color: var(--rye); }
.station .side .scan { margin-top: 1.5vh; font-size: clamp(14px, 1.5vw, 19px); color: var(--ink-soft); }
@media (max-width: 720px) { .station { grid-template-columns: 1fr; } .station .side { border-left: 0; border-top: 14px solid var(--ink); } }

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

/* bottom-corner brand */
.foot {
  position: fixed; right: 16px; bottom: 12px; font-size: 13px; font-weight: 600; color: var(--rye);
  letter-spacing: .01em; pointer-events: none;
}
.foot b { font-weight: 900; color: var(--ink); font-stretch: 112%; letter-spacing: -.02em; }
.station .foot { font-size: clamp(14px, 1.3vw, 18px); right: 2vw; bottom: 2vh; }
@media print { .foot { position: static; text-align: right; margin-top: 20px; } }
