/*
 * DICE AFTER DARK - cabinet styles
 * Copied from Trivia After Dark's cabinet (2026-10-30), which is Hold'em's: the fixed 1600x900 stage app.js
 * scales to fit, the bezel with its neon rails, 9-sliced plates, LCD readouts and arcade buttons.
 * Desktop only: a phone gets one card. The dice playfield follows at the bottom of this file.
 */
/*
 * The cabinet's two typefaces, served from here instead of Google Fonts (same as Euchre,
 * 2026-10-28): Bungee (display) and Barlow Condensed 500/600/700 (UI), both SIL Open Font
 * License 1.1 (fonts/OFL-*.txt). Same files and unicode ranges Google served; a browser only
 * fetches the ranges a page actually uses.
 */
/* vietnamese */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-condensed-500-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-condensed-500-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/barlow-condensed-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-condensed-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-condensed-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/barlow-condensed-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-condensed-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-condensed-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/barlow-condensed-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* vietnamese */
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/bungee-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/bungee-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Bungee';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/bungee-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #0d0a09;
    --felt-dark: #15100d;
    --cream: #f7f0e1;
    --card-red: #c8261b;
    --card-black: #16120f;
    --gold: #f2c14e;
    --gold-deep: #a8761c;
    --neon-red: #ff5544;
    --neon-blue: #45c9ff;
    --lcd: #7dff6b;
    --text: #f3eadb;
    --muted: #b5a690;
    --display: 'Bungee', 'Impact', 'Arial Black', sans-serif;
    --ui: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
    --card-w: 92px;
    --card-h: 128px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    background: radial-gradient(ellipse at 50% 40%, #241812 0%, var(--ink) 70%);
    color: var(--text);
    font: 600 18px/1.25 var(--ui);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
#safe-probe {
    position: fixed; visibility: hidden; pointer-events: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* ---------- Stage & bezel ---------- */

#viewport { position: fixed; inset: 0; overflow: clip; }
/* Scrollbars, house rule: fit first; when a panel must scroll, one thin gold bar, never the grey default, never nested. */
* { scrollbar-width: thin; scrollbar-color: var(--gold) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; }
#stage::before {
    content: ''; position: absolute; inset: 60px 30px; z-index: -1; border-radius: 40px;
    box-shadow: -50px 0 90px -20px rgba(255, 85, 68, .35), 50px 0 90px -20px rgba(69, 201, 255, .35);
}
.bezel {
    position: absolute; inset: 0; border-style: solid; border-width: 50px 56px 78px;
    border-image: url(assets/bezel.webp) 132 147 205 147 stretch;
    pointer-events: none; z-index: 50;
}
.screen {
    position: absolute; inset: 44px 50px 72px; overflow: clip;
    background: url(assets/felt.webp) center / cover, var(--felt-dark);
    border-radius: 18px;
}
.view { position: absolute; inset: 6px; }

/* ---------- Buttons ---------- */

