/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  line-height: 1.6;
  min-height: 100vh;
}

/* === Layout === */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 24px;
  position: relative;
}

header h1 {
  font-size: 2rem;
  color: #60a5fa;
}

.app-title-link {
  color: inherit;
  text-decoration: none;
}
.app-title-link:hover,
.app-title-link:focus {
  text-decoration: underline;
}

.subtitle {
  color: #9ca3af;
  font-size: 0.9rem;
}

/* === Language switch === */
.lang-switch {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
}

.lang-switch button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}

.lang-switch button:hover {
  color: #e5e7eb;
}

.lang-switch button.active {
  background: #60a5fa;
  color: #0f0f1a;
}

.lang-switch .flag {
  font-size: 0.95rem;
}

@media (max-width: 520px) {
  .lang-switch {
    position: static;
    justify-content: center;
    margin: 0 auto 12px;
  }
}

/* === Cards === */
.card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 {
  color: #60a5fa;
  font-size: 1.1rem;
  margin-bottom: 12px;
  border-bottom: 1px solid #2a2a4a;
  padding-bottom: 8px;
}

.card h3 {
  color: #93c5fd;
  font-size: 0.95rem;
  margin: 12px 0 8px;
}

/* === Forms === */
label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #9ca3af;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 8px 12px;
  background: #0f0f1a;
  border: 1px solid #3a3a5a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.9rem;
  margin-top: 4px;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: #60a5fa;
}

/* === Teams Grid === */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 12px;
}

/* === Odds === */
.odds-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.margin-info {
  font-size: 0.8rem;
  color: #f59e0b;
  margin-top: 8px;
}

/* === Over/Under Grid === */
.ou-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ou-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.ou-label {
  font-size: 0.85rem;
  color: #93c5fd;
  font-weight: bold;
}

/* === Settings / Sliders === */
.setting {
  margin-bottom: 16px;
}

input[type="range"] {
  width: 100%;
  margin-top: 4px;
  accent-color: #60a5fa;
}

/* === Help Buttons === */
.help-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3a3a5a;
  color: #60a5fa;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
  border: 1px solid #60a5fa40;
  padding: 0;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
}
summary .help-tip {
  transform: translateY(-3px);
}
.help-tip:hover {
  background: #4a4a6a;
  border-color: #60a5fa;
}

/* === Help Modal === */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-modal.hidden { display: none; }
.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.help-modal-content {
  position: relative;
  background: #1e1e2e;
  border: 1px solid #3a3a5a;
  border-radius: 12px;
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #3a3a5a;
}
.help-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #e2e8f0;
}
.help-modal-close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.help-modal-close:hover { color: #e2e8f0; }
.help-modal-body {
  padding: 16px 20px 20px;
  color: #cbd5e1;
  font-size: 0.85rem;
  line-height: 1.6;
}
.help-modal-body p { margin: 0 0 10px; }
.help-modal-body p:last-child { margin-bottom: 0; }
.help-modal-body strong { color: #e2e8f0; }
.help-modal-body .help-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #3a3a5a20;
}
.help-modal-body code {
  background: #2a2a3e;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.8rem;
}
.help-modal-body ul {
  margin: 6px 0;
  padding-left: 18px;
}
.help-modal-body li { margin-bottom: 4px; }

/* === Calculate Button === */
.calculate-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.2s;
}

.calculate-btn:hover {
  background: #1d4ed8;
}

/* === Results === */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.results-header h2 {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.close-btn {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}

.close-btn:hover {
  color: #e0e0e0;
}

.results-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}


.hidden {
  display: none !important;
}

.most-likely {
  color: #4ade80;
  font-weight: bold;
  margin-bottom: 12px;
}

