/* fck the vig — "Electric Violet" app design (direction D) */
:root {
  --bg: #110a24;
  --bg-2: #0c0719;
  --surface: #1d1439;
  --surface-2: #2a1f50;
  --line: #2d2352;
  --text: #f6f3ff;
  --muted: #b4aad8;
  --dim: #8a80b0;
  --accent: #9b74ff;
  --accent-ink: #14062e;
  --accent-soft: rgba(155, 116, 255, .18);
  --warn: #ffcf5c;
  --warn-soft: rgba(255, 207, 92, .12);
  --bad: #ff7b9a;
  --bad-soft: rgba(255, 123, 154, .12);
  --radius: 22px;
  --font: Sora, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 28px; background: rgba(17, 10, 36, .88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 22px; letter-spacing: -.5px; text-decoration: none; }
.brand span { color: var(--accent); }
.top-right { display: flex; align-items: center; gap: 10px; }
.state-btn { background: var(--surface); border: 0; border-radius: 999px; padding: 11px 16px; min-height: 44px; font-size: 14px; font-weight: 600; cursor: pointer; }
.state-btn:hover { background: var(--surface-2); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.status.live .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.status.sample .dot { background: var(--warn); }
.status.stale .dot { background: var(--bad); }

.banner { max-width: 1440px; margin: 14px auto 0; padding: 12px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; background: var(--warn-soft); }
.banner strong { color: var(--warn); }

/* ---------- three panels ---------- */
.app { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(340px, 420px); gap: 22px; max-width: 1440px; margin: 0 auto; padding: 22px 28px 40px; align-items: start; }
.panel { min-width: 0; }
.panel-today, .panel-results { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow: auto; scrollbar-width: thin; }
.panel-results { background: var(--surface); border-radius: 28px; padding: 22px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
h1, .panel-title { margin: 0 0 6px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
h1 { font-size: 30px; }
.panel-title { font-size: 26px; }
.lede { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

/* today: price gaps */
.gaps { display: grid; gap: 10px; }
.gap { width: 100%; text-align: left; cursor: pointer; background: var(--surface); border: 2px solid transparent; border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.gap:hover { border-color: var(--line); }
.gap.on { border-color: var(--accent); }
.gap-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gap-pick { font-weight: 700; font-size: 15.5px; }
.gap-game { font-size: 12px; color: var(--muted); margin-top: -4px; }
.gap-badge { flex: none; font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.gap-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.gap-row strong { color: var(--text); }
.gaps .none { color: var(--muted); font-size: 14px; padding: 8px 2px; }

.vig-card { margin-top: 16px; background: var(--surface); border-radius: var(--radius); padding: 16px 18px; }
.vig-card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.vig-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.vig-list li { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 4px 10px; align-items: center; font-size: 13.5px; }
.vig-list .bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.vig-list .bar i { display: block; height: 6px; border-radius: 99px; background: var(--muted); }
.vig-list li.low .bar i { background: var(--accent); }
.vig-list .pct { text-align: right; font-weight: 700; }

/* build: board */
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
.tab { border: 0; background: var(--surface); border-radius: 999px; padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 14px; white-space: nowrap; }
.tab .count { color: var(--muted); font-weight: 600; margin-left: 4px; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.tab[aria-selected="true"] .count { color: var(--accent-ink); opacity: .7; }
.fresh { font-size: 12px; color: var(--muted); }
.games { display: grid; gap: 12px; }
.day { color: var(--muted); font-size: 13px; font-weight: 600; margin: 8px 4px 0; }
.game { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.game.empty-msg { color: var(--muted); }
.game-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.chip-time { font-weight: 700; color: var(--text); }
.chip-live { color: var(--bad); font-weight: 700; }
.chip-props { color: var(--accent); font-weight: 700; }
.books-count { margin-left: auto; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, minmax(84px, 112px)); gap: 7px; align-items: center; }
.grid .h { font-size: 11px; color: var(--dim); text-align: center; font-weight: 600; }
.team { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.team .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .at { color: var(--dim); font-weight: 500; }
.team .short { display: none; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 11px; color: #fff; }
.pick {
  position: relative; height: 52px; border-radius: 14px; border: 2px solid transparent; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; line-height: 1.15;
  transition: border-color .12s, background .12s;
}
.pick:hover { border-color: var(--line); }
.pick .ln { font-size: 11.5px; color: var(--muted); }
.pick .pr { font-weight: 700; font-size: 14.5px; }
.pick .bb { position: absolute; right: 7px; bottom: 4px; font-size: 8.5px; font-weight: 700; color: var(--dim); }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.pick.on .ln, .pick.on .bb { color: var(--text); }
.pick[disabled] { opacity: .3; cursor: default; }

.props-toggle { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 0; border-radius: 14px; padding: 12px 14px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 13.5px; }
.props-toggle .count { color: var(--muted); font-weight: 500; }
.props-toggle .chev { margin-left: auto; color: var(--muted); }
.props-toggle svg { color: var(--accent); }
.props { margin-top: 12px; }
.props-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 0; background: var(--surface-2); border-radius: 999px; padding: 9px 14px; min-height: 40px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.psearch { margin-left: auto; background: var(--surface-2); border: 2px solid transparent; border-radius: 999px; padding: 9px 14px; color: var(--text); font: inherit; font-size: 13px; width: 180px; outline: none; }
.psearch:focus { border-color: var(--accent); }
.prop-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(2, minmax(84px, 112px)); gap: 7px; align-items: center; }
.prop-grid.yn { grid-template-columns: minmax(0, 1fr) minmax(84px, 112px); }
.prop-grid .h { font-size: 11px; color: var(--dim); text-align: center; font-weight: 600; }
.prop-grid .h.left { text-align: left; }
.player { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cta { display: block; width: 100%; border: 0; border-radius: 20px; padding: 17px; min-height: 54px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 16px; cursor: pointer; text-align: center; text-decoration: none; }
.cta:hover { filter: brightness(1.08); }
.cta.light { background: var(--text); color: var(--bg); }
.see-best { display: none; }

/* results */
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: 13px; padding: 6px 0; }
.link-btn:hover { color: var(--text); }
.legs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.leg { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 18px; padding: 10px 10px 10px 16px; }
.leg .what { font-weight: 700; font-size: 14px; display: block; }
.leg .game-l { font-size: 12px; color: var(--muted); }
.leg .best { font-weight: 700; color: var(--accent); }
.leg .x { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--bg); color: var(--muted); font-size: 20px; cursor: pointer; }
.leg .x:hover { color: var(--text); }
.empty { color: var(--muted); font-size: 14px; }
.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent); color: var(--accent-ink); }
.steps b { color: var(--text); }

.stake-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stake-chips { display: flex; gap: 6px; }
.stake-chips button { border: 0; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; min-height: 44px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.stake-chips button.on { background: var(--accent); color: var(--accent-ink); }
.stake-wrap { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; color: var(--muted); }
.stake-wrap input { width: 56px; background: none; border: 0; color: var(--text); font: 700 14px var(--font); outline: none; }

.note { font-size: 12.5px; padding: 11px 13px; border-radius: 16px; margin-top: 12px; line-height: 1.5; }
.note.warn { background: var(--warn-soft); }
.note.warn strong { color: var(--warn); }
.note.info { background: var(--surface-2); color: var(--muted); }

.payout { margin-top: 14px; background: var(--accent); color: var(--accent-ink); border-radius: 26px; padding: 20px 22px; display: grid; gap: 4px; }
.payout .lbl { font-size: 14px; font-weight: 700; }
.payout .big { font-size: 58px; font-weight: 800; letter-spacing: -2.5px; line-height: 1; }
.payout .sub { font-size: 14px; font-weight: 600; }

.rank { margin-top: 16px; }
.rank h3 { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; display: flex; justify-content: space-between; }
.row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.bchip { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: 10px; color: #fff; grid-row: span 2; }
.row .bk { font-weight: 700; display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.row .bk .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; flex: none; }
.badge.book { background: var(--surface-2); color: var(--muted); }
.badge.ex { background: var(--accent-soft); color: var(--text); }
.badge.chk { background: var(--warn-soft); color: var(--warn); }
.row .money { text-align: right; grid-row: span 2; display: grid; }
.row .pay { font-weight: 800; font-size: 18px; }
.row .odds { font-size: 12px; color: var(--muted); }
.row.best .pay { color: var(--accent); }
.meter { grid-column: 2 / 3; display: grid; gap: 6px; }
.meter .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter .bar i { display: block; height: 8px; border-radius: 99px; background: var(--muted); }
.row.best .meter .bar i { background: var(--accent); }
.legp { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11.5px; }
.lp { color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 2px 7px; text-decoration: none; }
a.lp:hover { color: var(--text); }
.lp.off { color: var(--warn); }
.lp .ext { opacity: .6; margin-left: 2px; }
.missing, .hint { font-size: 12px; color: var(--muted); margin-top: 10px; }
.open-best { margin-top: 14px; }

/* tab bar (phone only) */
.tabbar { display: none; }
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; margin-left: 4px; }

/* footer */
.foot { max-width: 1440px; margin: 0 auto; padding: 24px 28px 48px; color: var(--muted); font-size: 12.5px; display: grid; gap: 6px; border-top: 1px solid var(--line); }
.foot p { margin: 0; }
.foot b { color: var(--text); }
.rg { color: var(--dim); }

/* dialogs */
.modal { border: 0; padding: 0; background: transparent; color: var(--text); max-width: calc(100vw - 32px); }
.modal::backdrop { background: rgba(8, 4, 20, .75); backdrop-filter: blur(4px); }
.modal-card { width: 460px; max-width: 100%; background: var(--surface); border-radius: 28px; padding: 24px; }
.modal-card.wide { width: 760px; max-height: 82vh; overflow: auto; }
.modal-card h3 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.modal-card select { width: 100%; margin-top: 12px; background: var(--surface-2); color: var(--text); border: 0; border-radius: 16px; padding: 14px; font: inherit; font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 18px; }
.modal-actions .cta { width: auto; padding: 14px 22px; }
.state-preview { margin-top: 12px; font-size: 13.5px; }
.state-preview .grp { margin-top: 10px; }
.state-preview .grp > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.bk-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bk-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12.5px; font-weight: 600; }
.bk-pill i { width: 18px; height: 18px; border-radius: 6px; display: inline-block; }
.bk-pill.warn { box-shadow: inset 0 0 0 1px var(--warn); }
.no-h { color: var(--bad) !important; }
.chk-h { color: var(--warn) !important; }
.block-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.block-list li { padding: 8px 11px; border-radius: 12px; background: var(--bad-soft); }
.block-list.chk li { background: var(--warn-soft); }
.no-t { color: var(--bad); font-weight: 600; }
.chk-t { color: var(--warn); font-weight: 600; }
.about-h { margin: 18px 0 6px; font-size: 16px; font-weight: 700; }
.about-scroll { max-height: 46vh; overflow: auto; border-radius: 14px; background: var(--bg-2); }
.about-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.about-table th, .about-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.about-table th { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.about-scroll thead th { position: sticky; top: 0; background: var(--bg-2); }
.about-table a { color: var(--accent); word-break: break-all; }

/* ---------- tablet: two columns ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .panel-today { grid-column: 1 / -1; position: static; max-height: none; overflow: visible; }
  .gaps { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ---------- phone: one screen at a time with a tab bar ---------- */
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; }
  .status { display: none; }
  .banner { margin: 10px 16px 0; }
  .app { display: block; padding: 16px 16px 120px; }
  .panel { display: none; }
  .app[data-tab="today"] .panel-today, .app[data-tab="build"] .panel-build, .app[data-tab="results"] .panel-results { display: block; }
  .panel-today, .panel-results { position: static; max-height: none; overflow: visible; }
  .panel-results { background: none; padding: 0; border-radius: 0; }
  .gaps { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
  .grid { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(62px, 84px)); gap: 5px; }
  .prop-grid { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(70px, 92px)); gap: 5px; }
  .prop-grid.yn { grid-template-columns: minmax(0, 1fr) minmax(70px, 92px); }
  .avatar { width: 26px; height: 26px; font-size: 10px; border-radius: 8px; }
  .team { gap: 8px; font-size: 14px; }
  .team .full { display: none; }
  .team .short { display: inline; }
  .pick { height: 48px; }
  .pick .bb { display: none; }
  .psearch { width: 100%; margin-left: 0; }
  .see-best:not([hidden]) { display: block; position: sticky; bottom: 92px; margin-top: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
  .foot { padding-bottom: 110px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: rgba(17, 10, 36, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .tabbar button { background: none; border: 0; padding: 14px 0; min-height: 52px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
  .tabbar button[aria-current="page"] { color: var(--accent); font-weight: 800; }
  .payout .big { font-size: 52px; }
}
