/* ============================================================
   WM 2026 — Stadion bei Flutlicht
   Fonts: Anton (Display) · Archivo (UI) · Chivo Mono (Scores)
   ============================================================ */

:root {
  --bg: #0a120d;
  --panel: #121d15;
  --panel-2: #16241b;
  --line: rgba(220, 255, 235, 0.09);
  --text: #edf6ee;
  --muted: #8da899;
  --volt: #d6ff3b;
  --volt-dim: rgba(214, 255, 59, 0.14);
  --red: #ff4d3d;
  --radius: 14px;
  --font-display: "Anton", sans-serif;
  --font-body: "Archivo", sans-serif;
  --font-mono: "Chivo Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button { touch-action: manipulation; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* --- Atmosphäre ------------------------------------------- */

.noise {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.floodlight {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -120px, rgba(214, 255, 59, 0.10), transparent 70%),
    radial-gradient(700px 500px at 100% 0%, rgba(120, 220, 170, 0.05), transparent 65%);
}

/* --- Hero --------------------------------------------------- */

.hero {
  position: relative;
  padding: 56px 20px 36px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-inner {
  position: relative; z-index: 2;
  max-width: 860px; margin: 0 auto;
}

.watermark {
  position: absolute;
  top: -38px; right: -16px;
  font-family: var(--font-display);
  font-size: clamp(120px, 24vw, 240px);
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(220, 255, 235, 0.07);
  letter-spacing: 0.02em;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  animation: rise 0.6s ease both;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(64px, 12vw, 128px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  animation: rise 0.6s 0.08s ease both;
}

.hero h1 .volt { color: var(--volt); }

.hero h1 .byline {
  font-family: var(--font-mono);
  font-size: clamp(17px, 2.8vw, 24px);
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--text);
  margin-left: 16px;
  vertical-align: super;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 16px;
  background: rgba(18, 29, 21, 0.7);
}

.sub {
  margin-top: 12px;
  color: var(--muted);
  font-size: clamp(14px, 2.4vw, 17px);
  max-width: 56ch;
  animation: rise 0.6s 0.16s ease both;
}

.meta-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 20px;
  animation: rise 0.6s 0.24s ease both;
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 29, 21, 0.7);
}

.pill b { color: var(--volt); font-weight: 700; }
.pill-muted { color: var(--muted); }

#pill-live { border-color: rgba(255, 77, 61, 0.5); }
#pill-live b { color: var(--red); }

.pitch-deco {
  position: absolute; right: 0; top: 0; height: 100%; z-index: 1;
  color: rgba(220, 255, 235, 0.06);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* --- Filterleiste ------------------------------------------ */

.bar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 18, 13, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar-inner {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.chip:hover { border-color: rgba(214, 255, 59, 0.5); }
.chip:active { transform: scale(0.96); }

.chip.is-active {
  background: var(--volt);
  border-color: var(--volt);
  color: #0a120d;
}

.chip.is-active .dot-sm { background: var(--red); box-shadow: none; }

/* --- Custom-Dropdowns ---------------------------------------- */

.dd { position: relative; flex: 0 1 auto; min-width: 148px; }
.dd-wide { flex: 1; min-width: 190px; }

.dd-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.15s;
}

.dd-btn::after {
  content: "";
  flex: 0 0 auto;
  width: 11px; height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%23d6ff3b' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.2s ease;
}

.dd-btn:hover { border-color: rgba(214, 255, 59, 0.5); }
.dd.is-open .dd-btn { border-color: var(--volt); }
.dd.is-open .dd-btn::after { transform: rotate(180deg); }
.dd.has-value .dd-btn {
  border-color: var(--volt);
  color: var(--volt);
  background: var(--volt-dim);
}

.dd-menu {
  position: absolute;
  top: calc(100% + 8px); left: 0;
  min-width: 100%;
  width: max-content; max-width: min(280px, calc(100vw - 32px));
  background: #131f17;
  border: 1px solid rgba(214, 255, 59, 0.25);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.3);
  z-index: 90;
  animation: dd-in 0.16s ease;
}

