/* ==========================================================================
   Blue Man Bozo — visual system
   Built from the logo: a near-black field with a blue cast, electric blue
   lettering, white script, a gold crown and green ticks on the parlay slips.
   Dark first, because that is where the mark lives. Loud in three places —
   the ticket, the week heading, the Bozo Index — and quiet everywhere else.
   ========================================================================== */

/* ---------- tokens: dark, the default ---------- */
:root {
  color-scheme: dark;

  --bg:             #080c14;   /* black with a blue cast, not pure black */
  --surface:        rgba(120, 165, 255, .055);
  --surface-solid:  #111a28;
  --surface-2:      rgba(120, 165, 255, .035);
  --blur:           saturate(180%) blur(20px);
  --border:         #1d2a3d;
  --border-strong:  #2c3d56;

  --text:           #f2f6fc;
  --text-2:         #aebcd0;
  --text-3:         #8595ad;   /* 6.4:1 on --bg */
  --on-brand:       #ffffff;

  /* The logo blue. --brand is the accent you read; --brand-fill is the one
     that carries white text at 5.1:1, since the bright one only manages 3.9. */
  --brand:          #3d8bff;
  --brand-fill:     #1569e0;
  --brand-hover:    #2f7ef0;
  --brand-tint:     rgba(61, 139, 255, .14);
  --brand-ring:     rgba(61, 139, 255, .38);
  --brand-glow:     0 0 24px rgba(45, 125, 255, .35);

  /* The crown. Reserved for the bozo and nothing else. */
  --gold:           #ffc233;
  --gold-tint:      rgba(255, 194, 51, .14);

  --green:          #3ddc84;   /* the ticks on the parlay slips */
  --green-tint:     rgba(61, 220, 132, .14);
  --red:            #ff6b81;
  --red-tint:       rgba(255, 107, 129, .14);
  --orange:         #ffb02e;
  --orange-tint:    rgba(255, 176, 46, .14);
  --blue:           #3d8bff;
  --blue-tint:      rgba(61, 139, 255, .14);

  --gradient:       linear-gradient(100deg, #1569e0 0%, #3d8bff 55%, #7cc0ff 100%);
  --band:           linear-gradient(180deg, rgba(61, 139, 255, .16) 0%, rgba(61, 139, 255, .04) 45%, rgba(8, 12, 20, 0) 100%);

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, .45);
  --shadow:         0 4px 14px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-lg:      0 18px 40px rgba(0, 0, 0, .6), 0 6px 16px rgba(0, 0, 0, .45);

  --r:      16px;
  --r-sm:   12px;
  --r-pill: 999px;
  --r-xs:   9px;
  --tap:    44px;          /* the floor for anything you tap on a phone */
  --font:   Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  --display: "Archivo Black", Impact, "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  --mono:   ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- tokens: light, for anyone who wants it ---------- */
/* Same set, re-valued. Nothing below this line references a literal colour. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg:             #f4f7fb;
  --surface:        rgba(255, 255, 255, .74);
  --surface-solid:  #ffffff;
  --surface-2:      rgba(244, 247, 251, .82);
  --border:         #dbe3ee;
  --border-strong:  #c3cfe0;
  --text:           #0a1628;
  --text-2:         #3d4d63;
  --text-3:         #5c6b80;
  --brand:          #0b5ed7;
  --brand-fill:     #0b5ed7;
  --brand-hover:    #0a52bd;
  --brand-tint:     rgba(11, 94, 215, .10);
  --brand-ring:     rgba(11, 94, 215, .30);
  --brand-glow:     none;
  --gold:           #8a5a00;
  --gold-tint:      rgba(255, 194, 51, .20);
  --green:          #0e6245;
  --green-tint:     #d7f7c2;
  --red:            #b3093c;
  --red-tint:       #fde2dd;
  --orange:         #9a4e00;
  --orange-tint:    #fcedb9;
  --blue:           #0b5ed7;
  --blue-tint:      #d6ecff;
  --gradient:       linear-gradient(100deg, #0b5ed7 0%, #3d8bff 55%, #7cc0ff 100%);
  --band:           linear-gradient(180deg, rgba(11, 94, 215, .10) 0%, rgba(61, 139, 255, .04) 45%, rgba(244, 247, 251, 0) 100%);
  --shadow-sm:      0 1px 2px rgba(10, 22, 40, .06), 0 1px 1px rgba(0, 0, 0, .04);
  --shadow:         0 4px 12px rgba(10, 22, 40, .08), 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-lg:      0 15px 35px rgba(10, 22, 40, .12), 0 5px 15px rgba(0, 0, 0, .07);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:             #f4f7fb;
    --surface:        rgba(255, 255, 255, .74);
    --surface-solid:  #ffffff;
    --surface-2:      rgba(244, 247, 251, .82);
    --border:         #dbe3ee;
    --border-strong:  #c3cfe0;
    --text:           #0a1628;
    --text-2:         #3d4d63;
    --text-3:         #5c6b80;
    --brand:          #0b5ed7;
    --brand-fill:     #0b5ed7;
    --brand-hover:    #0a52bd;
    --brand-tint:     rgba(11, 94, 215, .10);
    --brand-ring:     rgba(11, 94, 215, .30);
    --brand-glow:     none;
    --gold:           #8a5a00;
    --gold-tint:      rgba(255, 194, 51, .20);
    --green:          #0e6245;
    --green-tint:     #d7f7c2;
    --red:            #b3093c;
    --red-tint:       #fde2dd;
    --orange:         #9a4e00;
    --orange-tint:    #fcedb9;
    --blue:           #0b5ed7;
    --blue-tint:      #d6ecff;
    --gradient:       linear-gradient(100deg, #0b5ed7 0%, #3d8bff 55%, #7cc0ff 100%);
    --band:           linear-gradient(180deg, rgba(11, 94, 215, .10) 0%, rgba(61, 139, 255, .04) 45%, rgba(244, 247, 251, 0) 100%);
    --shadow-sm:      0 1px 2px rgba(10, 22, 40, .06), 0 1px 1px rgba(0, 0, 0, .04);
    --shadow:         0 4px 12px rgba(10, 22, 40, .08), 0 1px 3px rgba(0, 0, 0, .05);
    --shadow-lg:      0 15px 35px rgba(10, 22, 40, .12), 0 5px 15px rgba(0, 0, 0, .07);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  font-family: var(--font); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
/* a faint gradient band at the very top, fading into the page */
body::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 360px; z-index: -1; pointer-events: none;
  background: var(--band);
}
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
h2 { font-size: 19px; }
p { margin: 0 0 .75rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
button { font: inherit; }

/* ---------- layout ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 20px 96px; }

.topbar { position: sticky; top: 0; z-index: 60; background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 12px 20px 0; display: flex; align-items: center; gap: 14px; }
.topbar-inner + .topbar-inner { padding-top: 6px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; min-width: 0; }
.brand-mark { width: 32px; height: 32px; flex: none; border-radius: var(--r-xs); display: grid; place-items: center; font-size: 17px; background: var(--brand-fill); color: #fff; box-shadow: var(--brand-glow); }
.brand-text b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.brand-text span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: -2px; }

.userchip-group { display: flex; align-items: center; gap: 6px; }
.userchip {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 12px 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--surface-solid); color: inherit;
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.userchip:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.userchip .av { font-size: 16px; line-height: 1; }

/* theme control */
.theme-toggle { display: inline-flex; padding: 2px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-solid); gap: 1px; }
.theme-btn { width: 34px; height: 34px; border: 0; background: transparent; border-radius: var(--r-pill); cursor: pointer; display: grid; place-items: center; color: var(--text-3); transition: background .15s, color .15s; }
.theme-btn:hover { color: var(--text-2); }
.theme-btn svg { width: 14px; height: 14px; }
.theme-btn.active { background: var(--brand-tint); color: var(--brand); }

