/* ============================================================
   Top Bins - model-grade dark theme
   Restyle only: every selector below matches the existing markup.
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-deep: #080a0f;
  --panel: #0f131b;
  --panel-2: #121824;
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-border-strong: rgba(255, 255, 255, 0.12);
  --text: #eef2f7;
  --text-dim: #7d8899;
  --text-faint: #59637433;
  --accent: #19e39a;
  --accent-soft: rgba(25, 227, 154, 0.12);
  --accent-line: rgba(25, 227, 154, 0.32);
  --warn: #f5b94a;
  --danger: #ff6b6b;
  --home-color: #19e39a;
  --away-color: #ff5d47;
  --home-secondary: #19e39a;
  --away-secondary: #ff5d47;
  --draw-color: #39424f;

  --font-display: "Space Grotesk", "Archivo", sans-serif;
  --font-heading: "Space Grotesk", "Archivo", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-num: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -28px rgba(0, 0, 0, 0.95);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
}

/* tabular figures everywhere numbers appear */
.elo-val, .xg-row, .wdl-seg, .ko-seg, .bar-row-value, .btts-value,
.market-num-val, .market-input, .key-line-prob, .verdict-prob, .bd-value,
.bd-keyline-prob, .bd-rank, .score-input, .acc-pct, .acc-frac, .stat-value,
.h2h-score, .h2h-date, .streak-pill, .match-prob, .confidence-badge {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ------------------------------------------------------------
   Backdrop - quiet, not stadium-lit
   ------------------------------------------------------------ */

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 45% at 50% -12%, rgba(25, 227, 154, 0.10), transparent 62%),
    linear-gradient(180deg, #0b0e14 0%, #090c11 60%, #080a0f 100%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */

.header {
  text-align: center;
  padding: 44px 16px 22px;
  animation: rise 0.6s var(--ease) both;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6.5vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}

.logo .ball {
  -webkit-text-fill-color: initial;
  background: none;
  color: inherit;
  filter: none;
  font-size: 0.7em;
  vertical-align: 0.12em;
}

.tagline {
  margin-top: 10px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ------------------------------------------------------------
   Layout
   ------------------------------------------------------------ */

.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 18px 88px;
}

.hidden {
  display: none !important;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   Generic card
   ------------------------------------------------------------ */

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--ease);
  animation: rise 0.5s var(--ease) both;
}

.card:hover {
  border-color: var(--panel-border-strong);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(25, 227, 154, 0.08);
  transform: translateY(-1px);
}

.card-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.card-icon {
  font-size: 0.9rem;
  filter: grayscale(0.25);
  opacity: 0.9;
}

/* ------------------------------------------------------------
   Fixtures
   ------------------------------------------------------------ */

.fixtures-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.fixtures-head .card-title {
  margin-bottom: 0;
}

.fixtures-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 3px;
}

.tab-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 7px 13px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: #04140c;
  background: var(--accent);
}

.fixtures-list {
  max-height: 470px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.fixtures-list::-webkit-scrollbar { width: 6px; }
.fixtures-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.fixture-date-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fixture-date-label {
  position: sticky;
  top: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--panel);
  padding: 8px 0 6px;
  z-index: 2;
}

.fixture-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 13px 14px;
  transition: border-color 0.2s ease, transform 0.2s var(--ease), background 0.2s ease;
}

.fixture-card:not(.undecided):hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
  background: rgba(25, 227, 154, 0.04);
}

