:root {
  --bg: #0d1117; --panel: #151b23; --panel2: #1c2430; --line: #263041;
  --text: #e6edf3; --muted: #8b98a9; --accent: #22c55e; --accent2: #16a34a;
  --live: #ef4444; --warn: #f59e0b; --lost: #ef4444; --push: #8b98a9;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); } 100% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }
.status { color: var(--muted); font-size: 12px; flex: 1; }
.wallet { display: flex; gap: 16px; align-items: center; }
.wallet div { display: flex; flex-direction: column; align-items: flex-end; }
.wallet small { color: var(--muted); font-size: 11px; }
.wallet strong { font-size: 16px; color: var(--accent); }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; color: var(--muted); }
.ghost:hover { color: var(--text); }

.layout { display: grid; grid-template-columns: 230px 1fr 320px; gap: 12px; padding: 12px; align-items: start; }
.side, .slip { position: sticky; top: 64px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: calc(100vh - 76px); overflow: auto; }
.side input { width: 100%; padding: 8px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.side h4 { margin: 14px 4px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.list button { display: flex; justify-content: space-between; width: 100%; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 6px; }
.list button:hover { background: var(--panel2); }
.list button.active { background: var(--panel2); color: var(--accent); }
.list span { color: var(--muted); font-size: 12px; }

.tabs { display: flex; gap: 4px; margin: 8px 0; }
.tabs button { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 7px 4px; font-size: 12px; }
.tabs button.active { border-color: var(--accent); color: var(--accent); }
.tabs span { opacity: .7; }

.events { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.group h3 { margin: 4px 2px 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.card-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.live-tag { color: var(--live); font-weight: 700; }
.src-at { background: #b91c1c; color: #fff; border-radius: 4px; padding: 0 6px; font-weight: 600; }
.no-odds { color: var(--muted); }
.teams { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-bottom: 10px; }
.team { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.team img { width: 22px; height: 22px; object-fit: contain; }
.score { font-weight: 800; font-size: 18px; text-align: right; }
.score.flash { animation: flash 1.5s; }
@keyframes flash { 0%, 60% { color: var(--warn); } }
.markets { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.market small { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.sels { display: flex; gap: 4px; }
.odd { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 4px; }
.odd span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.odd b { font-size: 14px; }
.odd:hover:not(:disabled) { border-color: var(--accent); }
.odd.on { background: var(--accent2); border-color: var(--accent); }
.odd.on span { color: #dcfce7; }
.odd:disabled { opacity: .4; cursor: not-allowed; }
.odd.up b { color: var(--accent); }
.odd.down b { color: var(--live); }
.empty { color: var(--muted); text-align: center; padding: 40px 10px; }

.leg { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; position: relative; }
.leg .x { position: absolute; right: 6px; top: 4px; background: none; border: 0; color: var(--muted); font-size: 16px; }
.leg small { color: var(--muted); display: block; }
.leg .row { display: flex; justify-content: space-between; margin-top: 2px; }
.stake { display: flex; gap: 6px; margin: 10px 0 6px; }
.stake input { flex: 1; min-width: 0; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); }
.chips { display: flex; gap: 4px; margin-bottom: 8px; }
.chips button { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 4px; font-size: 12px; }
.summary { display: flex; justify-content: space-between; color: var(--muted); margin: 4px 0; }
.summary b { color: var(--text); }
.primary { width: 100%; background: var(--accent2); border: 0; border-radius: 8px; padding: 10px; font-weight: 700; margin-top: 6px; }
.primary:disabled { opacity: .5; cursor: not-allowed; }
.bet { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: var(--panel2); }
.bet.won { border-left-color: var(--accent); }
.bet.lost { border-left-color: var(--lost); }
.bet.push { border-left-color: var(--push); }
.bet header { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bet .l { margin: 4px 0; font-size: 13px; }
.bet .l small { color: var(--muted); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--line); }
.badge.won { background: var(--accent2); } .badge.lost { background: var(--lost); }
.note { font-size: 11px; color: var(--muted); margin-top: 10px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 8px; z-index: 50; }
.fab { display: none; }

@media (max-width: 1100px) { .layout { grid-template-columns: 200px 1fr; } .slip { display: none; } .slip.open { display: block; position: fixed; inset: auto 0 0 0; top: auto; max-height: 75vh; z-index: 30; border-radius: 12px 12px 0 0; }
  .fab { display: block; position: fixed; right: 16px; bottom: 16px; z-index: 31; background: var(--accent2); border: 0; border-radius: 999px; padding: 12px 18px; font-weight: 700; } }
@media (max-width: 720px) { .layout { grid-template-columns: 1fr; padding: 8px 16px; } .side { position: static; max-height: none; } .status { display: none; } .wallet { gap: 10px; } .top { padding: 10px 16px; } }
