/* Matchsplit — a kitchen pass on paper. Light ground, black ink, one red stamp. */
:root {
  --paper: #F3EEE4; --slip: #FFFDF6; --ink: #141210; --mute: #6E665B; --rule: #D8CFBF; --stamp: #E8432E;
  --stampSoft: #FBE3DD; --wait: #FFF4C9;
  --disp: 'Anton', 'Impact', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.5 var(--mono); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
code { font-family: var(--mono); }
button { font: inherit; cursor: pointer; }

/* ---------- the CA rail: sticky, first thing on the page ---------- */
.carail { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--paper); padding: 7px 12px 8px;
  display: flex; flex-direction: column; gap: 5px; border-bottom: 3px solid var(--stamp); }
.carail-id { display: flex; align-items: center; gap: 10px; min-height: 24px; }
.carail-id img { border-radius: 4px; display: block; }
.carail-id b { font: 400 17px/1 var(--disp); letter-spacing: .06em; }
.carail-how, .carail-gm { font-size: 12px; text-decoration: none; border-bottom: 1px solid rgba(243,238,228,.35); }
.carail-how { margin-left: auto; }
.carail-gm[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.carail-ca { display: flex; align-items: center; gap: 8px; min-width: 0; }
.carail-k { font: 400 13px/1 var(--disp); letter-spacing: .08em; color: var(--stamp); }
.carail-addr { flex: 1; min-width: 0; font-size: 10.4px; letter-spacing: -.01em; user-select: all; -webkit-user-select: all; white-space: nowrap; overflow-wrap: anywhere; }
.carail-addr.wait { color: rgba(243,238,228,.6); font-style: italic; letter-spacing: 0; font-size: 12px; }
.carail-copy { flex: none; background: var(--stamp); color: #fff; border: 0; border-radius: 3px; padding: 5px 11px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.carail-copy.done { background: var(--paper); color: var(--ink); }

/* ---------- the knockout headline ---------- */
.knock { padding: 20px 16px 6px; max-width: 1180px; margin: 0 auto; }
.knock-kick { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.knock-kick b { color: var(--stamp); font-weight: 700; }
.knock-h { margin: 0; min-height: 64px; padding-bottom: 4px; font: 400 clamp(40px, 11.5vw, 108px)/.95 var(--disp); letter-spacing: -.005em; text-transform: uppercase; }
.knock-h em { font-style: normal; color: var(--stamp); }

/* ---------- layout ---------- */
.floor { max-width: 1180px; margin: 0 auto; padding: 10px 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }

/* ---------- the pass ---------- */
.pass { min-width: 0; }
.pass-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--ink); padding-bottom: 8px; }
.pass-round span { display: block; font: 400 15px/1.1 var(--disp); letter-spacing: .07em; }
.pass-round small { color: var(--mute); font-size: 12px; }
.pass-clock { text-align: right; }
.pass-clock small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); }
.pass-clock span { font: 400 40px/1 var(--disp); font-variant-numeric: tabular-nums; }
.pass-clock.hot span { color: var(--stamp); }
.pass-clock.idle span { color: var(--rule); }
.pass-say { margin: 12px 0 14px; font-size: 14.5px; line-height: 1.5; padding: 10px 12px; background: var(--slip); border-left: 4px solid var(--stamp); }
.pass-say b { background: var(--wait); padding: 0 3px; }

/* the rail: a stack of clipped ticket pairs */
.rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.duo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr); align-items: stretch;
  padding: 10px 8px 12px; margin-top: -4px; background: #EAE3D6; border: 1.5px solid var(--ink); border-radius: 2px;
  box-shadow: 0 2px 0 var(--ink); }
