/* ClubTote - phone-first member UI, desktop admin, dark tote board */

:root {
    --bg: #f3f5f0;
    --card: #ffffff;
    --text: #1b1f1a;
    --muted: #68705f;
    --line: #dbe1d4;
    --accent: #1f6b3a;
    --accent-ink: #ffffff;
    --accent-soft: #e4f1e8;
    --gold: #b8862b;
    --gold-soft: #fbf1dc;
    --danger: #b3261e;
    --danger-soft: #fbe4e2;
    --warn: #9a5b00;
    --warn-soft: #fff1d6;
    --ok: #1f6b3a;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
    --win: #1f6b3a; --place: #2b5fa8; --show: #8a4bb3;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111512;
        --card: #1a211c;
        --text: #e7ebe4;
        --muted: #9aa394;
        --line: #2a332c;
        --accent: #3f9c5e;
        --accent-ink: #0b130d;
        --accent-soft: #1d2f23;
        --gold: #e0b452;
        --gold-soft: #2f2816;
        --danger: #ef6a63;
        --danger-soft: #3a1c1a;
        --warn: #f0b35a;
        --warn-soft: #332814;
        --ok: #3f9c5e;
        --shadow: none;
        --win: #4fb06f; --place: #6d9ae0; --show: #b98ad9;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
.h-compact { margin: 0; }
p { margin: .4rem 0 .8rem; }
a { color: var(--accent); }
code { background: var(--accent-soft); padding: .05em .35em; border-radius: 6px; font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.r { text-align: right; }
.l { text-align: left; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; }
.pos { color: var(--ok); } .neg { color: var(--danger); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; color: var(--muted); margin: 0 0 .2rem; }
.error { color: var(--danger); background: var(--danger-soft); padding: .55rem .8rem; border-radius: 10px; }
.flash { color: var(--ok); background: var(--accent-soft); padding: .55rem .8rem; border-radius: 10px; }
/* Snackbar: save confirmations, bottom right (above the phone's bottom nav) */
.snackbar-host { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); pointer-events: none; }
.betting-shell ~ .snackbar-host { bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
.snackbar { pointer-events: auto; display: flex; align-items: flex-start; gap: .75rem; padding: .7rem .8rem .7rem 1rem; border-radius: 8px; background: #1f2a22; color: #fff; border-left: 4px solid #3f9c5e; box-shadow: 0 6px 20px rgba(0,0,0,.28); animation: snackbar-in .18s ease-out; }
.snackbar-text { flex: 1; line-height: 1.35; }
.snackbar-close { background: none; border: 0; color: rgba(255,255,255,.7); cursor: pointer; font-size: .9rem; padding: 0 .1rem; line-height: 1.35; }
.snackbar-close:hover { color: #fff; }
@keyframes snackbar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.banner { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.banner.ok { background: var(--accent-soft); color: var(--text); border-left: 4px solid var(--accent); }

.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.gap { gap: .5rem; }
.row.wrap { flex-wrap: wrap; gap: .5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 2fr 1fr; } }

.card { background: var(--card); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card.narrow { max-width: 420px; margin: 2rem auto; }

/* ---------- forms ---------- */
label { display: block; font-size: .86rem; color: var(--muted); margin: .7rem 0 .25rem; }
label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); font-size: .95rem; margin: .5rem 0; }
label.check input { width: auto; margin: 0; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 1.1rem; height: 1.1rem; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
.big-input { font-size: 1.4rem; padding: .7rem .9rem; text-align: center; letter-spacing: .08em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { padding: .9rem 1.2rem; font-size: 1.08rem; }
.btn-sm { padding: .3rem .6rem; font-size: .84rem; font-weight: 500; }
.btn + .btn { margin-left: .25rem; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 1rem; cursor: pointer; padding: .3rem .5rem; }
.icon-btn:hover { color: var(--danger); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { font: inherit; font-size: .86rem; font-weight: 600; padding: .4rem .9rem; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--accent); color: var(--accent-ink); }

.tabs { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: .8rem; }
.tab { font: inherit; font-weight: 600; padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.pill { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.pill-ok, .pill-paid { background: var(--accent-soft); color: var(--ok); }
.pill-muted, .pill-void, .pill-setup { background: var(--line); color: var(--muted); }
.pill-gold, .pill-settled { background: var(--gold-soft); color: var(--gold); }
.pill-warn, .pill-unpaid, .pill-closed { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-win { background: color-mix(in srgb, var(--win) 15%, transparent); color: var(--win); }
.pill-place { background: color-mix(in srgb, var(--place) 15%, transparent); color: var(--place); }
.pill-show { background: color-mix(in srgb, var(--show) 15%, transparent); color: var(--show); }

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .5rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table th.r, .table td.r { text-align: right; }
.table.compact th, .table.compact td { padding: .3rem .4rem; font-size: .9rem; }
.table tr.paying td { background: var(--accent-soft); }
.table tr.group-head td { font-weight: 800; padding-top: .9rem; border-bottom: 2px solid var(--line); text-transform: uppercase; letter-spacing: .05em; font-size: .85em; }
.group-title { margin-top: 1.2rem; padding-top: .6rem; border-top: 2px solid var(--line); }
.table tr.owes td:nth-child(3) { color: var(--warn); }
.table tr.hh-total td { font-size: .85rem; background: var(--bg); }
.table tr.scr td { opacity: .5; text-decoration: line-through; }
.table tfoot th { border-top: 2px solid var(--line); color: var(--text); }
ul.plain { list-style: none; padding: 0; margin: .3rem 0; }
ul.plain li { padding: .15rem 0; }

.t-num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .35rem; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; margin-right: .4rem; }

.countdown strong { font-variant-numeric: tabular-nums; }
.countdown.urgent strong { color: var(--danger); }

/* ---------- member shell ---------- */
.betting-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: calc(.6rem + env(safe-area-inset-top)) 1rem .6rem; background: var(--accent); color: #fff; }
.topbar .brand { font-weight: 800; letter-spacing: .02em; }
.topbar .event-name { opacity: .85; font-size: .85rem; margin-left: .5rem; }
.topbar .pill { background: rgba(255,255,255,.18); color: #fff; }
.topbar .countdown { font-size: .9rem; } .topbar .countdown .muted { color: rgba(255,255,255,.75); }
.topbar .countdown.urgent strong { color: #ffd1cc; }
.betting-main { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 1rem 1rem calc(5.5rem + env(safe-area-inset-bottom)); }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); z-index: 10; }
.nav-item { display: flex; flex-direction: column; align-items: center; gap: .1rem; font-size: .72rem; color: var(--muted); text-decoration: none; padding: .2rem .8rem; border-radius: 10px; }
.nav-item .nav-ico { font-size: 1.25rem; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }

.choice-list { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0 1rem; }
.choice-list.compact { gap: .25rem; }
.choice { font: inherit; font-size: 1.05rem; text-align: left; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.choice:hover { border-color: var(--accent); }

/* team list on the bet page */
.team-list { margin: .5rem 0 1rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.team-row { display: grid; grid-template-columns: 1fr repeat(var(--pools, 3), minmax(64px, auto)); gap: .4rem; align-items: center; width: 100%; padding: .6rem .75rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.team-row:last-child { border-bottom: 0; }
button.team-row:active { background: var(--accent-soft); }
.team-row.head { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); cursor: default; background: var(--bg); }
.team-row.scratched { opacity: .5; cursor: default; }
.team-group { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-top: .9rem; padding: .35rem .2rem; border-bottom: 2px solid var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: .85rem; }
.team-group .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.t-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .3rem; min-width: 0; }
.t-title { font-weight: 600; }
.t-players { flex-basis: 100%; font-size: .78rem; color: var(--muted); }
.t-flight { font-size: .7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 .3rem; }
.t-odds { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; min-width: 64px; }
.t-odds .pays { font-weight: 700; font-variant-numeric: tabular-nums; }
.t-odds .toone { font-size: .64em; color: var(--accent); }
.odds { white-space: nowrap; font-variant-numeric: tabular-nums; }
.odds small { font-size: .7em; font-weight: 400; margin: 0 .25em; opacity: .75; }
.board-odds { margin-left: .5em; font-size: .64em; font-weight: 600; color: #c7d2c6; }
.t-odds .onteam { font-size: .72rem; color: var(--muted); }

/* slip */
.slip-spacer { height: 1rem; }
.slip { background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); }
.slip-head { display: flex; justify-content: space-between; margin-bottom: .4rem; }
.slip-line { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.slip-edit { flex: 1; display: flex; align-items: center; gap: .4rem; background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; padding: 0; }
.slip-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.slip-total { display: flex; justify-content: space-between; font-size: 1.1rem; padding: .6rem 0; }

/* bottom sheet */
.sheet-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.modal-backdrop { align-items: center; padding: 1rem; }
.sheet { width: 100%; max-width: 620px; background: var(--card); border-radius: 20px 20px 0 0; padding: .6rem 1rem calc(1.2rem + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto .8rem; }
.pool-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.pool-btn { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .6rem .3rem; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.pool-btn span { font-size: .72rem; color: var(--muted); }
.pool-btn .pays { font-size: .85rem; color: var(--text); font-weight: 600; }
.pool-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.amount-row { display: flex; align-items: stretch; gap: .5rem; }
.amount-row input { text-align: center; font-size: 1.5rem; font-weight: 700; }
.step { width: 3.2rem; font-size: 1.5rem; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; }
.chip { font: inherit; font-weight: 600; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.chip.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.modal { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; padding: 1.2rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-danger { border-top: 5px solid var(--danger); }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; }
.modal-actions .btn { flex: 1; }
.confirm-list { list-style: none; padding: 0; margin: .5rem 0; }
.confirm-list li { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.confirm-list li.total { border-bottom: 0; font-size: 1.1rem; padding-top: .6rem; }

/* tickets */
.money-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.money-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; display: flex; flex-direction: column; }
.money-card .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.money-card .amount { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.money-card .sub { font-size: .78rem; color: var(--muted); }
.money-card.hot { border-color: var(--warn); background: var(--warn-soft); }
.money-card.hot .amount { color: var(--warn); }
.money-card.win { grid-column: 1 / -1; border-color: var(--gold); background: var(--gold-soft); }
.money-card.win .amount { color: var(--gold); }

.ticket { background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--warn); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .7rem; }
.ticket.paid { border-left-color: var(--ok); }
.ticket.void { border-left-color: var(--line); opacity: .7; }
.ticket-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .3rem; }
.ticket-num { font-weight: 800; font-size: 1.05rem; }
.ticket-head .pill { margin-left: auto; }
.ticket-line { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; font-size: .95rem; }
.ticket-line.refunded { text-decoration: line-through; color: var(--muted); }
.ticket-line.won { font-weight: 600; }
.payout { color: var(--gold); font-weight: 700; }
.ticket-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--line); font-size: .9rem; }
.owe-tag { color: var(--warn); font-weight: 700; }
.ticket-lines-inline { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .92rem; }
.ticket-lines-inline .refunded { text-decoration: line-through; color: var(--muted); }

.finish-list { padding-left: 1.6rem; margin: .3rem 0; }
.finish-list li { padding: .2rem 0; }
.rules h3 { margin-top: 1.1rem; }

/* ---------- admin: top bar + left rail ---------- */
.admin-shell { min-height: 100dvh; display: grid; grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; grid-template-areas: "top top" "rail main"; }
.admin-top { grid-area: top; display: flex; align-items: center; gap: .8rem; padding: .55rem 1rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.admin-top .brand { font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; }
.admin-top .admin-event { color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: .5rem; }
.admin-top .linklike { font-size: .9rem; }
.nav-toggle { display: none; font-size: 1.3rem; padding: .2rem .5rem; color: var(--text); }
.admin-rail { grid-area: rail; position: sticky; top: 53px; align-self: start; height: calc(100dvh - 53px); overflow-y: auto; background: var(--card); border-right: 1px solid var(--line); padding: .8rem .6rem 1rem; }
.rail-group { margin-bottom: .9rem; }
.rail-head { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: .2rem .7rem .3rem; }
.admin-rail a { display: flex; align-items: center; gap: .55rem; font-size: .95rem; color: var(--text); text-decoration: none; padding: .45rem .7rem; border-radius: 10px; }
.admin-rail a:hover { background: var(--bg); }
.admin-rail a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail-ico { width: 1.3rem; text-align: center; color: var(--muted); font-size: .95rem; }
.admin-rail a.active .rail-ico { color: var(--accent); }
.rail-backdrop { display: none; }
.admin-main { grid-area: main; min-width: 0; width: 100%; padding: 1rem 1.25rem 2rem; }
@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
    .nav-toggle { display: inline-block; }
    .admin-top .admin-event { display: none; }
    .admin-rail { position: fixed; top: 53px; left: 0; bottom: 0; width: 240px; transform: translateX(-100%); transition: transform .18s ease; z-index: 30; box-shadow: 0 0 30px rgba(0,0,0,.2); }
    .admin-shell.nav-open .admin-rail { transform: none; }
    .admin-shell.nav-open .rail-backdrop { display: block; position: fixed; inset: 53px 0 0 0; background: rgba(0,0,0,.35); z-index: 25; }
    .admin-main { padding: .8rem; }
}
.banner.test { background: var(--warn-soft); border-left: 4px solid var(--warn); }
.topbar .test-tag { background: var(--warn); color: #1b1f1a; font-weight: 800; font-size: .7rem; letter-spacing: .06em; padding: .15rem .45rem; border-radius: 6px; margin-left: .4rem; }
.event-list .is-active td { background: var(--accent-soft); }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover td { background: var(--bg); }
.table.clickable tbody tr.is-active:hover td { background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg)); }
.event-list .is-test td:first-child::after { content: " TEST"; font-size: .7rem; color: var(--warn); font-weight: 800; letter-spacing: .06em; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain:disabled .card { opacity: .7; }
.tabs a.tab { text-decoration: none; }
.market-times { display: grid; grid-template-columns: auto 1fr; gap: .25rem .5rem; align-items: center; font-size: .85rem; }
.market-times input { padding: .3rem .5rem; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; }
.stat .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .78rem; color: var(--muted); }
.stat.warn { border-color: var(--warn); } .stat.warn .value { color: var(--warn); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.filters input, .filters select { width: auto; min-width: 200px; }
.admin-ticket .ticket-head .pill { margin-left: auto; }

/* ---------- tote board ---------- */
.board-shell { min-height: 100dvh; background: #0b1a10; color: #f1f5ee; padding: 1.2rem 1.6rem 4.5em; font-size: clamp(14px, 1.5vw, 22px); }
.board-shell .muted { color: #8fa391; }
.board-shell .pill-ok { background: #1f6b3a; color: #fff; }
.board-shell .pill-muted { background: #2a3a2e; color: #c7d2c6; }
.board-shell .pill-gold { background: #b8862b; color: #fff; }
.board-shell .countdown { color: #f1f5ee; } .board-shell .countdown .muted { color: #8fa391; }
.board-shell .countdown.urgent strong { color: #ff8a80; }
.board-empty { text-align: center; padding-top: 20vh; }
.board-empty h1 { font-size: 3em; }
.board-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid #1f6b3a; padding-bottom: .6rem; margin-bottom: 1rem; }
.board-head h1 { font-size: 2em; margin: 0; }
.board-sub { color: #8fa391; margin: .2rem 0 0; text-transform: uppercase; letter-spacing: .08em; font-size: .7em; }
.board-controls { display: flex; align-items: center; gap: 1rem; }
.board-controls .seg { background: #142a1b; border-color: #2a4a33; }
.board-controls .seg button { color: #c7d2c6; }
.board-controls .seg button.active { background: #e3b341; color: #0b1a10; }
.board-clock { font-variant-numeric: tabular-nums; color: #8fa391; }
.board-market { margin-bottom: 1.6rem; }
.board-market-head { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin-bottom: .5rem; }
.board-market-head h2 { margin: 0; font-size: 1.4em; }
.board-pool-total { margin-left: auto; font-size: 1.2em; }
.board-pool-total strong { color: #e3b341; }
.board-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board-table th { text-align: right; font-size: .7em; text-transform: uppercase; letter-spacing: .06em; color: #8fa391; padding: .3em .6em; border-bottom: 1px solid #244a31; }
.board-table th.l, .board-table td.l { text-align: left; }
.board-table th .dim { color: #5f7a63; font-weight: 400; margin-left: .4em; }
.board-table tr.sub th { font-size: .6em; border-bottom: 1px solid #1a3322; }
.board-table td { padding: .32em .6em; border-bottom: 1px solid #16291c; text-align: right; }
.board-table td.num { color: #e3b341; font-weight: 800; width: 2.5em; }
.board-table td.name { font-weight: 600; }
.board-table td.pays { font-weight: 700; color: #ffffff; }
.board-table td.on { color: #8fa391; }
.board-table tr.fav td.name::after { content: " FAV"; font-size: .65em; color: #e3b341; letter-spacing: .08em; }
.board-table tr.scr td { color: #5f7a63; text-decoration: line-through; }
.board-table tr.flight-head td { text-align: left; padding: 1.4em .6em .35em; color: #e3b341; font-weight: 800; font-size: .75em; text-transform: uppercase; letter-spacing: .1em; border-bottom: 2px solid #244a31; }
.board-table tbody tr.flight-head:first-child td { padding-top: .5em; }
.board-table tr.flight-head td.flight-pool { text-align: right; color: #c7d2c6; font-weight: 600; font-size: .7em; letter-spacing: .06em; }
/* Pools: a tinted block each, Win green and Place amber, with a dark gap between them. Header cells are opaque
   so rows don't show through the sticky header. */
.board-table thead { position: sticky; top: 0; z-index: 2; }
.board-table thead th { background: #0b1a10; }
.board-table th.pool-win { background: #17402a; color: #b9e6c4; }
.board-table th.pool-place { background: #3b3216; color: #f3d98f; }
.board-table th.pool-show { background: #1b2c40; color: #bcd3ee; }
.board-table th.pool-win .dim, .board-table th.pool-place .dim, .board-table th.pool-show .dim { color: inherit; opacity: .7; }
.board-table td.pool-win { background: rgba(76, 175, 96, .13); }
.board-table td.pool-place { background: rgba(227, 179, 65, .13); }
.board-table td.pool-show { background: rgba(110, 160, 225, .11); }
.board-table th.pool-start, .board-table td.pool-start { border-left: 6px solid #0b1a10; }
/* Paging: a thin bar that fills until the next page, dots to jump, and a gentle fade between pages. */
.board-pager { margin: -.4rem 0 .8rem; }
/* Page timer: bottom right, sitting in the footer bar. The inner circle's thick stroke draws a pie that drains to empty. */
.board-timer { position: fixed; right: 1.2rem; bottom: calc(.55em + env(safe-area-inset-bottom)); z-index: 6; display: flex; align-items: center; gap: .45em; font-size: .8em; color: #8fa391; font-variant-numeric: tabular-nums; }
.board-timer svg { width: 1.5em; height: 1.5em; transform: rotate(-90deg) scaleY(-1); }
.board-timer .timer-face { fill: #16291c; stroke: #2a4a33; stroke-width: 2; }
.board-timer .timer-fill { fill: none; stroke: #e3b341; stroke-width: 15; stroke-dasharray: 47.13 47.13; stroke-dashoffset: 0; opacity: .85; animation: board-drain linear forwards; }
@keyframes board-drain { to { stroke-dashoffset: 47.13; } }
@media (prefers-reduced-motion: reduce) { .board-timer .timer-fill { animation: none; } }
@media (max-width: 700px) { .board-foot { padding-left: 1rem; padding-right: 3rem; } .board-timer span { display: none; } }
.board-dots { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; margin-top: .4rem; font-size: .7em; color: #8fa391; }
.board-dots button { width: .7em; height: .7em; border-radius: 50%; border: 0; padding: 0; background: #2a4a33; cursor: pointer; }
.board-dots button.on { background: #e3b341; }
.board-page { animation: board-fade .7s ease-out; }
@keyframes board-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .board-page { animation: none; } }
.board-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: .7em 13rem calc(.7em + env(safe-area-inset-bottom)); background: #0f2416; border-top: 2px solid #1f6b3a; color: #c7d2c6; font-size: .9em; text-align: center; }
.board-foot-call { color: #e3b341; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-right: .2em; }
.board-foot strong { color: #e3b341; }

/* ---------- misc ---------- */
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff3cd; color: #5c4400; padding: .7rem 1rem; z-index: 1000; box-shadow: 0 -2px 10px rgba(0,0,0,.2); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
.components-reconnect-modal { font-family: inherit; }

@media print {
    .admin-top, .no-print, .bottom-nav, .tabs { display: none !important; }
    .card { box-shadow: none; break-inside: avoid; }
    body { background: #fff; color: #000; }
}
/* Expected odds include unpaid tickets: an amber dashed frame, a banner, italic figures. Actual gets a quiet note. */
.board-shell .pill-actual { background: #1f6b3a; color: #fff; }
.board-shell .pill-expected { background: #e3b341; color: #0b1a10; font-weight: 800; }
.board-page.expected { outline: 2px dashed #e3b341; outline-offset: 6px; border-radius: 4px; }
.board-page.expected .board-table td.pays { font-style: italic; color: #f3d98f; }
.board-expected-note { background: #3b3216; color: #f3d98f; border-left: 6px solid #e3b341; padding: .45em .8em; margin-bottom: .6rem; font-size: .85em; }
.board-expected-note strong { color: #fff; text-transform: uppercase; letter-spacing: .06em; margin-right: .4em; }
.board-actual-note { color: #8fa391; font-size: .75em; margin: -.2rem 0 .5rem; }
.board-dots button.exp { background: #6b5a24; }
.board-dots button.exp.on { background: #e3b341; box-shadow: 0 0 0 2px #0b1a10, 0 0 0 3px #e3b341; }
