/* Kombinat WM Orakel
   Basis: monochromes Kombinat-Design (Schwarz/Weiß, viel Luft, präzise Typo)
   Akzent: WM-2026-Energie (lebendiges Magenta + Cyan, an die FIFA-26-Brand angelehnt) */

:root {
  --ink: #0a0a0a;
  --paper: #ffffff;
  --paper-2: #f4f3f0;
  --line: #e3e1dc;
  --muted: #6b6b6b;

  --accent: #e6007e;        /* WM 2026 Magenta */
  --accent-2: #00b4d8;      /* Cyan */
  --accent-3: #ffcc00;      /* Gold */
  --good: #138a36;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --font: "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(230, 0, 126, 0.06), transparent 60%),
    radial-gradient(1000px 500px at -10% 0%, rgba(0, 180, 216, 0.06), transparent 55%),
    var(--paper);
  line-height: 1.5;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 16px; }
.brand-logo { height: 26px; width: auto; }
.brand-divider { width: 1px; height: 24px; background: var(--line); }
.brand-title {
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 14px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: 100px;
}
.badge-stripe {
  width: 22px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0 33%, var(--accent-2) 33% 66%, var(--accent-3) 66% 100%);
}

/* ---------- Layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(18px, 5vw, 56px) 80px; }

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  font-weight: 800;
}
.hero-sub { color: var(--muted); max-width: 56ch; margin: 0 0 28px; font-size: 16px; }

/* ---------- Controls ---------- */
.controls {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-wrap { flex: 1 1 320px; position: relative; }
.search-wrap::before {
  content: "⌕";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--muted);
}
#search {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 15px;
  font-family: inherit;
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(230, 0, 126, 0.1); }

.tabs { display: inline-flex; background: var(--paper-2); border-radius: 100px; padding: 4px; }
.tab {
  border: 0;
  background: transparent;
  padding: 10px 20px;
  border-radius: 100px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s;
}
.tab.is-active { background: var(--ink); color: var(--paper); }

.meta-bar {
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
}
.meta-bar .pill {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 3px 10px;
}
.meta-bar .warn { color: var(--accent); border-color: var(--accent); }

/* ---------- Views ---------- */
.view { margin-top: 26px; }
.hidden { display: none; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 700;
}

/* ---------- Match cards ---------- */
.match-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }

.match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.match-card { cursor: pointer; }
.match-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); }
.match-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Ergebnis-Karte */
.match-card.result { cursor: default; }
.match-card.result:hover { transform: none; box-shadow: var(--shadow); }
.score { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 0 8px; }
.team-side.won .team-name { color: var(--ink); }
.team-side.won::after { content: "✓"; color: var(--good); font-weight: 800; }
.team-side.away.won::after { order: -1; }