@keyframes dd-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.dd-list {
  max-height: 300px;
  overflow-y: auto;
  display: grid; gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 255, 59, 0.35) transparent;
}

.dd-list::-webkit-scrollbar { width: 6px; }
.dd-list::-webkit-scrollbar-thumb { background: rgba(214, 255, 59, 0.3); border-radius: 99px; }
.dd-list::-webkit-scrollbar-track { background: transparent; }

.dd-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  text-align: left;
  font-family: var(--font-body); font-weight: 500; font-size: 13.5px;
  color: var(--text);
  background: none;
  border: none;
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.1s;
}

.dd-item:hover { background: rgba(214, 255, 59, 0.12); color: var(--volt); }

.dd-item.is-selected {
  background: var(--volt);
  color: #0a120d;
  font-weight: 700;
}

.dd-item .dd-hint {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.dd-item.is-selected .dd-hint, .dd-item:hover .dd-hint { color: inherit; }

.dd-search {
  width: 100%;
  font-family: var(--font-body); font-size: 13.5px;
  color: var(--text);
  background: rgba(10, 18, 13, 0.8);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.dd-search:focus { outline: none; border-color: var(--volt); }
.dd-search::placeholder { color: var(--muted); }

.dd-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.reload {
  font-size: 18px; line-height: 1;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--volt);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.4s ease, border-color 0.15s;
}

.reload:hover { border-color: var(--volt); }
.reload.spinning { transform: rotate(360deg); }

/* --- Live-Punkt --------------------------------------------- */

.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255, 77, 61, 0.6);
  animation: pulse 1.6s infinite;
}

.dot-sm { width: 7px; height: 7px; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(255, 77, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0); }
}

/* --- Liste --------------------------------------------------- */

#app {
  position: relative; z-index: 2;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* --- Spotlight: aktuelles / nächstes Spiel ------------------- */

#feature { display: grid; gap: 12px; margin-bottom: 34px; }

.fcard {
  position: relative;
  border-radius: 18px;
  padding: 20px 24px;
  border: 1px solid var(--volt-dim);
  background:
    radial-gradient(600px 200px at 50% -60px, rgba(214, 255, 59, 0.10), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
}

.fcard.is-live {
  border-color: rgba(255, 77, 61, 0.45);
  background:
    radial-gradient(600px 200px at 50% -60px, rgba(255, 77, 61, 0.14), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  animation: live-glow 2.4s ease-in-out infinite;
}

@keyframes live-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 61, 0.0), 0 14px 40px rgba(0, 0, 0, 0.4); }
  50%      { box-shadow: 0 0 24px 2px rgba(255, 77, 61, 0.18), 0 14px 40px rgba(0, 0, 0, 0.4); }
}

.f-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 14px;
}

.f-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--volt);
}

.is-live .f-status { color: var(--red); }

.f-round {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}

.f-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.f-team {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}

.f-team.f-right { justify-content: flex-end; text-align: right; }

.f-team img {
  width: 42px; height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  flex: 0 0 auto;
}

.f-team .f-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 3.4vw, 30px);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.f-mid { text-align: center; }

