/* AI Sports Hub — broadcast / stadium editorial palette */
@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700;800&family=Barlow:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --bg-deep: #060a10;
  --bg-panel: rgba(17, 24, 39, 0.88);
  --bg-elevated: #1a2332;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --accent-dim: rgba(251, 191, 36, 0.14);
  --accent-glow: rgba(251, 191, 36, 0.28);
  --live: #22c55e;
  --live-dim: rgba(34, 197, 94, 0.14);
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 10px;
  --radius-lg: 16px;
  --font-display: "Barlow Condensed", "Noto Sans SC", sans-serif;
  --font-body: "Barlow", "Noto Sans SC", sans-serif;
  --font: var(--font-body);
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.35);
  --max: 1180px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-deep: #f1f5f9;
    --bg-panel: #ffffff;
    --bg-elevated: #e8edf4;
    --border: rgba(15, 23, 42, 0.1);
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #d97706;
    --accent-strong: #b45309;
    --accent-dim: rgba(217, 119, 6, 0.12);
    --accent-glow: rgba(217, 119, 6, 0.2);
    --live: #16a34a;
    --live-dim: rgba(22, 163, 74, 0.12);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
    --header-bg: rgba(255, 255, 255, 0.94);
  }

  .site-header {
    background: var(--header-bg);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }

  .brand {
    color: #0f172a;
  }

  .nav-main a {
    color: #475569;
  }

  .nav-main a:hover {
    color: #0f172a;
  }

  .menu-toggle {
    color: #0f172a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark light;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 15% -10%, rgba(251, 191, 36, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 85% 0%, rgba(34, 197, 94, 0.05) 0%, transparent 50%);
  z-index: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg, rgba(6, 10, 16, 0.9));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(251, 191, 36, 0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 16px var(--accent-glow);
  color: #0f172a;
}

.nav-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-main a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav-main a:hover {
  color: var(--text);
  background: var(--bg-elevated);
  text-decoration: none;
}

.nav-main a.is-active {
  color: var(--accent);
  background: var(--accent-dim);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  background: var(--bg-panel);
}

.lang-switch a {
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--text);
  text-decoration: none;
}

.lang-switch a.is-active {
  background: var(--bg-elevated);
  color: var(--accent);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: block;
  }

  .nav-main {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-bottom: 8px;
  }

  .nav-main.is-open {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

/* hero */
.hero {
  padding: 48px 0 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 210, 106, 0.25);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
}

.hero-lead {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}

@media (max-width: 720px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat-card span {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0f172a;
  box-shadow: 0 4px 20px var(--accent-glow);
  font-weight: 700;
}

.btn-ghost {
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border);
}

/* sections */
.section {
  padding: 28px 0 48px;
}

.section-head {
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .module-grid {
    grid-template-columns: 1fr;
  }
}

.module-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.module-card:hover {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: var(--shadow-soft);
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: grid;
  place-items: center;
  font-size: 1.35rem;
}

.module-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.module-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.module-card .btn {
  align-self: flex-start;
  padding: 10px 16px;
  font-size: 0.88rem;
}

/* placeholder inner pages */
.page-hero {
  padding: 36px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
  position: relative;
}

.page-hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

.page-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.page-hero p {
  margin: 0;
  color: var(--text-muted);
}

/* data / predictions boards — less scroll before table */
.board-page .header-inner {
  padding: 10px 0;
}

.page-hero--data {
  padding: 10px 0 8px;
  margin-bottom: 10px;
}

.page-hero--data h1 {
  margin: 0 0 4px;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
}

