/* bet365 live odds board. Layout follows the ProperOdds scanner: sidebar navigation,
   a plain title bar and one card per game. Colours come from tokens.css (the main
   frontend's design tokens); the two typefaces are self-hosted (SIL OFL). */

@font-face {
  font-family: 'Inter Var';
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Commit Mono';
  src: url('/fonts/CommitMonoVariable.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --font-ui: 'Inter Var', var(--font-body);
  --font-num: 'Commit Mono', var(--font-mono);
  --sidebar-w: 248px;
  --card-bg: var(--color-bg-elevated);
  --card-border: var(--color-border-subtle);
  --chip-bg: var(--color-bg-surface);
  --chip-bg-hover: var(--color-bg-surface-light);
  --up-bg: var(--color-success-muted);
  --up-fg: var(--color-success-bright);
  --down-bg: var(--color-danger-muted);
  --down-fg: var(--color-danger-bright);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ring: rgba(255, 255, 255, 0.06);
  --rule: rgba(148, 163, 184, 0.16);
  --rule-strong: rgba(148, 163, 184, 0.26);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--color-bg-base);
  color: var(--color-text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.4;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--color-primary-bright); outline-offset: 2px; }

/* ---------- Brand ---------- */
.wordmark { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.wordmark b { color: var(--color-primary); font-weight: 700; }
.wordmark-lg { justify-content: center; font-size: 26px; gap: 12px; }
.book-logo { border-radius: 5px; flex: none; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(48rem 26rem at 50% 0%, var(--brand-navy-muted), transparent 70%), var(--color-bg-base);
}
.login-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 32px 28px 24px;
  background: var(--card-bg);
  border: 1px solid var(--color-border-default);
  border-radius: 14px;
}
.login-lead {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 2px 0 18px;
  color: var(--color-text-secondary);
}
.login-card label { color: var(--color-text-secondary); font-size: 13px; }
.login-card input {
  height: 42px;
  padding: 0 12px;
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  font-family: var(--font-num);
}
.login-card input:hover { border-color: var(--color-border-strong); }
.btn-primary {
  height: 42px;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: var(--color-cta-text);
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { background: var(--color-primary-bright); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.login-error { min-height: 1.3em; margin: 2px 0 0; text-align: center; color: var(--down-fg); font-size: 13px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 12px 14px;
  background: var(--color-bg-base);
  border-right: 1px solid var(--card-border);
}
.sidebar .wordmark { padding: 0 8px 6px; }

.sport-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.nav-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  text-align: left;
  font-weight: 500;
  cursor: pointer;
}
.nav-item:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
.nav-item[aria-current="true"] { background: var(--color-bg-surface); border-color: var(--color-border-default); color: var(--color-text-primary); }
.nav-item .count { margin-left: auto; color: var(--color-text-muted); font-family: var(--font-num); font-size: 12px; }
.nav-item.league { padding: 6px 10px 6px 22px; font-size: 13px; font-weight: 400; }
.nav-item .name { min-width: 0; overflow-wrap: anywhere; }

.sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding: 12px 8px 0; border-top: 1px solid var(--card-border); font-size: 13px; }
.sidebar-foot p { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--color-text-secondary); }
.rate { color: var(--color-text-muted) !important; font-family: var(--font-num); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-live { background: var(--color-success); }
.dot-wait { background: var(--color-warning); }
.dot-down { background: var(--color-danger); }
.link-btn { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--color-text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--color-text-primary); }

/* ---------- Main ---------- */
.main { width: 100%; max-width: 820px; min-width: 0; margin: 0 auto; padding: 0 20px 40px; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 0 14px;
  background: var(--color-bg-base);
  border-bottom: 1px solid var(--card-border);
}
.menu-btn { display: none; padding: 7px 12px; border: 1px solid var(--color-border-default); border-radius: 8px; background: var(--chip-bg); cursor: pointer; }
.title-block { min-width: 0; flex: 1 1 220px; }
.title-block h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.view-sub { margin: 2px 0 0; color: var(--color-text-muted); font-size: 13px; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tools input[type="search"] {
  width: 260px; max-width: 100%; height: 36px; padding: 0 12px;
  background: var(--chip-bg); border: 1px solid var(--color-border-default); border-radius: 8px;
}
.tools input[type="search"]:hover { border-color: var(--color-border-strong); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--color-border-default); border-radius: 9px; background: var(--chip-bg); }
.seg button { padding: 5px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--color-text-muted); font-size: 13px; font-weight: 500; cursor: pointer; }
.seg button:hover { color: var(--color-text-primary); }
.seg button[aria-pressed="true"] { background: var(--color-primary-muted); color: var(--color-primary-bright); }

