/* ============ TheRealOdds design system — dark navy, cyan accent ============ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');
:root {
  --bg: #070b15;
  --panel: #0c1322;
  --panel-2: #101a2e;
  --panel-3: #16233c;
  --tile: #0c1322;              /* brand: favicon / app-icon tile */
  --border: rgba(148, 163, 184, 0.10);
  --border-strong: rgba(148, 163, 184, 0.18);
  --ink: #e6edf7;
  --ink-2: #9fb0c8;
  --muted: #64748b;
  --accent: #22d3ee;
  --accent-ink: #67e8f9;
  --accent-deep: #0891b2;       /* brand: cyan on light backgrounds (a11y) */
  --accent-dim: rgba(34, 211, 238, 0.14);
  --on-accent: #06202a;         /* brand: text/glyphs ON the cyan accent */
  --pos: #10b981;
  --neg: #ef4444;
  --gold: #fbbf24;
  --radius: 14px;
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-brand: "Space Grotesk", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
.page-title, h1.page-title { font-family: var(--font-brand); letter-spacing: -0.02em; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ---------------- layout shell ---------------- */
.shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 0 28px 64px; }
.content { max-width: 1240px; margin: 0 auto; }

/* sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--border);
  background: rgba(9, 14, 26, 0.85);
  padding: 18px 14px 24px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
  z-index: 40;
}
.side-logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 16px; }
.side-logo svg { display: block; }
.side-section {
  font-size: 10.5px; letter-spacing: 0.14em; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  margin: 18px 8px 6px;
}
.side-section::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); font-weight: 550; font-size: 14px;
  transition: background 0.12s, color 0.12s;
}
.side-link:hover { background: var(--panel-2); color: var(--ink); text-decoration: none; }
.side-link.active { background: var(--accent-dim); color: var(--accent-ink); }
.side-link .ico { width: 18px; text-align: center; opacity: 0.9; }
.side-promo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 16px 2px 0; padding: 11px 12px;
  background: linear-gradient(115deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.14) 60%, rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(34, 211, 238, 0.25); border-radius: 12px;
  color: var(--ink); font-weight: 650; font-size: 13.5px;
}
.side-promo:hover { text-decoration: none; filter: brightness(1.1); }
.side-promo .tag {
  background: var(--accent); color: #06202a; font-size: 10.5px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; letter-spacing: 0.04em;
}
.side-foot { margin-top: 22px; padding: 0 8px; font-size: 11.5px; color: var(--muted); }

/* topbar */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: none; align-items: center; gap: 8px; }
.top-search {
  flex: 1; max-width: 430px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; color: var(--muted); font-size: 13.5px;
}
.top-live {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 600;
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%; background: var(--pos);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.btn {
  border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--ink);
  padding: 8px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 650; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06202a; }
.btn:hover { filter: brightness(1.12); }
.btn.refresh { display: inline-flex; align-items: center; gap: 6px; }
.btn.refresh .rf-ico { display: inline-block; font-size: 15px; line-height: 1; }
.btn.refresh.busy { opacity: 0.7; }
.btn.refresh.busy .rf-ico { animation: lz-spin 0.8s linear infinite; }
@keyframes lz-spin { to { transform: rotate(360deg); } }

/* menu button (mobile) */
.menu-btn { display: none; }

/* ---------------- shared components ---------------- */
.panel {
  background: linear-gradient(180deg, var(--panel) 0%, rgba(12, 19, 34, 0.72) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.panel-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 16.5px; font-weight: 750; letter-spacing: -0.01em; }
.panel-body { padding: 16px 18px; }
.section-gap { margin-top: 26px; }

h1.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { color: var(--ink-2); margin-top: 4px; font-size: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-strong);
  color: var(--ink-2); background: var(--panel-2);
}
.badge.live { color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); }
.badge.model { color: var(--gold); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.badge.real { color: var(--accent-ink); border-color: rgba(34, 211, 238, 0.4); background: var(--accent-dim); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 700;
  padding: 5px 12px; border-radius: 7px; cursor: pointer;
}
.seg button.active { background: var(--accent); color: #06202a; }
.seg button:not(.active):hover { color: var(--ink); }
.seg.mini button { padding: 4px 9px; font-size: 11px; }

.chg { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: var(--pos); }
.chg.down { color: var(--neg); }

.chip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  font-size: 12.5px; font-weight: 800; color: #0b1120;
}
.flag { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel-3); flex: 0 0 22px; }
.flag.sm { width: 18px; height: 18px; flex-basis: 18px; }
.flag.lg { width: 28px; height: 28px; flex-basis: 28px; }