.score-matrix-note {
  color: #9ca3af;
  font-weight: normal;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* === Score Matrix === */
.score-matrix-container {
  overflow-x: auto;
}

.score-matrix {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.75rem;
  text-align: center;
}

.score-matrix th {
  background: #2a2a4a;
  color: #93c5fd;
  padding: 6px;
  font-weight: normal;
}

.score-matrix .team-header {
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.score-matrix .team-header-vertical {
  writing-mode: vertical-lr;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 8px 4px;
  white-space: nowrap;
}

.score-matrix td {
  padding: 6px;
  border: 1px solid #2a2a4a;
}

.score-matrix .highlight {
  outline: 2px solid #4ade80;
  font-weight: bold;
}

/* === Outcome Bars === */
.outcome-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outcome-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.outcome-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.outcome-bar-track {
  height: 24px;
  background: #2a2a4a;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.outcome-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.outcome-bar-fill.home { background: #3b82f6; }
.outcome-bar-fill.draw { background: #f59e0b; }
.outcome-bar-fill.away { background: #ef4444; }

.outcome-odds {
  font-weight: 600;
  color: #60a5fa;
  font-size: 0.8rem;
}

.outcome-odds.book {
  color: #9ca3af;
}

.outcome-bar-fill.bookmaker {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: none;
  border-right: 2px dashed #e0e0e0;
}

/* === Results Tables === */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.results-table th {
  background: #2a2a4a;
  color: #93c5fd;
  padding: 8px;
  text-align: left;
  font-weight: normal;
}

.results-table td {
  padding: 8px;
  border-bottom: 1px solid #2a2a4a;
}

.results-table .value-positive {
  color: #4ade80;
  font-weight: bold;
}

.results-table .value-negative {
  color: #f87171;
}

.overvalued-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  background: #f8717130;
  color: #f87171;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.counter-bet-row td {
  font-size: 0.85rem;
  color: #9ca3af;
  border-top: none !important;
  padding-top: 0 !important;
}

#bookmaker-comparison small {
  color: #9ca3af;
  font-size: 0.8em;
}

.model-row td {
  background: #1e293b;
  border-bottom: 2px solid #3b82f6;
  color: #60a5fa;
}

.comp-cell {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.comp-value {
  border: 2px solid #4ade80;
  color: #4ade80;
  background: #4ade8015;
}

.best-odds-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.4);
  margin-left: 4px;
  vertical-align: middle;
}

.sharp-value-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  margin-left: 4px;
  vertical-align: middle;
}

.benchmark-label {
  text-align: center;
  color: #9ca3af;
  font-size: 0.85rem;
  margin: 0 0 8px 0;
}

.best-odds-info {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

.comp-overvalued {
  border: 2px solid #f87171;
  color: #f87171;
  background: #f8717115;
}

.last-update {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 6px;
}

/* === Floating Model Sliders === */
.slider-panel {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(900px, calc(100vw - 40px));
  background: #1a1a2e;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s;
}

.slider-panel.loading {
  opacity: 0.5;
}

.slider-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
}

.slider-panel-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slider-panel-reset {
  background: none;
  border: 1px solid #4b5563;
  border-radius: 4px;
  color: #9ca3af;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
  margin-left: auto;
  margin-right: 8px;
}

.slider-panel-reset:hover {
  color: #e0e0e0;
  border-color: #6b7280;
}

.slider-panel-toggle {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}

.slider-panel-toggle:hover {
  color: #e0e0e0;
}

.slider-panel-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 6px;
  line-height: 1;
  transition: color 0.15s;
  margin-left: 2px;
}

.slider-panel-close:hover {
  color: #ef4444;
}

.slider-panel-body {
  padding: 0 14px 12px;
}

.slider-panel-body.collapsed {
  display: none;
}

.slider-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

.slider-panel-item label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 2px;
  white-space: nowrap;
}

.slider-panel-item input[type="range"] {
  margin-top: 2px;
}

.slider-panel-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

.slider-panel-depth {
  margin-top: 8px;
}

.slider-panel-depth label {
  font-size: 0.75rem;
  color: #9ca3af;
}

.slider-panel-depth input[type="range"] {
  margin-top: 2px;
  width: 100%;
}