.fixture-teams {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fixture-matchup {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.fixture-matchup .fx-vs {
  color: var(--text-dim);
  font-weight: 500;
  margin: 0 7px;
}

.fixture-meta {
  font-family: var(--font-num);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
}

.fixture-predict-btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  padding: 9px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s var(--ease);
}

.fixture-predict-btn:hover {
  background: var(--accent);
  color: #04140c;
  transform: translateY(-1px);
}

.fixture-card.undecided {
  opacity: 0.45;
}

.fixture-card.undecided .fixture-matchup {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.fixture-tbd {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border: 1px dashed var(--panel-border-strong);
  border-radius: 9px;
  padding: 9px 14px;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Picker
   ------------------------------------------------------------ */

.picker {
  text-align: center;
}

.team-input-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.team-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.team-field label {
  font-family: var(--font-body);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.team-field input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 13px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.team-field input::placeholder,
.injury-field input::placeholder,
.market-input::placeholder,
.score-input::placeholder { color: rgba(125, 136, 153, 0.65); }

.team-field input:focus {
  border-color: var(--accent-line);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(25, 227, 154, 0.12);
}

.vs {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding-bottom: 15px;
  letter-spacing: 0.16em;
}

.predict-btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  color: #04140c;
  background: var(--accent);
  border: none;
  border-radius: 11px;
  padding: 15px 42px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 10px 26px -14px rgba(25, 227, 154, 0.9);
  transition: transform 0.15s var(--ease), box-shadow 0.2s ease, filter 0.2s ease;
}

.predict-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 32px -14px rgba(25, 227, 154, 1);
}

.predict-btn:active {
  transform: translateY(0) scale(0.99);
}

.predict-btn:disabled {
  opacity: 0.5;
  cursor: wait;
  box-shadow: none;
}

.injury-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-bottom: 18px;
}

.injury-field label {
  font-family: var(--font-body);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.injury-field input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.injury-field input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(25, 227, 154, 0.12);
}

.error-msg {
  margin-top: 12px;
  color: var(--danger);
  font-weight: 500;
  font-size: 0.86rem;
  min-height: 1.2em;
}

/* ------------------------------------------------------------
   Scoreboard hero - team colour as accent, not as a paint bucket
   ------------------------------------------------------------ */

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--panel-border);
  min-height: 158px;
  background:
    linear-gradient(115deg,
      color-mix(in srgb, var(--home-color) 16%, transparent) 0%,
      transparent 42%,
      transparent 58%,
      color-mix(in srgb, var(--away-color) 16%, transparent) 100%),
    var(--panel);
  box-shadow: var(--shadow-card);
  animation: rise 0.5s var(--ease) both;
}

.team-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 20px;
  position: relative;
}

.team-block.home { align-items: flex-start; text-align: left; border-top: 2px solid var(--home-color); }
.team-block.away { align-items: flex-end; text-align: right; border-top: 2px solid var(--away-color); }

.team-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

.team-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5.2vw, 2.1rem);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--text);
}

.elo-row {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.team-block.away .elo-row {
  flex-direction: row-reverse;
}

.elo-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.elo-val {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.vs-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  position: relative;
  z-index: 1;
  border-left: 1px solid var(--panel-border);
  border-right: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.18);
}

