:root {
  --bg: #07140f;
  --panel: rgba(12, 26, 21, 0.84);
  --panel-strong: rgba(15, 38, 31, 0.94);
  --line: rgba(193, 242, 218, 0.18);
  --text: #eefbf5;
  --muted: #a5b9b0;
  --accent: #21d19f;
  --accent-2: #ffcc66;
  --danger: #ff6b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(33, 209, 159, 0.22), transparent 26rem),
    linear-gradient(135deg, #06110d 0%, #0c241d 46%, #15160d 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#pitchCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.42;
  pointer-events: none;
}

.shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar,
.controls,
.summary-grid,
.layout {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
}

.status,
.metric,
.match-panel,
.result-panel,
.controls,
.disclaimer {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.status {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.status.ok {
  color: var(--accent);
}

.controls {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
}

.disclaimer {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  border-color: rgba(255, 204, 102, 0.28);
  color: var(--muted);
}

.disclaimer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-2);
}

.disclaimer p {
  font-size: 13px;
  line-height: 1.5;
}

.date-control {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
button {
  height: 42px;
  border-radius: 8px;
  font: inherit;
}

input {
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

button {
  border: 1px solid transparent;
  padding: 0 16px;
  color: #04130e;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: var(--accent);
}

.ghost-btn {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

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

.metric {
  min-height: 88px;
  padding: 16px;
  border-radius: 8px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 14px;
}

.match-panel,
.result-panel {
  min-height: 520px;
  border-radius: 8px;
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head span {
  color: var(--muted);
}

.fixture-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.fixture-card {
  width: 100%;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.fixture-card:hover {
  border-color: rgba(33, 209, 159, 0.58);
}

.teams {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-weight: 900;
}

.fixture-meta,
.warning-list,
.factor-list {
  color: var(--muted);
  font-size: 13px;
}

.result-panel {
  padding: 22px;
  background: var(--panel-strong);
  overflow: auto;
}

.empty-state,
.loading-state {
  min-height: 460px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2,
.loading-state h2 {
  color: var(--text);
}

.hidden {
  display: none;
}

.orbital-loader {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  position: relative;
  animation: pulse 1.8s ease-in-out infinite;
}

.orbital-loader.small {
  width: 58px;
  height: 58px;
}

.orbital-loader::before,
.orbital-loader::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.orbital-loader::after {
  inset: 24px;
  border-top-color: var(--accent-2);
  animation-duration: 1.5s;
  animation-direction: reverse;
}

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

@keyframes pulse {
  50% {
    transform: scale(1.06);
  }
}

.prob-grid,
.score-grid,
.h2h-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.single-result {
  display: grid;
  gap: 16px;
}

.result-card {
  display: grid;
  gap: 16px;
}

.result-card.compact {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.result-card.compact .prediction-title h2 {
  font-size: 22px;
}

.result-card.compact .prob-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-card.compact .score-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.result-section {
  display: grid;
  gap: 10px;
}

.result-section h2,
.warning-list h2 {
  font-size: 24px;
}

.verdict-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(33, 209, 159, 0.35);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(33, 209, 159, 0.14), rgba(255, 204, 102, 0.08));
}

.verdict-strip span,
.verdict-strip em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.verdict-strip strong {
  font-size: 22px;
}

.result-disclaimer {
  margin-top: 0;
  box-shadow: none;
}

.all-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.all-results-head p {
  color: var(--muted);
  margin-top: 6px;
}

.all-results-grid {
  display: grid;
  gap: 14px;
}

.error-box {
  padding: 16px;
  border: 1px solid rgba(255, 107, 107, 0.42);
  border-radius: 8px;
  color: #ffd2d2;
  background: rgba(255, 107, 107, 0.1);
}

.error-box.slim {
  margin-top: 10px;
  padding: 12px;
}

.prob-card,
.score-card,
.h2h-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.prob-card span,
.score-card span,
.h2h-card span {
  color: var(--muted);
  font-size: 12px;
}

.prob-card strong,
.score-card strong,
.h2h-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.bar {
  height: 8px;
  margin-top: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.prediction-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.prediction-title p {
  color: var(--muted);
  margin-top: 6px;
}

.badge {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 8px;
  color: #04130e;
  background: var(--accent-2);
  font-weight: 900;
}

.warning-list {
  margin-top: 14px;
  color: #ffd2d2;
}

.factor-list {
  margin-top: 14px;
}

.h2h-note {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(255, 204, 102, 0.35);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 204, 102, 0.07);
}

.h2h-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 24px, 560px);
    padding-top: 18px;
  }

  .topbar,
  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-grid,
  .layout,
  .prob-grid,
  .score-grid,
  .h2h-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .status {
    min-width: 0;
  }

  .date-control {
    min-width: 0;
  }

  .controls button,
  .controls input {
    width: 100%;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric {
    min-height: 76px;
    padding: 12px;
  }

  .metric strong {
    font-size: 22px;
  }

  .match-panel,
  .result-panel {
    min-height: auto;
  }

  .result-panel {
    padding: 14px;
  }

  .fixture-card {
    min-height: 92px;
  }

  .teams {
    align-items: start;
  }

  .prediction-title {
    align-items: stretch;
    flex-direction: column;
  }

  .badge {
    width: max-content;
  }

  .verdict-strip {
    align-items: start;
    flex-direction: column;
  }

  .result-card.compact .prob-grid,
  .result-card.compact .score-grid {
    grid-template-columns: 1fr;
  }
}

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

  .topbar {
    margin-bottom: 12px;
  }

  .disclaimer p,
  .fixture-meta,
  .warning-list,
  .factor-list {
    font-size: 12px;
  }

  .prob-card strong,
  .score-card strong,
  .h2h-card strong {
    font-size: 22px;
  }
}

/* England visual theme */
:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(11, 31, 58, 0.15);
  --text: #071c35;
  --muted: #58708c;
  --accent: #cf142b;
  --accent-2: #123c73;
  --shadow: 0 24px 70px rgba(11, 31, 58, 0.14);
}

body {
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(207, 20, 43, 0.12) 44% 56%, transparent 56% 100%),
    linear-gradient(0deg, transparent 0 45%, rgba(207, 20, 43, 0.1) 45% 55%, transparent 55% 100%),
    radial-gradient(circle at 16% 10%, rgba(18, 60, 115, 0.16), transparent 28rem),
    linear-gradient(135deg, #ffffff 0%, #eef3fb 52%, #f8fbff 100%);
}

#pitchCanvas {
  opacity: 0.2;
}

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

.crest {
  width: 86px;
  height: 102px;
  object-fit: contain;
  filter: drop-shadow(0 16px 18px rgba(11, 31, 58, 0.2));
}

.eyebrow,
.disclaimer strong {
  color: var(--accent);
}

.status.ok {
  color: var(--accent-2);
  border-color: rgba(207, 20, 43, 0.25);
}

input,
.ghost-btn,
.fixture-card,
.prob-card,
.score-card,
.h2h-card,
.result-card.compact {
  background: rgba(255, 255, 255, 0.74);
}

button,
.badge {
  color: #ffffff;
}

.fixture-card:hover {
  border-color: rgba(207, 20, 43, 0.58);
}

.bar {
  background: rgba(11, 31, 58, 0.1);
}

.badge {
  background: var(--accent);
}

.verdict-strip {
  border-color: rgba(207, 20, 43, 0.28);
  background: linear-gradient(90deg, rgba(207, 20, 43, 0.1), rgba(18, 60, 115, 0.08));
}

.disclaimer,
.h2h-note {
  border-color: rgba(207, 20, 43, 0.24);
}

.h2h-note {
  background: rgba(207, 20, 43, 0.06);
}

@media (max-width: 860px) {
  .brand {
    align-items: center;
  }

  .crest {
    width: 62px;
    height: 76px;
  }
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.94) 0 44%, rgba(207,20,43,0.18) 44% 56%, rgba(255,255,255,0.94) 56% 100%),
    rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(12px);
}

.intro-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(207, 20, 43, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.intro-modal.wide {
  width: min(860px, 100%);
}

.intro-modal h2 {
  margin: 10px 0 20px;
  font-size: clamp(28px, 4vw, 42px);
}

.intro-crest {
  width: 104px;
  height: 124px;
  object-fit: contain;
  margin: 0 auto 12px;
  filter: drop-shadow(0 14px 18px rgba(11, 31, 58, 0.2));
}

.intro-modal .primary-btn {
  min-width: 180px;
}

.method-flow {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) auto minmax(130px, 1fr) auto minmax(150px, 1.2fr) auto minmax(130px, 1fr) auto minmax(150px, 1.2fr);
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.flow-node,
.flow-stack {
  min-height: 72px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 900;
}

.flow-stack {
  gap: 6px;
  font-size: 13px;
  text-align: left;
}

.flow-node.source,
.flow-stack {
  background: #eef4ff;
}

.flow-node.model {
  background: #fff2f2;
}

.flow-node.output {
  background: #f2fff8;
}

.flow-arrow {
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.method-copy {
  margin: 10px 0 18px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .intro-modal {
    padding: 20px;
  }

  .method-flow {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    transform: rotate(90deg);
  }
}
