:root {
  --bg: #081214;
  --bg-2: #0c191c;
  --surface: #102124;
  --card: #13272a;
  --card-2: #16302f;
  --line: #1e3538;
  --line-2: #274448;
  --text: #e9f3ef;
  --muted: #87a29b;
  --accent: #2ee6a8;
  --accent-dim: #1c8f6b;
  --danger: #ff6b6b;
  --warn: #f2c14e;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(900px 420px at 20% -10%, #123033 0%, var(--bg) 60%);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  min-height: 100vh;
}
button { font: inherit; }
a { color: inherit; text-decoration: none; }

/* top bar */
.appbar {
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px; height: 64px;
  background: #071011; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: .12em; color: var(--muted); white-space: nowrap; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--accent); color: #04120c; font-weight: 900; font-size: 16px;
}
.brand em { font-style: normal; color: var(--text); font-weight: 700; margin-left: 5px; }

.sportbar { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.sportbar::-webkit-scrollbar { display: none; }
.sport-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.sport-btn .mono {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: #1a3033; color: var(--accent); font-size: 10px; font-weight: 700;
}
.sport-btn b { font-weight: 500; font-size: 12px; color: #5f7a74; }
.sport-btn:hover { color: var(--text); background: #0e1c1e; }
.sport-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.sport-btn.active .mono { background: var(--accent); color: #04120c; }

.app-right { display: flex; align-items: center; gap: 12px; }
.live-pill { font-size: 11px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.live-pill.ok { color: var(--accent); border-color: #1f5a44; }
.live-pill.bad { color: var(--danger); border-color: #5a2424; }
.wallet { text-align: right; line-height: 1.15; }
.wallet span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.wallet strong { font-size: 15px; }

/* competition bar */
.compbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 9px 22px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 64px; z-index: 25;
}
.comp-left, .comp-right { display: flex; align-items: center; gap: 10px; }
.comp-left { flex: 1; min-width: 220px; }
.comp-right { margin-left: auto; }
.comp-title { color: #5f7a74; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.select-wrap select, .search-wrap input {
  background: #0b191b; border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-size: 12.5px; outline: none;
}
.select-wrap select:focus, .search-wrap input:focus { border-color: var(--accent-dim); }
.search-wrap input { width: 190px; }
.subnav { display: flex; gap: 2px; background: #0b191b; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tab {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px;
}
.tab.active { background: var(--accent); color: #04120c; font-weight: 700; }
.ghost {
  background: #0b191b; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 7px 12px; cursor: pointer; font-size: 12px;
}
.ghost:hover { color: var(--text); border-color: var(--line-2); }

/* layout */
.shell {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) 330px;
  gap: 16px; max-width: 1560px; margin: 0 auto; padding: 16px 22px;
  align-items: start;
}
.rail {
  position: sticky; top: 120px; display: grid; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-size: 13px; cursor: default; }
.rail-item .ico { color: #4f6a64; width: 16px; text-align: center; }
.rail-item.active, .rail-item:hover { background: #17302f; color: var(--text); }
.rail-item.active .ico { color: var(--accent); }

.content { min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1350px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .shell { grid-template-columns: minmax(0, 1fr) 320px; } .rail { display: none; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  .compbar { position: static; }
}

.league-head {
  grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px;
  margin: 8px 0 0; padding: 6px 2px; border-bottom: 1px solid var(--line);
}
.league-head h3 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #9fb8b1; font-weight: 600; }
.league-head span { font-size: 11px; color: #5c7871; }

/* match card */
.card {
  background: linear-gradient(180deg, var(--card) 0%, #122326 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 12px 10px; display: flex; flex-direction: column; gap: 9px;
}
.card:hover { border-color: var(--line-2); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #6f8b84; font-size: 11px; }
.card-league { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-state.live { color: var(--danger); display: inline-flex; align-items: center; gap: 5px; }
.card-state.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.card-state { white-space: nowrap; }

.teams { display: grid; gap: 5px; }
.team { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.team-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-score { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.team.lost .team-name { color: #9fb2ac; }

.market-line { display: grid; gap: 6px; }
.market-label { color: #64817a; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.odds-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.odds-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.odd {
  background: #0c1a1c; border: 1px solid #1f3a3c; border-radius: 7px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px; cursor: pointer; color: var(--text); min-height: 44px; gap: 1px;
}
.odd .t { font-size: 9.5px; color: #5f7c75; line-height: 1; }
.odd .v { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.odd:hover { border-color: var(--accent-dim); background: #102624; }
.odd.selected { background: var(--accent); border-color: var(--accent); }
.odd.selected .t, .odd.selected .v { color: #04120c; }
.odd:disabled { opacity: .4; cursor: not-allowed; }
.odd .alt { font-size: 9px; color: #6f9a8d; }
.odd.selected .alt { color: #0a3a2a; }

.more {
  align-self: flex-start; background: none; border: 0; color: var(--accent); font-size: 11.5px;
  padding: 2px 0; cursor: pointer;
}
.card-extra { display: grid; gap: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.hidden { display: none !important; }

/* betslip */
.slip {
  position: sticky; top: 120px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 900px) { .slip { position: static; } }
.slip-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.slip-head h2 { font-size: 13px; margin: 0; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.link { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.slip-items { padding: 10px 12px; display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.pick { background: #0c1a1c; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 12px; }
.pick strong { display: block; font-size: 12.5px; }
.pick .row { display: flex; justify-content: space-between; color: var(--muted); gap: 8px; margin-top: 3px; }
.pick .row b { color: var(--accent); }
.slip-foot { padding: 12px 14px 14px; border-top: 1px solid var(--line); display: grid; gap: 9px; }
.slip-foot label { font-size: 11px; color: var(--muted); display: grid; gap: 5px; }
input[type="number"], input[type="text"], select {
  background: #0b191b; border: 1px solid var(--line); color: var(--text);
  border-radius: 7px; padding: 8px 10px; font-size: 13px; width: 100%;
}
.line { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.line strong { color: var(--text); font-variant-numeric: tabular-nums; }
.primary {
  background: var(--accent); color: #04120c; border: none; border-radius: 8px;
  padding: 11px; font-weight: 800; font-size: 13px; cursor: pointer;
}
.primary:disabled { opacity: .35; cursor: not-allowed; }
.message { margin: 0; font-size: 11.5px; min-height: 15px; color: var(--warn); }
.message.ok { color: var(--accent); }

/* tables, bets, admin */
.empty { color: var(--muted); font-size: 12.5px; margin: 6px 2px; }
.table-wrap { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 74vh; background: var(--surface); }
.table-meta { padding: 9px 12px; color: var(--muted); font-size: 11.5px; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2; }
.odds-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 900px; }
.odds-table th { position: sticky; top: 33px; background: #0d1c1e; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; white-space: nowrap; z-index: 1; }
.odds-table td { padding: 6px 10px; border-bottom: 1px solid #17282a; white-space: nowrap; font-variant-numeric: tabular-nums; }
.odds-table tbody tr:hover { background: #13292b; }
.odds-table .best-cell { color: var(--accent); font-weight: 700; }

.panel { max-width: 1560px; margin: 0 auto; padding: 0 22px 20px; }
@media (max-width: 900px) { .panel { padding: 0 12px 16px; } }
.panel h2 { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.bets { display: grid; gap: 8px; }
.bet { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 12.5px; }
.bet-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.bet-status { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; background: #1c2f2b; color: var(--muted); }
.bet-status.won { background: #123a29; color: var(--accent); }
.bet-status.lost { background: #3a1717; color: var(--danger); }
.leg { color: var(--muted); font-size: 12px; display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.leg b { color: var(--text); }
.admin { display: grid; gap: 10px; padding: 10px 0; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px auto auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 7px 0; }
@media (max-width: 700px) { .admin-row { grid-template-columns: 1fr; } }
.admin-row .title { font-size: 12.5px; }
.admin-row .sub { color: var(--muted); font-size: 11px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 6px 0; }
.hint { color: var(--muted); font-size: 11.5px; }

/* schedule */
.schedule { display: grid; gap: 4px; grid-column: 1 / -1; }
.sched-row { display: grid; grid-template-columns: 62px 110px minmax(120px, 200px) minmax(0, 1fr) 110px; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }
.sched-row[data-schedule-event] { cursor: pointer; }
.sched-row[data-schedule-event]:hover { border-color: var(--accent-dim); }
.sched-time { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.sched-sport { color: var(--muted); font-size: 11.5px; }
.sched-league { color: #6f8b84; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-teams em { color: var(--muted); font-style: normal; margin: 0 4px; }
.sched-odds { text-align: right; color: #6f8b84; font-size: 11.5px; }
.sched-odds.on { color: var(--accent); }
@media (max-width: 700px) { .sched-row { grid-template-columns: 54px 1fr 90px; } .sched-league { display: none; } .sched-sport { display: none; } }

/* all-markets modal */
.modal { position: fixed; inset: 0; background: rgba(3, 8, 8, .78); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 18px; }
.modal.hidden { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; width: min(920px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 14px; letter-spacing: .04em; }
.am-books { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.am-books .chip { background: #0c1a1c; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; cursor: pointer; }
.am-books .chip.active { color: #04120c; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.am-body { overflow: auto; padding: 6px 16px 18px; }
.am-market { border-bottom: 1px solid #17282a; padding: 8px 0; }
.am-market h4 { margin: 0 0 5px; font-size: 12px; color: #9fb8b1; font-weight: 500; }
.am-outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.am-outcome { background: #0c1a1c; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 11.5px; color: var(--text); }
.am-outcome b { color: var(--accent); margin-left: 6px; font-variant-numeric: tabular-nums; }
.am-outcome.off { opacity: .45; }