/* underlined tabs */
.tabs { display: flex; gap: 22px; overflow-x: auto; max-width: 100%; scrollbar-width: none; margin-bottom: -1px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; position: relative; min-height: var(--tap); padding: 12px 2px 14px; border: 0; background: transparent; box-shadow: inset 0 -2px 0 transparent;
  color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: color .15s, box-shadow .15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--brand); }
.tab .dot { position: absolute; top: 9px; right: -8px; width: 6px; height: 6px; border-radius: 50%; background: #ff5996; }
.tab-short { display: none; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: var(--r); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card.tight { padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; }
.spacer { margin-left: auto; }
.accent-edge { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.danger-edge { border-color: var(--red); }

.eyebrow { font-size: 13px; font-weight: 500; color: var(--brand); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.tiny { font-size: 13px; }
.center { text-align: center; }
.mono, .num .big, .odds, .count, .stat-big, .acc-pct, .votecount, .tally b, .statline { font-variant-numeric: tabular-nums; }
.text-warn { color: var(--orange); }
.text-danger { color: var(--red); }
.note-warn { color: var(--orange); background: var(--orange-tint); border-radius: var(--r-sm); padding: 9px 12px; }
.pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px; overflow-x: auto; margin: 0; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 9px 18px; border-radius: var(--r-pill); border: 1px solid var(--border); cursor: pointer; text-decoration: none;
  background: var(--surface-solid); color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.4;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); box-shadow: var(--shadow-sm), var(--brand-glow); }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { background: var(--red-tint); border-color: transparent; color: var(--red); box-shadow: none; }
.btn.danger:hover:not(:disabled) { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--brand); }
.btn.ghost:hover:not(:disabled) { background: var(--brand-tint); border-color: transparent; box-shadow: none; }
.btn.sm { min-height: 36px; padding: 7px 14px; font-size: 13px; }
/* A button that sits inside a sentence should read as a link, not a pill. */
.btn.link {
  min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
  color: var(--brand); font-size: inherit; font-weight: 500; text-decoration: underline;
  text-underline-offset: 2px;
}
.btn.link:hover:not(:disabled) { background: none; box-shadow: none; color: var(--brand-hover); }
.btn.block { width: 100%; min-height: var(--tap); padding: 13px 16px; font-size: 15px; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: 11px 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface-solid); color: var(--text); font: inherit; font-size: 14.5px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .03); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:disabled { opacity: .5; background: var(--surface-2); }
textarea { resize: vertical; min-height: 76px; }
select {
  appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%238898aa' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 10px;
}
.checkline { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.checkline input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; box-shadow: none; }