.duo:first-child { margin-top: 0; }
.duo:nth-child(odd) { transform: rotate(-.35deg); }
.duo:nth-child(even) { transform: rotate(.3deg); }
.duo::before { content: attr(data-pair); position: absolute; top: -1px; left: 50%; transform: translate(-50%, -50%); background: var(--ink); color: var(--paper);
  font-size: 10px; letter-spacing: .1em; padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.duo-v { align-self: center; text-align: center; font: 400 20px/1 var(--disp); color: var(--mute); }
.tkt { position: relative; min-width: 0; background: var(--slip); padding: 10px 10px 9px; border-top: 2px dashed var(--rule);
  box-shadow: 0 1px 0 var(--rule); overflow: hidden; }
.tkt-n { font: 400 26px/1 var(--disp); }
.tkt-s { display: block; margin-top: 4px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tkt-s small { font-size: 11px; font-weight: 400; color: var(--mute); }
.tkt-w { display: block; font-size: 11px; color: var(--mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tkt-w a { text-decoration: none; }
.tkt-r { display: block; margin-top: 6px; font-size: 11.5px; font-weight: 700; }
.tkt.win { background: #fff; outline: 2px solid var(--stamp); outline-offset: -2px; }
.tkt.win .tkt-r { color: var(--stamp); }
.tkt.lost { background: #F4EFE6; color: var(--mute); }
.tkt.lost .tkt-s { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--stamp); }
.tkt.even .tkt-r { color: var(--mute); }
.tkt.mine .tkt-w { color: var(--ink); font-weight: 700; }
.stamp { position: absolute; right: 6px; top: 8px; transform: rotate(-9deg); border: 2.5px solid var(--stamp); color: var(--stamp);
  font: 400 15px/1 var(--disp); letter-spacing: .08em; padding: 3px 6px 2px; border-radius: 3px; background: rgba(255,253,246,.85); }
.stamp.soft { border-style: dashed; }
.tkt.lost .stamp { color: var(--mute); border-color: var(--mute); transform: rotate(7deg); }
.slot { min-width: 0; border: 2px dashed var(--rule); display: flex; flex-direction: column; justify-content: center; padding: 10px; color: var(--mute); background: transparent; min-height: 92px; }
.slot b { font: 400 22px/1 var(--disp); color: var(--rule); }
.slot span { font-size: 12px; margin-top: 4px; }
.slot.next { border-color: var(--stamp); background: var(--wait); color: var(--ink); animation: beckon 1.6s ease-in-out infinite; }
.slot.next b { color: var(--stamp); }
@keyframes beckon { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,67,46,.0); } 50% { box-shadow: 0 0 0 4px rgba(232,67,46,.18); } }
.tkt.fresh { animation: print .55s ease-out; }
@keyframes print { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.stamp.fresh { animation: thump .4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes thump { from { transform: rotate(-9deg) scale(1.8); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: 1; } }
.rail-more { margin: 10px 0 0; font-size: 12px; color: var(--mute); text-align: center; }

/* the slip: stake + send */
.slip { margin-top: 20px; background: var(--slip); border: 1.5px solid var(--ink); padding: 14px; box-shadow: 4px 4px 0 var(--ink); }
.slip-k { display: block; font: 400 15px/1 var(--disp); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
.slip-k small { font: 400 11px var(--mono); letter-spacing: 0; text-transform: none; color: var(--mute); margin-left: 6px; }
.slip-row { display: flex; gap: 8px; }
.slip-in { flex: 1; min-width: 0; border: 2px solid var(--ink); background: #fff; font: 700 22px/1 var(--mono); padding: 10px 12px; border-radius: 0; color: var(--ink); }
.slip-in:focus { outline: 3px solid var(--stamp); outline-offset: 1px; }
.slip-go { flex: none; border: 0; background: var(--stamp); color: #fff; font: 400 18px/1 var(--disp); letter-spacing: .05em; padding: 0 16px; text-transform: uppercase; }
.slip-go:disabled { opacity: .55; cursor: wait; }
.slip-read { margin: 10px 0 0; font-size: 13px; line-height: 1.45; }
.slip-read b { color: var(--stamp); }
.slip-own { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--rule); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.slip-own button { border: 1.5px solid var(--ink); background: var(--paper); padding: 6px 12px; font-weight: 700; }
.slip-own button.hot { background: var(--ink); color: var(--paper); }

/* ---------- side column ---------- */
.side { min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.side-h { margin: 0 0 8px; font: 400 18px/1 var(--disp); letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.side-h small { font: 400 11px var(--mono); letter-spacing: 0; text-transform: none; color: var(--mute); }
.spike-feed { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow: auto; }
.spike-feed li { padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: 12.5px; line-height: 1.4; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.spike-feed li time { color: var(--mute); font-size: 11px; }
.spike-feed li.take b { color: var(--stamp); }
.spike-feed li.fresh { animation: print .5s ease-out; background: var(--wait); }
.spike-quiet { color: var(--mute); display: block !important; }
.lastpass-none { margin: 0; color: var(--mute); font-size: 13px; }
.lp-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: 12.5px; }
.lp-row b { color: var(--stamp); }
.lp-sum { margin: 8px 0 0; font-size: 12px; color: var(--mute); }
.howto-steps { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.5; }
.howto-steps li { margin-bottom: 8px; }
.howto-ex { margin-top: 10px; background: var(--slip); border: 1.5px solid var(--ink); padding: 10px 12px; }
.howto-exh { margin: 0 0 6px; font: 400 14px/1 var(--disp); letter-spacing: .06em; text-transform: uppercase; }
.howto-t { width: 100%; border-collapse: collapse; font-size: 12px; }
.howto-t td { padding: 4px 2px; border-bottom: 1px dashed var(--rule); white-space: nowrap; }
.howto-t td:nth-child(2) { color: var(--mute); text-align: center; }
.howto-t td:last-child { text-align: right; font-weight: 700; }
.howto-note { margin: 8px 0 0; font-size: 12px; color: var(--mute); }
.howto.lit { outline: 3px solid var(--stamp); outline-offset: 6px; }

/* ---------- footer ---------- */
.tailcard { border-top: 3px solid var(--ink); max-width: 1180px; margin: 0 auto; padding: 16px 16px 40px; font-size: 12px; color: var(--mute); }
.tailcard p { margin: 0 0 4px; overflow-wrap: anywhere; }
.tailcard b { color: var(--ink); }
.tailcard a { margin-right: 10px; }

/* ---------- sheet + toast ---------- */
.sheet { position: fixed; inset: 0; background: rgba(20,18,16,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet.off { display: none; }
.sheet-card { background: var(--paper); width: 100%; max-width: 520px; max-height: 80vh; overflow: auto; border-top: 4px solid var(--stamp); padding: 14px 16px 24px; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font: 400 18px/1 var(--disp); letter-spacing: .05em; }
.sheet-top button { border: 0; background: none; font-size: 26px; line-height: 1; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick-list button { border: 1.5px solid var(--ink); background: #fff; padding: 10px; text-align: left; font-weight: 700; }
.seat-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: 12.5px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; font-size: 13px; z-index: 50; max-width: 92vw; border-left: 4px solid var(--stamp); }

/* ---------- widths ---------- */
@media (min-width: 720px) {
  .carail { flex-direction: row; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 22px; }
  .carail-id { flex: none; }
  .carail-how { margin-left: 8px; }
  .carail-ca { flex: 0 1 auto; }
  .carail-addr { font-size: 13px; }
  .knock, .floor, .tailcard { padding-left: 28px; padding-right: 28px; }
  .knock { padding-top: 30px; }
  .duo { grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); padding: 14px 12px 16px; }
  .tkt-n { font-size: 32px; }
  .tkt-s { font-size: 22px; }
  .pass-clock span { font-size: 52px; }
  .slip-in { font-size: 26px; }
  .slip-go { font-size: 21px; padding: 0 22px; }
}
@media (min-width: 1000px) {
  .carail { padding: 10px max(28px, calc((100vw - 1180px) / 2 + 28px)); }
  .carail-addr { font-size: 14px; }
  .floor { grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
  .side { position: sticky; top: 72px; }
  .pass-say { font-size: 16px; }
  .tkt-n { font-size: 36px; }
  .slot { min-height: 110px; }
}
@media (min-width: 1300px) {
  .floor { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
.slip-pass { border: 0; background: var(--ink); color: var(--paper); padding: 4px 10px; font-weight: 700; }