.skel { color: var(--muted); padding: 26px; text-align: center; font-size: 13.5px; }
.err { color: #fca5a5; padding: 18px; font-size: 13.5px; }

/* tables */
/* border-collapse: separate (not collapse) — collapse makes sticky <thead> bleed
   scrolled rows through the header on iOS Safari. Cells keep their own borders. */
table.lz { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
table.lz th {
  text-align: right; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.lz th:first-child, table.lz th.l { text-align: left; }
table.lz td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
table.lz td:first-child, table.lz td.l { text-align: left; }
table.lz tr:last-child td { border-bottom: 0; }
table.lz tbody tr:hover { background: rgba(148, 163, 184, 0.045); }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink-2); }

.tscroll { overflow-x: auto; }

/* reusable inline help — a "?" badge that toggles a small closable popover */
.help-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--muted);
  font-size: 10px; font-weight: 800; line-height: 1; cursor: pointer;
  vertical-align: middle; user-select: none;
}
.help-badge:hover { color: var(--ink); border-color: var(--accent); }
.help-pop {
  position: absolute; z-index: 60; max-width: 270px;
  background: #0e1626; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 12px 26px 12px 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  font-size: 12.5px; line-height: 1.55; color: var(--ink-2); font-weight: 500;
  text-align: left; white-space: normal;
}
.help-pop .hp-t { display: block; color: var(--ink); font-weight: 750; margin-bottom: 5px; }
.help-pop .hp-x { position: absolute; top: 6px; right: 9px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }
.help-pop .hp-x:hover { color: #ef4444; }

/* freshly-arrived live-feed rows briefly flash so new activity is visible */
@keyframes oc-flash { from { background: rgba(34, 211, 238, 0.20); } to { background: transparent; } }
tr.oc-new td { animation: oc-flash 1.8s ease-out; }
.feed-row.oc-new { animation: oc-flash 1.8s ease-out; }

/* share bar */
.sharebar { display: inline-block; width: 90px; height: 5px; border-radius: 3px; background: var(--panel-3); vertical-align: middle; overflow: hidden; }
.sharebar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #22d3ee, #3b82f6); }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; }
.tile .k { font-size: 11.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tile .v { font-size: 24px; font-weight: 800; margin-top: 5px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--ink-2); margin-top: 3px; }

/* ---------------- hero (home) ---------------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: 18px; border: 1px solid rgba(34, 211, 238, 0.22);
  background:
    radial-gradient(900px 320px at 85% -40%, rgba(34, 211, 238, 0.28), transparent 60%),
    radial-gradient(700px 300px at 15% 130%, rgba(168, 85, 247, 0.16), transparent 60%),
    linear-gradient(115deg, #0b2a3d 0%, #0c1a3a 55%, #131034 100%);
  padding: 42px 40px; margin-top: 6px;
  display: flex; align-items: center; gap: 20px;
}
.hero h2 { font-size: 32px; letter-spacing: -0.02em; font-weight: 850; line-height: 1.12; }
.hero p { color: #b9cadf; margin: 12px 0 20px; max-width: 460px; font-size: 15px; }
.hero .left { flex: 1 1 55%; min-width: 280px; }
.hero-art { flex: 1 1 45%; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; max-width: 420px; }
.hero-art .chip { width: 52px; height: 52px; border-radius: 14px; font-size: 20px; flex-basis: 52px; opacity: 0.95; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
.hero-art .chip.ghost { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.35); border: 1px solid rgba(255, 255, 255, 0.09); }

.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 1020px) { .home-grid { grid-template-columns: 1fr; } }

.rowlist .row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 6px; border-bottom: 1px solid var(--border);
}
.rowlist .row:last-child { border-bottom: 0; }
.rowlist .rk { width: 18px; color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; }
.rowlist .nm { font-weight: 700; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.rowlist .vol { font-weight: 750; font-variant-numeric: tabular-nums; }
.panel-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

.newtag { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--accent-ink); background: var(--accent-dim); border-radius: 5px; padding: 2px 5px; }

/* notice card */
.notice h3 { font-size: 17px; font-weight: 800; display: flex; gap: 9px; align-items: center; }
.notice p, .notice li { color: var(--ink-2); font-size: 13.8px; }
.notice p { margin: 10px 0; }
.notice ul { margin: 10px 0 0 18px; display: grid; gap: 8px; }
.notice b { color: var(--ink); }

/* ---------------- world cup ---------------- */
.match-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.match-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.match-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); font-weight: 650; letter-spacing: 0.03em; }
.match-teams { display: grid; gap: 8px; }
.match-team { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px; }
.match-team .sc { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.odds-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.odds-box {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  text-align: center; padding: 6px 4px 7px;
}
.odds-box .k { font-size: 10px; color: var(--muted); font-weight: 700; letter-spacing: 0.06em; }
.odds-box .v { font-size: 14.5px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 1px; }
.ou-line { font-size: 11.5px; color: var(--ink-2); display: flex; gap: 10px; justify-content: center; }
.ou-line b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* outrights matrix */
.matrix-wrap { overflow-x: auto; }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
table.matrix th, table.matrix td { padding: 9px 8px; text-align: center; font-size: 13.5px; border-bottom: 1px solid var(--border); }
table.matrix th { font-size: 10.5px; color: var(--muted); }
table.matrix .team-cell {
  position: sticky; left: 0; background: var(--panel); z-index: 2;
  text-align: left; min-width: 150px; font-weight: 700;
  display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--border);
}
table.matrix tr:last-child td, table.matrix tr:last-child .team-cell { border-bottom: 0; }
.px { color: var(--ink-2); font-weight: 600; padding: 3px 7px; border-radius: 7px; display: inline-block; min-width: 44px; }
.px.best { background: var(--accent-dim); color: var(--accent-ink); font-weight: 800; border: 1px solid rgba(34, 211, 238, 0.35); }
.px.fair { color: var(--ink); font-weight: 750; }
.matrix-note { font-size: 11.5px; color: var(--muted); text-align: right; padding: 10px 6px 2px; }

