:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #1a1d21;
  --panel-2: #22262b;
  --line: #343a40;
  --text: #f4f6f8;
  --muted: #aeb7c2;
  --accent: #31c6b2;
  --accent-2: #f2b84b;
  --danger: #f06a6a;
  --ok: #8bd17c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 24px;
  background: rgba(16, 17, 20, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.nav a,
.button-link,
button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.nav a:hover,
.button-link:hover,
button:hover {
  border-color: var(--accent);
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0;
  max-width: 850px;
  font-size: clamp(2rem, 4vw, 4.5rem);
  line-height: 0.98;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.status-pill,
.confidence {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.confidence.hoch {
  color: var(--ok);
  border-color: rgba(139, 209, 124, 0.5);
}

.confidence.mittel {
  color: var(--accent-2);
  border-color: rgba(242, 184, 75, 0.5);
}

.confidence.niedrig {
  color: var(--danger);
  border-color: rgba(240, 106, 106, 0.5);
}

.grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

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

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

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

.panel,
.prediction-card,
.team-card,
.chart-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
}

.section-block {
  margin-top: 28px;
}

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

.section-head h2,
.panel h2,
.chart-panel h2 {
  margin: 0;
  font-size: 1.2rem;
}

.prediction-grid,
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.prediction-card {
  display: grid;
  gap: 14px;
}

.match-meta,
.card-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.teams-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 1.1rem;
}

.versus {
  color: var(--muted);
}

.flag {
  font-size: 1.6rem;
  line-height: 1;
}

.flag.small {
  font-size: 1rem;
  margin-right: 4px;
}

.flag.large {
  font-size: 2.4rem;
}

.flag.hero {
  font-size: 4.5rem;
}

.probabilities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.probabilities div {
  padding: 12px;
  background: var(--panel-2);
  border-radius: 8px;
}

.probabilities span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.probabilities strong {
  display: block;
  margin-top: 6px;
  font-size: 1.4rem;
}

.empty-state {
  padding: 22px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

input,
select {
  min-height: 38px;
  min-width: 180px;
  padding: 8px 10px;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: var(--panel);
}

th,
td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.team-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
}

.team-card span:last-child,
.compact-list {
  color: var(--muted);
}

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

.chart-panel {
  min-height: 320px;
}

.chart-panel canvas {
  width: 100%;
  max-height: 260px;
}

.comparison {
  display: grid;
  grid-template-columns: 1fr 180px 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.compare-side,
.compare-center {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 10px;
}

.compare-side h2 {
  margin: 0;
}

.compare-center strong {
  font-size: 3rem;
}

.compact-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.compact-list.columns {
  columns: 2;
}

code {
  color: var(--accent);
  white-space: normal;
}

@media (max-width: 820px) {
  .topbar,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .cards-2,
  .cards-3,
  .cards-4,
  .comparison,
  .probabilities {
    grid-template-columns: 1fr;
  }

  .page-heading h1 {
    font-size: 2.4rem;
  }

  .flag.hero {
    font-size: 3.2rem;
  }
}
