:root {
  --bg: #0f1420; --panel: #182033; --panel2: #212b43; --line: #2c3854;
  --text: #eef2fa; --muted: #93a0bd; --accent: #f5b83d; --accent-ink: #1b1403;
  --good: #4ade80; --bad: #f87171; --live: #fb7185;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 14px 0 6px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: .82rem; }
.empty { color: var(--muted); text-align: center; padding: 22px 0; }
.msg { color: var(--bad); min-height: 1.2em; margin: 6px 0; font-size: .9rem; }
.live { color: var(--live); font-weight: 600; }

.top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; max-width: 640px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.play { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); background: var(--accent); padding: 2px 7px; border-radius: 99px; font-weight: 700; }
.who { margin-left: auto; color: var(--text); font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.who .dot { margin: 0; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--panel); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; text-align: center; padding: 15px 4px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.tabs a.on { color: var(--accent); }

.seg { display: flex; background: var(--panel); border-radius: 10px; padding: 4px; }
.seg a { flex: 1; text-align: center; padding: 9px; border-radius: 7px; color: var(--muted); font-weight: 700; }
.seg a.on { background: var(--panel2); color: var(--text); }
.datebar { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-weight: 600; }
.datebar a { font-size: 1.6rem; padding: 2px 18px; line-height: 1; }

.game { background: var(--panel); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.game-info { display: flex; justify-content: space-between; gap: 10px; color: var(--text); }
.teams { flex: 1; min-width: 0; }
.teams div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.teams span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { color: var(--muted); font-size: .85rem; text-align: right; white-space: nowrap; align-self: center; }
.quickml, .market { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.price { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 46px; padding: 8px 12px;
  background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; font: inherit; cursor: pointer; }
.market .price { background: var(--panel); min-height: 54px; }
.price b { color: var(--accent); }
.price.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.price.on b { color: var(--accent-ink); }
.back { display: inline-block; padding: 6px 0; font-size: .9rem; }
.matchup h1 { margin-top: 4px; }

button.primary { width: 100%; min-height: 48px; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  font: inherit; font-weight: 800; cursor: pointer; }
button.primary:disabled { opacity: .5; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 6px 0; }
input, select { width: 100%; min-height: 46px; padding: 8px 12px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font: inherit; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.field { display: block; font-size: .82rem; color: var(--muted); flex: 1; }
.field input, .field select { margin-top: 4px; }
.row { display: flex; gap: 8px; align-items: end; }
.row .primary { width: auto; padding: 0 20px; }
.stack > * { margin-bottom: 10px; }
.checks { gap: 22px; align-items: center; }

.card { display: flex; justify-content: space-between; gap: 10px; background: var(--panel); border-radius: 12px; padding: 12px; margin-bottom: 10px; color: var(--text); }
.right { text-align: right; white-space: nowrap; }
.tag { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; background: var(--panel2); color: var(--muted); font-weight: 700; }
.tag.won { background: #14532d; color: var(--good); } .tag.lost { background: #4c1d1d; color: var(--bad); }
.tag.final { background: var(--accent); color: var(--accent-ink); }
.share { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; }
.balance { margin: 12px 0 0; }
.pick { margin-top: 8px; }

.bet { background: var(--panel); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; }
.bet-top, .bet-bottom, .leg { display: flex; justify-content: space-between; gap: 10px; }
.bet-top { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.bet-bottom { font-size: .85rem; margin-top: 4px; }
.leg { padding: 3px 0; }

.board { margin-top: 8px; }
.board-head, .board-row summary { display: grid; grid-template-columns: 28px 1fr auto 84px; gap: 8px; align-items: center; }
.board-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 6px; }
.board-head span:nth-child(n+3), .board-row summary span:nth-child(n+3) { text-align: right; }
.board-row { background: var(--panel); border-radius: 12px; margin-bottom: 8px; }
.board-row summary { padding: 14px 12px; cursor: pointer; list-style: none; }
.board-row summary::-webkit-details-marker { display: none; }
.board-row[open] { padding-bottom: 6px; }
.board-row .bet { background: var(--panel2); margin: 0 8px 6px; }

.code { font: 700 1.8rem ui-monospace, Menlo, monospace; letter-spacing: .2em; margin: 4px 0; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches input { position: absolute; opacity: 0; }
.swatches i { display: block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.swatches input:checked + i { border-color: var(--text); }

.slip-bar { position: fixed; left: 12px; right: 12px; bottom: calc(60px + env(safe-area-inset-bottom)); min-height: 48px; z-index: 6;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 20px #0008; }
.slip { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
  box-shadow: 0 -10px 40px #000a; }
.slip > * { max-width: 608px; margin-left: auto; margin-right: auto; }
.slip-head { display: flex; justify-content: space-between; align-items: center; }
.slip-head h2 { margin: 0; font-size: 1.1rem; }
.slip-leg { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.slip-leg .x { background: none; border: 0; color: var(--muted); font-size: 1.3rem; cursor: pointer; padding: 4px 8px; }
.slip-leg .err { color: var(--bad); font-size: .82rem; }
.slip-leg .chg { color: var(--accent); font-size: .82rem; }
.slip .field { margin-top: 10px; } .slip input, .slip select { background: var(--bg); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.quick button { min-height: 40px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.payout { font-weight: 700; margin: 12px 0 4px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: min(92vw, 380px); }
dialog::backdrop { background: #000b; }
dialog h2 { margin: 0 0 4px; } dialog input { margin: 10px 0 0; background: var(--bg); }

.more { background: var(--panel); border-radius: 12px; margin-top: 10px; padding: 0 12px; }
.more summary { padding: 14px 0; cursor: pointer; font-weight: 600; }
.more[open] { padding-bottom: 12px; }
.more .market { margin-top: 8px; }
.more .market .price { background: var(--panel2); min-height: 46px; }
.prop-title { font-size: .8rem; color: var(--muted); margin-top: 12px; }