/* big line chart */
.chart-box { position: relative; }
.chart-box svg { display: block; width: 100%; height: auto; }
.lz-tip {
  position: absolute; pointer-events: none; z-index: 5; display: none;
  background: #0b1424f2; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 9px 11px; font-size: 12px; min-width: 150px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.lz-tip .t { color: var(--muted); font-weight: 700; margin-bottom: 5px; font-size: 11px; }
.lz-tip .r { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; font-variant-numeric: tabular-nums; }
.lz-tip .r i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.lz-tip .r b { margin-left: auto; padding-left: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 7px 14px; padding: 12px 4px 0; }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 650; }
.legend .li i { width: 10px; height: 10px; border-radius: 3px; }

/* movement cards */
.move-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.move-card { padding: 14px 16px 10px; }
.move-head { display: flex; align-items: center; gap: 9px; }
.move-head .nm { font-weight: 750; font-size: 15px; }
.move-head .mkt { font-size: 11.5px; color: var(--muted); }
.move-odds { margin-left: auto; text-align: right; font-weight: 800; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.move-odds .from { color: var(--muted); font-weight: 650; }
.move-card svg { display: block; width: 100%; margin-top: 8px; }

/* groups */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.group-card .gh { font-weight: 800; font-size: 15.5px; padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.group-card table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.group-card th { font-size: 10px; letter-spacing: 0.09em; color: var(--muted); text-transform: uppercase; padding: 8px 8px; text-align: right; font-weight: 750; border-bottom: 1px solid var(--border); }
.group-card th.l { text-align: left; padding-left: 16px; }
.group-card td { padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.group-card tr:last-child td { border-bottom: 0; }
.group-card td.l { text-align: left; padding-left: 16px; }
.group-card .tn { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.group-card .rk { color: var(--muted); width: 10px; display: inline-block; }
.group-card .adv { color: var(--pos); font-weight: 800; }
.win-odds { color: #6ee7b7; font-weight: 750; }

/* ---------------- sports analytics ---------------- */
.sa-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
.sa-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.sa-grid > *, .sa-grid3 > * { min-width: 0; }  /* let wide tables scroll, not expand the track */
@media (max-width: 900px) { .sa-grid, .sa-grid3 { grid-template-columns: 1fr; } }
.feed-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row .fr-ev { flex: 1; min-width: 0; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-row .fr-pl { color: var(--ink-2); font-size: 12px; width: 74px; flex: 0 0 74px; }
.feed-row .fr-amt { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-row .fr-ago { color: var(--muted); font-size: 11.5px; width: 40px; flex: 0 0 40px; text-align: right; }
@media (max-width: 600px) {
  .feed-row .fr-pl { display: none; }
  .feed-row { gap: 8px; font-size: 12.5px; }
}

/* ---------------- on-chain (live feed / whales) ---------------- */
.chainbadge {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  padding: 3px 7px; border-radius: 6px; border: 1px solid; flex: 0 0 auto; min-width: 42px;
}
.addr { font-family: var(--mono); font-size: 12.5px; color: var(--accent-ink); }
.addr:hover { text-decoration: underline; }
.oc-row .fr-ago { color: var(--accent-ink); }
.oc-empty { text-align: center; padding: 40px 22px; }
.oc-empty-ic { font-size: 34px; }
.oc-empty h3 { font-size: 17px; font-weight: 750; margin: 10px 0 8px; }
.oc-empty p { color: var(--ink-2); max-width: 520px; margin: 8px auto; font-size: 13.5px; }
.oc-empty code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12px; color: var(--accent-ink); }
.biggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.biggest-grid > * { min-width: 0; }
@media (max-width: 900px) { .biggest-grid { grid-template-columns: 1fr; } }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7; font-weight: 750; font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
}
.feed-table tbody tr td, .big-table tbody tr td { border-bottom: 1px solid var(--border); }
.feed-table td, .big-table td { padding: 11px 12px; }
.mini-select {
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 6px 26px 6px 11px; font-size: 12.5px; font-weight: 650; cursor: pointer;
  appearance: none; max-width: 150px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.mini-select:hover { border-color: var(--accent); }
@media (max-width: 600px) {
  .mini-select { max-width: 120px; font-size: 12px; }
  .feed-table td, .big-table td { padding: 9px 8px; }
}

/* ---------------- provably fair ---------------- */
.pf-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; }
@media (max-width: 860px) { .pf-grid { grid-template-columns: 1fr; } }
.pf-picker {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--ink);
  border-radius: 12px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.pf-picker:hover { border-color: var(--accent); }
.pf-picker-k { color: var(--muted); font-weight: 600; }
.pf-label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 650; margin: 12px 0 6px; }
.pf-label:first-child { margin-top: 0; }
.pf-input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--ink);
  border-radius: 10px; padding: 11px 13px; font-size: 14px; font-family: var(--mono);
}
.pf-input:focus { outline: none; border-color: var(--accent); }
.seg.pf-full { display: flex; width: 100%; }
.seg.pf-full button { flex: 1; }
.pf-slider { width: 100%; accent-color: var(--accent); margin-top: 8px; }
.pf-go { cursor: pointer; }
.pf-res-k { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pf-res-v { font-size: 40px; font-weight: 850; letter-spacing: -0.02em; margin: 8px 0; word-break: break-word; }
.pf-raw { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.pf-note { margin-top: 14px; font-size: 12px; color: var(--muted); font-family: var(--mono); border-top: 1px solid var(--border); padding-top: 12px; }
.pf-hash { margin-top: 14px; padding: 10px 12px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.pf-hash.ok { color: #6ee7b7; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.4); }
.pf-hash.bad { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.4); }
.pf-modal { position: fixed; inset: 0; z-index: 90; background: rgba(4, 7, 14, 0.72); backdrop-filter: blur(4px); align-items: flex-start; justify-content: center; padding: 6vh 14px; }
.pf-modal-card { width: 100%; max-width: 620px; background: linear-gradient(180deg, #0d1526, #0b1220); border: 1px solid var(--border-strong); border-radius: 18px; padding: 18px; }
.pf-modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 750; margin-bottom: 14px; }
.pf-search { width: 100%; background: var(--panel-2); border: 1px solid var(--border-strong); color: var(--ink); border-radius: 10px; padding: 10px 13px; font-size: 14px; margin-bottom: 14px; }
.pf-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-height: 52vh; overflow-y: auto; }
@media (max-width: 560px) { .pf-picker-grid { grid-template-columns: repeat(3, 1fr); } }
.pf-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; color: var(--ink); font-weight: 650; font-size: 12.5px; cursor: pointer; text-align: center; }
.pf-tile:hover { border-color: var(--border-strong); }
.pf-tile.sel { border-color: var(--accent); background: var(--accent-dim); }
.pf-gicon { font-size: 26px; }

/* ---------------- drill-down modal ---------------- */
.drill-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4, 7, 14, 0.72); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 14px; overflow-y: auto;
}
.drill {
  width: 100%; max-width: 780px; margin-bottom: 6vh;
  background: linear-gradient(180deg, #0d1526, #0b1220);
  border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.drill-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.drill-head .flags { display: flex; }
.drill-head .flags .flag { width: 30px; height: 30px; flex-basis: 30px; border: 2px solid #0d1526; }
.drill-head .flags .flag + .flag { margin-left: -9px; }
.drill-head h3 { font-size: 19px; letter-spacing: -0.01em; }
.drill-head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.drill-close {
  margin-left: auto; border: 1px solid var(--border-strong); background: var(--panel-2);
  color: var(--ink); width: 34px; height: 34px; border-radius: 9px; font-size: 15px; cursor: pointer;
}
.drill-close:hover { filter: brightness(1.2); }
.drill-body { padding: 0 20px 18px; }
.mkt-select {
  width: 100%; max-width: 340px; margin: 4px 0 14px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; font-size: 14.5px; font-weight: 650;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.drill-chart { background: rgba(16, 26, 46, 0.6); border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 6px; margin-bottom: 14px; }
.drill-chart .ttl { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 750; padding: 2px 4px 6px; }
.drill-tablewrap { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
table.drill-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13.5px; }
table.drill-t th {
  position: sticky; top: 0; z-index: 2; background: #101a2e;
  font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted);
  font-weight: 750; text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border-strong);
}
table.drill-t th:first-child { text-align: left; }
table.drill-t td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--border); }
table.drill-t td:first-child { text-align: left; }
table.drill-t tr:last-child td { border-bottom: 0; }
table.drill-t .bk { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; }
table.drill-t tr.fair-row td { background: rgba(34, 211, 238, 0.07); border-bottom: 1px solid rgba(34, 211, 238, 0.25); }
.drill-foot { display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; color: var(--muted); font-size: 11.5px; padding: 12px 2px 0; }
@media (max-width: 600px) {
  .drill-overlay { padding: 0; }
  .drill { min-height: 100vh; border-radius: 0; border: 0; }
  .drill-tablewrap { max-height: none; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.drill-t th, table.drill-t td { padding: 8px 8px; font-size: 12.5px; white-space: nowrap; }
  table.drill-t th:first-child, table.drill-t td:first-child {
    position: sticky; left: 0; z-index: 3; background: #0d1526;
    max-width: 150px; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 6px 0 10px -6px rgba(0, 0, 0, 0.6);
  }
  table.drill-t th:first-child { z-index: 4; }
  table.drill-t tr.fair-row td:first-child { background: #10202e; }
}

/* footer */
.foot {
  margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between;
}

/* hero CTA row */
.cta-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  body { overflow-x: hidden; }
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
    background: #0a101d;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .menu-btn {
    display: inline-flex; border: 1px solid var(--border-strong); background: var(--panel-2);
    color: var(--ink); border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 15px;
  }
  .topbar .brand { display: flex; }
  .top-search { display: none; }
  .main { padding: 0 14px 48px; }
  .hero { padding: 28px 22px; flex-direction: column; align-items: flex-start; }
  .hero-art { justify-content: flex-start; }
  .tscroll, .matrix-wrap { -webkit-overflow-scrolling: touch; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  /* topbar: menu + logo + live + refresh */
  .topbar { gap: 10px; padding: 12px 0; }
  .topbar .btn { display: none; }
  .topbar .btn.refresh { display: inline-flex; padding: 7px 10px; }
  .btn.refresh .rf-label { display: none; }  /* icon-only on mobile */
  .top-live { font-size: 11px; }
  .top-live { white-space: nowrap; font-size: 11.5px; }
  h1.page-title { font-size: 21px; }
  .hero h2 { font-size: 25px; }
  .hero p { font-size: 14px; }
  .hero-art .chip { width: 42px; height: 42px; flex-basis: 42px; font-size: 16px; border-radius: 11px; }
  .panel-head { padding: 13px 14px; gap: 8px; }
  .panel-body { padding: 13px 14px; }
  .panel-title { font-size: 15px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile .v { font-size: 19px; }

  /* ranking table: tighter cells + sticky rank/casino while swiping */
  table.lz th, table.lz td { padding: 9px 8px; font-size: 13px; }
  table.lz th:nth-child(1), table.lz td:nth-child(1) {
    position: sticky; left: 0; z-index: 2; background: var(--panel);
  }
  table.lz th:nth-child(2), table.lz td:nth-child(2) {
    position: sticky; left: 34px; z-index: 2; background: var(--panel);
    max-width: 168px; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 6px 0 10px -6px rgba(0, 0, 0, 0.6);
  }
  table.lz tbody tr:hover td { background: var(--panel); }
  .sharebar { width: 56px; }

  /* rowlists (home cards) */
  .home-grid > div, .home-grid .panel { min-width: 0; }
  .rowlist .row { gap: 8px; }
  .rowlist .nm { flex-wrap: wrap; gap: 4px 8px; overflow: hidden; }
  .rowlist svg { flex: 0 0 auto; width: 76px; height: 26px; }
  .rowlist .vol { font-size: 12.5px; }

  /* world cup */
  .match-grid { grid-template-columns: 1fr; }
  .move-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .move-card { padding: 11px 12px 8px; }
  .move-head .nm { font-size: 13.5px; }
  .move-odds { font-size: 13px; }
  .group-grid { grid-template-columns: 1fr; }
  table.matrix .team-cell { min-width: 122px; }
  table.matrix th, table.matrix td { padding: 8px 6px; font-size: 12.5px; }
  .legend { gap: 5px 11px; }
  .legend .li { font-size: 11.5px; }
  .seg button { padding: 5px 9px; font-size: 12px; }
  .foot { flex-direction: column; gap: 6px; }
}

@media (max-width: 420px) {
  .move-grid { grid-template-columns: 1fr; }
  .rowlist .nm > span:last-child { display: none; } /* hide sub-labels on tiny screens */
}