input[type="range"] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: var(--r-pill); border: 0; padding: 0; background: var(--border-strong); box-shadow: none; cursor: pointer; }
input[type="range"]:focus { box-shadow: none; }
/* The generic rule above removes the ring for range inputs. Put a visible
   one back on the thumb — this is the control that sets the number you bet. */
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--brand-ring); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--brand-ring); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid var(--border-strong); box-shadow: var(--shadow); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 1px solid var(--border-strong); box-shadow: var(--shadow); }

/* ---------- badges & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge.win   { background: var(--green-tint);  color: var(--green);  border-color: transparent; }
.badge.loss  { background: var(--red-tint);    color: var(--red);    border-color: transparent; }
.badge.push  { background: var(--orange-tint); color: var(--orange); border-color: transparent; }
.badge.blue, .badge.live { background: var(--brand-tint); color: var(--brand); border-color: transparent; }
.badge.pending { background: var(--surface-2); }

.statuspill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; }
.statuspill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.statuspill.open   { background: var(--green-tint);  color: var(--green); }
.statuspill.locked { background: var(--orange-tint); color: var(--orange); }
.statuspill.graded { background: var(--blue-tint);   color: var(--blue); }
.statuspill.final  { background: var(--red-tint);    color: var(--red); }

/* ---------- pick rows ---------- */
.pickrow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 13px 15px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-solid); margin-bottom: 8px; }
.pickrow.mine { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.pickrow.is-bozo { border-color: var(--red); background: var(--red-tint); }
.pickrow .av { font-size: 22px; flex: none; width: 30px; text-align: center; line-height: 1; }
.pickrow .who { min-width: 0; flex: 1; }
.pickrow .who b { display: block; font-size: 14.5px; font-weight: 600; }
.pickrow .who .bet { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.pickrow .num { flex: none; text-align: right; }
.pickrow .num .big { font-size: 16px; font-weight: 600; }
.pickrow.hiddenpick .who .bet { color: var(--text-3); }
/* History rows were divs with a click handler: unreachable by keyboard and
   announced as plain text. As buttons they need the element defaults reset. */
button.rowbtn { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
button.rowbtn:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
button.rowbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }

/* ---------- the ticket ---------- */
.ticket { position: relative; overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 18px 20px; background: var(--surface-2); }
/* A thin blue rail, the one place the logo's glow shows up in the UI. */
.ticket::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.ticket.cashed::before { background: var(--green); }
.ticket.dead::before { background: var(--red); }
.ticket .odds { font-family: var(--display); font-size: 40px; font-weight: 400; letter-spacing: -.01em; line-height: 1; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ticket.dead .odds, .ticket.cashed .odds { background: none; -webkit-background-clip: initial; background-clip: initial; }
.ticket.dead .odds { color: var(--red); }
.ticket.cashed .odds { color: var(--green); }

/* ---------- bozo reveal ---------- */
.bozo-hero { position: relative; overflow: hidden; text-align: center; padding: 36px 24px 30px; }
.bozo-hero::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--gradient); }
.bozo-hero .nose { font-size: 60px; line-height: 1; animation: pop .5s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.bozo-hero h2 { font-size: clamp(32px, 6vw, 44px); font-weight: 600; margin: 8px 0 2px; letter-spacing: -.035em; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }
.bozo-hero .roast { max-width: 580px; margin: 14px auto 0; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.bozo-hero .tally { display: inline-flex; gap: 28px; margin-top: 20px; padding: 12px 24px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); }
.bozo-hero .tally b { display: block; font-size: 22px; font-weight: 600; }
.bozo-hero .tally span { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ---------- status strip ---------- */
.status-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 20px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.status-strip.you  { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.status-strip.done { border-color: var(--green); }
.status-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.status-head > div:first-child { flex: 1; min-width: 200px; }
.status-head h2 { font-family: var(--display); font-size: 26px; font-weight: 400; letter-spacing: 0; text-transform: uppercase; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 14px 7px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-solid); font-size: 13px; font-weight: 500; color: var(--text-2); cursor: default; }
.chip .chip-av { font-size: 15px; line-height: 1; }
.chip .chip-state { font-weight: 600; }
.chip.in  { background: var(--green-tint); border-color: transparent; color: var(--text); }
.chip.in  .chip-state { color: var(--green); }
.chip.out .chip-state { color: var(--orange); }
.chip.me  { box-shadow: 0 0 0 2px var(--brand-ring); }

/* ---------- pay line / your week ---------- */
.payline { display: flex; align-items: center; gap: 12px; padding: 4px 0; }
.payline-av { font-size: 26px; flex: none; line-height: 1; }
.myline { display: flex; align-items: center; gap: 12px; }

/* ---------- group stats & accuracy ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface-2); }
.stat-big { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.stat-big .stat-of { font-size: 16px; color: var(--text-3); font-weight: 500; }
.stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-top: 8px; }
.stat-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

.acc-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-solid); margin-bottom: 8px; }
.acc-row.me { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.acc-row.unranked { opacity: .55; }
.acc-rank { font-weight: 600; color: var(--text-3); width: 30px; flex: none; font-size: 13px; }
.acc-row .av { font-size: 20px; flex: none; line-height: 1; }
.acc-who { flex: 1; min-width: 0; }
.acc-who b { font-size: 14.5px; font-weight: 600; }
.acc-pct { text-align: right; flex: none; }
.acc-pct .mono { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }

.meter { height: 4px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; margin: 6px 0 3px; }
.meter i { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, #ff7a00, #ff5996); }
.meter.small { height: 3px; }
.acc-meter i { background: var(--brand); }

/* ---------- leaderboard ---------- */
.lb { width: 100%; border-collapse: collapse; }
.lb th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--text-3); padding: 0 10px 8px; }
.lb td { padding: 11px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.lb tr.top td { background: var(--red-tint); }
.lb .rank { font-weight: 600; color: var(--text-3); width: 34px; font-size: 13px; }
.lb .person { display: flex; align-items: center; gap: 10px; }
.lb .person .av { font-size: 20px; line-height: 1; }
.lb .person b { font-size: 14.5px; font-weight: 600; display: block; }
.lb .person small { color: var(--text-3); font-size: 11px; }
.lb .count { font-size: 19px; font-weight: 600; }
.lb .count.hot { color: var(--red); }

/* ---------- pick builder ---------- */
.gamecard { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 15px; background: var(--surface-solid); cursor: pointer; text-align: left; width: 100%; color: inherit; transition: border-color .15s, box-shadow .15s; }
.gamecard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.gamecard.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.gamecard .teams { font-size: 14.5px; font-weight: 600; }
.gamecard .when { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- voting ---------- */
.votecard { border: 1px solid var(--border); border-radius: var(--r); padding: 16px; background: var(--surface-solid); cursor: pointer; text-align: left; width: 100%; color: inherit; position: relative; transition: border-color .15s, box-shadow .15s; }
.votecard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.votecard.voted { border-color: var(--red); background: var(--red-tint); }
.votecard .head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.votecard .head .av { font-size: 24px; line-height: 1; }
.votecard .head b { font-size: 15px; font-weight: 600; }
.votecard .bet { font-size: 13.5px; color: var(--text-2); margin-bottom: 10px; overflow-wrap: anywhere; }
.votecount { position: absolute; top: 12px; right: 12px; font-weight: 600; font-size: 12.5px; padding: 3px 10px; border-radius: var(--r-pill); background: var(--red-tint); color: var(--red); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--text-2); }
.empty .big { font-size: 40px; margin-bottom: 10px; }
/* The by-hand form is an escape hatch, not a step. Collapsed it stops adding
   600px of form under the board that most people will never fill in. */
.disclosure { padding: 0; }
.disclosure > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; min-height: var(--tap); border-radius: var(--r); font-size: 14px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary > span { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.disclosure > summary::after { content: '+'; margin-left: auto; font-size: 18px; line-height: 1; color: var(--text-3); flex: none; }
.disclosure[open] > summary::after { content: '\2212'; }
.disclosure[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--r) var(--r) 0 0; }
.disclosure > summary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-ring); }
.disclosure-body { padding: 16px; }

