/* ──────────────────────────────────────────────────────
   WM 2026 Web — style.css
   Palette: Deep Forest Green + WM Gold
   ────────────────────────────────────────────────────── */

:root {
  --bg:           #0b1a10;
  --surface:      #122018;
  --surface-2:    #192d21;
  --border:       #223a2a;
  --accent:       #c9a227;
  --accent-dim:   #7a6118;
  --accent-glow:  rgba(201, 162, 39, 0.12);
  --text:         #ddeee2;
  --text-muted:   #638a6b;
  --live:         #ff4545;
  --live-bg:      rgba(255, 69, 69, 0.07);
  --done-bg:      rgba(50, 75, 56, 0.4);
  --radius:       10px;
  --radius-sm:    7px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  gap: 16px;
}

.brand {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent) !important;
  text-decoration: none !important;
  white-space: nowrap;
  letter-spacing: -0.3px;
}

nav {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
nav::-webkit-scrollbar { display: none; }

nav a {
  color: var(--text-muted);
  text-decoration: none !important;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
nav a:hover  { background: var(--surface-2); color: var(--text); }
nav a.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }

/* ── Main & Footer ── */
main { flex: 1; padding: 28px 0 48px; }

footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
footer a { color: var(--accent); }

/* ── Page heading ── */
.page-title {
  font-size: 23px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.4px;
}
.page-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

/* ── Pills ── */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  vertical-align: middle;
}

.pill-live {
  background: var(--live-bg);
  color: var(--live);
  border: 1px solid rgba(255, 69, 69, 0.45);
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.pill-ft  { background: var(--done-bg); color: var(--text-muted); }
.pill-ns  { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(201,162,39,0.3); }

/* ── Date separator ── */
.date-group  { margin-bottom: 28px; }
.date-label  {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Match Card ── */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.match-card:hover { border-color: var(--accent-dim); }

.match-card.is-live {
  border-color: rgba(255, 69, 69, 0.55);
  background: color-mix(in srgb, var(--surface) 91%, var(--live));
}
.match-card.is-done { opacity: 0.82; }

.match-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
  gap: 8px;
  flex-wrap: wrap;
}
.match-header-left  { display: flex; align-items: center; gap: 8px; }
.match-stage        { font-size: 12px; color: var(--text-muted); }
.match-venue        { font-size: 11.5px; color: var(--text-muted); text-decoration: none; }
a.match-venue:hover { color: var(--accent); text-decoration: underline; }

.match-teams {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
}
.team-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }
.team-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.team.team-away {
  flex-direction: row-reverse;
  text-align: right;
}

.match-score-block {
  min-width: 68px;
  text-align: center;
  flex-shrink: 0;
}
.score-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
  line-height: 1;
  display: block;
}
.score-value.pending {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}
.score-minute {
  font-size: 11px;
  color: var(--live);
  font-weight: 700;
  margin-top: 3px;
  display: block;
}

/* ── Spielplan Filter ── */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 140px;
}
.filter-group label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

select {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 30px 8px 10px;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath fill='%23638a6b' d='M0 0l5.5 7L11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  width: 100%;
}
select:focus { outline: none; border-color: var(--accent-dim); }

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.btn {
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.btn-primary  { background: var(--accent); color: #0b1a10; }
.btn-primary:hover { background: #dbbb30; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.filter-result-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Filter Toggle (Checkbox) ── */
.filter-toggle {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.toggle-label:hover { color: var(--text); }

.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Standings Tables ── */

/* Single-column stack — Gruppen A → B → C … klar nacheinander */
.groups-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Auf größeren Bildschirmen 2 Spalten nebeneinander */
@media (min-width: 700px) {
  .groups-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.group-card-title {
  background: var(--surface-2);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.standings-table th {
  padding: 8px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.standings-table th.th-team { text-align: left; padding-left: 14px; min-width: 120px; }

.standings-table td {
  padding: 9px 8px;
  text-align: center;
  border-bottom: 1px solid rgba(34, 58, 42, 0.45);
}
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: rgba(25, 45, 33, 0.5); }

/* Top-2 advance — gold left border */
.standings-table tr.rank-advance td:first-child {
  border-left: 3px solid var(--accent);
}
/* 3rd place playoff */
.standings-table tr.rank-playoff td:first-child {
  border-left: 3px solid var(--accent-dim);
}

.td-team {
  text-align: left;
  padding-left: 12px !important;
}
.team-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.td-pts {
  font-weight: 800;
  color: var(--accent);
  font-size: 14px;
}
.td-gd {
  color: var(--text-muted);
}

/* ── Leaderboard ── */
.lb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lb-card-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.lb-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}
.leaderboard-table th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table th.th-right { text-align: right; }

.leaderboard-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(34, 58, 42, 0.4);
  vertical-align: middle;
}
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:hover td { background: var(--surface-2); }

.lb-rank  { font-weight: 800; font-size: 16px; color: var(--text-muted); width: 42px; }
.lb-name-cell { }
.lb-name  { font-weight: 600; font-size: 15px; }
.lb-country { font-size: 14px; margin-left: 4px; }
.lb-pts   { font-weight: 800; color: var(--accent); font-size: 18px; text-align: right; }
.lb-cnt   { color: var(--text-muted); font-size: 13px; text-align: right; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}
.empty-icon { font-size: 44px; display: block; margin-bottom: 14px; }
.empty-text { font-size: 15px; }

/* ── Responsive ── */
@media (max-width: 480px) {
  .team-name     { max-width: 90px; }
  .score-value   { font-size: 22px; }
  .match-card    { padding: 12px 12px; }
  .groups-grid   { grid-template-columns: 1fr; }
  .match-venue   { display: none; }
  .filter-bar    { gap: 10px; }
}

@media (min-width: 640px) {
  .match-venue { display: block; }
}
