/* Thirstday — the bar. One screen: crew (BAC) | stage | receipt printer. */
:root {
  --bg: #121110; --panel: #181715; --raise: #1f1e1b; --line: #2d2b27; --fg: #ecebe6; --mut: #a19e94;
  --acc: #ff6a13; --acc-fg: #fff; --paper: #fbfaf5; --ink: #171614; --ink-mut: #6b6860;
  --good: #3fb871; --bad: #ff5a47; --warn: #f5b041;
  --mono: 'JetBrains Mono', ui-monospace, monospace; --cond: 'Barlow Condensed', sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--mono); font-size: 13px; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.app { height: 100vh; display: grid; grid-template-rows: 56px minmax(0, 1fr); }
.top { display: flex; align-items: center; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--cond); font-weight: 800; font-size: 26px; letter-spacing: .02em; white-space: nowrap; }
.brand b { background: var(--acc); color: var(--acc-fg); padding: 0 8px; margin-right: 6px; }
.steps { display: flex; gap: 4px; flex: 1; justify-content: center; min-width: 0; }
.step { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--mut); padding: 0 10px; height: 36px; border-radius: 4px; font-family: var(--cond); font-weight: 700; font-size: 16px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.step .n { font-family: var(--mono); font-size: 11px; opacity: .7; }
.step.done { color: var(--fg); }
.step.now { background: var(--acc); color: var(--acc-fg); }
.clock { color: var(--mut); white-space: nowrap; text-align: right; line-height: 1.3; }
.clock b { color: var(--fg); }

.main { display: grid; grid-template-columns: 250px minmax(0, 1fr) 380px; min-height: 0; }

