/* Oddsprey v2 components. Markup lives in templates/v2/_components.html, one macro per block. */

/* ── button ─────────────────────────────────────────────────────────────── */
.v2 .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-sm);
  border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.v2 .btn-primary { background: var(--accent-fill); color: var(--accent-ink); }
.v2 .btn-primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, white); }
.v2 .btn-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.v2 .btn-secondary:hover { background: var(--surface); }
.v2 .btn-ghost { background: transparent; color: var(--muted); }
.v2 .btn-ghost:hover { color: var(--text); background: var(--surface); }
.v2 .btn-lg { min-height: 48px; padding: 0 var(--s-6); font-size: var(--fs-base); border-radius: var(--r); }
.v2 .btn-sm { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.v2 .btn svg { width: 16px; height: 16px; }

/* ── chip ───────────────────────────────────────────────────────────────── */
.v2 .chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 20px; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--muted);
}
.v2 .chip-ok { background: var(--accent-soft); color: var(--accent); }
.v2 .chip-warn { background: var(--warn-soft); color: var(--warn); }
.v2 .chip-loss { background: var(--loss-soft); color: var(--loss); }
.v2 .chip-osprey { background: var(--g-osprey-soft); color: var(--g-osprey); }
.v2 .chip-falcon { background: var(--g-falcon-soft); color: var(--g-falcon); }
.v2 .chip-owl { background: var(--g-owl-soft); color: var(--g-owl); }

/* ── card ───────────────────────────────────────────────────────────────── */
.v2 .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-5); }
.v2 .card-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  margin-bottom: var(--s-3); }
.v2 .card-sub { color: var(--muted); font-size: var(--fs-sm); }
a.card { display: block; color: inherit; text-decoration: none !important;
  transition: border-color .15s var(--ease), transform .15s var(--ease); }
a.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

/* ── probability bar ────────────────────────────────────────────────────── */
.v2 .pbar { display: grid; gap: 6px; }
.v2 .pbar-row { display: grid; grid-template-columns: 44px 1fr 40px; align-items: center; gap: var(--s-3);
  font-size: var(--fs-sm); }
.v2 .pbar-label { color: var(--muted); }
.v2 .pbar-track { height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.v2 .pbar-fill { display: block; height: 100%; border-radius: inherit; background: var(--bar-rest); }
.v2 .pbar-row.is-top .pbar-fill { background: var(--accent-fill); }
.v2 .pbar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
/* compact: one split bar, three numbers under it (the phone scores row) */
.v2 .pbar-split { display: flex; gap: 3px; height: 4px; }
.v2 .pbar-split span { border-radius: var(--r-pill); background: var(--bar-rest); }
.v2 .pbar-split span.is-top { background: var(--accent-fill); }
.v2 .pbar-split-vals { display: flex; justify-content: space-between; margin-top: 4px;
  font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.v2 .pbar-split-vals .is-top { color: var(--accent); font-weight: 600; }

/* ── market row ─────────────────────────────────────────────────────────── */
.v2 .mkt { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.v2 .mkt th { text-align: right; font-weight: 500; font-size: var(--fs-xs); color: var(--muted);
  padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.v2 .mkt th:first-child, .v2 .mkt td:first-child { text-align: left; }
.v2 .mkt td { text-align: right; padding: var(--s-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.v2 .mkt tr:last-child td { border-bottom: 0; }
.v2 .mkt-name { font-weight: 600; white-space: normal !important; }
@media (max-width: 559px) {
  .v2 .mkt thead { display: none; }
  .v2 .mkt tr { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--s-3); padding: var(--s-3) 0;
    border-bottom: 1px solid var(--line); }
  .v2 .mkt tr:last-child { border-bottom: 0; }
  .v2 .mkt td { padding: 0; border: 0; text-align: left; }
  .v2 .mkt td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: var(--fs-xs); }
  .v2 .mkt td.mkt-edge { grid-column: 2; grid-row: 1; text-align: right; }
}

/* ── match card ─────────────────────────────────────────────────────────── */
.v2 .match { display: flex; flex-direction: column; gap: var(--s-4); }
.v2 .match-meta { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-xs);
  color: var(--muted); }
.v2 .match-comp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2 .match-time { font-variant-numeric: tabular-nums; flex: none; }
.v2 .match-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s-3);
  text-align: center; }
.v2 .team { display: flex; flex-direction: column; align-items: center; gap: var(--s-2); min-width: 0; }
.v2 .team-name { font-weight: 600; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.v2 .crest { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; font-weight: 700;
  letter-spacing: .02em; color: var(--muted); }
.v2 .crest.has-img { background: transparent; }
.v2 .crest img { width: 28px; height: 28px; object-fit: contain; }
.v2 .match-vs { color: var(--muted); font-size: var(--fs-xs); }
.v2 .match-foot { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm);
  color: var(--muted); font-variant-numeric: tabular-nums; }
.v2 .match-foot b { color: var(--text); font-weight: 600; }

/* ── KPI tile ───────────────────────────────────────────────────────────── */
.v2 .kpi { display: flex; gap: var(--s-4); align-items: flex-start; }
.v2 .kpi-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent); }
.v2 .kpi-icon svg { width: 22px; height: 22px; }
.v2 .kpi-value { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
  font-variant-numeric: tabular-nums; }
.v2 .kpi-value.is-up { color: var(--accent); }
.v2 .kpi-value.is-down { color: var(--loss); }
.v2 .kpi-label { color: var(--muted); font-size: 14px; margin-top: 2px; }

/* ── empty state ────────────────────────────────────────────────────────── */
.v2 .empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2);
  padding: var(--s-10) var(--s-6); border: 1px dashed var(--line); border-radius: var(--r-lg); }
.v2 .empty-icon { width: 40px; height: 40px; color: var(--muted); margin-bottom: var(--s-2); }
.v2 .empty p { color: var(--muted); max-width: 42ch; }
.v2 .empty .btn { margin-top: var(--s-3); }

/* ── gambler badge ──────────────────────────────────────────────────────── */
.v2 .gambler { display: inline-flex; align-items: center; gap: var(--s-2); padding: 2px 10px 2px 8px;
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.v2 .gambler-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.v2 .gambler-osprey { color: var(--g-osprey); background: var(--g-osprey-soft); }
.v2 .gambler-falcon { color: var(--g-falcon); background: var(--g-falcon-soft); }
.v2 .gambler-owl { color: var(--g-owl); background: var(--g-owl-soft); }