.hint { font-size: 13px; color: var(--text-3); margin: -6px 0 12px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.howto { margin: 0; padding-left: 22px; line-height: 1.6; font-size: 14.5px; }
.howto li { margin-bottom: 8px; }
.howto li::marker { color: var(--brand); font-weight: 600; }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 32px); max-width: 440px; }
.toast { position: relative; overflow: hidden; padding: 12px 16px 12px 18px; border-radius: var(--r); font-size: 14px; font-weight: 500; animation: rise .22s ease-out; width: 100%; background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); }
/* The glyph carries the meaning, the stripe is decoration. A coloured dot alone
   was the only success/error signal and it fell to 1.6:1 on the dark theme's
   near-white toast — invisible exactly where it mattered. */
.toast::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; opacity: .35; }
.toast.ok::after { background: #34d399; opacity: 1; }
.toast.err::after { background: #fb7185; opacity: 1; }
.toast.info::after { background: #a5b4fc; opacity: 1; }
.toast.ok::before, .toast.err::before, .toast.info::before { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; margin-right: 9px; vertical-align: -4px; font-size: 11px; font-weight: 600; line-height: 1; background: var(--bg); color: var(--text); }
.toast.ok::before { content: '\2713'; }
.toast.err::before { content: '\0021'; }
.toast.info::before { content: '\0069'; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-back { position: fixed; inset: 0; background: rgba(10, 37, 64, .45); z-index: 150; display: grid; place-items: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--border); border-radius: 20px; padding: 24px; width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }

.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.quota { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-3); }
.quota .bar { width: 70px; height: 4px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; }
.quota .bar i { display: block; height: 100%; background: var(--green); }
.quota .bar i.hot { background: var(--orange); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 190; overflow: hidden; }
.confetti i { position: absolute; width: 8px; height: 14px; border-radius: 2px; opacity: .95; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(760deg); opacity: 0; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--border); border-radius: 24px; padding: 36px 32px; box-shadow: var(--shadow-lg); }
.login-card .logo { text-align: center; margin-bottom: 26px; }
.login-card .logo .mark { font-size: 46px; line-height: 1; }
.login-card .logo .mark:has(img) { display: block; width: min(300px, 78vw); margin: 0 auto; aspect-ratio: 1; }
/* The artwork's own black field sits on a near-black page, so its square edge
   shows as an accidental rectangle. Rounding it makes the edge deliberate. */
.login-card .logo .mark img { width: 100%; height: 100%; object-fit: contain; display: block;
  border-radius: 22px; filter: drop-shadow(0 0 44px rgba(45, 125, 255, .38)); }
/* The card gets out of the way — on the landing page the artwork is the page. */
.login-card:has(.logo img) { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; }
.login-card .logo:has(img) { margin-bottom: 8px; }
/* With the artwork present the wordmark is already in it — no need to say it twice. */
.login-card .logo:has(img) h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-card .logo h1 { font-size: 24px; font-weight: 600; margin-top: 12px; letter-spacing: -.03em; }
.login-card .logo p { font-size: 13.5px; color: var(--text-2); margin: 4px 0 0; }
.login-error { background: var(--red-tint); color: var(--red); padding: 10px 13px; border-radius: var(--r-sm); font-size: 13.5px; margin-bottom: 14px; }
.login-theme { position: fixed; top: 16px; right: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .wrap { padding: 16px 14px 80px; }
  .card { padding: 16px; }
  .topbar-inner { gap: 10px; padding: 10px 14px 0; }
  .brand-text span { display: none; }
  .userchip { padding: 4px; gap: 0; }
  .userchip .av { font-size: 18px; width: 26px; height: 26px; display: grid; place-items: center; }
  .userchip .chip-name, .chip-out { display: none; }
  .theme-btn { width: 32px; height: 32px; }
  .tabs { gap: 14px; }
  .tab-full { display: none; }
  .tab-short { display: inline; }
  .status-head h2 { font-size: 22px; }
  .ticket .odds { font-size: 32px; }
  .pickrow { padding: 11px; gap: 9px; }
  .pickrow .av { font-size: 20px; width: 24px; }
  .lb td, .lb th { padding: 10px 6px; }
  .hide-sm { display: none; }
  .stat-row { gap: 8px; }
  .stat { padding: 10px; }
  .stat-big { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .stat-sub { font-size: 11px; }
  .acc-pct .mono { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}

/* ==========================================================================
   The prop board — category pills, grouped sections, a grid of odds buttons
   ========================================================================== */

.board { padding-bottom: 8px; }

/* category pills: horizontally scrollable, thumb-sized */
.pill-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin: 0 -2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pill-row::-webkit-scrollbar { display: none; }
.pill {
  flex: none; min-height: 38px; padding: 8px 18px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--text-2);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.pill:hover { color: var(--text); border-color: var(--text-3); }
.pill.active { background: var(--brand-fill); border-color: var(--brand-fill); color: var(--on-brand); }

/* group-by / side switches + search */
.board-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.seg-wide { width: 100%; }
.seg-wide .seg-btn { flex: 1; }
.seg-btn {
  min-height: 36px; padding: 6px 14px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-solid); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); outline: 1px solid var(--brand-ring); }
.board-search { flex: 1; min-width: 160px; }

/* one section per game or team */
.board-section + .board-section { margin-top: 20px; }
.board-section-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 0 2px 10px; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.board-section-head b { font-size: 15px; font-weight: 600; }

/* the grid: player column pinned, market columns scroll sideways */
/* The market columns scroll sideways when there are more than fit. The mask
   fades the right edge so it is obvious there is more, instead of a column
   that just looks clipped. */
.board-grid {
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  margin: 0 -4px; padding: 0 4px;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 28px), transparent 100%);
}
/* No mask when everything already fits — otherwise the last column looks faded
   for no reason. */