/* Crew: each player's BAC, always visible */
.crew { border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.crew-h { color: var(--mut); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; display: flex; justify-content: space-between; padding: 2px 2px 4px; }
.mate { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; grid-template-columns: 36px 1fr auto; gap: 4px 10px; align-items: center; }
.mate.serving { border-color: var(--acc); }
.mate .av { width: 36px; height: 36px; border-radius: 50%; grid-row: span 2; }
.mate .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mate .dr { color: var(--mut); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mate .bac { font-family: var(--cond); font-weight: 800; font-size: 26px; line-height: 1; grid-row: span 2; text-align: right; }
.mate .bac small { display: block; font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--mut); }
.mate .meter { grid-column: 1 / -1; height: 4px; background: var(--raise); border-radius: 2px; overflow: hidden; }
.mate .meter i { display: block; height: 100%; transition: width .6s ease; }
.mate svg { grid-column: 1 / -1; width: 100%; height: 26px; }
.empty-seat { border: 1px dashed var(--line); border-radius: 6px; padding: 14px; color: var(--mut); text-align: center; }

/* Stage */
.stage { min-height: 0; overflow: auto; padding: 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.stage-h { display: flex; align-items: center; gap: 12px; }
.stage-h h1 { white-space: nowrap; font-family: var(--cond); font-weight: 800; font-size: 34px; margin: 0; letter-spacing: .01em; text-transform: uppercase; }
.stage-h .meta { color: var(--mut); }
.stage-h .acts { margin-left: auto; display: flex; gap: 8px; }
.btn { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 0 16px; height: 40px; font-weight: 700; white-space: nowrap; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); }
.btn.big { height: 52px; font-size: 15px; padding: 0 24px; }
.input { background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; height: 40px; padding: 0 12px; font: inherit; font-size: 14px; }

/* Open tab (lobby) */
.find { display: flex; gap: 8px; } .find .input { flex: 1; max-width: 420px; }
.hits { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.hit { display: flex; align-items: center; gap: 10px; border: 1px dashed var(--line); border-radius: 6px; padding: 8px 10px; }
.hit img { width: 36px; height: 36px; border-radius: 50%; } .hit .btn { margin-left: auto; height: 34px; }
.seats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.seat { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px; display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; align-items: center; }
.seat img.av { width: 44px; height: 44px; border-radius: 50%; grid-row: span 2; }
.seat .nm { font-weight: 700; } .seat .rk { color: var(--mut); font-size: 12px; }
.seat .recent { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 6px; } .seat .recent img { width: 26px; height: 26px; border-radius: 4px; }
.seat .x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border: 0; background: transparent; color: var(--mut); font-size: 18px; border-radius: 50%; }
.seat.loading { opacity: .6; } .seat.loading .rk::after { content: ''; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border: 2px solid var(--mut); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Orders (check-in) */
.orders { display: flex; flex-direction: column; gap: 8px; }
.order { display: grid; grid-template-columns: minmax(150px, 1fr) 110px 92px; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.order .who { display: flex; gap: 10px; align-items: center; min-width: 0; } .order .who img { width: 36px; height: 36px; border-radius: 50%; }
.order .who .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.order label { display: flex; flex-direction: column; gap: 3px; color: var(--mut); font-size: 11px; }
.order .input { height: 36px; width: 100%; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; height: 36px; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--mut); }
.seg button.on { background: var(--fg); color: var(--bg); font-weight: 700; }
.menu { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.drink { flex-direction: row !important; justify-content: center; gap: 8px; height: 34px; }
.drink { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 5px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.drink b { font-family: var(--cond); font-size: 16px; } .drink span { color: var(--mut); font-size: 10px; white-space: nowrap; }
.drink.on { border-color: var(--acc); background: rgba(255,106,19,.12); } .drink.on span { color: var(--fg); }

/* Specials (challenges) and bet slips: dealt cards */
.deal { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; perspective: 1000px; }
.card { position: relative; background: var(--paper); color: var(--ink); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 230px; }
.card .for { display: flex; align-items: center; gap: 8px; font-weight: 700; } .card .for img { width: 28px; height: 28px; border-radius: 50%; }
.card .kind { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mut); }
.card .t { font-family: var(--cond); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; }
.card .r { color: var(--ink-mut); }
.card .items { display: flex; flex-wrap: wrap; gap: 4px; } .card .stakes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.card .stakes div { border: 1px dashed rgba(0,0,0,.2); border-radius: 6px; padding: 6px; text-align: center; }
.card .stakes b { display: block; font-family: var(--cond); font-size: 20px; }
.card .stakes .w b { color: #1e8b4e; } .card .stakes .l b { color: #d23a28; }
.card .items img { width: 30px; height: 30px; border-radius: 4px; }
.card .items img.need { box-shadow: 0 0 0 2px var(--good); } .card .items img.ban { box-shadow: 0 0 0 2px var(--bad); filter: grayscale(.6); }
.card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--ink-mut); font-size: 11px; }
.card .redo { border: 1px solid rgba(0,0,0,.18); background: transparent; border-radius: 6px; height: 30px; padding: 0 10px; color: var(--ink); }
.card .back { position: absolute; inset: 0; border-radius: 10px; background: repeating-linear-gradient(45deg, var(--acc) 0 6px, #c94f0a 6px 12px); border: 6px solid var(--paper); opacity: 0; pointer-events: none; }
.card.dealt { animation: deal .5s cubic-bezier(.2,.7,.3,1) both; animation-delay: var(--d); }
.card.dealt .back { animation: flip .45s ease-in both; animation-delay: calc(var(--d) + .55s); }
@keyframes deal { from { transform: translate(-60px, -260px) rotate(-25deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flip { 0% { opacity: 1; transform: rotateY(0); } 99% { opacity: 1; transform: rotateY(90deg); } 100% { opacity: 0; } }
.slip .vs { display: flex; align-items: center; gap: 8px; }
.slip .vs img { width: 44px; height: 44px; border-radius: 50%; }
.slip .stakes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 12px; }
.slip .stakes div { border: 1px dashed rgba(0,0,0,.2); border-radius: 6px; padding: 6px; text-align: center; }
.slip .stakes b { display: block; font-family: var(--cond); font-size: 20px; }
.slip .stakes .w b { color: #1e8b4e; } .slip .stakes .l b { color: #d23a28; }

/* In game */
.live { flex: 1; display: grid; grid-template-rows: auto auto 1fr; gap: 14px; align-items: start; }
.bigclock { font-family: var(--cond); font-weight: 800; font-size: 96px; line-height: .9; text-align: center; }
.bigclock small { display: block; font-family: var(--mono); font-weight: 400; font-size: 12px; color: var(--mut); letter-spacing: .1em; margin-top: 8px; }
.lineup { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lu { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lu .pics { position: relative; } .lu .pics .ch { width: 64px; height: 64px; border-radius: 8px; } .lu .pics .av { position: absolute; right: -8px; bottom: -8px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--panel); }
.lu .nm { font-weight: 700; } .lu .sm { color: var(--mut); font-size: 11px; }
.pull { justify-self: center; align-self: end; }
.pulling { justify-self: center; align-self: end; color: var(--acc); font-size: 15px; height: 52px; display: flex; align-items: center; }
.pulling::before { content: ''; width: 14px; height: 14px; margin-right: 10px; border: 3px solid var(--acc); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* Receipts stage: who's up */
.line-up { display: flex; flex-direction: column; gap: 8px; }
.q { display: grid; grid-template-columns: 36px 1fr auto auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.q img { width: 36px; height: 36px; border-radius: 50%; }
.q .nm { font-weight: 700; } .q .sm { color: var(--mut); font-size: 11px; }
.q .tot { font-family: var(--cond); font-weight: 800; font-size: 22px; }
.q .st { font-size: 11px; letter-spacing: .1em; color: var(--mut); min-width: 64px; text-align: right; }
.q.now { border-color: var(--acc); background: rgba(255,106,19,.08); } .q.now .st { color: var(--acc); }
.q.done { opacity: .45; } .q.done .st { color: var(--good); }
.serve { display: flex; gap: 8px; margin-top: 4px; }

/* Printer + receipt */
.printer { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #0e0d0c; }
.slot { flex: 0 0 auto; margin: 14px 14px 0; height: 30px; border-radius: 6px 6px 2px 2px; background: linear-gradient(#2b2a27, #1a1917); box-shadow: inset 0 -6px 0 #000; display: flex; align-items: center; padding: 0 12px; color: #6f6c64; font-size: 10px; letter-spacing: .2em; position: relative; z-index: 2; }
.paper-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 26px 20px; margin-top: -4px; }
.receipt { background: var(--paper); color: var(--ink); padding: 18px 16px 22px; font-size: 12px; position: relative; }
.receipt::after { content: ''; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: linear-gradient(-45deg, transparent 6px, var(--paper) 0) 0 0/12px 8px repeat-x, linear-gradient(45deg, transparent 6px, var(--paper) 0) 0 0/12px 8px repeat-x; }
.receipt.printing { animation: print 1.3s steps(16) both; }
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -10px 0); } }
.rc-c { text-align: center; } .rc-hd { font-family: var(--cond); font-weight: 800; font-size: 22px; letter-spacing: .04em; }
.rc-sm { color: var(--ink-mut); font-size: 11px; }
.rc-hr { border-top: 1px dashed #b4b0a6; margin: 9px 0; }
.rc-who { display: flex; align-items: center; gap: 8px; } .rc-who img { width: 34px; height: 34px; border-radius: 50%; } .rc-who .ch { border-radius: 4px; margin-left: auto; }
.rc-build { display: flex; gap: 2px; margin-top: 8px; } .rc-build img, .rc-build span { width: 24px; height: 24px; } .rc-build span { background: #ebe8df; }
.rc-l { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 3px 0; }
.rc-l img { width: 22px; height: 22px; } .rc-l img.bad { box-shadow: 0 0 0 2px var(--bad); } .rc-l img.good { box-shadow: 0 0 0 2px var(--good); } .rc-l img.dead { filter: grayscale(1); }
.rc-l .give { color: var(--ink-mut); }
.rc-tot { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.rc-tot.big { font-family: var(--cond); font-size: 26px; }
.rc-glass { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.rc-glass .gl { display: flex; gap: 3px; } .rc-glass .gl i { width: 14px; height: 20px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 3px 3px; position: relative; overflow: hidden; }
.rc-glass .gl i::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--f); background: var(--warn); }
.rc-bac { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 6px; margin-top: 6px; }
.rc-bac b { display: block; font-family: var(--cond); font-size: 24px; }
.stamp { position: absolute; top: 70px; right: 14px; border: 3px solid var(--good); color: var(--good); font-weight: 800; font-size: 15px; padding: 2px 10px; transform: rotate(-12deg); }
.tabrow { white-space: nowrap; display: grid; grid-template-columns: 26px 1fr auto 44px; gap: 8px; align-items: center; padding: 4px 0; }
.tabrow img { width: 26px; height: 26px; border-radius: 50%; }

.tabrow > :nth-child(n+3) { text-align: right; }
@media (max-width: 1360px) { .main { grid-template-columns: 220px minmax(0, 1fr) 330px; } .paper-wrap { padding: 0 18px 20px; } }