.slider-panel-override {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.slider-panel-toggle-item {
  display: flex;
  align-items: flex-end;
  padding-bottom: 4px;
}

.slider-panel-toggle-item .slider-panel-override {
  margin-top: 0;
}

.slider-panel-override input[type="checkbox"] {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 32px;
  height: 16px;
  background: #374151;
  border-radius: 8px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #9ca3af;
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.slider-panel-override input:checked + .toggle-switch {
  background: #3b82f6;
}

.slider-panel-override input:checked + .toggle-switch::after {
  transform: translateX(16px);
  background: #fff;
}

.toggle-label {
  font-size: 0.7rem;
  color: #9ca3af;
  transition: color 0.15s;
}

.slider-panel-override input:checked ~ .toggle-label {
  color: #60a5fa;
}

/* === Responsive === */
@media (max-width: 600px) {
  .teams-grid {
    grid-template-columns: 1fr;
  }

  .odds-row {
    grid-template-columns: 1fr;
  }

  .ou-row {
    grid-template-columns: 60px 1fr 1fr;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .match-result-group,
  .col-headers {
    grid-template-columns: 45px 120px 45px;
  }

  .slider-panel {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    transform: none;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
    z-index: 100;
  }

  .slider-panel-grid {
    grid-template-columns: 1fr 1fr;
  }

  #results {
    padding-bottom: 140px;
  }
}

/* Selector bar */
.selector-bar .selector-row {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.selector-bar .selector-row label {
  flex: 1;
  min-width: 140px;
}

/* Inline row wrapping a select plus adjacent help-tip */
.selector-bar .input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.selector-bar .input-row select {
  flex: 1;
  min-width: 0;
}

.season-label {
  flex: 0.5 !important;
  min-width: 80px !important;
}

.season-only-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto !important;
  min-width: auto !important;
  align-self: center;
}

.season-only-label {
  font-size: 0.7rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.season-only-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.season-only-toggle input[type="checkbox"] { display: none; }
.season-only-toggle input:checked + .toggle-switch { background: #3b82f6; }
.season-only-toggle input:checked + .toggle-switch::after { transform: translateX(16px); background: #fff; }

/* Give League a bit more room so "Men's International" isn't clipped */
.selector-bar .selector-row label:has(#league-select) {
  flex: 1.3;
  min-width: 180px;
}

/* Match list */
.match-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.match-row:hover {
  background: rgba(96, 165, 250, 0.1);
}

.match-row.selected {
  background: rgba(96, 165, 250, 0.2);
  border-left: 3px solid #60a5fa;
}

.match-teams {
  font-weight: 500;
}

.match-odds {
  font-family: monospace;
  font-size: 0.9rem;
  color: #94a3b8;
}

.muted {
  color: #64748b;
  font-style: italic;
}

/* Collapsible sections */
details.card summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

details.card summary::-webkit-details-marker {
  display: none;
}

details.card summary h2::before {
  content: '\25B8 ';
  font-size: 0.8em;
}

details.card[open] summary h2::before {
  content: '\25BE ';
}

/* Round headers */
.match-round-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 12px 6px;
  border-bottom: 1px solid #2a2a4a;
  margin-bottom: 4px;
  cursor: pointer;
  user-select: none;
}

.match-round-header:hover .round-title {
  color: #93c5fd;
}

.toggle-icon {
  font-size: 0.75rem;
  margin-left: 4px;
}

.match-date-group.collapsed {
  display: none;
}

.match-round-header:first-child {
  padding-top: 0;
}

.round-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #60a5fa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* .round-meta replaced by .col-headers */

/* Finished match rows */
.match-row.finished {
  opacity: 0.85;
}

.match-row.finished:hover {
  background: rgba(96, 165, 250, 0.1);
}

/* (match-score replaced by match-col-result in grid layout) */

/* Column-aligned result group (grid) */
.match-result-group,
.col-headers {
  display: grid;
  grid-template-columns: 55px 150px 55px;
  gap: 10px;
  align-items: center;
}

.col-headers {
  font-size: 0.75rem;
  color: #6b7280;
}

.col-h {
  text-align: center;
  white-space: nowrap;
}

.match-col-pred {
  display: flex;
  align-items: center;
  justify-content: center;
}

.match-col-1x2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.match-odds-row {
  display: flex;
  gap: 2px;
}

.match-col-result {
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  color: #e0e0e0;
  text-align: center;
}

.match-col-result.not-played {
  color: #4b5563;
  cursor: help;
}

.odds-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.3;
}

.odds-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
}

.odds-cell.correct {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  font-weight: 700;
}

.odds-cell.correct .odds-label {
  color: #4ade80;
}

/* Odds movement arrows */
.odds-up, .odds-down {
  font-size: 0.55rem;
  margin-left: 2px;
  vertical-align: middle;
}
.odds-up { color: #4ade80; }
.odds-down { color: #f87171; }

/* Tooltip on the odds cell (not the tiny arrow) */
.odds-cell, .comp-cell { position: relative; }
.odds-cell[data-prev]::after,
.comp-cell[data-prev]::after {
  content: attr(data-prev);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1e3a;
  color: #ccc;
  font-size: 0.7rem;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}
@media (hover: hover) {
  .odds-cell[data-prev]:hover::after,
  .comp-cell[data-prev]:hover::after {
    opacity: 1;
  }
}

/* Steam / significant odds movement badge */
.steam-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  margin-left: 6px;
  vertical-align: middle;
  animation: steam-pulse 2s ease-in-out infinite;
}

@keyframes steam-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Round navigation buttons */
.round-nav-btn {
  display: block;
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  background: transparent;
  border: 1px dashed #3a3a5a;
  border-radius: 6px;
  color: #60a5fa;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.round-nav-btn:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: #60a5fa;
}

.hide-nav-btn {
  color: #6b7280;
  border-color: #2a2a4a;
  font-size: 0.8rem;
  padding: 6px;
  margin: 4px 0;
}

/* Prediction indicators */

.pred-score {
  font-family: monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #93c5fd;
  background: rgba(96, 165, 250, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}
.pred-score.pred-hit {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.pred-score.pred-exact {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}
.pred-score.pred-miss {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.pred-probs {
  display: flex;
  gap: 2px;
  width: 100%;
  justify-content: center;
}

.pred-p {
  font-family: monospace;
  font-size: 0.75rem;
  color: #6b7280;
  padding: 2px 5px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  min-width: 38px;
  text-align: center;
}

.pred-best {
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 5px;
}

.pred-best.conf-high {
  color: #4ade80;
  border: 2px solid #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.pred-best.conf-mid {
  color: #fb923c;
  border: 2px solid #fb923c;
  background: rgba(251, 146, 60, 0.12);
}

.pred-best.conf-low {
  color: #f87171;
  border: 2px solid #f87171;
  background: rgba(248, 113, 113, 0.12);
}

/* === Streak Badges === */
.streak-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 3px;
  vertical-align: middle;
}

.streak-W {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid #4ade8060;
}

.streak-D {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid #fbbf2460;
}

.streak-L {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid #f8717160;
}

/* === P/L Chart === */
.pl-chart {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 80px;
  margin-bottom: 16px;
  padding: 4px 0;
  border-bottom: 1px solid #3a3a5a;
}

.pl-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  transition: opacity 0.15s;
}

.pl-bar:hover {
  opacity: 0.7;
}

.pl-bar-pos { background: #4ade80; }
.pl-bar-neg { background: #f87171; }

/* === Tracker Summary === */
.tracker-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tracker-stat {
  flex: 1;
  min-width: 100px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.tracker-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #60a5fa;
}

.tracker-stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 4px;
}

.tracker-scroll {
  max-height: 360px;
  overflow-y: auto;
  overflow-x: auto;
}

/* Suggested Bets: keep short columns on a single line (dates like 2026-08-29 and league
   names were wrapping mid-value); let the Match column absorb any remaining width. */
.sb-table td:nth-child(1),
.sb-table th:nth-child(1),
.sb-table td:nth-child(2),
.sb-table th:nth-child(2),
.sb-table td:nth-child(6),
.sb-table th:nth-child(6),
.sb-table td:nth-child(8),
.sb-table th:nth-child(8) {
  white-space: nowrap;
}

.tracker-scroll thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1f2937;
}

.tracker-table td {
  font-size: 0.8rem;
}

/* === Suggested Bets confidence dot === */
.conf-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.conf-cold { background: #60a5fa; }
.conf-warming { background: #fbbf24; }
.conf-warm { background: #f87171; }

.suggested-bet-row { cursor: pointer; }
.suggested-bet-row:hover,
.suggested-bet-row:focus { background: rgba(96, 165, 250, 0.12); outline: none; }

/* === Elo Table === */
.elo-table td, .elo-table th {
  text-align: center;
}

.elo-table td:nth-child(2) {
  text-align: left;
}

.form-cell {
  display: flex;
  gap: 3px;
  justify-content: center;
}

.form-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
}

.form-w { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.form-d { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.form-l { background: rgba(248, 113, 113, 0.2); color: #f87171; }

/* === Today Highlight === */
.today-wrapper {
  border: 2px solid #4ade80;
  border-radius: 8px;
  overflow: hidden;
}

.match-round-header.today-group {
  border-bottom-color: #4ade80;
  background: rgba(74, 222, 128, 0.08);
}

.match-round-header.today-group > .round-title {
  color: #4ade80 !important;
}

/* === Mobile Polish === */
@media (max-width: 600px) {
  .score-matrix th,
  .score-matrix td {
    font-size: 0.65rem;
    padding: 3px;
  }
}

@media (max-width: 480px) {
  /* --- Match rows: stack vertically --- */
  .match-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .match-teams {
    font-size: 0.9rem;
  }

  .pred-score {
    font-size: 0.75rem;
    padding: 1px 5px;
  }

  /* Hide column headers (no alignment when stacked) */
  .col-headers {
    display: none;
  }

  /* Switch result group from grid to flex, full width */
  .match-result-group {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .match-col-pred {
    flex-shrink: 0;
  }

  .match-col-1x2 {
    flex: 1;
    min-width: 0;
  }

  .match-col-result {
    flex-shrink: 0;
    min-width: 45px;
  }

  /* --- Selector bar: full-width stack --- */
  .selector-bar .selector-row {
    flex-direction: column;
    gap: 10px;
  }

  .selector-bar .selector-row label,
  .selector-bar .selector-row label:has(#league-select) {
    flex: none;
    min-width: 0;
    width: 100%;
  }

  .season-label {
    flex: none !important;
    min-width: 0 !important;
    width: 100%;
  }

  /* --- Scrollable analysis tables --- */
  #results .card,
  details.card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-table {
    min-width: 360px;
  }

  .results-table th,
  .results-table td {
    padding: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* --- Score matrix: tighter --- */
  .score-matrix th,
  .score-matrix td {
    font-size: 0.6rem;
    padding: 2px;
  }

  /* --- Tournament filter: smaller pills --- */
  .tournament-filter {
    gap: 4px;
    padding: 6px 8px;
  }

  .tournament-filter button {
    font-size: 11px;
    padding: 3px 8px;
  }
}

/* === Small Phone Polish === */
@media (max-width: 400px) {
  .container {
    padding: 12px;
  }

  .card {
    padding: 12px;
    margin-bottom: 12px;
  }

  .card h2 {
    font-size: 1rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }

  .match-row {
    padding: 8px;
  }

  .match-round-header {
    padding: 10px 8px 4px;
  }

  .odds-cell {
    min-width: 36px;
    padding: 2px 4px;
    font-size: 0.75rem;
  }

  .odds-label {
    font-size: 0.55rem;
  }

  .pred-p {
    min-width: 32px;
    font-size: 0.7rem;
    padding: 2px 3px;
  }

  header h1 {
    font-size: 1.3rem;
  }

  .steam-badge {
    font-size: 0.55rem;
    padding: 1px 3px;
    margin-left: 4px;
  }

  .tournament-tag {
    font-size: 9px;
    padding: 1px 4px;
  }

  .streak-badge {
    font-size: 0.6rem;
    padding: 1px 3px;
  }

  .help-modal-body {
    padding: 12px 14px;
    font-size: 0.82rem;
  }
}

/* Tournament filter (internationals only) */
.tournament-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a2a2a;
  background: #0f0f0f;
}

.tournament-filter button {
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tournament-filter button:hover {
  background: #222;
  border-color: #555;
}

.tournament-filter button.active {
  background: #2a5a8a;
  color: #fff;
  border-color: #3a7aba;
}

.tournament-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* FIFA */
.tournament-tag.wc26         { background: #8a6a1a; color: #fff; }
.tournament-tag.wc_qual      { background: #1a4a8a; color: #fff; }
/* UEFA */
.tournament-tag.euro         { background: #2a5a9a; color: #fff; }
.tournament-tag.nations      { background: #5a2a7a; color: #fff; }
/* CONMEBOL */
.tournament-tag.copa_america { background: #1a6a3a; color: #fff; }
/* CAF */
.tournament-tag.afcon        { background: #8a5a1a; color: #fff; }
.tournament-tag.afcon_qual   { background: #6a4a1a; color: #fff; }
/* CONCACAF */
.tournament-tag.gold_cup     { background: #1a6a5a; color: #fff; }
.tournament-tag.gold_cup_qual{ background: #1a5a4a; color: #fff; }
.tournament-tag.concacaf_nl  { background: #2a5a6a; color: #fff; }
/* AFC */
.tournament-tag.asian_cup    { background: #7a2a2a; color: #fff; }
.tournament-tag.asian_cup_qual{ background: #5a2a2a; color: #fff; }
/* Other */
.tournament-tag.friendly     { background: #555;    color: #ddd; }

.filter-banner {
  font-size: 11px;
  color: #888;
  padding: 4px 8px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}

.elo-toggle {
  display: block;
  margin: 10px auto 0;
  background: #1a1a1a;
  color: #ccc;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}
.elo-toggle:hover {
  background: #222;
  border-color: #555;
}

.context-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 6px 0 0;
}

/* === Standings Table === */
.standings-table td,
.standings-table th {
  text-align: center;
}

.standings-table .standings-team {
  text-align: left;
}

.standings-table .standings-pts {
  font-weight: 700;
}

.standings-table .standings-leader td {
  background: rgba(96, 165, 250, 0.08);
}

/* Group stage standings (WC-style) */
.standings-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.standings-group-header {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.4rem 0;
}

.group-stage-complete-banner {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
  padding: 0.4rem 0 0.9rem 0;
  opacity: 0.7;
}

.knockout-stage-header {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1.1rem 0 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.25rem;
}

.knockout-stage-inline {
  padding: 0.9rem 0.75rem 0.3rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  margin-top: 0.25rem;
}

/* Knockout results view (below group standings) */
.knockout-results {
  margin-top: 1.75rem;
}

.knockout-results-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  color: var(--text);
}

.knockout-round {
  margin-bottom: 1.1rem;
}

.knockout-round-header {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem 0;
}

.knockout-tie {
  display: grid;
  grid-template-columns: 1fr auto 1fr 5.25rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.knockout-tie:last-child {
  border-bottom: none;
}

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

.ko-home {
  text-align: right;
}

.ko-away {
  text-align: left;
}

.ko-winner {
  color: var(--text);
  font-weight: 700;
}

.ko-score {
  font-family: monospace;
  font-weight: 700;
  color: var(--text);
  padding: 1px 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  white-space: nowrap;
}

.ko-pred-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.ko-pred-score {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ko-pred {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.ko-pred-ok {
  color: #4ade80;
  background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.4);
}

.ko-pred-miss {
  color: #f87171;
  background: rgba(248,113,113,0.15);
  border: 1px solid rgba(248,113,113,0.4);
}

@media (max-width: 560px) {
  .knockout-tie {
    grid-template-columns: 1fr auto 1fr;
    row-gap: 0.15rem;
  }
  .ko-pred-cell {
    grid-column: 1 / -1;
    justify-content: center;
  }
}