.xg-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(1.5rem, 5.6vw, 2.2rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.xg-dash {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.xg-label {
  margin-top: 8px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.56rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Win / Draw / Loss bar
   ------------------------------------------------------------ */

.wdl-bar {
  display: flex;
  gap: 3px;
  width: 100%;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.wdl-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  width: 0%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  transition: width 1.1s var(--ease);
}

.wdl-home { background: color-mix(in srgb, var(--home-color) 62%, #0b0e14); }
.wdl-draw { background: var(--draw-color); }
.wdl-away { background: color-mix(in srgb, var(--away-color) 62%, #0b0e14); }

.wdl-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-home { background: color-mix(in srgb, var(--home-color) 80%, #0b0e14); }
.dot-draw { background: var(--draw-color); }
.dot-away { background: color-mix(in srgb, var(--away-color) 80%, #0b0e14); }

/* ------------------------------------------------------------
   Card grid
   ------------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

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

/* ------------------------------------------------------------
   Animated bar lists (scorelines, over/under, scorers)
   ------------------------------------------------------------ */

.bar-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-list.small {
  gap: 11px;
}

.bar-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bar-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.84rem;
}

.bar-row-label {
  font-weight: 500;
  color: var(--text);
  min-width: 0;
}

.bar-row-value {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text);
  white-space: nowrap;
}

.bar-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 1.1s var(--ease);
}

.bar-fill.home-fill {
  background: color-mix(in srgb, var(--home-color) 78%, #0b0e14);
}

.bar-fill.away-fill {
  background: color-mix(in srgb, var(--away-color) 78%, #0b0e14);
}

.small .bar-track {
  height: 5px;
}

/* ------------------------------------------------------------
   BTTS
   ------------------------------------------------------------ */

.btts-display {
  text-align: center;
  padding: 8px 0 4px;
}

.btts-value {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1;
}

.btts-fill {
  height: 8px;
  background: var(--accent);
}

.bar-track:has(.btts-fill) {
  height: 8px;
}

/* ------------------------------------------------------------
   Scorers
   ------------------------------------------------------------ */

.scorer-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 480px) {
  .scorer-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.scorer-team-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

/* "form-adjusted" note in the scorer card title */
.form-note {
  margin-left: auto;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

/* small "xG" tag next to each form-adjusted scorer */
.xg-tag {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.52rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

/* "INT only" tag - no club data, flagged for a possible manual override */
.int-tag {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.5rem;
  letter-spacing: 0.04em;
  color: var(--warn);
  background: rgba(245, 185, 74, 0.1);
  border: 1px solid rgba(245, 185, 74, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

/* injured / out chips below the scorer list */
.injured-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.injured-chip {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: #ff9b9b;
  background: rgba(255, 107, 107, 0.08);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 999px;
  padding: 3px 9px;
  text-decoration: line-through;
}

/* ------------------------------------------------------------
   Result log
   ------------------------------------------------------------ */

.log-hint {
  color: var(--text-dim);
  font-size: 0.84rem;
  margin: 0 0 16px;
}

.log-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-input {
  width: 62px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 11px 6px;
  color: var(--text);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.05rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.score-input:focus {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(25, 227, 154, 0.12);
}

.log-dash {
  color: var(--text-dim);
  font-family: var(--font-num);
  font-size: 1rem;
}

.log-btn {
  margin-left: auto;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.log-btn:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
}

.log-msg {
  margin-top: 12px;
  font-size: 0.84rem;
  font-weight: 500;
  min-height: 1.2em;
  color: var(--accent);
}

.log-msg.error {
  color: var(--danger);
}

/* ------------------------------------------------------------
   Context strip, confidence, market, form
   ------------------------------------------------------------ */

.context-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ctx-chip {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 6px 13px;
}

.ctx-host {
  color: #ffd98a;
  background: rgba(245, 185, 74, 0.08);
  border-color: rgba(245, 185, 74, 0.28);
}

.ctx-rest {
  color: #9fd0ff;
  background: rgba(100, 170, 255, 0.08);
  border-color: rgba(100, 170, 255, 0.28);
}

/* Knockout advancement card */
.ko-note {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  line-height: 1.55;
}
.ko-note b { color: var(--text); font-family: var(--font-num); font-weight: 600; }
.ko-bar {
  display: flex;
  gap: 3px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.ko-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0%;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.86rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  transition: width 1.1s var(--ease);
}
.ko-home { background: color-mix(in srgb, var(--home-color) 62%, #0b0e14); }
.ko-away { background: color-mix(in srgb, var(--away-color) 62%, #0b0e14); }
.ko-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* Confidence badge in the W/D/L title */
.confidence-badge {
  margin-left: auto;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: none;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.conf-high { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.conf-mid  { color: #ffd98a; background: rgba(245, 185, 74, 0.1); border: 1px solid rgba(245, 185, 74, 0.28); }
.conf-low  { color: var(--text-dim); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--panel-border); }

/* Model vs Market */
.market-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.market-input-row label {
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 0;
}

.market-input {
  width: 118px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.market-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(25, 227, 154, 0.12); }

.market-nums {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.market-num {
  flex: 1;
  min-width: 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px 12px;
}

.market-num-label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.market-num-val {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  letter-spacing: -0.03em;
  color: var(--text);
}

.market-verdict {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-align: center;
  border-radius: 10px;
  padding: 12px;
}
.market-agree { color: var(--text-dim); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--panel-border); }
.market-value {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  text-shadow: none;
}

/* Over/Under key line */
.key-line-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 4px;
}
.key-line-tag {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #04140c;
  background: var(--accent);
  border-radius: 4px;
  padding: 3px 7px;
}
.key-line-pick {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.key-line-prob {
  margin-left: auto;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.key-line-rest-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 16px 0 10px;
}

/* Form & head-to-head */
.form-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 16px;
}
@media (max-width: 480px) { .form-columns { grid-template-columns: 1fr; } }

.form-team-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 10px;
}
.form-streak { display: flex; gap: 5px; margin-bottom: 8px; }
.streak-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 6px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 0.68rem;
  color: #fff;
}
.pill-w { background: rgba(25, 227, 154, 0.16); color: var(--accent); border: 1px solid var(--accent-line); }
.pill-d { background: rgba(255, 255, 255, 0.05); color: var(--text-dim); border: 1px solid var(--panel-border); }
.pill-l { background: rgba(255, 93, 71, 0.12); color: #ff8b78; border: 1px solid rgba(255, 93, 71, 0.3); }
.form-goals { font-family: var(--font-body); font-size: 0.74rem; color: var(--text-dim); }
.form-none { font-size: 0.76rem; color: var(--text-dim); }

.h2h-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 4px 0 10px;
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
}
.h2h-list { display: flex; flex-direction: column; gap: 8px; }
.h2h-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}
.h2h-date { font-family: var(--font-num); color: var(--text-dim); white-space: nowrap; font-size: 0.74rem; }
.h2h-score { color: var(--text-dim); text-align: right; }
.h2h-score b { font-family: var(--font-num); color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------
   Top Bins Verdict - the headline takeaway card
   ------------------------------------------------------------ */

.verdict-card {
  position: relative;
  margin-top: 24px;
  padding: 28px 26px;
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(25, 227, 154, 0.08), transparent 65%),
    var(--panel-2);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 1);
  animation: rise 0.5s var(--ease) both;
}

@keyframes verdict-glow {
  0%, 100% { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 1); }
  50%      { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 1), 0 0 30px -14px rgba(25, 227, 154, 0.5); }
}

.verdict-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}

.verdict-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--text);
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  text-shadow: none;
}

.verdict-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--accent);
  text-shadow: none;
}

.verdict-lines {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.verdict-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px 14px;
}

.verdict-label {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.verdict-pick {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 4.6vw, 1.7rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  text-shadow: none;
  min-width: 0;
}

.verdict-prob {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  letter-spacing: -0.02em;
  color: var(--accent);
  text-shadow: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   Top Bins Breakdown - story-shareable ranked card
   ------------------------------------------------------------ */

.breakdown-card {
  margin-top: 22px;
  padding: 26px 22px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 90% 45% at 50% 0%, rgba(25, 227, 154, 0.07), transparent 62%),
    var(--panel-2);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 1);
}

.bd-head { text-align: center; margin-bottom: 22px; }

.bd-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  line-height: 1;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--text);
}
.bd-brand .bd-ball { -webkit-text-fill-color: initial; color: initial; font-size: 0.75em; }

.bd-tagline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 8px 0 16px;
}

.bd-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1rem, 4vw, 1.35rem);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.bd-team {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  border-bottom: 2px solid var(--team-accent, transparent);
  padding-bottom: 4px;
}
.bd-team-home { --team-accent: var(--home-color); }
.bd-team-away { --team-accent: var(--away-color); }
.bd-flag { font-size: 1.2em; }
.bd-vs { color: var(--text-dim); font-family: var(--font-body); font-weight: 500; font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; border: 0; }

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

.bd-section-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.bd-list { display: flex; flex-direction: column; gap: 7px; }

.bd-row {
  display: grid;
  grid-template-columns: 20px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  border-left: 3px solid color-mix(in srgb, var(--row-color, var(--panel-border-strong)) 72%, #0b0e14);
}

.bd-row:not(.bd-top) { opacity: 0.72; }
.bd-row:not(.bd-top) .bd-label,
.bd-row:not(.bd-top) .bd-value { font-size: 0.84rem; }

.bd-row.bd-top {
  padding: 14px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-left: 3px solid var(--accent);
  box-shadow: none;
}

.bd-rank {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}
.bd-row.bd-top .bd-rank { color: var(--accent); font-size: 1.15rem; }

.bd-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--row-color) 82%, #0b0e14);
  box-shadow: none;
}
.bd-chip {
  font-size: 1.1em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  border-left: 2px solid color-mix(in srgb, var(--row-color) 72%, #0b0e14);
  padding-left: 6px;
}

.bd-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bd-row.bd-top .bd-label { font-size: 1.08rem; font-weight: 700; }

.bd-value {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
}
.bd-row.bd-top .bd-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.bd-keyline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--panel-border);
}
.bd-keyline-pick {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}
.bd-keyline-prob {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

.bd-footer {
  text-align: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border);
}

/* ------------------------------------------------------------
   Scorecard
   ------------------------------------------------------------ */

.scorecard #scorecard-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.scorecard .accent {
  color: var(--accent);
  font-family: var(--font-num);
}

/* ------------------------------------------------------------
   Mobile / vertical-frame tuning
   ------------------------------------------------------------ */

@media (max-width: 480px) {
  .container {
    padding: 0 14px 64px;
  }

  .card { padding: 18px; border-radius: 13px; }

  .scoreboard {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .team-block.home, .team-block.away {
    align-items: center;
    text-align: center;
    padding: 20px 16px 16px;
  }

  .team-block.away .elo-row {
    flex-direction: row;
  }

  .vs-divider {
    order: 2;
    padding: 14px 18px 20px;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--panel-border);
    border-bottom: 1px solid var(--panel-border);
  }

  .team-block.home { order: 1; }
  .team-block.away { order: 3; border-top: 0; border-bottom: 2px solid var(--away-color); }
  .team-block.home { border-top: 2px solid var(--home-color); }

  .wdl-legend { font-size: 0.58rem; letter-spacing: 0.08em; }
  .verdict-card { padding: 22px 18px; }
}

/* ---- shared top nav (Predict / Bracket / Accuracy) ---- */
.topnav {
  display: inline-flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.topnav-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  transition: color .18s ease, background .18s ease;
}
.topnav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.topnav-link.active {
  color: #04140c;
  background: var(--accent);
  border-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
}

/* played (group-stage) fixtures show the final score instead of a predict button */
.fixture-card.played { opacity: 0.9; }
.fixture-score {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border-strong);
  border-radius: 9px;
  padding: 8px 14px;
  white-space: nowrap;
}

.fixture-outcome {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.fixture-winner {
  font-family: var(--font-ui, inherit);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 9px;
  padding: 8px 12px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.fixture-winner.is-prediction {
  opacity: 0.85;
}

.fixture-winner.hit {
  color: #19e39a;
  border-color: rgba(25, 227, 154, 0.45);
  background: rgba(25, 227, 154, 0.1);
}

.fixture-winner.miss {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.1);
}

.fixture-winner.draw {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.1);
}


/* Results legend banner ------------------------------------------------ */
.results-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 14px 0 4px;
  padding-right: 2px;
}

.results-legend.hidden {
  display: none;
}

.legend-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 5px 10px;
  white-space: nowrap;
}

.legend-label.legend-actual {
  color: var(--text);
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 640px) {
  .results-legend {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

.fixture-winner.neutral {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

/* Per-result caption + expandable played cards ------------------------- */
.outcome-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.outcome-caption {
  font-family: var(--font-ui, inherit);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.outcome-cell.is-actual .outcome-caption {
  color: var(--text);
}

.fixture-card.clickable {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.fixture-card.clickable:hover,
.fixture-card.clickable:focus-visible {
  border-color: rgba(25, 227, 154, 0.35);
  background: rgba(25, 227, 154, 0.05);
  transform: translateY(-1px);
  outline: none;
}