.f-score {
  font-family: var(--font-mono);
  font-size: clamp(34px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.is-live .f-score { color: var(--red); text-shadow: 0 0 24px rgba(255, 77, 61, 0.35); }
.fcard:not(.is-live) .f-score { color: var(--volt); }

.f-countdown {
  margin-top: 6px;
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.f-bottom {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
}

.f-bottom .stadium { color: var(--text); font-weight: 600; }

@media (max-width: 560px) {
  .fcard { padding: 16px; }
  .f-main { gap: 10px; }
  .f-team { flex-direction: column; align-items: flex-start; gap: 6px; }
  .f-team.f-right { align-items: flex-end; }
  .f-team img { width: 32px; height: 32px; }
}

.day { margin-bottom: 34px; }

.day-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.day-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.day-head .count {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--muted);
}

.day.is-today .day-head h2 { color: var(--volt); }

.matches { display: grid; gap: 10px; }

/* --- Match-Karte --------------------------------------------- */

.match {
  position: relative;
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.match:hover {
  transform: translateY(-2px);
  border-left-color: var(--volt);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.match.is-live {
  border-color: rgba(255, 77, 61, 0.4);
  border-left: 3px solid var(--red);
  background:
    linear-gradient(180deg, rgba(255, 77, 61, 0.06), transparent 60%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}

.match.is-finished { opacity: 0.82; }
.match.is-finished:hover { opacity: 1; }

.when {
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
  border-right: 1px solid var(--line);
  padding-right: 14px;
}

.when .time {
  font-family: var(--font-mono);
  font-size: 21px; font-weight: 700;
  color: var(--volt);
  letter-spacing: 0.02em;
}

.when .status {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted);
}

.is-live .when .status {
  color: var(--red);
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700;
}

.teams { display: grid; gap: 6px; align-content: center; }

.team-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
}

.team-row img {
  width: 24px; height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.team-row .name { font-weight: 600; font-size: 15.5px; }
.team-row.winner .name { color: var(--volt); }

.team-row .score {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
  min-width: 28px; text-align: right;
  font-variant-numeric: tabular-nums;
}

.team-row .score.empty { color: var(--muted); font-weight: 400; }

.where {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 4px; padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.where .stadium { color: var(--text); font-weight: 500; }

.tags {
  margin-left: auto;
  display: inline-flex;
  gap: 6px;
}

.tag {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.tag-group { color: var(--volt); border-color: var(--volt-dim); }

/* --- Zustände ------------------------------------------------ */

.state {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
  display: grid; gap: 16px; justify-items: center;
}

.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--volt);
  animation: spin 0.9s linear infinite;
}

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

/* --- Footer -------------------------------------------------- */

footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* --- Mobil & Tablet ------------------------------------------ */

@media (max-width: 720px) {
  /* Filterleiste: Chips + Reload oben, Land volle Breite, Gruppe/Phase halbe Breite */
  .bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    grid-template-areas:
      "chips chips reload"
      "team  team  team"
      "group phase phase";
    gap: 8px;
    padding: 10px 14px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .chips {
    grid-area: chips;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  .reload { grid-area: reload; }
  #dd-team { grid-area: team; }
  #dd-group { grid-area: group; }
  #dd-phase { grid-area: phase; }
  .dd, .dd-wide { min-width: 0; }

  /* Touch-Targets: mindestens 42px hoch */
  .chip, .dd-btn { min-height: 42px; }
  .reload { width: 42px; height: 42px; }
  .dd-item { min-height: 42px; }
  /* iOS: kein Auto-Zoom beim Fokus der Suche */
  .dd-search { font-size: 16px; }
}

@media (max-width: 560px) {
  .hero {
    padding: 36px 16px 24px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .watermark { top: -20px; right: -24px; opacity: 0.7; }
  .hero h1 .byline {
    font-size: 14px;
    margin-left: 10px;
    padding: 3px 10px;
    vertical-align: middle;
  }
  .meta-pills { margin-top: 14px; }
  .pill { font-size: 11.5px; padding: 5px 10px; }

  #app { padding: 16px 14px 48px; }

  .day-head h2 { font-size: 18px; }

  .match { grid-template-columns: 58px 1fr; gap: 12px; padding: 13px 14px; }
  .when { padding-right: 10px; }
  .when .time { font-size: 16px; }
  .when .status { font-size: 10px; }
  .team-row { grid-template-columns: 22px 1fr auto; gap: 8px; }
  .team-row img { width: 20px; height: 20px; }
  .team-row .name { font-size: 14px; }
  .team-row .score { font-size: 18px; }
  .where { font-size: 12px; gap: 6px; }
  .tags { margin-left: 0; width: 100%; }

  footer {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
