:root {
  --bg: #0b1411;
  --bg-2: #11201a;
  --card: #14241d;
  --card-2: #1b2f26;
  --line: #21382d;
  --pitch: #2ecc71;
  --pitch-dim: #1f7a47;
  --gold: #f4c95d;
  --text: #e8f3ed;
  --muted: #8fae9f;
  --danger: #e0696a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, #173127 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--pitch); }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(46,204,113,.06), transparent);
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-size: 38px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.brand h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.nav-link {
  text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; transition: border-color .15s ease;
}
.nav-link:hover { border-color: var(--pitch); }

.backend-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; color: var(--muted);
}
.backend-pill .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pitch); box-shadow: 0 0 10px var(--pitch);
}

/* ---------- Layout ---------- */
main {
  max-width: 980px; margin: 0 auto;
  padding: 28px clamp(16px, 5vw, 48px) 60px;
}

.panel-card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.section-title { margin: 30px 0 14px; font-size: 18px; color: var(--muted); font-weight: 600; }

/* ---------- Controls ---------- */
.matchup {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 16px; align-items: end;
}
.team-pick label {
  display: block; font-size: 12px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); margin-bottom: 6px;
}
select {
  width: 100%; padding: 12px 14px; font-size: 16px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.vs { color: var(--gold); font-weight: 700; padding-bottom: 12px; }

.controls-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 18px; flex-wrap: wrap;
}
.switch { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--pitch); cursor: pointer; }

.run-btn {
  background: linear-gradient(180deg, var(--pitch), var(--pitch-dim));
  color: #06140d; font-weight: 800; font-size: 15px;
  border: 0; padding: 13px 24px; border-radius: 12px; cursor: pointer;
  transition: transform .08s ease, box-shadow .2s ease;
  box-shadow: 0 6px 18px rgba(46,204,113,.25);
}
.run-btn:hover { transform: translateY(-1px); }
.run-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.quickpicks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: border-color .15s ease;
}
.chip:hover { border-color: var(--pitch); }

/* ---------- Consensus ---------- */
.consensus { text-align: center; }
.consensus .verdict-tag {
  display: inline-block; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px;
}
.scoreline-big {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 6px 0 4px; flex-wrap: wrap;
}
.scoreline-big .side { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.scoreline-big .flag { font-size: 34px; }
.scoreline-big .score {
  font-size: 46px; font-weight: 900; letter-spacing: 2px;
  background: var(--card-2); padding: 6px 18px; border-radius: 14px; border: 1px solid var(--line);
}
.fav-line { color: var(--muted); font-size: 15px; margin: 6px 0 16px; }
.fav-line strong { color: var(--text); }

.prob-bar { display: flex; height: 30px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.prob-bar .seg { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #06140d; }
.prob-bar .home { background: var(--pitch); }
.prob-bar .draw { background: #5a6f64; color: var(--text); }
.prob-bar .away { background: var(--gold); }
.prob-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 7px; }

.conf-wrap { margin-top: 16px; }
.conf-wrap .label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.conf-track { height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.conf-fill { height: 100%; background: linear-gradient(90deg, var(--pitch-dim), var(--pitch)); border-radius: 999px; }

.agreed-badge {
  display: inline-block; margin-top: 14px; font-size: 12.5px;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
}
.agreed-badge.yes { color: var(--pitch); background: rgba(46,204,113,.08); }
.agreed-badge.no  { color: var(--gold);  background: rgba(244,201,93,.08); }

.detail-cta { margin-top: 18px; }
.match-link {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 14px;
  color: #06140d; background: linear-gradient(180deg, var(--pitch), var(--pitch-dim));
  padding: 11px 20px; border-radius: 12px;
  box-shadow: 0 6px 18px rgba(46,204,113,.22);
  transition: transform .08s ease;
}
.match-link:hover { transform: translateY(-1px); }

/* ---------- Agents ---------- */
.agents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.agent {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.agent.judge { border-color: var(--pitch-dim); box-shadow: 0 0 0 1px rgba(46,204,113,.12) inset; }
.agent .ahead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.agent .aemoji { font-size: 26px; }
.agent .aname { font-weight: 700; font-size: 14.5px; }
.agent .arole { font-size: 11.5px; color: var(--muted); }
.agent .ascore { font-size: 30px; font-weight: 900; margin: 8px 0 4px; }
.agent .areason { font-size: 13px; color: #cfe3d8; }
.agent .aconf { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.agent .aconf b { color: var(--text); }

/* ---------- Debate ---------- */
.debate { display: flex; flex-direction: column; gap: 12px; }
.turn { display: flex; gap: 12px; align-items: flex-start; }
.turn .bubble {
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 14px; font-size: 13.5px; flex: 1;
}
.turn .who { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.turn .who .mini { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 8px; }
.turn .bemoji { font-size: 24px; padding-top: 4px; }
.note {
  text-align: center; color: var(--gold); font-size: 13px;
  border: 1px dashed var(--pitch-dim); border-radius: 12px; padding: 8px;
  background: rgba(244,201,93,.05);
}
.round-tag {
  align-self: center; font-size: 11px; color: var(--muted);
  letter-spacing: 1px; text-transform: uppercase; margin: 4px 0;
}

/* ---------- Loading / misc ---------- */
.hidden { display: none !important; }
.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner {
  width: 38px; height: 38px; margin: 0 auto 14px;
  border: 4px solid var(--line); border-top-color: var(--pitch);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); }
.foot p { max-width: 640px; margin: 0 auto; }

@media (max-width: 720px) {
  .agents { grid-template-columns: 1fr; }
  .matchup { grid-template-columns: 1fr; }
  .vs { text-align: center; padding: 4px 0; }
}
