.bracket-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 24px 96px;
}

/* ---- accuracy hero: reuses the fixed "floodlit" hero band ---- */

.accuracy-hero { padding-bottom: 36px; }

.accuracy-row {
  display: flex;
  align-items: baseline;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.accuracy-value {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 5.5rem);
  color: var(--hero-gold);
  line-height: 0.9;
}

.accuracy-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 6px;
}

.accuracy-label {
  color: var(--hero-ink);
  font-weight: 600;
  font-size: 0.9375rem;
}

.accuracy-sub {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--hero-ink-soft);
}

.refresh-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.refresh-button {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--hero-line);
  background: transparent;
  color: var(--hero-ink);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.refresh-button:hover:not(:disabled) {
  border-color: var(--hero-gold);
  color: var(--hero-gold);
}

.refresh-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.refresh-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--hero-ink-soft);
  max-width: 46ch;
}

h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 8px;
  color: var(--pitch);
}

.section-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 14px;
  max-width: 60ch;
}

.legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 24px;
}

.legend-chip {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-chip.correct { color: var(--accent); border-color: var(--accent-wash); background: var(--accent-wash); }
.legend-chip.incorrect { color: var(--red-card); border-color: var(--red-card-wash); background: var(--red-card-wash); }
.legend-chip.pending { color: var(--muted); }

.legend-chip.correct::before { content: '\2713'; font-weight: 700; }
.legend-chip.incorrect::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 11px;
  background: var(--red-card);
  border-radius: 1.5px;
  transform: rotate(-8deg);
}

.knockout {
  padding: 40px 0;
  border-bottom: 1px solid var(--gridline);
}

.bracket-scroll {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  position: relative;
}

.bracket-lines {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  color: var(--gridline);
  z-index: 0;
}

.bracket-lines path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.bracket-column {
  display: flex;
  flex-direction: column;
  min-width: 240px;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.bracket-column h3 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 700;
}

.bracket-column .match-list {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  flex: 1;
}

/* ---- match card: a small scoreboard ---- */

.match-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: var(--surface-1);
  font-size: 0.8125rem;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.match-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.match-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.match-card .mc-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  gap: 8px;
}

.match-card .mc-team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-secondary);
}

.match-card .mc-team.winner .mc-team-name { color: var(--text-primary); font-weight: 800; }

.match-card .mc-team.pick:not(.winner) .mc-team-name {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.mc-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--hero-ink);
  background: var(--pitch);
  border-radius: 4px;
  padding: 1px 6px;
  min-width: 1.4em;
  text-align: center;
}

.match-card .mc-team:not(.winner):not(.pick) .mc-score {
  background: var(--baseline);
  color: var(--text-secondary);
}

.mc-score.predicted {
  background: transparent;
  border: 1px dashed var(--pitch);
  color: var(--pitch);
}

.match-card .mc-team:not(.winner):not(.pick) .mc-score.predicted {
  border-color: var(--border);
  color: var(--muted);
}

.mc-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--gridline);
  font-size: 0.6875rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.mc-status { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.mc-status.correct { color: var(--accent); }
.mc-status.correct::before { content: '\2713'; }
.mc-status.incorrect { color: var(--red-card); }
.mc-status.incorrect::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 10px;
  background: var(--red-card);
  border-radius: 1.5px;
  transform: rotate(-8deg);
}

.groups { padding: 40px 0 0; }

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

.group-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.group-card h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--pitch);
  margin: 0 0 10px;
}

.group-card .match-card {
  border: none;
  border-radius: 6px;
  padding: 6px 4px;
  margin: 0 -4px;
}

.group-card .match-card:hover { background: var(--accent-wash); transform: none; }

.group-card .match-card .mc-meta { display: none; }

/* ---- native <dialog>, styled as a match report ---- */

.match-detail {
  border: none;
  border-radius: 12px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  color: var(--text-primary);
  background: var(--surface-1);
}

.match-detail::backdrop {
  background: rgba(6, 12, 8, 0.55);
}

.close-detail {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.close-detail:hover { background: var(--accent-wash); border-color: var(--accent); }

#detail-content {
  overflow-y: auto;
  max-height: min(80vh, 720px);
}

.dt-header {
  background: linear-gradient(160deg, var(--hero-bg-2), var(--hero-bg));
  padding: 24px 24px 20px;
  border-radius: 12px 12px 0 0;
}

.dt-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(224, 176, 57, 0.16);
  color: var(--hero-gold);
  margin-bottom: 10px;
}

.dt-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 4px;
  letter-spacing: 0.01em;
  color: var(--hero-ink);
}

.dt-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--hero-ink-soft);
  margin: 0;
}

.dt-body { padding: 4px 24px 24px; }

.dt-section {
  padding: 16px 0;
  border-top: 1px solid var(--gridline);
}

.dt-section h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}

.dt-table-scroll {
  overflow-x: auto;
}

.dt-factor-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.dt-factor-table th, .dt-factor-table td {
  text-align: right;
  padding: 4px 6px;
}

.dt-factor-table th:first-child, .dt-factor-table td:first-child {
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
}

.dt-factor-table thead th {
  color: var(--muted);
  font-weight: 400;
  border-bottom: 1px solid var(--gridline);
}

.dt-prob-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.8125rem;
}

.dt-prob-label { width: 90px; flex-shrink: 0; font-weight: 600; }

.dt-prob-track {
  flex: 1;
  height: 8px;
  background: var(--baseline);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0.7;
}

.dt-prob-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}

.dt-prob-pct {
  width: 46px;
  text-align: right;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.dt-goals {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.dt-goals strong { color: var(--text-primary); }

.dt-note {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.sim-trigger {
  margin-top: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8125rem;
  cursor: pointer;
}

.sim-trigger:hover {
  background: var(--accent);
  color: var(--surface-1);
}

@media (max-width: 640px) {
  .accuracy-value { font-size: 3rem; }
}

/* Below this, a side-by-side bracket means scrolling both down (16 R32
   matches) and sideways (5 rounds) at once. Stack rounds full-width instead
   so the only scroll direction is down. Connector lines are a horizontal-
   layout concept and are hidden here (see the matching JS check). */
@media (max-width: 767px) {
  .bracket-scroll {
    flex-direction: column;
    overflow-x: visible;
  }

  .bracket-column {
    min-width: 0;
    width: 100%;
  }

  .bracket-column .match-list {
    flex: none;
    justify-content: flex-start;
  }

  .bracket-lines {
    display: none;
  }
}