/* ---------- Game tables (Middles page styling) ---------- */
.games { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.game {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
  background: var(--color-bg-elevated);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.24), 0 0 0 1px var(--ring);
  overflow: hidden;
}
.game-head { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 12px; }
.teams { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.team { font-size: 15px; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; min-width: 0; }
.game-meta { margin: 6px 0 0; color: var(--color-text-muted); font-size: 12px; font-weight: 500; }
.live-pill {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--color-success-muted);
  color: var(--color-success-bright);
  font-size: 11px;
  font-weight: 700;
}
.start { flex: none; color: var(--color-text-secondary); font-size: 12px; font-weight: 600; padding-top: 2px; }

.odds-table { display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(var(--cols), minmax(0, 1fr)); }
.odds-table > .th {
  padding: 8px 10px;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  overflow-wrap: break-word;
}
.odds-table > .th:first-child { text-align: left; padding-left: 16px; }
.odds-table > .th + .th, .odds-table > .cell { border-left: 1px solid var(--rule); }
.odds-table > .mkt {
  display: flex;
  align-items: center;
  padding: 9px 10px 9px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--color-primary-bright);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
  min-width: 0;
}
.mkt small { display: block; margin-top: 1px; color: var(--color-text-muted); font-size: 11px; font-weight: 500; }
.odds-table > .cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--color-bg-surface);
  transition: background-color 150ms var(--ease-out);
}
.odds-table > .cell:hover, .list-row:hover { background: var(--color-bg-surface-light); }
.odds-table > .cell.empty { background: transparent; }
.olabel { min-width: 0; color: var(--color-text-secondary); font-size: 12px; font-weight: 600; overflow-wrap: break-word; text-align: right; }
.oline { color: var(--color-text-secondary); font-family: var(--font-num); font-size: 12px; white-space: nowrap; }
.oprice {
  min-width: 48px;
  padding: 1px 5px;
  border-radius: 5px;
  text-align: right;
  font-family: var(--font-num);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-primary);
  white-space: nowrap;
  transition: background-color 600ms var(--ease-out), color 600ms var(--ease-out);
}
.oprice.up { background: var(--up-bg); color: var(--up-fg); transition: none; }
.oprice.down { background: var(--down-bg); color: var(--down-fg); transition: none; }
.is-suspended { opacity: 0.5; }
.is-suspended .oprice { color: var(--color-text-muted); font-family: var(--font-ui); font-size: 11px; font-weight: 600; }

/* Markets with more than three outcomes: name across the row, outcomes in a two-up list. */
.odds-table > .list { grid-column: 1 / -1; border-bottom: 1px solid var(--rule); }
.list .mkt-wide { padding: 9px 16px 6px; color: var(--color-primary-bright); font-size: 13px; font-weight: 600; overflow-wrap: break-word; }
.list .mkt-wide small { margin-left: 6px; color: var(--color-text-muted); font-size: 11px; font-weight: 500; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); border-top: 1px solid var(--rule); }
.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 7px 16px;
  background: var(--color-bg-surface);
  border-bottom: 1px solid var(--rule);
  transition: background-color 150ms var(--ease-out);
}
.list-row .oname { min-width: 0; color: var(--color-text-primary); font-size: 13px; font-weight: 500; overflow-wrap: break-word; }
.list-grid .list-row:nth-child(odd) { border-right: 1px solid var(--rule); }

.more { height: 1px; }
.empty { margin: 48px 0; text-align: center; color: var(--color-text-muted); }

/* ---------- Narrow windows ---------- */
.scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, 0.5); }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; z-index: 20; left: 0; top: 0;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform 220ms var(--ease-out);
  }
  .sidebar.is-open { transform: none; }
  .menu-btn { display: inline-block; }
  .main { padding: 0 12px 32px; }
  .tools { width: 100%; }
  .tools input[type="search"] { flex: 1; width: auto; }
}
@media (max-width: 520px) {
  .odds-table { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); }
  .odds-table > .th:first-child { display: none; }
  .odds-table > .th:nth-child(2) { border-left: 0; }
  .odds-table > .mkt { grid-column: 1 / -1; padding-left: 12px; border-bottom: 0; padding-bottom: 4px; }
  .odds-table > .mkt + .cell { border-left: 0; }
  .game-head { padding: 12px; }
  .list-row { padding: 7px 12px; }
  .seg button { padding: 5px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .outcome .oprice { transition: none; }
}
