:root {
  color-scheme: light;
  --navy: #112653;
  --navy-2: #1d3972;
  --navy-3: #081938;
  --yellow: #ffc21a;
  --yellow-2: #ffda63;
  --ink: #12213d;
  --muted: #687289;
  --page: #eef0f4;
  --panel: #ffffff;
  --line: #d8dde7;
  --soft: #f5f6f8;
  --green: #18a56f;
  --red: #e4424f;
  --market-count: 4;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button { cursor: pointer; }

.install-banner {
  position: fixed;
  z-index: 40;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: 56px minmax(180px, 1fr) auto 28px;
  gap: 12px;
  align-items: center;
  width: min(620px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid #ffffff2b;
  border-radius: 14px;
  background: linear-gradient(125deg, var(--navy), var(--navy-2));
  color: #fff;
  box-shadow: 0 14px 40px #07132d66;
}
.install-banner[hidden] { display: none; }
.install-banner img { border-radius: 13px; box-shadow: 0 5px 15px #0005; }
.install-banner > div { display: grid; gap: 4px; }
.install-banner strong { font-size: 14px; }
.install-banner span { color: #d2dced; font-size: 11px; line-height: 1.45; }
.install-banner .primary-button { width: auto; min-width: 112px; margin: 0; white-space: nowrap; }
.install-close { align-self: start; width: 28px; height: 28px; padding: 0; border: 0; background: transparent; color: #fff; font-size: 23px; line-height: 1; }

.app-header { background: var(--navy); color: white; box-shadow: 0 3px 12px #0916303d; }
.header-row, .main-nav, .sport-tabs, main, footer { width: min(1600px, calc(100% - 28px)); margin-inline: auto; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 86px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px 4px 15px 4px; background: linear-gradient(145deg, var(--yellow), #ff9e00); box-shadow: 0 7px 18px #07132d80; }
.brand-mark svg { width: 38px; height: 38px; fill: var(--navy); }
.brand-mark svg path:last-child { fill: var(--yellow); stroke: var(--navy); stroke-width: 1.5; }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-size: clamp(20px, 2.5vw, 30px); letter-spacing: -.05em; }
.brand-copy small { margin-top: 7px; color: var(--yellow); font-size: 9px; font-weight: 900; letter-spacing: .24em; }
.connection-pill { display: flex; align-items: center; gap: 11px; max-width: 440px; padding: 10px 14px; border: 1px solid #ffffff24; border-radius: 12px; background: #0617357d; }
.connection-pill > span:last-child { display: grid; gap: 3px; }
.connection-pill strong { max-width: 390px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.connection-pill small { color: #b9c7df; font-size: 11px; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #8793a8; box-shadow: 0 0 0 4px #8793a824; }
.status-dot.live, .status-dot.connected { background: #27dd95; box-shadow: 0 0 0 4px #27dd952b, 0 0 14px #27dd95a8; }
.status-dot.error { background: #ff5965; }
.status-dot.stale { background: var(--yellow); }

.main-nav { display: flex; align-items: stretch; min-height: 66px; }
.nav-item { position: relative; display: inline-flex; flex: 0 0 132px; align-items: center; justify-content: center; gap: 8px; border: 0; border-top: 1px solid #ffffff0f; background: transparent; color: #dae3f3; font-weight: 700; }
.main-nav > a.nav-item { text-decoration: none; }
.external-nav-item { color: var(--yellow); }
.nav-item::after { content: ""; position: absolute; right: 20px; bottom: 0; left: 20px; height: 4px; border-radius: 4px 4px 0 0; background: transparent; }
.nav-item:hover { background: #ffffff0b; }
.nav-item.active { color: var(--yellow); }
.nav-item.active::after { background: var(--yellow); }
.nav-icon { font-size: 21px; line-height: 1; }
.nav-item b { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ffffff1c; font-size: 10px; }
.nav-action { margin-left: auto; }
.nav-action.enabled { color: #54e4ad; }
.account-button.signed-in { color: var(--yellow); }
.account-button #balance-badge { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sports-ribbon { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 4px 15px #0e214114; }
.sport-tabs { display: flex; overflow-x: auto; scrollbar-width: thin; }
.sport-tab { position: relative; display: grid; grid-template-columns: 30px auto; grid-template-rows: 22px 20px; align-items: center; min-width: 110px; min-height: 77px; padding: 10px 13px; border: 0; border-right: 1px solid #e6e8ed; background: #fff; color: #2e374b; text-align: left; }
.sport-tab.game-tab { min-width: 132px; text-decoration: none; background: #112653; color: #fff; }
.sport-tab.game-tab:hover { background: #19366f; }
.sport-tab.game-tab::after { background: var(--yellow); }
.sport-tab:hover { background: #f7f8fa; }
.sport-tab.active { background: var(--yellow); color: #10182a; }
.sport-tab::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: transparent; }
.sport-tab.active::after { background: var(--navy); }
.sport-tab .sport-glyph { grid-row: 1 / 3; display: grid; place-items: center; width: 27px; height: 27px; }
.sport-glyph svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sport-glyph.all { font-size: 27px; }
.sport-tab strong { align-self: end; font-size: 13px; }
.sport-tab > span:last-child { align-self: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

main { padding: 16px 0 30px; }
.community-intro { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 28px; align-items: center; margin-bottom: 14px; padding: 17px 20px; border-radius: 9px; background: linear-gradient(125deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: 0 7px 22px #11265322; }
.community-intro > div { display: grid; gap: 5px; }
.community-intro small { color: var(--yellow); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.community-intro strong { font-size: clamp(18px, 2.2vw, 27px); }
.community-intro p { margin: 0; color: #d2dced; font-size: 12px; line-height: 1.6; }
.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.search-box { position: relative; display: block; width: min(480px, 100%); }
.search-icon { position: absolute; top: 50%; left: 13px; translate: 0 -52%; color: var(--navy); font-size: 25px; line-height: 1; }
.search-box input { width: 100%; height: 44px; padding: 0 14px 0 42px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); }
.search-box input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px #1d39721a; }
.tool-actions { display: flex; flex: 1 1 540px; align-items: center; justify-content: flex-end; gap: 18px; }
.display-options { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.display-options[hidden] { display: none; }
.display-toggle { display: grid; grid-template-columns: 36px auto; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.display-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #aab0bb; box-shadow: inset 0 0 0 1px #737b89; transition: background .18s ease; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0004; transition: translate .18s ease; }
.display-toggle input:checked + .toggle-track { background: var(--navy-2); }
.display-toggle input:checked + .toggle-track::after { translate: 16px 0; }
.display-toggle input:focus-visible + .toggle-track { outline: 3px solid #1d397233; outline-offset: 2px; }
.toggle-copy { display: grid; gap: 1px; }
.toggle-copy strong { color: var(--ink); font-size: 11px; line-height: 1.2; }
.toggle-copy small { color: var(--muted); font-size: 9px; line-height: 1.2; }
.live-summary { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.live-summary i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px #e4424f19; }
.live-summary.prematch i { background: var(--navy-2); box-shadow: 0 0 0 4px #1d397224; }
.live-summary strong { color: var(--ink); font-size: 18px; }

.changes { display: grid; gap: 7px; margin: 10px 0; }
.changes:empty { display: none; }
.change { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-left: 4px solid var(--yellow); border-radius: 5px; background: #fff5c9; color: #5a4700; box-shadow: 0 1px 4px #15274b0e; font-size: 12px; }
.change.score { border-color: var(--red); background: #fff0f1; color: #8a2730; }
.change.availability { border-color: #3b72c4; background: #eef5ff; color: #244f8e; }

.market-bar { display: grid; grid-template-columns: minmax(360px, 1.25fr) minmax(0, 4fr); gap: 0; min-width: 0; margin: 0 0 7px; border: 1px solid #d4d7dd; background: #e1e3e7; }
.market-bar-label { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 14px; border-right: 1px solid #cdd1d8; background: var(--yellow); text-align: center; }
.market-bar-label span { font-weight: 900; }
.market-bar-label small { display: none; }
.market-selectors { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 8px; align-items: center; padding: 8px; }
.market-selectors label { display: grid; gap: 3px; min-width: 0; }
.market-selectors label > span { color: #6a7180; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.market-selectors select { width: 100%; height: 34px; min-width: 0; border: 1px solid #afb5c0; border-radius: 2px; background: white; color: #11192c; font-size: 11px; font-weight: 750; }
.no-markets { grid-column: 1 / -1; color: var(--muted); font-size: 12px; text-align: center; }

.league-list { display: grid; gap: 8px; }
.league { min-width: 0; background: #fff; box-shadow: 0 2px 7px #11265312; }
.league-head { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 9px; background: var(--navy); color: #fff; }
.league-head > span { display: grid; place-items: center; width: 20px; height: 20px; color: var(--yellow); }
.league-head svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.league-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.league-head small { margin-left: auto; color: #bfcbe0; font-size: 10px; text-transform: uppercase; }
.league-rows { display: grid; }
.event-row { position: relative; display: grid; grid-template-columns: minmax(360px, 1.25fr) repeat(var(--market-count), minmax(0, 1fr)); min-width: 0; border-bottom: 1px solid var(--line); background: #fff; }
.event-row:last-child { border-bottom: 0; }
.event-row.recent::before { content: ""; position: absolute; z-index: 2; inset: 0 auto 0 0; width: 4px; background: var(--yellow); animation: recent-pulse .7s ease-out; }
.event-row.prematch .match-time strong { color: var(--navy-2); }
.match-cell { display: grid; grid-template-columns: 28px 96px minmax(0, 1fr) 38px; align-items: center; min-width: 0; min-height: 72px; padding: 7px 8px; border-right: 6px solid var(--page); background: #f8f9fb; }
.favorite { width: 28px; height: 34px; padding: 0; border: 0; background: transparent; color: #9aa2b2; font-size: 21px; }
.favorite.active { color: #e5a900; }
.match-time { display: grid; justify-items: center; gap: 2px; padding-right: 7px; border-right: 1px solid #dfe2e8; }
.match-time strong { color: var(--red); font-size: 12px; }
.match-time span { max-width: 90px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.event-italian-time { color: #4f5968; font-size: 7px; font-style: normal; font-variant-numeric: tabular-nums; font-weight: 800; line-height: 1.2; text-align: center; white-space: nowrap; }
.event-countdown { display: block; margin-top: 2px; color: #a56f00; font-size: 7px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.2; text-align: center; white-space: nowrap; }
.event-countdown[data-countdown-kind="end"] { color: var(--red); }
.bet-countdown { width: fit-content; margin: 3px 0; padding: 4px 7px; border-radius: 9px; background: #fff2c2; font-size: 9px; }
.bet-countdown[data-countdown-kind="end"] { background: #ffe7e9; }
.teams { display: grid; gap: 7px; min-width: 0; padding: 0 11px; }
.teams span { display: flex; justify-content: space-between; gap: 10px; min-width: 0; overflow: hidden; font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.teams b { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.market-total { justify-self: end; color: #53617a; font-size: 10px; font-weight: 800; }
.market-cell { display: grid; align-content: center; gap: 3px; min-width: 0; min-height: 72px; padding: 7px 5px; border-right: 1px solid var(--line); background: #fff; }
.market-cell:last-child { border-right: 0; }
.market-cell > small { display: block; color: #757d8d; font-size: 9px; font-weight: 800; text-align: center; }
.market-cell.unavailable { place-items: center; background: #f5f6f8; color: #a2a8b3; }
.prices { display: flex; align-items: stretch; gap: 3px; min-width: 0; }
.price { display: grid; flex: 1 1 0; place-items: center; min-width: 0; min-height: 42px; padding: 3px 2px; border: 1px solid #e0e3e9; border-radius: 2px; background: #f8f9fb; }
.price:not(:disabled):hover { border-color: var(--navy-2); background: #eef3ff; box-shadow: 0 0 0 2px #1d39721a; }
.price em { max-width: 100%; overflow: hidden; color: #687186; font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.price b { color: #111a2e; font-size: 12px; font-variant-numeric: tabular-nums; }
.price.locked { background: #eef0f3; opacity: .62; }
.price.selected { outline: 3px solid #0a8f62; outline-offset: -2px; background: #e6f8f1; }
.price.selected b { background: #0a8f62; color: #fff; }
.price:disabled { cursor: not-allowed; }
.price.locked b { color: #657084; }
.price.value-changed, .teams b.value-changed { color: #101629; background: var(--yellow); animation: value-blink .42s steps(2, end) 8; }
.teams b.value-changed { margin: -3px; padding: 3px; border-radius: 3px; }

.empty { padding: 80px 16px; color: var(--muted); text-align: center; }
footer { padding: 18px 0 38px; color: #70798b; font-size: 11px; line-height: 1.6; text-align: center; }
footer strong { color: var(--navy); }
footer p { margin: 0 auto 10px; }
footer > small { display: block; margin-top: 7px; color: #8b93a2; font-size: 9px; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px 15px; }
.legal-links button { padding: 0; border: 0; border-bottom: 1px solid #8793a8; background: transparent; color: var(--navy-2); font-size: 10px; font-weight: 750; }

.bet-slip { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 36px); overflow: auto; border: 1px solid #0b1d43; border-radius: 12px; background: #fff; box-shadow: 0 22px 65px #06142d66; }
.app-toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; width: max-content; max-width: calc(100vw - 28px); padding: 13px 17px; transform: translateX(-50%); border-radius: 9px; background: var(--navy); box-shadow: 0 14px 38px #06142d66; color: #fff; font-size: 12px; font-weight: 850; text-align: center; }
.app-toast.success { border-left: 5px solid var(--green); }
.app-toast.error { border-left: 5px solid var(--red); }
.app-toast[hidden] { display: none; }
.bet-slip > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; background: var(--navy); color: #fff; }
.bet-slip > header div { display: grid; gap: 3px; }
.bet-slip > header small, .modal-head small { color: var(--yellow); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.bet-slip > header strong { font-size: 16px; }
.bet-slip > header button, .dialog-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #ffffff18; color: #fff; font-size: 23px; }
.bet-slip-body { display: grid; gap: 10px; padding: 15px; }
.bet-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 4px; border-radius: 9px; background: #edf1f6; }
.bet-mode-tabs button { min-height: 49px; padding: 6px 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #48536a; font-size: 12px; font-weight: 900; }
.bet-mode-tabs button small { display: block; margin-top: 2px; color: #778197; font-size: 8px; font-weight: 700; }
.bet-mode-tabs button.active { border-color: #d8ad00; background: var(--yellow); color: #16213a; box-shadow: 0 2px 7px #1020401f; }
.bet-mode-tabs button.active small { color: #465065; }
.bet-selections { display: grid; gap: 6px; max-height: 250px; overflow: auto; }
.bet-selection-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 25px; align-items: center; gap: 8px; padding: 9px 8px 9px 10px; border-left: 4px solid #0a8f62; border-radius: 6px; background: #f2f5f8; }
.bet-selection-row > div { display: grid; min-width: 0; gap: 2px; }
.bet-selection-row strong, .bet-selection-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-selection-row strong { font-size: 11px; }
.bet-selection-row small { color: var(--muted); font-size: 9px; }
.bet-selection-row > b { padding: 5px 7px; border-radius: 4px; background: var(--yellow); font-size: 11px; }
.bet-selection-row > button { width: 25px; height: 25px; padding: 0; border: 0; border-radius: 50%; background: #dce2e9; color: #526078; font-size: 17px; }
.system-football-choices { display: grid; grid-column: 1 / -1; gap: 5px; padding-top: 7px; border-top: 1px solid #dce2e9; }
.system-football-choices > small { color: var(--navy); font-size: 8px; font-weight: 850; }
.system-football-choices > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.system-football-choices button { min-height: 34px; padding: 4px; border: 1px solid #cbd2dd; border-radius: 5px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 900; }
.system-football-choices button b { display: block; margin-top: 1px; font-size: 9px; }
.system-football-choices button.active { border-color: #087e54; background: #dff6ed; box-shadow: inset 0 0 0 1px #087e54; }
.system-football-choices button:disabled { opacity: .45; cursor: not-allowed; }
.system-football-choices.unavailable { color: var(--red); }
.bet-add-hint { color: #667187; font-size: 9px; text-align: center; }
.system-field, .bet-calculation { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.system-field select { min-width: 120px; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-weight: 800; }
.bet-calculation strong { color: var(--ink); font-size: 12px; }
.bet-odds-breakdown { display: grid; gap: 6px; max-height: 210px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; }
.bet-odds-breakdown:empty { display: none; }
.bet-odds-breakdown > strong { color: var(--navy); font-size: 9px; text-transform: uppercase; }
.bet-odds-breakdown ol { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.bet-odds-breakdown li { display: grid; gap: 2px; padding-bottom: 5px; border-bottom: 1px solid #e2e6ed; }
.bet-odds-breakdown li:last-child { padding-bottom: 0; border-bottom: 0; }
.bet-odds-breakdown li span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.bet-odds-breakdown li b { color: var(--navy); font-size: 9px; font-variant-numeric: tabular-nums; }
.bet-odds-breakdown > small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.bet-event { font-size: 14px; font-weight: 850; }
.bet-market { color: var(--muted); font-size: 10px; line-height: 1.4; }
.bet-pick { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px; border-radius: 7px; background: #f1f4f9; }
.bet-pick b { min-width: 55px; padding: 7px; border-radius: 5px; background: var(--yellow); text-align: center; }
.stake-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.stake-field > span:last-child { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 850; }
.stake-field input { width: 110px; height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
.potential { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.potential span { color: var(--muted); font-size: 11px; }
.potential strong { color: var(--green); font-size: 20px; }
.simulation-note { color: var(--muted); font-size: 9px; line-height: 1.4; text-align: center; }
.ticket-legs { display: grid; gap: 5px; margin: 7px 0; padding: 0; list-style: none; }
.ticket-legs li { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 9px; border-radius: 5px; background: #f0f3f7; }
.ticket-legs li span { display: grid; min-width: 0; gap: 2px; }
.ticket-legs li strong, .ticket-legs li small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-legs li strong { font-size: 10px; }
.ticket-legs li small { color: var(--muted); font-size: 8px; }
.ticket-legs li.won { border-left: 3px solid var(--green); }
.ticket-legs li.lost { border-left: 3px solid var(--red); }
.ticket-legs li.void { border-left: 3px solid #778197; }
.ticket-legs li b { flex: none; font-size: 10px; }

.primary-button, .secondary-button { min-height: 43px; padding: 0 15px; border: 0; border-radius: 7px; font-weight: 850; }
.primary-button { background: var(--yellow); color: #18213a; }
.primary-button:hover { background: var(--yellow-2); }
.secondary-button { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.primary-button:disabled, .secondary-button:disabled { cursor: wait; opacity: .55; }
.form-message { min-height: 0; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-message:empty { display: none; }
.form-message.error { color: #b42532; }
.form-message.success { color: #087e54; }

.modal { width: min(520px, calc(100vw - 24px)); max-height: min(780px, calc(100vh - 24px)); padding: 0; overflow: auto; border: 0; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: 0 30px 90px #020b1d99; }
.modal::backdrop { background: #04102cba; backdrop-filter: blur(3px); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; background: var(--navy); color: #fff; }
.modal-head > div { display: grid; gap: 3px; }
.modal-head strong { font-size: 18px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.auth-tabs button { min-height: 46px; border: 0; background: #f3f5f8; color: var(--muted); font-weight: 850; }
.auth-tabs button.active { border-bottom: 4px solid var(--yellow); background: #fff; color: var(--navy); }
.auth-modal form { display: grid; gap: 13px; padding: 19px 20px 12px; }
.auth-modal form label { display: grid; gap: 6px; color: #505b70; font-size: 11px; font-weight: 750; }
.auth-modal form input { height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; outline: none; }
.auth-modal form input:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px #1d39721a; }
.auth-modal form > p:not(.form-message) { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.terms-check { display: flex !important; grid-template-columns: none !important; flex-direction: row; align-items: flex-start; gap: 9px !important; padding: 10px; border-radius: 7px; background: #f3f5f8; color: var(--ink) !important; line-height: 1.5; }
.terms-check[hidden] { display: none !important; }
.terms-check input { flex: 0 0 auto; width: 17px !important; height: 17px !important; margin: 2px 0 0; }
.terms-check button { padding: 0; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--navy-2); font-size: inherit; font-weight: 850; }
.modal-note { margin: 0; padding: 0 20px 18px; color: var(--muted); font-size: 9px; line-height: 1.5; text-align: center; }

.account-modal { width: min(920px, calc(100vw - 24px)); }
.wallet-card { display: grid; gap: 5px; margin: 16px; padding: 16px; border-radius: 10px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; }
.wallet-card[hidden], #player-panel[hidden] { display: none; }
.wallet-card span { color: #c7d3e9; font-size: 11px; }
.wallet-card strong { color: var(--yellow); font-size: 28px; }
.wallet-card small { color: #9fafca; font-size: 9px; }
.player-outcome-panel { display: grid; gap: 10px; margin: 0 16px 16px; }
.player-financial-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.player-financial-summary article { position: relative; display: grid; gap: 5px; min-width: 0; overflow: hidden; padding: 13px; border: 1px solid var(--line); border-left: 5px solid var(--navy-2); border-radius: 9px; background: linear-gradient(145deg, #fff, #f5f7fb); }
.player-financial-summary article.live-net { border-left-color: #8793a8; }
.player-financial-summary article.live-net.positive { border-left-color: var(--green); background: #f0faf6; }
.player-financial-summary article.live-net.negative { border-left-color: var(--red); background: #fff4f5; }
.player-financial-summary article.potential-return { border-left-color: var(--yellow); }
.player-financial-summary span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.player-financial-summary strong { overflow: hidden; color: var(--navy); font-size: clamp(18px, 3vw, 26px); font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.player-financial-summary .live-net.positive strong { color: var(--green); }
.player-financial-summary .live-net.negative strong { color: var(--red); }
.player-financial-summary .potential-return strong { color: #a56f00; }
.player-financial-summary small { overflow: hidden; color: var(--muted); font-size: 8px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.player-outcome-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.player-outcome-summary article { display: grid; gap: 4px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-top: 4px solid #8793a8; border-radius: 8px; background: #f8f9fb; }
.player-outcome-summary article.won, .player-outcome-summary article.potential-win { border-top-color: var(--green); }
.player-outcome-summary article.lost, .player-outcome-summary article.potential-loss { border-top-color: var(--red); }
.player-outcome-summary article.waiting { border-top-color: var(--yellow); }
.player-outcome-summary article.active-live { animation: live-summary-pulse 1.15s ease-in-out infinite; }
.player-outcome-summary span { overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 850; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.player-outcome-summary strong { color: var(--navy); font-size: 22px; }
.player-outcome-summary small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.player-chart-card { background: #fbfcfe; }
.player-outcome-chart { display: grid; gap: 7px; }
.player-chart-row { display: grid; grid-template-columns: 84px minmax(80px, 1fr) 24px 90px; gap: 8px; align-items: center; }
.player-chart-row > span, .player-chart-row > small { color: var(--muted); font-size: 8px; }
.player-chart-row > b { color: var(--navy); font-size: 10px; text-align: right; }
.player-chart-row > small { text-align: right; }
.player-chart-track { height: 10px; overflow: hidden; border-radius: 6px; background: #e9edf3; }
.player-chart-track i { display: block; height: 100%; border-radius: inherit; background: #8793a8; transition: width .25s ease; }
.player-chart-row.won .player-chart-track i, .player-chart-row.potential-win .player-chart-track i { background: var(--green); }
.player-chart-row.lost .player-chart-track i, .player-chart-row.potential-loss .player-chart-track i { background: var(--red); }
.player-chart-row.waiting .player-chart-track i { background: var(--yellow); }
.player-projection-note { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.history-head { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 9px; }
.history-head button { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 800; }
.history-date-filter { display: grid; gap: 8px; margin: 0 16px 11px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8fa; }
.history-filter-modes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.history-filter-modes button { min-height: 34px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--navy); font-size: 9px; font-weight: 850; }
.history-filter-modes button.active { border-color: var(--navy); background: var(--navy); color: #fff; }
.history-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.history-date-fields[hidden], .history-date-fields label[hidden] { display: none; }
.history-date-fields label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.history-date-fields input { width: 100%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--navy); font: inherit; }
.history-filter-summary { margin: 0; color: var(--navy); font-size: 9px; font-weight: 850; }
.bet-history { display: grid; gap: 8px; max-height: 430px; overflow: auto; padding: 0 16px 14px; }
.history-analysis { margin: 4px 0; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.history-bet { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); border-left: 4px solid #8793a8; border-radius: 7px; }
.history-bet.won { border-left-color: var(--green); }
.history-bet.lost { border-left-color: var(--red); }
.history-bet.void { border-left-color: #718096; }
.history-bet.potential-win { border-left-color: var(--green); background: #f3fbf7; }
.history-bet.potential-loss { border-left-color: var(--red); background: #fff7f7; }
.history-bet.waiting { border-left-color: var(--yellow); }
.history-bet.in-play { position: relative; animation: live-bet-pulse 1.15s ease-in-out infinite; }
.history-bet.in-play > header b { display: inline-flex; align-items: center; gap: 5px; color: #fff; }
.history-bet.in-play > header b::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 #fff8; content: ""; animation: live-dot 1.15s ease-out infinite; }
.history-bet.potential-win.in-play > header b { background: var(--green); }
.history-bet.potential-loss.in-play > header b { background: var(--red); }
.history-bet > header, .history-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.history-bet > header span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.history-bet > header b { padding: 3px 6px; border-radius: 10px; background: #eef1f6; font-size: 9px; }
.history-bet > strong { font-size: 12px; }
.history-bet > p, .history-bet > small { margin: 0; color: var(--muted); font-size: 9px; }
.history-bet-date { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: 5px; background: #edf2f8; color: var(--navy); font-size: 9px; }
.history-bet-date span { color: var(--muted); font-weight: 750; }
.history-bet-date strong { text-align: right; }
.history-pick { padding: 7px 0; border-top: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; font-size: 11px; }
.settle-actions { display: flex; gap: 6px; padding-top: 5px; }
.settle-actions button { flex: 1; min-height: 31px; border: 1px solid var(--line); border-radius: 5px; background: #f7f8fa; font-size: 10px; font-weight: 800; }
.settle-actions button[data-settle="won"] { color: #087e54; }
.settle-actions button[data-settle="lost"] { color: #b42532; }
.history-empty { margin: 20px; color: var(--muted); font-size: 12px; text-align: center; }
.account-modal > .form-message { margin: 0 16px 12px; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 16px 16px; }
.account-actions .secondary-button { width: 100%; }
.danger-button { border-color: #e5aeb4; color: #a71928; }

.admin-panel { margin: 0 16px 16px; padding: 13px 0 2px; border-top: 2px solid var(--yellow); }
.admin-panel[hidden] { display: none; }
.admin-panel > p { margin: 0 0 11px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-panel .history-head { padding-inline: 0; }
.admin-users { display: grid; gap: 7px; max-height: 310px; overflow: auto; }
.admin-user { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(260px, 1.2fr); gap: 9px; align-items: stretch; padding: 10px; border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 7px; background: #f8f9fb; }
.admin-user > header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.admin-user > header > div { display: grid; gap: 3px; min-width: 0; }
.admin-user > header strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.admin-user small { color: var(--muted); font-size: 8px; }
.admin-user > header > span { color: var(--navy); font-size: 12px; font-weight: 900; }
.admin-budget-transfer, .player-limit-editor { display: grid; gap: 7px; min-width: 0; padding: 9px; border-radius: 6px; background: #fff; }
.admin-budget-transfer { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.player-limit-editor { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: end; }
.admin-user label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; }
.admin-user label span { color: var(--navy); }
.admin-user input { width: 100%; min-width: 0; height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; text-align: right; }
.admin-user button { height: 32px; border: 0; border-radius: 5px; background: var(--navy); color: #fff; font-size: 9px; font-weight: 850; }
.admin-panel > .form-message { margin-top: 10px; }

.role-dashboard { display: grid; gap: 13px; padding: 16px; }
.role-dashboard[hidden] { display: none; }
.dashboard-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard-title > div { display: grid; gap: 3px; }
.dashboard-title small { color: #b27e00; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.dashboard-title strong { color: var(--navy); font-size: 18px; }
.dashboard-title button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 850; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-grid article { display: grid; gap: 7px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc; }
.stat-grid span { color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.stat-grid strong { overflow: hidden; color: var(--green); font-size: clamp(15px, 2vw, 21px); text-overflow: ellipsis; white-space: nowrap; }
.stat-grid strong.negative { color: var(--red); }
.commission-dashboard { display: grid; gap: 9px; padding: 12px; border: 1px solid #dbc46f; border-radius: 9px; background: linear-gradient(135deg, #fffdf5, #fff8dc); }
.commission-dashboard .history-head { padding: 0; }
.commission-dashboard .history-head span { color: #7b6208; font-size: 9px; font-weight: 750; text-align: right; }
.commission-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.commission-stat-grid article { display: grid; gap: 5px; min-width: 0; padding: 10px; border: 1px solid #e7dcae; border-radius: 7px; background: #fff; }
.commission-stat-grid span { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.commission-stat-grid strong { overflow: hidden; color: var(--green); font-size: clamp(13px, 2vw, 18px); text-overflow: ellipsis; white-space: nowrap; }
.bank-policy-analytics { display: grid; gap: 6px; }
.bank-policy-analytics article { display: grid; grid-template-columns: minmax(170px, 1fr) repeat(3, minmax(90px, auto)); gap: 10px; align-items: center; padding: 9px; border: 1px solid #e7dcae; border-radius: 7px; background: #fff; }
.bank-policy-analytics article > div { display: grid; gap: 3px; min-width: 0; }
.bank-policy-analytics article > div strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
.bank-policy-analytics article small { color: var(--muted); font-size: 8px; }
.bank-policy-analytics article > span { display: grid; gap: 2px; justify-items: end; }
.bank-policy-analytics article > span b { color: var(--green); font-size: 10px; }
.bank-policy-analytics article > span b.negative { color: var(--red); }
.chart-card { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.chart-card > div:first-child { display: flex; justify-content: space-between; margin-bottom: 9px; }
.chart-card > div:first-child strong { font-size: 11px; }
.chart-card > div:first-child small { color: var(--muted); font-size: 9px; }
.bank-chart { display: grid; grid-template-columns: repeat(14, minmax(9px, 1fr)); gap: 5px; align-items: end; height: 105px; }
.chart-day { display: grid; grid-template-rows: 80px 14px; gap: 3px; min-width: 0; text-align: center; }
.chart-axis { display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #dfe3ea; }
.chart-axis i { width: min(16px, 70%); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--green); }
.chart-axis i.negative { background: var(--red); }
.chart-day small { color: var(--muted); font-size: 7px; }
.settlement-panel { display: grid; gap: 7px; padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.settlement-panel .history-head { padding-bottom: 0; }
.sync-status { margin: 0 16px; color: var(--muted); font-size: 9px; }
.sync-status.error { color: var(--red); }
.settlement-report { display: grid; gap: 7px; max-height: 320px; overflow: auto; padding: 0 16px; }
.settlement-summary { display: flex; flex-wrap: wrap; gap: 5px; }
.settlement-summary span { padding: 4px 7px; border-radius: 12px; background: #eef2f7; color: var(--navy); font-size: 9px; font-weight: 800; }
.settlement-row { display: grid; gap: 4px; padding: 9px; border: 1px solid var(--line); border-left: 4px solid #8793a8; border-radius: 7px; }
.settlement-row.won { border-left-color: var(--green); }
.settlement-row.lost { border-left-color: var(--red); }
.settlement-row header { display: flex; justify-content: space-between; gap: 8px; }
.settlement-row header span, .settlement-row p, .settlement-row small { margin: 0; color: var(--muted); font-size: 9px; }
.settlement-row > strong { font-size: 11px; }
.bank-open-bets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 350px; overflow: auto; }
.bank-open-bet { display: grid; gap: 5px; padding: 11px; border: 1px solid var(--line); border-left: 4px solid var(--yellow); border-radius: 7px; }
.bank-open-bet header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bank-open-bet header span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.bank-open-bet header b { color: var(--navy); font-size: 11px; }
.bank-open-bet > strong { font-size: 11px; }
.bank-open-bet p, .bank-open-bet small { margin: 0; color: var(--muted); font-size: 9px; }
.awaiting-settlement { padding-top: 4px; color: #9a7200 !important; font-weight: 750; }
.awaiting-settlement.potential-win { color: var(--green) !important; }
.awaiting-settlement.potential-loss { color: var(--red) !important; }
.current-score { color: var(--navy) !important; font-weight: 850; }

@keyframes live-bet-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #ffc92800; transform: translateZ(0); }
  50% { box-shadow: 0 0 0 4px #ffc92875; }
}

@keyframes live-summary-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); box-shadow: 0 0 0 3px #ffc92855; }
}

@keyframes live-dot {
  0% { box-shadow: 0 0 0 0 #fff9; opacity: 1; }
  70% { box-shadow: 0 0 0 6px #fff0; opacity: .75; }
  100% { box-shadow: 0 0 0 0 #fff0; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .history-bet.in-play, .player-outcome-summary article.active-live, .history-bet.in-play > header b::before { animation: none; }
}
.admin-dashboard .admin-panel { margin: 0; }
.superadmin-note { padding: 11px; border-left: 4px solid var(--yellow); border-radius: 5px; background: #fff7d6; color: #5d4b0b; font-size: 10px; line-height: 1.5; }
.association-panel { display: grid; gap: 9px; padding: 13px; border: 2px solid #e6aa00; border-radius: 9px; background: #fffaf0; }
.association-panel .history-head { padding: 0; }
.association-panel .history-head span { padding: 4px 8px; border-radius: 12px; background: #fff0bd; color: #7d5900; font-size: 9px; font-weight: 900; }
.association-panel .history-head span.complete { background: #e3f5ec; color: var(--green); }
.association-panel > p, .superadmin-management-panel > p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.superadmin-assignments { display: grid; gap: 7px; }
.assignment-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(150px, 220px) 78px; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-left: 5px solid var(--yellow); border-radius: 8px; background: #fff; }
.assignment-row.assigned { border-left-color: var(--green); }
.assignment-row > div { display: grid; gap: 3px; min-width: 0; }
.assignment-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.assignment-row small { color: var(--muted); font-size: 8px; }
.assignment-row select { width: 100%; min-width: 0; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 9px; }
.assignment-row button { height: 34px; border: 0; border-radius: 5px; background: var(--navy); color: #fff; font-size: 9px; font-weight: 850; }
.superadmin-management-panel { display: grid; gap: 8px; padding-top: 4px; }
.superadmin-management-panel .history-head { padding-inline: 0; }
.superadmin-users { display: grid; gap: 8px; }
.super-user { display: grid; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fb; }
.super-user > header { display: grid; grid-template-columns: minmax(145px, 1fr) auto auto; gap: 9px; align-items: center; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.super-user > header > div { display: grid; gap: 3px; min-width: 0; }
.super-user > header > span { color: var(--navy); font-size: 11px; font-weight: 900; }
.super-user.admin-policy-card { border-left: 5px solid var(--yellow); }
.super-user.locked { grid-template-columns: 1fr auto; border-color: #d7b13f; background: #fff9e7; }
.super-user > div { display: grid; gap: 3px; min-width: 0; }
.super-user > div strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.super-user small { color: var(--muted); font-size: 8px; }
.super-user > span { color: var(--navy); font-size: 10px; font-weight: 850; }
.super-user .super-user-assignment { grid-column: span 2; color: var(--muted); font-size: 9px; font-weight: 700; }
.super-user button { min-height: 32px; padding: 0 8px; border: 0; border-radius: 5px; background: var(--navy); color: #fff; font-size: 8px; font-weight: 850; }
.super-user label { display: flex; align-items: center; gap: 3px; font-size: 9px; }
.super-user input, .super-user select { width: 100%; min-width: 0; height: 32px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 9px; }
.admin-funding { display: grid !important; grid-template-columns: minmax(180px, 260px) auto; justify-content: start; align-items: end; gap: 8px !important; padding: 8px; border-radius: 6px; background: #eef3f9; }
.bank-policy-editor { display: grid !important; grid-template-columns: repeat(5, minmax(105px, 1fr)) auto; align-items: end; gap: 7px !important; padding: 9px; border: 1px solid #e7dcae; border-radius: 7px; background: #fffdf6; }
.bank-policy-editor label, .admin-funding label { display: grid; gap: 4px; min-width: 0; color: var(--muted); }
.bank-policy-editor label span, .admin-funding label span { color: var(--navy); font-weight: 800; }
.superadmin-panel > .form-message { margin: 0; }

.leaderboard-modal { width: min(650px, calc(100vw - 24px)); }
.leaderboard-explainer { margin: 14px 16px 7px; padding: 10px 12px; border-left: 4px solid var(--yellow); background: #fff7d6; color: #5d4b0b; font-size: 10px; line-height: 1.5; }
.leaderboard { display: grid; gap: 7px; margin: 0; padding: 8px 16px 18px; list-style: none; }
.leaderboard li { min-height: 58px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.leaderboard li.is-me { border-color: #e6aa00; background: #fff9e6; }
.leaderboard-player-button { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 14px; gap: 10px; align-items: center; width: 100%; min-height: 58px; padding: 8px 11px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.leaderboard-player-button:hover, .leaderboard-player-button:focus-visible { background: #f4f7fb; outline: 2px solid var(--yellow); outline-offset: -2px; }
.leaderboard .rank { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: var(--yellow); }
.leaderboard li:nth-child(1) .rank { background: var(--yellow); color: var(--navy); }
.leaderboard-player-copy { display: grid; gap: 3px; }
.leaderboard-player-copy strong { font-size: 12px; }
.leaderboard-player-copy small { color: var(--muted); font-size: 9px; }
.leaderboard .score { color: var(--green); font-size: 13px; font-weight: 900; }
.leaderboard .score.negative { color: var(--red); }
.leaderboard-chevron { color: var(--muted); font-size: 22px; font-weight: 800; }
.leaderboard-modal > .form-message { margin: 0 16px 16px; }
.leaderboard-player-modal { width: min(940px, calc(100vw - 24px)); }
.leaderboard-player-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.leaderboard-player-toolbar button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 10px; font-weight: 850; }
.leaderboard-player-toolbar span { color: var(--muted); font-size: 10px; font-weight: 750; text-align: right; }
.player-analytics { display: grid; gap: 10px; padding: 14px 16px; background: #f7f9fc; }
.player-analytics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.player-analytics-grid article { display: grid; gap: 5px; min-width: 0; padding: 11px; border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 7px; background: #fff; }
.player-analytics-grid span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.player-analytics-grid strong { overflow: hidden; color: var(--green); font-size: clamp(14px, 2vw, 20px); text-overflow: ellipsis; white-space: nowrap; }
.player-analytics-grid strong.negative, .player-formulas b.negative { color: var(--red); }
.player-analytics-grid small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.player-formulas { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.player-formulas article { display: grid; align-content: start; gap: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.player-formulas header, .player-formulas div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.player-formulas header { margin-bottom: 5px; padding-bottom: 7px; border-bottom: 2px solid var(--yellow); }
.player-formulas header strong { color: var(--navy); font-size: 10px; }
.player-formulas header b { color: var(--green); font-size: 12px; }
.player-formulas div { padding: 4px 0; border-bottom: 1px solid #eef1f5; font-size: 9px; }
.player-formulas div span { color: var(--muted); }
.player-formulas div b { color: var(--green); white-space: nowrap; }
.player-formulas .reconciliation { color: #8a5e00; background: #fff8de; }
.player-formulas > article > small { margin-top: 7px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.player-analysis-section { display: grid; gap: 8px; padding: 13px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.player-analysis-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.player-analysis-heading > div { display: grid; gap: 2px; }
.player-analysis-heading small { color: #a67500; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.player-analysis-heading strong { color: var(--navy); font-size: 13px; }
.player-analysis-heading > span { color: var(--muted); font-size: 8px; text-align: right; }
.bets-heading { padding: 14px 16px 9px; }
.player-movements { display: grid; gap: 5px; max-height: 260px; overflow: auto; }
.player-movement { display: grid; grid-template-columns: 130px minmax(180px, 1fr) 100px 110px; gap: 9px; align-items: center; padding: 8px 9px; border: 1px solid var(--line); border-left: 4px solid #8793a8; border-radius: 6px; background: #fff; }
.player-movement.grant, .player-movement.weekly-grant, .player-movement.payout { border-left-color: var(--green); }
.player-movement.stake, .player-movement.budget-expiry, .player-movement.commission { border-left-color: var(--red); }
.player-movement.refund { border-left-color: var(--yellow); }
.player-movement.reconciliation { border-left-color: #8b5cf6; background: #faf8ff; }
.player-movement time, .player-movement small { color: var(--muted); font-size: 8px; }
.player-movement > div { display: grid; gap: 2px; min-width: 0; }
.player-movement > div strong, .player-movement > div small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-movement > div strong { font-size: 10px; }
.player-movement .movement-amount { justify-self: end; font-size: 10px; }
.player-movement .movement-amount.positive { color: var(--green); }
.player-movement .movement-amount.negative { color: var(--red); }
.player-movement > span { justify-self: end; color: var(--navy); font-size: 9px; font-weight: 850; }
.leaderboard-player-bets { max-height: min(52vh, 520px); padding-top: 0; }
.bet-score-calculation { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; padding: 7px 8px; border-radius: 5px; background: #f0f7f4; font-size: 9px; }
.bet-score-calculation.negative { background: #fff1f2; }
.bet-score-calculation.open { background: #fff8df; }
.bet-score-calculation > strong { color: var(--navy); }
.bet-score-calculation > span { justify-self: end; }
.bet-score-calculation > small { grid-column: 1 / -1; color: var(--muted); }
.bet-score-calculation.positive span b { color: var(--green); }
.bet-score-calculation.negative span b { color: var(--red); }
.ticket-odds-formula { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; padding: 6px 8px; border-radius: 5px; background: #eef3fa; font-size: 9px; }
.ticket-odds-formula span { color: var(--muted); font-weight: 750; }
.ticket-odds-formula b { overflow-wrap: anywhere; color: var(--navy); text-align: right; }
.ticket-odds-formula small { grid-column: 1 / -1; color: var(--muted); }
.leaderboard-player-modal > .form-message { margin: 0 16px 16px; }

.legal-modal { width: min(800px, calc(100vw - 24px)); }
.legal-tabs { position: sticky; top: 65px; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #fff; }
.legal-tabs button { min-height: 43px; border: 0; border-bottom: 3px solid transparent; background: #f5f6f8; color: var(--muted); font-size: 10px; font-weight: 850; }
.legal-tabs button.active { border-bottom-color: var(--yellow); background: #fff; color: var(--navy); }
.legal-copy { padding: 17px 22px 8px; }
.legal-copy h2 { margin: 0 0 13px; color: var(--navy); font-size: 21px; }
.legal-copy h3 { margin: 17px 0 5px; color: var(--navy-2); font-size: 13px; }
.legal-copy p { margin: 0 0 9px; color: #505b70; font-size: 11px; line-height: 1.65; }
.legal-copy a { color: #174f9d; font-weight: 750; }
.legal-warning { margin: 8px 22px 20px; padding: 10px; border-radius: 6px; background: #fff0f1; color: #8a2730; font-size: 9px; line-height: 1.5; text-align: center; }

@keyframes value-blink {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: .22; filter: brightness(1.25); }
}
@keyframes recent-pulse {
  from { box-shadow: inset 16px 0 25px #ffc21a66; }
  to { box-shadow: inset 0 0 0 #ffc21a00; }
}

@media (max-width: 980px) {
  .connection-pill strong { max-width: 250px; }
  .market-bar { grid-template-columns: 270px minmax(0, 1fr); }
  .event-row { grid-template-columns: 270px repeat(var(--market-count), minmax(160px, 1fr)); overflow-x: auto; }
  .league-rows { overflow-x: auto; }
  .event-row { min-width: 910px; }
}

@media (max-width: 700px) {
  .account-actions { grid-template-columns: 1fr; }
  .header-row, .main-nav, .sport-tabs, main, footer { width: min(100%, calc(100% - 18px)); }
  .header-row { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px 0 12px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-mark svg { width: 32px; height: 32px; }
  .connection-pill { width: 100%; max-width: none; }
  .connection-pill strong { max-width: calc(100vw - 82px); }
  .main-nav { min-height: 58px; overflow-x: auto; scrollbar-width: thin; }
  .nav-item { flex: 0 0 92px; min-width: 92px; padding: 4px; font-size: 11px; }
  .nav-item > span:last-of-type { overflow: hidden; text-overflow: ellipsis; }
  .nav-item .nav-icon { font-size: 17px; }
  .nav-item b { display: none; }
  .nav-action { margin-left: 0; }
  .account-button #balance-badge { display: none; }
  .sports-ribbon .sport-tabs { width: 100%; }
  .sport-tab { min-width: 96px; min-height: 68px; padding: 7px 10px; }
  main { padding-top: 10px; }
  .community-intro { grid-template-columns: 1fr; gap: 9px; padding: 14px; }
  .tools { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .tool-actions { display: grid; flex: none; grid-template-columns: minmax(0, 1fr) auto; align-items: center; justify-content: stretch; gap: 10px; }
  .display-options { display: grid; justify-content: stretch; gap: 10px; }
  .live-summary { flex: 0 0 auto; justify-content: flex-end; }
  .market-bar { display: block; }
  .market-bar-label { min-height: 36px; }
  .market-bar-label small { display: inline; margin-left: auto; font-size: 9px; }
  .market-selectors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event-row { display: block; min-width: 0; }
  .match-cell { position: sticky; left: 0; grid-template-columns: 26px 82px minmax(0, 1fr) 34px; min-height: 66px; border-right: 0; border-bottom: 1px solid var(--line); }
  .event-row .market-cell { display: inline-grid; width: 50%; min-height: 64px; vertical-align: top; border-bottom: 1px solid var(--line); }
  .league-rows { overflow: visible; }
  .league-head { position: sticky; top: 68px; z-index: 4; }
  .bet-slip { right: 7px; bottom: 7px; width: calc(100vw - 14px); }
  .app-toast { bottom: 14px; }
  .modal { width: calc(100vw - 14px); max-height: calc(100vh - 14px); }
  .admin-user { grid-template-columns: 1fr; }
  .admin-user > header { grid-column: 1; }
  .admin-budget-transfer { grid-template-columns: minmax(0, 1fr) auto; }
  .player-limit-editor { grid-template-columns: 1fr 1fr; }
  .player-limit-editor button { grid-column: 1 / -1; width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .commission-stat-grid { grid-template-columns: 1fr 1fr; }
  .bank-policy-analytics article { grid-template-columns: 1fr 1fr 1fr; }
  .bank-policy-analytics article > div { grid-column: 1 / -1; }
  .player-financial-summary { grid-template-columns: 1fr; }
  .player-outcome-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bank-open-bets { grid-template-columns: 1fr; }
  .super-user.locked { grid-template-columns: minmax(120px, 1fr) auto; }
  .super-user > header { grid-template-columns: minmax(120px, 1fr) auto; }
  .super-user > header button { grid-column: 1 / -1; width: 100%; }
  .admin-funding { grid-template-columns: minmax(0, 1fr) auto; }
  .bank-policy-editor { grid-template-columns: 1fr 1fr; }
  .bank-policy-editor button { grid-column: 1 / -1; width: 100%; }
  .assignment-row { grid-template-columns: minmax(120px, 1fr) 88px; }
  .assignment-row > div { grid-column: 1 / -1; }
  .assignment-row select { grid-column: 1; }
  .assignment-row button { grid-column: 2; }
  .bank-chart { gap: 2px; }
  .player-analytics-grid { grid-template-columns: 1fr 1fr; }
  .player-formulas { grid-template-columns: 1fr; }
  .player-movement { grid-template-columns: minmax(0, 1fr) auto; }
  .player-movement time { grid-column: 1 / -1; }
  .player-movement .movement-amount { grid-column: 2; grid-row: 2; }
  .player-movement > span { grid-column: 1 / -1; }
  .legal-copy { padding-inline: 15px; }
  .install-banner { grid-template-columns: 50px minmax(0, 1fr) 28px; gap: 9px; }
  .install-banner img { width: 50px; height: 50px; }
  .install-banner .primary-button { grid-column: 1 / -1; width: 100%; }
  .install-close { grid-column: 3; grid-row: 1; }
}

@media (max-width: 420px) {
  .brand-copy strong { font-size: 20px; }
  .nav-item { gap: 4px; }
  .market-selectors { grid-template-columns: 1fr 1fr; gap: 5px; padding: 6px; }
  .market-selectors select { font-size: 10px; }
  .teams { padding-inline: 7px; }
  .teams span { font-size: 11px; }
  .player-outcome-summary { grid-template-columns: 1fr 1fr; }
  .player-chart-row { grid-template-columns: 68px minmax(60px, 1fr) 20px 74px; gap: 5px; }
  .history-filter-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-date-fields { grid-template-columns: 1fr; }
  .commission-stat-grid, .player-limit-editor, .bank-policy-editor { grid-template-columns: 1fr; }
  .player-limit-editor button, .bank-policy-editor button { grid-column: 1; }
  .bank-policy-analytics article { grid-template-columns: 1fr; }
  .bank-policy-analytics article > div { grid-column: 1; }
  .bank-policy-analytics article > span { grid-template-columns: 1fr auto; justify-items: start; }
  .bank-policy-analytics article > span b { justify-self: end; }
  .player-analytics-grid { grid-template-columns: 1fr; }
  .player-analysis-heading { align-items: start; flex-direction: column; }
  .player-analysis-heading > span { text-align: left; }
}