.match-when {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.match-when .live {
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.match-when .live::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.teams-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.team-side { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.team-side.away { justify-content: flex-end; text-align: right; }
.team-flag { font-size: 26px; line-height: 1; }
.team-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 6px; }

.odds-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.odd {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 6px;
  text-align: center;
  background: var(--paper-2);
}
.odd .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.odd .val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.odd .book { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odd.best { border-color: var(--accent); background: rgba(230, 0, 126, 0.05); }

/* ---------- Team list ---------- */
.team-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.team-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.team-card:hover { transform: translateY(-2px); }
.team-card .rank {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  min-width: 26px;
  font-variant-numeric: tabular-nums;
}
.team-card .flag { font-size: 32px; line-height: 1; }
.team-card .info { flex: 1; min-width: 0; }
.team-card .nm { font-weight: 700; font-size: 16px; }
.team-card .sub { font-size: 12px; color: var(--muted); }
.team-card .wodd { text-align: right; }
.team-card .wodd .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.team-card .wodd .l { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Gruppen ---------- */
.group-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.group-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.group-letter { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.group-hint { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.grp-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.grp-row:last-child { border-bottom: 0; }
.grp-flag { font-size: 22px; line-height: 1; }
.grp-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-res { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.grp-odds { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 15px; min-width: 48px; text-align: right; }
.rb {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rb.W { background: rgba(19, 138, 54, 0.14); color: var(--good); }
.rb.D { background: var(--paper-2); color: var(--muted); }
.rb.L { background: rgba(230, 0, 126, 0.1); color: var(--accent); }
.rb.none { color: var(--line); font-weight: 400; }

/* Offizielle Gruppentabellen */
.group-grid.wide { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.crest { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.crest-fallback { font-size: 18px; }
.standings { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  font-weight: 700; padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); background: var(--paper);
}
.standings th.tl { text-align: left; padding-left: 16px; }
.standings td { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.standings tbody tr:last-child td { border-bottom: 0; }
.standings .pos { color: var(--muted); font-weight: 700; width: 26px; }
.standings .tcell { text-align: left; padding-left: 16px; display: flex; align-items: center; gap: 9px; }
.standings .tname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.standings .wdl { color: var(--muted); }
.standings .gd { color: var(--muted); }
.standings .pts { font-weight: 800; }
/* Top-2 = K.-o.-Qualifikation */
.standings tr.adv .pos { color: var(--good); }
.standings tr.adv { box-shadow: inset 3px 0 0 var(--good); }

/* ---------- Modal / Detailansicht ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 10, 0.45); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  border: 0; background: transparent; font-size: 26px; line-height: 1;
  cursor: pointer; color: var(--muted);
}
.modal-close:hover { color: var(--ink); }

.md-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.md-phase { font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.md-teams { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.md-team { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; flex: 1; }
.md-team.away { justify-content: flex-end; text-align: right; }
.md-flag { font-size: 30px; }
.md-vs { color: var(--muted); font-weight: 700; }

.md-probs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.pb { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; background: var(--paper-2); }
.pb span { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pb label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.md-note, .md-legend { font-size: 11px; color: var(--muted); margin: 8px 0 0; }

.md-tablewrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th {
  text-align: right; font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); padding: 9px 12px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.md-table th:first-child { text-align: left; }
.md-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.md-table tbody tr:last-child td { border-bottom: 0; }
.md-table .bk { font-weight: 600; }
.md-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.md-table .num.is-best { color: var(--accent); font-weight: 800; }
.md-table .num.is-out { color: var(--line); text-decoration: line-through; }

.md-legend { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; }
.lg.best { background: var(--accent); }
.lg.out { background: var(--line); }

/* ---------- States ---------- */
.empty, .loading, .errorbox {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.errorbox { color: var(--accent); }
.skeleton {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 150px;
  background: linear-gradient(90deg, var(--paper-2) 25%, #ececec 37%, var(--paper-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px clamp(18px, 5vw, 56px);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.site-footer .dot { opacity: 0.5; }

@media (max-width: 560px) {
  /* Header kompakter, Badge bricht nicht um */
  .site-header { padding: 14px 16px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-divider { display: none; }
  .brand-logo { height: 22px; }
  .brand-title { font-size: 12px; letter-spacing: 0.08em; }
  .brand-badge { font-size: 10px; padding: 6px 10px; white-space: nowrap; gap: 7px; }
  .badge-stripe { width: 16px; height: 7px; }

  .controls { flex-direction: column; align-items: stretch; }
  /* Suchfeld: feste Höhe nach Inhalt – sonst wird die flex-basis im
     Spalten-Layout zur Höhe und das zentrierte Such-Icon rutscht nach unten. */
  .search-wrap { flex: 0 0 auto; width: 100%; }
  /* Tabs als 2-spaltiges Raster statt einer überlaufenden Zeile */
  .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .tab { padding: 10px 8px; font-size: 13px; text-align: center; white-space: nowrap; }
  /* Ungerade Tab-Zahl: letzter Tab über beide Spalten, damit keine Lücke bleibt */
  .tab:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Tabellen auf Mobile einspaltig + kompakter */
  .group-grid.wide { grid-template-columns: 1fr; }
  .standings th, .standings td { padding: 8px 4px; }
  .standings .tcell, .standings th.tl { padding-left: 10px; }
  .standings .tname { max-width: 92px; }
}