.page-hero--data p {
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-page .board-controls {
  padding: 12px 16px 10px;
  margin-bottom: 8px;
  gap: 12px 18px;
}

.board-page .data-meta {
  margin-bottom: 8px;
}

.data-meta--tight {
  margin-bottom: 6px;
}

.data-meta--secondary {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.76rem;
  opacity: 0.9;
}

.data-strip--after {
  margin-top: 10px;
  margin-bottom: 0;
  padding: 8px 12px;
  font-size: 0.74rem;
}

.placeholder-box {
  background: var(--bg-panel);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.placeholder-box strong {
  display: block;
  color: var(--warning);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent);
}

/* demo data boards */
.data-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.data-meta code {
  font-size: 0.78rem;
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.data-strip {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0, 0, 0, 0.22);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover td {
  background: rgba(251, 191, 36, 0.04);
}

.data-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.cell-time {
  white-space: nowrap;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.cell-teams {
  min-width: 280px;
  max-width: 420px;
}

.matchup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

/* stacked home / away with vs vertically centered (Flashscore-style) */
.matchup-stack {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 10px;
  row-gap: 8px;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.matchup-stack .matchup-vs {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  justify-self: center;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.85;
}

.matchup-stack .matchup-line {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.matchup-vs {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.team-pair {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
}

.team-pair img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.team-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.cell-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.tag-live {
  border-color: rgba(34, 197, 94, 0.45);
  color: var(--live);
  background: var(--live-dim);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: var(--shadow-soft);
}

.product-card .img {
  height: 200px;
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  padding: 16px;
}

.product-card .img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-card .body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card .cat {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-card h3 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-size: 1.15rem;
  font-weight: 800;
  margin-top: auto;
}

.board-error {
  border: 1px solid rgba(255, 80, 80, 0.35);
  background: rgba(255, 80, 80, 0.08);
  color: #ffb4b4;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.model-empty {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 8px;
}

.model-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.model-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.model-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.skel {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bg-elevated), #243044, var(--bg-elevated));
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
  margin-top: 10px;
}

.skel.w-90 {
  width: 90%;
}

.skel.w-70 {
  width: 70%;
}

.skel.w-40 {
  width: 40%;
}

@keyframes sk {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: -200% 0%;
  }
}

.fixture-preview {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.fixture-preview strong {
  color: var(--text);
}

.pred-table .pred-fixture {
  min-width: 280px;
  max-width: 420px;
}

.team-logo-ph {
  width: 26px;
  height: 26px;
  display: inline-block;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.pred-model-block {
  margin-top: 0;
}

.pred-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
}

.pred-model-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 10px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

.pred-model-title--inline {
  margin: 0;
  flex: 0 1 auto;
}

.pred-accuracy-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(61, 214, 140, 0.35);
  background: linear-gradient(135deg, rgba(61, 214, 140, 0.12), rgba(61, 214, 140, 0.04));
}

.pred-accuracy-hero--compact {
  margin: 0;
  padding: 8px 12px;
  flex: 1 1 220px;
  max-width: 100%;
}

.pred-accuracy-hero--compact .pred-acc-main {
  min-width: 0;
}

.pred-accuracy-hero--compact .pred-acc-value {
  font-size: 1.55rem;
}

.pred-accuracy-hero--compact .pred-acc-note {
  display: none;
}

.pred-accuracy-hero--compact.pred-accuracy-hero--empty {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

.pred-accuracy-hero--empty {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pred-acc-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}

.pred-acc-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.pred-acc-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pred-acc-note {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.pred-acc-sub {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  min-width: 120px;
}

.pred-acc-sub-label {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.pred-acc-sub-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pred-model-hint {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pred-model-logic {
  margin: 0 0 16px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text);
}

.pred-model-logic--above-table {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.pred-logic-label {
  font-weight: 600;
  color: var(--accent);
}

.pred-backtest-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text);
}

.board-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.conf-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.conf-bar {
  display: inline-block;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-strong), var(--live));
  max-width: 72px;
}

.conf-val {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.meta-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.pred-details {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
}

.pred-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
}

.model-mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.model-mini {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.model-mini-name {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.model-mini-pick {
  font-weight: 700;
}

/* board filters & pagination */
.board-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 22px 24px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.board-controls::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--live), transparent);
}

.board-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.board-select,
.board-input {
  min-width: 180px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: rgba(0, 0, 0, 0.22);
  color: var(--text);
  color-scheme: dark;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.board-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}

.board-select:focus,
.board-input:focus {
  outline: none;
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.board-input[type="search"],
.board-input[type="text"].board-filter-input {
  min-width: 220px;
}

.board-filter-input {
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  align-self: flex-end;
}

.board-controls .btn-ghost {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  background: var(--bg-panel);
}

@media (prefers-color-scheme: light) {
  .board-controls {
    background: #f4f5f8;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: none;
  }

  .board-select,
  .board-input {
    background-color: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color-scheme: light;
  }

  .board-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c5c70' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 12px;
  }
}

.board-controls + .data-meta {
  margin: -8px 0 16px;
  padding: 0 4px;
}

.board-pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.board-pager-meta {
  margin-top: 8px;
}

.btn-ghost {
  padding: 6px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.backtest-block {
  margin-top: 32px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.backtest-table td,
.backtest-table th {
  font-variant-numeric: tabular-nums;
}

.backtest-meta-row td {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.backtest-note {
  margin: 0 0 12px;
}

.backtest-table .metric-val {
  font-weight: 600;
  color: var(--text);
}

.pred-legend-title {
  margin: 20px 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}

.field-legend {
  margin: 16px 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.pred-more {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.pred-more > summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}

.pred-more > summary::-webkit-details-marker {
  display: none;
}

.pred-more > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s;
}

.pred-more[open] > summary::before {
  transform: rotate(90deg);
}

.pred-more .pred-model-hint,
.pred-more .pred-model-logic,
.pred-more .field-legend,
.pred-more .backtest-block {
  margin-left: 14px;
  margin-right: 14px;
}

.pred-more .backtest-block {
  margin-bottom: 14px;
}

.legend-table th {
  font-weight: 600;
  color: var(--accent);
  vertical-align: top;
  white-space: nowrap;
}

.legend-table td {
  font-size: 0.84rem;
  line-height: 1.55;
  vertical-align: top;
}

.legend-table .metric-val {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.backtest-legend-table {
  margin-top: 8px;
}

.pred-table .th-explained {
  vertical-align: bottom;
  min-width: 88px;
}

.pred-table .th-label {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.pred-table .th-meaning {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 160px;
}

.metric-benchmark {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* prediction direction badges */
.pick-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.pick-H {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
  background: var(--accent-dim);
}

.pick-D {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.1);
}

.pick-A {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.1);
}

.pick-O {
  color: var(--live);
  border-color: rgba(34, 197, 94, 0.4);
  background: var(--live-dim);
}

.pick-U {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.1);
}

@media (prefers-color-scheme: light) {
  .pick-badge {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.12);
  }

  .pick-H {
    color: #92400e;
    border-color: rgba(180, 83, 9, 0.45);
    background: rgba(251, 191, 36, 0.22);
  }

  .pick-D {
    color: #334155;
    border-color: rgba(100, 116, 139, 0.45);
    background: rgba(148, 163, 184, 0.18);
  }

  .pick-A {
    color: #1e40af;
    border-color: rgba(37, 99, 235, 0.4);
    background: rgba(96, 165, 250, 0.18);
  }

  .pick-O {
    color: #166534;
    border-color: rgba(22, 163, 74, 0.45);
    background: rgba(34, 197, 94, 0.15);
  }

  .pick-U {
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(239, 68, 68, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