.arcade-btn {
    min-width: 150px; height: 70px; padding: 0 14px;
    border-style: solid; border-width: 20px 24px;
    border-image: url(assets/btn-blue.webp) 76 90 fill stretch;
    background: none;
    font: 400 20px/1 var(--display); letter-spacing: .02em; color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, .55), 0 0 10px rgba(0, 0, 0, .35);
    cursor: pointer; white-space: nowrap;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .08s ease;
}
.arcade-btn > * { margin: -20px 0; }
.arcade-btn.green { border-image-source: url(assets/btn-green.webp); }
.arcade-btn.red { border-image-source: url(assets/btn-red.webp); }
.arcade-btn.gold { border-image-source: url(assets/btn-gold.webp); color: #3b2300; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); }
.arcade-btn:hover:not(:disabled) { filter: brightness(1.12); }
.arcade-btn:active:not(:disabled) { transform: translateY(2px) scale(.98); }
/* Waiting for your turn: the buttons stay put, dark steel with dim lettering, so nothing jumps when it's you. */
.arcade-btn:disabled {
    border-image-source: url(assets/btn-gold.webp); border-image-slice: 76 90;
    background: linear-gradient(#34302d, #1a1715 60%, #26221f); background-clip: padding-box;
    color: #7b6f60; text-shadow: 0 1px 0 #000; cursor: default; opacity: .8;
}
.arcade-btn.busy { opacity: .7; pointer-events: none; }
.arcade-btn:focus-visible, .round:focus-visible, .avatar-grid button:focus-visible { outline: 3px solid var(--neon-blue); outline-offset: 3px; }

.round { position: relative; width: 60px; height: 60px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .08s; }
.round img { width: 100%; height: 100%; display: block; }
.round:hover { filter: brightness(1.12); }
.round:active { transform: scale(.94); }
/* Speaker: a dark steel face over the base button's "?", the speaker on it, a red slash when off. */
.sound-btn::before {
    content: ''; position: absolute; inset: 20%; border-radius: 50%; z-index: 1;
    background: radial-gradient(ellipse at 50% 16%, rgba(255, 255, 255, .45) 0 18%, transparent 42%),
        radial-gradient(circle at 50% 40%, #5a5550 0%, #2b2724 60%, #141210 100%);
}
.round.sound-btn img.spk { position: absolute; left: 24%; top: 30%; width: 54%; height: 40%; object-fit: contain; z-index: 2; }
.sound-btn:not(.on) img.spk { opacity: .45; }
.sound-btn:not(.on)::after {
    content: ''; position: absolute; left: 24%; right: 24%; top: 48%; height: 4px; border-radius: 3px; z-index: 3;
    background: #e3261b; box-shadow: 0 0 0 2px #1a0503; transform: rotate(-35deg);
}
.text-btn { background: none; border: 0; color: var(--muted); font: 700 15px var(--ui); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; padding: 6px 10px; }
.text-btn:hover { color: var(--gold); }

/* ← The Bar (Ben's sign) and the jukebox beside it, in the top-left corner of every view. */
.corner { position: absolute; left: 12px; top: 12px; z-index: 30; display: flex; align-items: center; gap: 8px; }
.door { height: 40px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .08s; }
.door img { height: 100%; width: auto; display: block; }
.door:hover { filter: brightness(1.15); }
.door:active { transform: scale(.96); }
.door:focus-visible { outline: 3px solid var(--neon-blue); outline-offset: 3px; }
/* In the game it heads the plates column. */
#game:not([hidden]) ~ .corner { top: 12px; left: 14px; }
.plates { padding-top: 52px; grid-auto-rows: 80px; gap: 6px; }
.plates .plate { height: 80px; }
/* If the sign can't load (the front page is down), the door says it in words. */
.door.words img { display: none; }
.door.words::after { content: '← THE BAR'; font: 400 16px/40px var(--display); color: var(--gold); white-space: nowrap; }

/* ---------- Logo ---------- */


.title-panel {
    display: grid; gap: 10px; padding: 18px 24px 18px 16px;
    border-style: solid; border-width: 28px 35px 31px 23px;
    border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch;
}
.field-label { display: block; font: 400 15px var(--display); color: var(--gold); letter-spacing: .04em; margin-top: 4px; }
#player-name {
    width: 100%; height: 52px; padding: 0 16px; border-radius: 10px;
    border: 2px solid var(--gold-deep); background: #050505; color: var(--lcd);
    font: 700 26px var(--ui); letter-spacing: .02em; user-select: text; /* your name as you type it, the case the log will show (022) */
    box-shadow: inset 0 0 14px rgba(125, 255, 107, .12);
}
#player-name::placeholder { color: #2f5a2b; }
#player-name:focus { outline: none; border-color: var(--gold); }
.avatar-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.avatar-grid button {
    aspect-ratio: 1; padding: 4px; border-radius: 12px; border: 2px solid #3a2c20;
    background: #120d0a; cursor: pointer;
}
.avatar-grid button img { width: 100%; height: 100%; object-fit: contain; display: block; }
.avatar-grid button.selected { border-color: var(--gold); background: #2a1c0c; box-shadow: 0 0 14px rgba(242, 193, 78, .45); }
.title-panel .arcade-btn.wide { width: 100%; height: 82px; font-size: 26px; border-width: 22px 26px; margin-top: 6px; }
.title-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
.title-actions .arcade-btn { width: 100%; min-width: 0; font-size: 18px; }
.smallprint { text-align: center; font: 700 14px var(--ui); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

/* ---------- Lobby ---------- */

/* ---------- Plates ---------- */
.plate {
    position: relative; width: 230px; height: 82px;
    border-style: solid; border-width: 19px 23px;
    border-image: url(assets/plate-name.webp) 66 72 fill stretch;
    display: grid; align-content: center; padding-right: 58px;
}
.plate .name { font: 400 18px/1 var(--display); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: -6px 0 0 -6px; }
.plate .sub { font: 700 13px/1 var(--ui); letter-spacing: .12em; color: #d7cff5; margin: 6px 0 -6px -6px; white-space: nowrap; }
.plate .stack { display: flex; align-items: center; gap: 6px; margin: 6px 0 -6px -6px; }
.plate .stack::before { content: ''; width: 17px; height: 17px; flex: none; background: url(assets/chip-1k-flat.webp) center / contain no-repeat; }
.plate .stack b { font: 400 17px/1 var(--display); color: var(--gold); text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.plate .avatar { position: absolute; right: -38px; top: 50%; width: 90px; height: 90px; transform: translateY(-54%); object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6)); z-index: 2; }
.seat.me .plate, .lobby-seat.me .plate { border-image-source: url(assets/plate-name-me.webp); }
.say {
    position: absolute; left: 0; top: -82px; z-index: 8; max-width: 280px; width: max-content;
    padding: 8px 14px; border-radius: 14px; background: var(--cream); color: var(--card-black);
    font: 700 17px/1.15 var(--ui); box-shadow: 0 6px 14px rgba(0, 0, 0, .55);
    animation: pop-in-say .3s cubic-bezier(.2, 1.6, .4, 1);
}
.say::after { content: ''; position: absolute; left: 40px; bottom: -9px; border: 10px solid transparent; border-bottom: 0; border-top-color: var(--cream); }
@keyframes pop-in-say { from { transform: scale(.6); opacity: 0; } }

/* ---------- Side column ---------- */

.side { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.side-top { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 2px; }
#exit { margin-left: 12px; }
.readout, .readout-clock {
    height: 52px; padding: 0 8px; border-style: solid; border-width: 13px 15px;
    border-image: url(assets/readout.webp) 64 70 fill stretch; background: none;
    display: flex; align-items: center; justify-content: space-between;
}
.readout span, .readout-clock span { font: 700 14px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: -8px 0; }
.readout b, .readout-clock b { font: 400 24px/1 var(--display); color: var(--lcd); text-shadow: 0 0 8px rgba(125, 255, 107, .6); margin: -8px 0; font-variant-numeric: tabular-nums; }
.readout b.up { color: var(--lcd); }
.readout b.down { color: #ff8a73; text-shadow: 0 0 8px rgba(255, 85, 68, .6); }
.readout-clock { height: 56px; border-width: 14px 15px 14px 58px; border-image: url(assets/readout-clock.webp) 58 64 58 236 fill stretch; padding-left: 12px; }
.room-code { cursor: pointer; }
.room-code b { letter-spacing: .1em; }
.chat {
    flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 4px 4px;
    border-style: solid; border-width: 28px 35px 31px 23px;
    border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch;
}
/* Log filter: All / Game / Chat */
.chat-filter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.chat-filter button {
    position: relative; height: 26px; padding: 0; border-radius: 8px; border: 1px solid #4a3a2c; background: #120d0a;
    font: 400 12px var(--display); color: var(--muted); cursor: pointer;
}
.chat-filter button[aria-checked='true'] { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(242, 193, 78, .25); }
.chat-filter .dot { position: absolute; top: 4px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #e3261b; box-shadow: 0 0 6px rgba(227, 38, 27, .8); }
.chat-log[data-filter='game'] .msg:not(.sys), .chat-log[data-filter='game'] .msg.react { display: none; }
.chat-log[data-filter='chat'] .msg.sys:not(.react), .chat-log[data-filter='chat'] .divider { display: none; }
.chat-log .msg.react { color: var(--gold); border-left-color: var(--gold-deep); }
.connection { font: 700 13px var(--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.connection:empty { display: none; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; font-size: 16px; user-select: text; }
.chat-log .msg { display: flex; gap: 6px; align-items: flex-start; line-height: 1.2; }
.chat-log .msg img { width: 26px; height: 26px; object-fit: contain; flex: none; margin-top: -2px; }
.chat-log .msg b { color: var(--gold); font-weight: 700; margin-right: 5px; }
.chat-log .msg.me b { color: var(--neon-blue); }
.chat-log .msg.sys { color: var(--muted); font-weight: 500; font-size: 15px; padding-left: 4px; border-left: 2px solid #4a3a2c; }
.chat-log .msg.sys.big { color: var(--text); border-left-color: var(--gold); }
.chat-log .divider { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font: 400 12px var(--display); color: var(--gold-deep); letter-spacing: .06em; text-transform: uppercase; }
.chat-log .divider::before, .chat-log .divider::after { content: ''; flex: 1; height: 1px; background: #4a3a2c; }
.quick-chat { display: flex; flex-wrap: wrap; gap: 4px; }
.quick-chat button { padding: 3px 9px; border-radius: 999px; border: 1px solid #5a4632; background: #120d0a; font: 600 14px var(--ui); color: var(--text); cursor: pointer; }
.quick-chat button:hover { border-color: var(--gold); color: var(--gold); }
.chat-form { display: flex; gap: 4px; }
.chat-form input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid #5a4632; background: #050505; color: var(--text); font: 600 16px var(--ui); user-select: text; }
.chat-form input:focus { outline: none; border-color: var(--gold); }
.chat-form button { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--gold-deep); background: #2a1c0c; color: var(--gold); font: 400 13px var(--display); cursor: pointer; }

/* ---------- Dialogs & toast (outside the stage, sized to the window) ---------- */

dialog {
    width: min(560px, 92vw); max-height: 88vh; overflow: auto; color: var(--text); background: none;
    padding: 22px 26px 22px 20px; border-style: solid; border-width: 28px 35px 31px 23px;
    border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch;
    font: 600 18px/1.35 var(--ui);
}
dialog::backdrop { background: rgba(5, 3, 2, .75); }
body.modal .view, body.modal #lobby.view { overflow: hidden; }
dialog:has(.cat-list) { width: min(640px, 92vw); }
dialog h2 { margin: 4px 0 10px; font: 400 28px/1.1 var(--display); color: var(--gold); }
dialog p, dialog ol { margin: 0 0 12px; }
dialog ol { padding-left: 20px; }
dialog li { margin-bottom: 6px; }
dialog .arcade-btn { width: 100%; margin-top: 10px; }
dialog .field-label { margin: 8px 0 6px; }
.dialog-close { position: absolute; right: 8px; top: 2px; background: none; border: 0; color: var(--muted); font-size: 30px; cursor: pointer; }
.invite-url { width: 100%; height: 40px; padding: 0 10px; border-radius: 8px; border: 1px solid #5a4632; background: #050505; color: var(--text); font: 600 14px var(--ui); }
.menu-list { display: grid; gap: 4px; }
/* Table speed: Relaxed / Normal / Quick */
.table-settings { display: grid; gap: 6px; margin: 4px 0 14px; padding-bottom: 12px; border-bottom: 1px solid rgba(242, 193, 78, .25); }
.table-settings .arcade-btn { margin-top: 0; }
.speed-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.speed-row button {
    height: 44px; border-radius: 10px; border: 2px solid #4a3a2c; background: #120d0a; cursor: pointer;
    font: 400 15px var(--display); color: var(--muted);
}
@media (max-width: 500px) { .speed-row button { font-size: 12px; } } /* dialogs are sized to the window, not the stage */
.speed-row button[aria-checked='true'] { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 14px rgba(242, 193, 78, .25); }
#toast {
    position: fixed; left: 50%; bottom: 7vh; transform: translateX(-50%); z-index: 100; max-width: 90vw;
    padding: 12px 22px; border-radius: 999px; background: #050505; border: 2px solid var(--gold-deep);
    font: 700 18px var(--ui); color: var(--gold); box-shadow: 0 8px 24px rgba(0, 0, 0, .6); text-align: center;
}
.bar-calling, .bar-closed { text-align: center; font-size: 20px; margin: 18px 0 6px; }
.bar-calling { color: var(--muted); animation: bar-blink 1.2s ease-in-out infinite; }
@keyframes bar-blink { 50% { opacity: .45; } }
.bar-me { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.bar-face {
    width: 64px; height: 64px; padding: 4px; border-radius: 14px; border: 2px solid var(--gold-deep);
    background: #120d0a; cursor: pointer; box-shadow: 0 0 14px rgba(242, 193, 78, .25);
}
.bar-face img { width: 100%; height: 100%; object-fit: contain; display: block; }
#bar-name, #bar-code {
    width: 100%; min-width: 0; height: 52px; padding: 0 14px; border-radius: 10px;
    border: 2px solid var(--gold-deep); background: #050505; color: var(--lcd);
    font: 400 22px var(--display); text-transform: uppercase; user-select: text;
    box-shadow: inset 0 0 14px rgba(125, 255, 107, .12);
}
#bar-code { letter-spacing: .3em; }
#bar-name { font: 700 26px var(--ui); letter-spacing: .02em; text-transform: none; }
#bar-name::placeholder, #bar-code::placeholder { color: #2f5a2b; }
#bar-name:focus, #bar-code:focus { outline: none; border-color: var(--gold); }
.bar-note { margin: 8px 0 4px !important; font: 600 15px/1.3 var(--ui); color: var(--muted); }
.bar-join { display: grid; grid-template-columns: 1fr 132px; gap: 10px; align-items: center; }
dialog .bar-join .arcade-btn { margin-top: 0; height: 56px; min-width: 0; font-size: 18px; }
.bar-tables ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bar-tables li {
    display: grid; grid-template-columns: auto 1fr 120px; gap: 10px; align-items: center;
    padding: 6px 8px 6px 12px; border-radius: 10px; background: rgba(0, 0, 0, .45); border: 1px solid #3a2c20;
}
.bar-tables li b { font: 400 20px var(--display); color: var(--lcd); letter-spacing: .12em; }
.bar-tables li span { font: 600 14px var(--ui); color: var(--muted); }
dialog .bar-tables .arcade-btn { margin-top: 0; height: 48px; min-width: 0; font-size: 15px; }
.bar-error { min-height: 0; margin: 8px 0 0 !important; color: #ff8a7a; font: 600 15px var(--ui); }
.bar-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.bar-tabs button {
    height: 38px; border-radius: 8px; border: 1px solid var(--gold-deep); background: #120d0a;
    color: var(--muted); font: 400 15px var(--display); cursor: pointer;
}
.bar-tabs button[aria-selected='true'] { background: #2a1c0c; color: var(--gold); }
.bar-faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; }
.bar-faces button { aspect-ratio: 1; padding: 4px; border-radius: 12px; border: 2px solid #3a2c20; background: #120d0a; cursor: pointer; }
.bar-faces button img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bar-faces button.selected { border-color: var(--gold); background: #2a1c0c; box-shadow: 0 0 14px rgba(242, 193, 78, .45); }
@media (max-width: 520px) {
    .bar-join { grid-template-columns: 1fr 104px; }
    #bar-code { letter-spacing: .12em; padding: 0 10px; font-size: 20px; }
    .bar-tables li { grid-template-columns: auto 1fr; }
    .bar-tables li button { grid-column: 1 / -1; }
    .bar-faces { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* The host's gone: the bar's countdown, over the felt, on every seat */
.bar-wait {
    position: absolute; left: 50%; top: 318px; z-index: 30; transform: translateX(-50%);
    display: grid; justify-items: center; gap: 2px; padding: 12px 28px 14px; min-width: 340px;
    border-radius: 16px; border: 2px solid var(--gold-deep); background: rgba(5, 4, 3, .92);
    box-shadow: 0 0 0 1px #000, 0 12px 40px rgba(0, 0, 0, .7), 0 0 24px rgba(242, 193, 78, .2);
    pointer-events: none;
}
.bar-wait b { font: 400 20px var(--display); color: var(--gold); letter-spacing: .06em; }
.bar-wait span { font: 400 48px/1 var(--display); color: #ff6a5a; text-shadow: 0 0 12px rgba(255, 80, 60, .5); }
.bar-wait small { font: 600 14px var(--ui); color: var(--muted); }

.react-menu .rm-grid .rm-kick { border-color: #6a1d18; }

/* =================================================================================
   DICE: the playfield (1600x900). Plates left; Jeff, the felt and the chalkboard centre;
   readouts and the log right. The art is Ben's, copied from ~/Labs/afterdark/art/dice/.
   ================================================================================= */

:root { --amber: #ffb347; --amber-hot: #ff8a2a; --chalk: #f4f1e6; --chalk-dim: rgba(244, 241, 230, .34); --chalk-red: #ff6b55; }
.screen { background: linear-gradient(rgba(8, 5, 4, .55), rgba(8, 5, 4, .78)), url(assets/bar.webp) center / cover, var(--felt-dark); }
body.season-halloween .screen { background: linear-gradient(rgba(30, 10, 0, .5), rgba(8, 5, 4, .8)), url(assets/bar.webp) center / cover, var(--felt-dark); }

/* The logo: the family's (art/dice/logo-dice.webp, red DICE, blue AFTER DARK, the moon), 900 and 420 wide here */
.logo { display: block; height: auto; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .6)) drop-shadow(0 0 22px rgba(69, 140, 255, .18)); }

/* Title */
#title-screen { display: grid; grid-template-columns: 1fr 520px; grid-template-rows: 1fr auto; align-items: center; gap: 12px 24px; padding: 0 48px 10px; }
.title-brand { display: grid; justify-items: center; gap: 12px; }
.title-logo { width: auto; height: 330px; margin-top: 8px; }
.title-crew { width: 100%; max-width: 760px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .7)); }
.tagline { margin: 0; font: 400 24px var(--display); color: var(--gold); letter-spacing: .04em; text-shadow: 0 2px 0 #000, 0 0 12px rgba(242, 193, 78, .35); }
.title-fine { grid-column: 1 / -1; margin: 0; text-align: center; font: 600 14px var(--ui); letter-spacing: .04em; color: rgba(181, 166, 144, .7); }
.title-fine span { margin-left: 10px; white-space: nowrap; }

/* Lobby: six stools left (two rows of three) over how it plays; the side column right */
#lobby { display: grid; grid-template-columns: 1fr 396px; gap: 16px; padding: 4px 6px 2px; }
.lobby-left { display: grid; grid-template-rows: 92px 1fr 140px; gap: 16px; min-height: 0; }
.lobby-head { display: flex; align-items: center; gap: 22px; padding-left: 210px; }
.lobby-logo { width: auto; height: 92px; }
.lobby-head .field-label { font-size: 17px; }
.lobby-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 96px; gap: 48px 30px; align-content: center;
    padding: 30px 34px 26px 44px; border-style: solid; border-width: 28px 35px 31px 23px; border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch; }
.lobby-grid .lobby-seat { position: relative; min-width: 0; }
.lobby-grid .lobby-seat .plate { width: 100%; height: 88px; padding: 0 8px 0 74px; gap: 4px; }
.lobby-grid .lobby-seat .plate .avatar { width: 76px; height: 76px; left: -14px; }
.lobby-grid .lobby-seat .plate .name { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobby-grid .lobby-seat.cpu .plate { opacity: .62; }
.lobby-grid .lobby-seat.empty { padding: 0; border: 0; background: none; cursor: pointer; }
.lobby-grid .lobby-seat.empty .plate { padding: 0; filter: grayscale(.85) brightness(.38); transition: filter .15s; }
.lobby-grid .lobby-seat.empty:hover .plate, .lobby-grid .lobby-seat.empty:focus-visible .plate { filter: grayscale(.6) brightness(.6); }
.lobby-grid .lobby-seat.empty > .place { left: -14px; top: -14px; opacity: .7; }
.lobby-grid .lobby-seat .join { position: absolute; inset: 0 0 8px; display: flex; align-items: center; justify-content: center; font: 400 19px var(--display); color: #fff; letter-spacing: .06em; }
.lobby-grid .lobby-seat .join i { font-style: normal; display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 8px; border-radius: 50%; border: 2px solid #fff; font: 400 20px/1 var(--display); }
.lobby-how { list-style: none; margin: 0; padding: 0 10px 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-content: center; }
.lobby-how li { display: grid; justify-items: center; gap: 4px; padding: 16px 10px; border-radius: 16px; background: rgba(5, 4, 3, .6); border: 1px solid rgba(242, 193, 78, .25);
    font: 700 18px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.lobby-how b { font: 400 40px/1 var(--display); color: var(--amber); text-shadow: 0 0 12px rgba(255, 140, 40, .5); }

.lobby-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 18px 20px 12px 12px;
    border-style: solid; border-width: 28px 35px 31px 23px; border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch; }
.lobby-count { display: grid; justify-items: center; padding: 4px 0 2px; }
.lobby-count b { font: 400 30px/1 var(--display); color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 12px rgba(242, 193, 78, .35); }
.lobby-count span { font: 700 15px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lobby-codebox { display: grid; justify-items: center; gap: 6px; }
.lobby-codebox .field-label { font-size: 13px; }
.lobby-code { width: 100%; height: 76px; padding: 0 16px; cursor: pointer; display: grid; place-items: center;
    border-style: solid; border-width: 16px 18px; border-image: url(assets/readout.webp) 64 70 fill stretch; background: none; }
.lobby-code b { font: 400 46px/1 var(--display); letter-spacing: .14em; color: var(--lcd); text-shadow: 0 0 12px rgba(125, 255, 107, .6); margin: -10px 0; }
.lobby-codebox .arcade-btn { width: 100%; height: 58px; font-size: 19px; }
.lobby-settings { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(242, 193, 78, .25); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; font: 700 15px var(--ui); letter-spacing: .12em; color: var(--muted); }
.set-ctl { display: flex; align-items: center; gap: 8px; }
.set-row b { min-width: 40px; text-align: center; font: 400 22px var(--display); color: var(--lcd); text-shadow: 0 0 8px rgba(125, 255, 107, .5); }
.set-row button { height: 36px; min-width: 36px; border-radius: 8px; border: 2px solid #5a4632; background: #120d0a; color: var(--gold); font: 400 16px var(--display); cursor: pointer; }
.set-row button:disabled { opacity: .35; cursor: default; }
.set-ctl.seg { gap: 4px; }
.set-ctl.seg button { min-width: 58px; color: var(--muted); }
.set-ctl.seg button[aria-checked='true'] { border-color: var(--gold); color: var(--lcd); background: #050505; box-shadow: 0 0 10px rgba(125, 255, 107, .25); }
.lobby-side > .arcade-btn { width: 100%; height: 74px; font-size: 24px; margin-top: auto; }
.lobby-side > .arcade-btn:disabled { opacity: .6; }
.lobby-need { margin: -4px 0 0; text-align: center; font: 700 16px var(--ui); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.lobby-side > .text-btn { align-self: center; padding: 2px 10px; }

/* The game grid */
#game { display: grid; grid-template-columns: 228px minmax(0, 1fr) 272px; gap: 14px; padding: 6px 8px 4px; }

/* Plates: everyone at the table, best total first */
.plates { display: grid; grid-auto-rows: 84px; gap: 10px; align-content: start; padding-top: 58px; }
.plates .seat { position: relative; }
.plates .plate, .lobby-seat .plate { width: 100%; height: 84px; padding: 0 30px 0 66px; display: grid; grid-template-rows: auto auto; align-content: center; gap: 4px; }
.plate .avatar { left: -16px; right: auto; width: 76px; height: 76px; transform: translateY(-52%); }
.plate .name { margin: 0; font-size: 19px; }
.plate .pts { font: 400 21px/1 var(--display); color: var(--gold); text-shadow: 0 1px 0 #000; font-variant-numeric: tabular-nums; }
.lobby-seat .plate .pts { font: 700 13px var(--ui); letter-spacing: .14em; color: #d7cff5; }
.plate .place, .lobby-seat.empty > .place { position: absolute; left: -14px; top: -14px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 40% 35%, #ffe38a, #c8901e 70%); color: #2b1800; font: 400 14px/1 var(--display); box-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.plate .place:empty { display: none; }
.plate .st { display: none; }
/* the roller's plate carries a die */
.plate .st.dice-badge { display: block; position: absolute; right: -12px; top: 50%; width: 40px; height: 40px; margin-top: -20px; transform: rotate(-12deg);
    background: url(assets/dice.webp) 80% 0 / 600% 100% no-repeat; filter: drop-shadow(0 0 8px rgba(255, 179, 71, .9)) drop-shadow(0 3px 3px rgba(0, 0, 0, .6));
    animation: badge-rock 1.2s ease-in-out infinite alternate; }
@keyframes badge-rock { to { transform: rotate(10deg); } }
.seat.rolling .plate { filter: brightness(1.15) drop-shadow(0 0 10px rgba(255, 179, 71, .55)); }
.seat.me .plate { border-image-source: url(assets/plate-name-me.webp); }
.seat.left .plate, .seat.watching .plate { opacity: .45; filter: grayscale(.8); }
.seat.left .plate .pts::after { content: ' · LEFT'; font: 700 13px var(--ui); letter-spacing: .14em; color: #d7cff5; }
.plate .pts { white-space: nowrap; }
.readout-row .readout span { white-space: nowrap; }
.seat.watching .plate .pts { font: 700 13px var(--ui); letter-spacing: .14em; color: #d7cff5; }
.plates .say { left: 60px; bottom: calc(100% - 6px); top: auto; z-index: 20; max-width: 250px; }
.plates .seat:first-child .say { bottom: auto; top: calc(100% - 4px); }
.plates .seat:first-child .say::after { bottom: auto; top: -9px; border: 10px solid transparent; border-top: 0; border-bottom-color: var(--cream); }

/* Centre: Jeff over the table; the felt (dice, ROLL, the clock) beside the chalkboard */
.center { position: relative; display: grid; grid-template-rows: 104px 1fr; gap: 10px; min-width: 0; min-height: 0; }
.host-row { display: grid; grid-template-columns: 160px 1fr; align-items: center; gap: 10px; }
.desk-logo { width: auto; height: 104px; justify-self: center; }
.jeff { display: grid; grid-template-columns: 108px 1fr; align-items: center; }
.jeff img { width: 116px; height: 116px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .7)); z-index: 2; }
.jeff-say { position: relative; min-height: 70px; padding: 8px 18px 8px 22px; border-radius: 18px; background: var(--cream); color: #241507;
    font: 600 21px/1.2 var(--ui); box-shadow: 0 6px 16px rgba(0, 0, 0, .55); display: grid; align-content: center;
    justify-self: start; width: fit-content; max-width: min(560px, 100%); } /* as wide as the line, wraps at the cap (022d) */
.jeff-say::before { content: ''; position: absolute; left: -16px; top: 50%; margin-top: -10px; border: 10px solid transparent; border-right: 16px solid var(--cream); border-left: 0; }
.jeff-say b { font: 400 12px var(--display); letter-spacing: .08em; color: #a0441c; }
.jeff-say.pop { animation: pop-in-say .25s ease-out; }

.table { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 12px; min-height: 0; }
.felt-col { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr 80px 72px; gap: 8px; min-height: 0; }

/* The felt: green baize in a wooden rail with a brass line, as the mockup */
.felt { position: relative; border-radius: 30px; overflow: hidden;
    border: 16px solid #4a2a14; border-image: linear-gradient(160deg, #7a4a24, #3a1f0d 40%, #6b3d1c 70%, #2c170a) 1;
    background: radial-gradient(ellipse at 45% 40%, #2e6b38 0%, #1d4f28 45%, #11331a 85%), #15391d;
    box-shadow: inset 0 0 0 3px #b98a2e, inset 0 0 0 5px #2a1c0c, inset 0 12px 40px rgba(0, 0, 0, .55), 0 10px 24px rgba(0, 0, 0, .6); }
.felt::before { /* the nap */ content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .22;
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 5px), repeating-linear-gradient(25deg, rgba(0, 0, 0, .12) 0 1px, transparent 1px 4px); }

/* The cup (art/dice/cup.webp, 600x474, mouth to the left) at the back right of the felt. It tips on a roll. */
.cup { position: absolute; right: 18px; top: 0; width: 192px; height: 152px; transform-origin: 80% 85%; z-index: 1;
    background: url(assets/cup.webp) center / contain no-repeat; filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .55)); }
.cup.tip { animation: cup-tip .4s ease-in-out; }
@keyframes cup-tip { 40% { transform: rotate(-16deg) translate(-14px, 8px); } 70% { transform: rotate(4deg); } }

/* The note on the felt: the count-in, whose roll, the dice still in the cup */
.felt-note { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; pointer-events: none; z-index: 2; text-align: center; }
.felt-note:empty { display: none; }
.felt-say { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 22px; border-radius: 999px; background: rgba(5, 12, 6, .55);
    font: 700 26px var(--ui); letter-spacing: .04em; color: var(--cream); text-shadow: 0 2px 0 #000; }
.felt-say img { width: 52px; height: 52px; object-fit: contain; margin: -8px 0; }
.felt-say.big { font: 400 46px var(--display); letter-spacing: .06em; color: var(--gold); background: none; text-shadow: 0 3px 0 #000, 0 0 22px rgba(242, 193, 78, .5); }
.count-lead { display: block; font: 400 20px var(--display); letter-spacing: .12em; color: var(--gold); text-shadow: 0 2px 0 #000; }
.count { position: relative; width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center; }
.count svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.count circle { fill: none; stroke-width: 9; }
.count .track { stroke: rgba(125, 255, 107, .14); }
.count .arc { stroke: var(--lcd); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(125, 255, 107, .7)); transition: stroke-dashoffset .1s linear; }
.count b { position: relative; font: 400 54px/1 var(--display); color: var(--lcd); text-shadow: 0 0 14px rgba(125, 255, 107, .7); }

/* Five dice in a row, each over its hold ring */
.dice { position: absolute; left: 0; right: 0; top: 40%; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.die-seat { position: relative; width: 108px; height: 162px; padding: 0; border: 0; background: none; cursor: default; }
.die-seat:not(:disabled) { cursor: pointer; }
.die-seat:focus-visible { outline: 3px solid var(--neon-blue); outline-offset: 4px; border-radius: 18px; }
/* The hold rings (art/dice/ring-dim.webp, ring-lit.webp): dull brass under a loose die, lit gold under a held one */
.ring { position: absolute; left: 50%; bottom: 12px; width: 112px; height: 62px; margin-left: -56px;
    background: url(assets/ring-dim.webp) center / 100% 100% no-repeat; filter: brightness(.58) saturate(.6) drop-shadow(0 4px 4px rgba(0, 0, 0, .6)); transition: filter .15s; }
.die-seat.held .ring { background-image: url(assets/ring-lit.webp); filter: drop-shadow(0 0 14px rgba(255, 180, 60, .85)) drop-shadow(0 0 4px rgba(255, 220, 140, .7)); }
/* The dice (art/dice/dice.webp: a 1440x240 sheet, faces 1-6 at 240 each) */
.die { position: absolute; left: 50%; top: 0; width: 108px; height: 108px; margin-left: -54px;
    background: url(assets/dice.webp) 0 0 / 600% 100% no-repeat; filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .55));
    transition: transform .15s; }
.die[data-v='1'] { background-position: 0% 0; }
.die[data-v='2'] { background-position: 20% 0; }
.die[data-v='3'] { background-position: 40% 0; }
.die[data-v='4'] { background-position: 60% 0; }
.die[data-v='5'] { background-position: 80% 0; }
.die[data-v='6'] { background-position: 100% 0; }
.dice.cupped .die { visibility: hidden; }
.die-seat.held .die { transform: translateY(-4px); }
.dice.live .die-seat:hover .die { transform: translateY(-8px) rotate(-2deg); filter: brightness(1.05) drop-shadow(0 16px 12px rgba(0, 0, 0, .5)); }
.dice.live .die-seat:hover:not(.held) .ring { filter: brightness(.85) saturate(.8) drop-shadow(0 0 8px rgba(255, 180, 60, .45)); }
/* The tumble itself is app.js (Web Animations): rotate, scale and blur per die while the face changes underneath */
.key { position: absolute; left: 0; right: 0; bottom: -12px; font: 400 13px var(--display); font-style: normal; color: rgba(242, 193, 78, .0); transition: color .2s; }
.dice.live .key { color: rgba(242, 193, 78, .6); }

/* LAST CALL (art/dice/stamp-last-call.webp): red chalk over the felt */
.stamp { position: absolute; left: 50%; top: 44%; z-index: 6; width: 460px; height: 259px; transform: translate(-50%, -50%) rotate(-4deg); pointer-events: none;
    background: url(assets/stamp-last-call.webp) center / contain no-repeat; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.stamp.go { animation: stamp-in .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stamp-in { from { transform: translate(-50%, -50%) rotate(-4deg) scale(2.2); opacity: 0; } }

/* ROLL: the house's gold arcade button, the rolls left as dots */
.roll-row { display: grid; place-items: center; }
.roll-btn { width: 380px; height: 78px; font-size: 32px; gap: 22px; border-width: 22px 26px; }
.roll-btn .dots { font: 400 26px/1 var(--ui); letter-spacing: .14em; }
.roll-btn.mine:not(:disabled) { animation: roll-glow 1s ease-in-out infinite alternate; }
@keyframes roll-glow { to { filter: brightness(1.18) drop-shadow(0 0 16px rgba(242, 193, 78, .8)); } }

/* The turn's clock: the gold bar */
.clock-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 16px; align-items: center; padding: 4px 26px 6px 70px; margin: 0 6px;
    border-style: solid; border-width: 14px 15px 14px 58px; border-image: url(assets/readout-clock.webp) 58 64 58 236 fill stretch; }
.clock-label { grid-column: 1; justify-self: center; margin: -2px 0 3px; text-align: center; font: 400 13px/13px var(--display); letter-spacing: .08em; color: var(--gold); white-space: nowrap; overflow: hidden; }
/* over the middle of the track (022d); a label wider than the track spills evenly both ways */
.clock-label.good { color: var(--lcd); text-shadow: 0 0 8px rgba(125, 255, 107, .6); }
.clock-label.bad { color: #ff8a73; }
.clock-track { grid-area: 2 / 1; height: 22px; border-radius: 12px; background: #050505; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .9), 0 0 0 2px #3a2a18; overflow: hidden; }
.clock-track i { display: block; height: 100%; border-radius: 12px; background: linear-gradient(#ffe9a8, #f2c14e 50%, #a8761c); box-shadow: 0 0 12px rgba(242, 193, 78, .6); transition: width .1s linear; }
.clock-track i.low { background: linear-gradient(#ffb3a3, #e3261b 50%, #8a1208); box-shadow: 0 0 12px rgba(255, 85, 68, .7); }
.clock-big { grid-area: 2 / 2; margin: -10px 0 -12px; font: 400 34px/1 var(--display); color: var(--gold); text-shadow: 0 0 10px rgba(242, 193, 78, .6); font-variant-numeric: tabular-nums; }

/* The chalkboard: slate in a wooden frame with brass corners */
.chalk { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 4px; min-height: 0; padding: 8px 10px;
    border: 14px solid #5a3417; border-image: linear-gradient(160deg, #7a4a24, #3a1f0d 45%, #6b3d1c 75%, #2c170a) 1;
    background: radial-gradient(ellipse at 40% 30%, rgba(255, 255, 255, .06), transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, .04), transparent 55%), #1b211f;
    box-shadow: inset 0 0 0 2px #0c0f0e, inset 0 0 30px rgba(0, 0, 0, .6), 0 10px 24px rgba(0, 0, 0, .6); }
.chalk::before, .chalk::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 4px; background: radial-gradient(circle at 40% 35%, #ffe38a, #a8761c 75%); box-shadow: 0 1px 3px #000; }
.chalk::before { left: -18px; top: -18px; }
.chalk::after { right: -18px; bottom: -18px; }
.card-tabs { display: flex; gap: 5px; justify-content: center; min-height: 40px; }
.card-tabs button { position: relative; width: 38px; height: 38px; padding: 2px; border-radius: 50%; border: 2px solid rgba(244, 241, 230, .2); background: rgba(0, 0, 0, .35); cursor: pointer; }
.card-tabs button img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-tabs button[aria-selected='true'] { border-color: var(--chalk); box-shadow: 0 0 10px rgba(244, 241, 230, .35); background: rgba(255, 255, 255, .08); }
.card-tabs button.me { border-color: rgba(69, 201, 255, .6); }
.card-tabs button.me[aria-selected='true'] { border-color: var(--neon-blue); }
.card-tabs button.roller::after { content: ''; position: absolute; right: -5px; top: -5px; width: 16px; height: 16px;
    background: url(assets/dice.webp) 0 0 / 600% 100% no-repeat; filter: drop-shadow(0 0 4px rgba(255, 179, 71, .9)); }
.card-tabs button.left { opacity: .45; }
.card-tabs button:disabled { cursor: default; opacity: .5; }
.card-tabs button:focus-visible { outline: 3px solid var(--neon-blue); outline-offset: 2px; }
.chalk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 2px; border-bottom: 2px solid rgba(244, 241, 230, .4); }
.chalk-head b { font: 600 22px var(--ui); color: var(--chalk); text-shadow: 0 0 1px rgba(255, 255, 255, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chalk-head span { font: 400 12px var(--display); letter-spacing: .1em; color: var(--amber); }
.chalk-rows { list-style: none; margin: 0; padding: 0; display: grid; grid-template-rows: repeat(15, minmax(0, 1fr)); min-height: 0; }
.chalk-rows .row { position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding: 0 6px; border-bottom: 1px solid rgba(244, 241, 230, .14);
    font: 600 20px/1 var(--ui); color: rgba(244, 241, 230, .82); text-shadow: 0 0 1px rgba(255, 255, 255, .35); }
.chalk-rows .row .lbl { white-space: nowrap; letter-spacing: .02em; }
.chalk-rows .row .val { grid-column: 3; min-width: 40px; text-align: right; font: 600 25px/1 var(--ui); color: var(--chalk); font-variant-numeric: tabular-nums; }
.chalk-rows .row.zero .val { color: var(--chalk-red); text-shadow: 0 0 2px rgba(255, 107, 85, .6); }
.chalk-rows .row.preview .val { color: var(--chalk-dim); text-shadow: none; }
.chalk-rows .row.preview.nil .val { color: var(--chalk-red); text-shadow: 0 0 2px rgba(255, 107, 85, .6); } /* a sacrifice is a choice (022) */
.chalk-rows.live .row.can { cursor: pointer; }
.chalk-rows.live .row.can:hover, .chalk-rows.live .row.sel { background: rgba(255, 255, 255, .07); border-radius: 6px; }
.chalk-rows.live .row.can:hover .val, .chalk-rows.live .row.sel .val { color: #fff; text-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.chalk-rows.live .row.preview.nil:hover .val, .chalk-rows.live .row.preview.nil.sel .val { color: #ff8a73; text-shadow: 0 0 6px rgba(255, 107, 85, .8); }
.chalk-rows.live .row.sel { box-shadow: inset 3px 0 0 var(--amber); }
.chalk-rows.live .row:not(.can):not(.used):not(.bonus):not(.total) .lbl { opacity: .4; } /* a joker roll: only the lit boxes take it */
.chalk-rows .row.bonus { border-top: 2px solid rgba(244, 241, 230, .4); border-bottom: 2px solid rgba(244, 241, 230, .4); color: var(--amber); }
.chalk-rows .row.bonus small { grid-column: 2; font: 600 15px var(--ui); color: var(--chalk-dim); }
.chalk-rows .row.total { border-top: 3px double rgba(244, 241, 230, .5); border-bottom: 0; font-size: 22px; color: var(--chalk); }
.chalk-rows .row.total .val { font-size: 30px; color: var(--amber); text-shadow: 0 0 8px rgba(255, 179, 71, .5); }
/* chalk-write: the number drawn in, left to right */
.chalk-rows .row.fresh .val { animation: chalk-write .3s linear both; }
/* After roll three, the open rows brighten once and fade, so the eye goes to the board (022) */
.chalk-rows .row.pulse { animation: row-pulse .6s ease-out both; animation-delay: var(--pd, 0s); }
.chalk-rows .row.pulse .val { animation: val-pulse .6s ease-out both; animation-delay: var(--pd, 0s); }
@keyframes row-pulse { 35% { background: rgba(244, 241, 230, .14); box-shadow: inset 0 0 14px rgba(244, 241, 230, .22); border-radius: 6px; } }
@keyframes val-pulse { 35% { filter: brightness(2.2); text-shadow: 0 0 10px rgba(255, 255, 255, .8); } }
@keyframes chalk-write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.chalk-rows .tag, .chalk-rows .plus { position: absolute; right: 54px; top: 50%; font: 400 14px/1 var(--display); font-style: normal; letter-spacing: .06em; pointer-events: none;
    padding: 3px 8px 2px; border-radius: 6px; transform: translateY(-50%) rotate(-6deg); animation: tag-out 2s linear forwards; }
.chalk-rows .tag { color: var(--chalk-red); border: 2px solid var(--chalk-red); }
.chalk-rows .plus { color: var(--amber); border: 2px solid var(--amber); }
@keyframes tag-out { 0% { opacity: 0; transform: translateY(-50%) rotate(-6deg) scale(1.6); } 10%, 85% { opacity: 1; transform: translateY(-50%) rotate(-6deg) scale(1); } 100% { opacity: 0; } }

/* Final board, paused: over the table, under Jeff */
.card-over { position: absolute; inset: 114px -4px 0; z-index: 30; display: grid; place-items: center; background: rgba(5, 3, 2, .88); border-radius: 18px; animation: pop-in-say .25s ease-out; }
.round-card, .final-card { max-height: 100%; display: grid; justify-items: center; gap: 10px; padding: 14px 22px 12px 14px;
    border-style: solid; border-width: 28px 35px 31px 23px; border-image: url(assets/chat-frame.webp) 63 77 68 51 fill stretch; }
.round-card { width: 560px; }
.final-card { width: 100%; height: 100%; grid-template-rows: auto 1fr auto; gap: 8px; }
.round-card .field-label { font-size: 22px; }
.final-head { display: flex; align-items: baseline; gap: 18px; }
.final-head .field-label { font-size: 18px; margin: 0; }
.winner { margin: 0; font: 400 30px/1 var(--display); color: var(--lcd); text-shadow: 0 0 12px rgba(125, 255, 107, .6); }
.card-note { margin: 0; font: 600 19px var(--ui); color: var(--muted); }
.final-cards { width: 100%; border-collapse: collapse; table-layout: fixed; font: 600 18px/1 var(--ui); color: var(--chalk);
    background: #1b211f; border-radius: 12px; box-shadow: inset 0 0 0 2px #3a2a18, inset 0 0 24px rgba(0, 0, 0, .6); }
.final-cards th.lbl { width: 150px; padding: 0 10px; text-align: left; font: 600 17px var(--ui); color: rgba(244, 241, 230, .75); white-space: nowrap; }
.final-cards thead th { position: relative; height: 70px; padding: 6px 4px 4px; vertical-align: bottom; font-weight: 400; border-bottom: 2px solid rgba(244, 241, 230, .4); }
.final-cards thead th img { display: block; width: 40px; height: 40px; margin: 0 auto 2px; object-fit: contain; }
.final-cards thead th span { display: block; font: 400 14px var(--display); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.final-cards thead th .place { position: absolute; left: 50%; top: 2px; margin-left: -38px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle at 40% 35%, #ffe38a, #c8901e 70%); color: #2b1800; font: 400 13px/1 var(--display); }
.final-cards thead th.me span { color: var(--neon-blue); }
.final-cards thead th.left { opacity: .5; }
.final-cards .new-best { position: absolute; right: 2px; top: 2px; padding: 2px 5px; border-radius: 5px; background: var(--lcd); color: #0b2a06; font: 400 10px/1 var(--display); font-style: normal; transform: rotate(6deg); box-shadow: 0 0 10px rgba(125, 255, 107, .7); }
.final-cards td { height: 24px; text-align: center; font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(244, 241, 230, .1); }
.final-cards td.zero { color: var(--chalk-red); }
.final-cards td.open { color: var(--chalk-dim); }
.final-cards tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, .025); }
.final-cards tr.bonus th, .final-cards tr.bonus td { color: var(--amber); border-top: 2px solid rgba(244, 241, 230, .35); border-bottom: 2px solid rgba(244, 241, 230, .35); }
.final-cards tr.total th, .final-cards tr.total td { height: 34px; font: 400 20px/1 var(--display); color: var(--amber); border-top: 3px double rgba(244, 241, 230, .5); border-bottom: 0; }
.final-cards tr.total th { font: 700 19px var(--ui); color: var(--chalk); }
.final-cards thead th:nth-child(2), .final-cards tbody td:nth-child(2) { background: rgba(242, 193, 78, .1); }
.final-foot { width: 100%; display: flex; align-items: center; gap: 14px; }
.send-off { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 14px 6px 6px; border-radius: 14px;
    background: var(--cream); color: #241507; text-decoration: none; font: 700 18px/1.15 var(--ui); }
.send-off img { width: 46px; height: 46px; flex: none; }
.send-off b { display: block; font: 400 11px var(--display); letter-spacing: .08em; color: #a0441c; }
.send-off span { flex: 1; }
.send-off span::after { content: ' →'; color: #a0441c; }
.send-off:hover { filter: brightness(1.06); }
.send-off:hover span { text-decoration: underline; }
.send-off:focus-visible { outline: 3px solid var(--neon-blue); outline-offset: 3px; }
.card-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.card-actions .arcade-btn { min-width: 150px; height: 64px; font-size: 18px; }
.final-foot .card-note { max-width: 220px; font-size: 17px; }

/* Side column */
.side-top { gap: 4px; }
.side-top .round { width: 56px; height: 56px; }
#exit { margin-left: 8px; }
.readout-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.readout-row .readout { padding: 0 4px; }
.readout-row .readout span { font-size: 12px; letter-spacing: .06em; }
.readout-row .readout b { font-size: 19px; white-space: nowrap; }
.readout-clock span { font-size: 13px; letter-spacing: .1em; }
.chat-log .msg.host b { color: #ff9a6e; }
.chat-log .msg.host { color: var(--cream); }
.chat-log .msg.tell b { color: #d7a8ff; }
.chat-log .msg.tell { color: var(--text); }
.chat-log[data-filter='chat'] .msg.host, .chat-log[data-filter='chat'] .msg.tell { display: none; }
.chat-log[data-filter='game'] .msg.host, .chat-log[data-filter='game'] .msg.tell { display: flex; }
.chat-log .msg.sys.roll { font-size: 14px; color: rgba(181, 166, 144, .8); }
.chat-log .msg.sys.big { font-weight: 700; }
.chat-log .msg.lastcall { font: 400 18px var(--display); color: var(--chalk-red); border-left-color: var(--chalk-red); letter-spacing: .04em; }
.speed-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#toast { position: fixed; }

/* Desktop only (021c): a phone gets the logo, one line and the link */
.phone-card { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 22px calc(24px + env(safe-area-inset-bottom, 0px));
    text-align: center; background: linear-gradient(rgba(8, 5, 4, .6), rgba(8, 5, 4, .85)), url(assets/bar.webp) center / cover, var(--felt-dark); }
.phone-card-logo { width: min(80vw, 380px); }
.phone-card-say { margin: 0; font: 400 22px/1.3 var(--display); color: var(--gold); text-shadow: 0 2px 0 #000; }
.phone-card .arcade-btn { width: min(86vw, 360px); height: 74px; font-size: 22px; }
.phone-card-note { margin: 0; font: 600 17px var(--ui); color: var(--muted); }
.phone-card .fine { margin: 0; font: 600 13px var(--ui); color: rgba(181, 166, 144, .6); }