.board-grid.fits { -webkit-mask-image: none; mask-image: none; }
/* Pinning the player column needs an opaque background to slide the cells
   under. When nothing overflows there is nothing to pin, so drop both —
   otherwise every row shows a filled box against the card. */
.board-grid.fits .board-player { position: static; background: transparent; }
.board-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(var(--cols), minmax(78px, 96px));
  gap: 6px; align-items: stretch; margin-bottom: 6px;
}
.board-row.board-head { margin-bottom: 4px; }
.board-head .board-player { background: transparent; }
.board-head .board-col {
  display: flex; align-items: flex-end; justify-content: center; padding: 0 4px 4px;
  font-size: 12px; font-weight: 500; color: var(--text-3); text-align: center; line-height: 1.25;
}
.board-player {
  position: sticky; left: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 1px; padding: 8px 12px 8px 4px; min-width: 0; background: var(--bg);
}
.board-player b { font-size: 14.5px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }

.board-cell {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: var(--tap); padding: 8px 6px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--r-xs); background: var(--surface-solid); color: inherit;
  font: inherit; transition: border-color .12s, box-shadow .12s, background .12s, transform .1s;
}
.board-cell:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.board-cell:active { transform: scale(.97); }
.board-cell.selected { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 2px var(--brand-ring); }
.board-cell .cell-line { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.board-cell .cell-price { font-size: 12.5px; font-weight: 500; color: var(--brand); font-variant-numeric: tabular-nums; }
.board-cell.selected .cell-price { color: var(--brand); }
.board-cell.empty-cell {
  border-style: dashed; border-color: var(--border); background: transparent; color: var(--text-3);
  cursor: default; font-size: 14px;
}
.board-cell.empty-cell:hover { border-color: var(--border); box-shadow: none; }

/* the confirm step reads as its own card below the board */
.confirm-card { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

@media (max-width: 620px) {
  .board-row { grid-template-columns: minmax(112px, 1fr) repeat(var(--cols), minmax(66px, 80px)); gap: 5px; }
  .board-player { padding-left: 2px; }
  .board-player b { font-size: 13.5px; }
  .board-search { min-width: 100%; order: 3; }
  .pill { padding: 8px 15px; font-size: 13.5px; }
}

/* ---------- the crown ----------
   Gold appears in exactly one place: whoever is on the hook. Spending it
   anywhere else is what turns an accent into decoration. */
.bozo-crown { color: var(--gold); }
.badge.gold { background: var(--gold-tint); color: var(--gold); border-color: transparent; }
.pickrow.is-bozo { border-color: var(--gold); background: var(--gold-tint); }
.payline-av { filter: drop-shadow(0 0 10px var(--brand-tint)); }
