:root {
  --bg: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #111117;
  --muted: #5a5d66;
  --border: rgba(17, 17, 23, 0.08);
  --shadow: 0 16px 40px rgba(17, 17, 23, 0.08);
  --gold: #d4a638;
  --gold-soft: rgba(212, 166, 56, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(212, 166, 56, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 24%),
    linear-gradient(180deg, #fcfcfd 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.page-glow {
  position: absolute;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
  pointer-events: none;
}

.page-glow-left {
  top: -8rem;
  left: -10rem;
  background: rgba(212, 166, 56, 0.22);
}

.page-glow-right {
  top: 10rem;
  right: -10rem;
  background: rgba(59, 130, 246, 0.18);
}

.site-header,
.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 24px 0 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #111117, #2b2f3a);
  color: #fff;
  font-family: "Anton", sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow);
}

.brand-kicker,
.section-kicker,
.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

.brand h1,
.hero h2,
.detail-hero h2,
.consensus-bar h3,
.empty-state h2 {
  margin: 0;
  font-family: "Anton", sans-serif;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.brand h1 {
  max-width: 780px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
}

.app-shell {
  padding: 20px 0 48px;
}

.detail-hero,
.consensus-bar,
.prediction-card,
.match-card,
.empty-state,
.loading-state {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.detail-hero,
.consensus-bar,
.empty-state,
.loading-state {
  border-radius: 28px;
}

.match-grid {
  display: grid;
  gap: 18px;
}

.match-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: 24px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 48px rgba(17, 17, 23, 0.12);
  border-color: rgba(212, 166, 56, 0.4);
}

.match-card-top,
.match-meta,
.prediction-header,
.detail-header-top,
.detail-notes,
.consensus-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.competition-pill,
.round-pill,
.prediction-status,
.versus-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.competition-pill,
.round-pill {
  background: var(--gold-soft);
  color: #7b5c08;
  padding: 8px 12px;
  font-size: 0.78rem;
}

.match-date,
.match-meta,
.pending-copy,
.reference-list span {
  color: var(--muted);
}

.match-date {
  text-align: right;
}

.match-club-row,
.detail-team-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.match-meta {
  justify-content: center;
  text-align: center;
  margin-top: 0;
}

.team-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.match-card .team-lockup {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  text-align: left;
  gap: 16px;
}

.team-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #f4f4f5;
  border: 1px solid rgba(17, 17, 23, 0.06);
}

.team-short {
  margin: 6px 0 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.team-lockup h2 {
  margin: 0;
  font-size: 1.1rem;
}

.match-card .team-lockup h2 {
  max-width: 9ch;
  text-wrap: balance;
}

.versus-pill {
  width: 50px;
  height: 50px;
  background: #111117;
  color: #fff;
  font-family: "Anton", sans-serif;
  letter-spacing: 0.1em;
  justify-self: center;
  align-self: center;
}

.first-leg-banner {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(212, 166, 56, 0.14), rgba(212, 166, 56, 0.04));
  font-weight: 700;
}

.prediction-strip {
  display: grid;
  gap: 12px;
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.model-chip {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.88);
  border: 0;
  border-top: 1px solid rgba(17, 17, 23, 0.08);
  font-size: 0.85rem;
  height: 100%;
  align-content: start;
}

.model-chip-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.model-chip-label {
  color: var(--muted);
  font-weight: 700;
}

.model-chip-helper {
  color: rgba(17, 17, 23, 0.45);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.model-chip-pick {
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--model-color) 16%, white);
  color: color-mix(in srgb, var(--model-color) 78%, black 22%);
  line-height: 1;
}

.model-chip-team-logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(17, 17, 23, 0.08);
  object-fit: contain;
  padding: 2px;
}

.model-chip-scoreline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.model-chip-scoreline strong,
.model-chip-label {
  font-size: 0.95rem;
}

.model-chip-score-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.model-chip-copy {
  margin: 0;
  color: #252833;
  line-height: 1.5;
  font-size: 0.84rem;
  text-wrap: pretty;
}

.model-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--model-color);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--model-color) 18%, white);
}

.back-link {
  display: inline-block;
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.detail-hero {
  padding: 26px;
  margin-bottom: 18px;
}

.detail-centerpiece {
  display: grid;
  gap: 10px;
  place-items: center;
  text-align: center;
}

.detail-scoreline {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: #111117;
  color: #fff;
  font-family: "Anton", sans-serif;
  font-size: 2rem;
}

.detail-notes {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(17, 17, 23, 0.08);
}

.consensus-bar {
  display: grid;
  gap: 16px;
  padding: 22px 24px;
  margin-bottom: 18px;
}

.consensus-bar h3 {
  font-size: clamp(1.4rem, 4vw, 2.5rem);
}

.consensus-track {
  display: flex;
  min-height: 44px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 17, 23, 0.06);
}

.consensus-fill {
  display: grid;
  place-items: center;
  min-width: fit-content;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(212, 166, 56, 0.9), rgba(17, 17, 23, 0.82));
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
}

.prediction-stack {
  display: grid;
  gap: 18px;
}

.prediction-card {
  padding: 22px;
  border-radius: 26px;
  border-left: 6px solid var(--model-color);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--model-accent, #fff) 28%, white), rgba(255, 255, 255, 0.96)),
    white;
}

.model-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.model-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(17, 17, 23, 0.08);
}

.prediction-status {
  padding: 10px 14px;
  background: color-mix(in srgb, var(--model-color) 14%, white);
  color: color-mix(in srgb, var(--model-color) 88%, black 18%);
  font-size: 0.8rem;
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.verdict-grid > div {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 17, 23, 0.06);
}

.verdict-grid strong {
  font-size: 1.1rem;
}

.one-liner {
  margin: 0 0 18px;
  font-size: 1.02rem;
  line-height: 1.6;
}

.analysis-shell {
  border-top: 1px solid rgba(17, 17, 23, 0.08);
  padding-top: 16px;
}

.analysis-shell summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

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

.analysis-shell[open] summary span {
  transform: rotate(180deg);
}

.analysis-shell summary span {
  transition: transform 180ms ease;
}

.analysis-panels {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.analysis-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 23, 0.06);
}

.analysis-panel h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.markdown-body p,
.markdown-body ul {
  margin: 0 0 12px;
  color: #252833;
  line-height: 1.7;
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 18px 0 10px;
  font-size: 1rem;
}

.markdown-body ul {
  padding-left: 18px;
}

.thinking-log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 18px;
  border-radius: 18px;
  background: #0f1117;
  color: #d9e1f2;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.reference-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 18px;
}

.reference-list a {
  display: inline-block;
  margin-bottom: 4px;
  color: #114aa4;
  font-weight: 700;
}

.pending-card {
  background: linear-gradient(135deg, rgba(245, 245, 247, 0.98), rgba(255, 255, 255, 0.96));
}

.empty-state,
.loading-state {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 280px;
  padding: 28px;
  text-align: center;
}

.loader {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(17, 17, 23, 0.12);
  border-top-color: var(--gold);
  animation: spin 900ms linear infinite;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 500ms ease,
    transform 500ms ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 760px) {
  .match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .match-club-row {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .detail-team-row {
    grid-template-columns: 1fr auto 1fr;
  }

  .analysis-panels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .prediction-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 759px) {
  .brand {
    align-items: flex-start;
  }

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

  .match-card .team-lockup {
    text-align: center;
    flex-direction: column;
    gap: 10px;
  }

  .match-card .team-lockup h2 {
    max-width: 12ch;
  }

  .versus-pill {
    margin: 0 auto;
  }

  .verdict-grid {
    grid-template-columns: 1fr;
  }

  .consensus-fill {
    justify-content: flex-start;
  }
}
