/* ===================================================================
   Kopfleiste und Navigation

   Liegt durchsichtig über dem Hero und wird danach grün hinterlegt.
   Auf dem Handy wird aus der Navigation eine Schublade mit
   Aufklappmenüs — sichtbar sind dort nur die Hauptpunkte.
   =================================================================== */

:root {
  --kopf-hoehe: 88px;

  /* Eigene Farbabstufungen für die Leiste. Aus dem Vereinsgrün #004824
     aufgehellt und abgedunkelt — eine einzelne flache Fläche wirkt
     billig, ein leichter Verlauf gibt der Leiste Tiefe. */
  --leiste-oben:  #00552d;
  --leiste-unten: #003b1d;
  --menue-oben:   #0a3d22;
  --menue-unten:  #04260f;
  --akzent:       #8ee0ad;
}

.kopfleiste {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: transparent;
  transition: background .32s ease, box-shadow .32s ease;
}

/* Verlauf statt flächiger Abdunklung: das Foto bleibt sichtbar,
   die weiße Schrift trägt trotzdem (siehe Bildüberlagerungen). */
.kopfleiste::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0, 14, 7, .55), rgba(0, 14, 7, 0));
  pointer-events: none;
  transition: opacity .32s ease;
}

.kopfleiste.fest {
  background: linear-gradient(to bottom, var(--leiste-oben), var(--leiste-unten));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset,
              0 10px 34px rgba(0, 0, 0, .16);
}
.kopfleiste.fest::before { opacity: 0; }

/* Über hellem Laub im Video verschwand die Menüschrift fast. Am Desktop
   deshalb ein etwas tieferer, dunklerer Verlauf und ein weicher Schatten
   hinter der Schrift — dezent, und nur solange der Kopf durchsichtig ist. */
@media (min-width: 1101px) {
  .kopfleiste:not(.fest)::before {
    bottom: -36px;
    background: linear-gradient(to bottom, rgba(0, 14, 7, .62), rgba(0, 14, 7, .28) 60%, rgba(0, 14, 7, 0));
  }
  .kopfleiste:not(.fest) .punkt > a { text-shadow: 0 1px 10px rgba(0, 0, 0, .55), 0 0 2px rgba(0, 0, 0, .25); }
}

.kopfleiste .innen {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 46px);
  height: var(--kopf-hoehe);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

/* ---------- Wortmarke ---------- */

.marke-link { display: flex; align-items: center; gap: clamp(10px, 1.2vw, 16px); text-decoration: none; flex: none; }
.marke-link img {
  width: clamp(38px, 4vw, 54px);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45));
  transition: transform .25s ease;
}
.marke-link:hover img { transform: scale(1.04); }
.marke-wort {
  color: #fff;
  font-size: clamp(.58rem, .7vw, .68rem);
  font-weight: 600;
  line-height: 1.8;
  letter-spacing: .26em;
  text-transform: uppercase;
}

/* ===================================================================
   Navigation — Desktop
   =================================================================== */

.hauptnav { margin-left: auto; display: flex; align-items: center; gap: clamp(2px, .6vw, 10px); }

.punkt { position: relative; }

.punkt > a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 30px clamp(8px, .9vw, 14px) 28px;
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: clamp(.72rem, .82vw, .78rem);
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .2s ease;
}
.punkt > a:hover,
.punkt:focus-within > a { color: #fff; }

/* Aktivmarkierung und Hover-Unterstrich wachsen aus der Mitte */
.punkt > a::after {
  content: "";
  position: absolute;
  left: clamp(8px, .9vw, 14px); right: clamp(8px, .9vw, 14px);
  bottom: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--akzent);
  transform: scaleX(0);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
}
.punkt:hover > a::after,
.punkt:focus-within > a::after { transform: scaleX(1); }
.punkt > a.aktiv { color: #fff; }
.punkt > a.aktiv::after { transform: scaleX(1); background: #fff; }

/* Pfeil nur bei Punkten mit Untermenü — die Klasse setzt kopf.js */
.punkt.hat-unter > a::before {
  content: "";
  order: 2;
  width: 7px; height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .6;
  transition: transform .26s ease, opacity .2s ease;
}
/* ---------- Untermenü: gemeinsame Grundlagen ----------
   Hier steht bewusst KEINE Positionierung und kein Ein-/Ausblenden.
   Genau das unterscheidet sich zwischen Desktop (schwebende Klappe)
   und Handy (aufklappende Liste) grundlegend und gehoert deshalb je
   in eine eigene Medienabfrage. Alles Gemeinsame steht hier — sonst
   fehlen dem Handy Grundregeln wie `list-style` oder der Punkt. */

.unter { list-style: none; margin: 0; }

.unter a {
  display: block;
  position: relative;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}

/* Aufzählungspunkt, der beim Überfahren in der Akzentfarbe aufleuchtet */
.unter a::before {
  content: "";
  position: absolute;
  left: 12px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  transition: background .18s ease, transform .18s ease;
}

/* ---------- Aufklappmenü (nur Desktop) ----------
   WICHTIG: Der gesamte Block steht in einer Medienabfrage. Stand er
   global, griffe `transform: translate(-50%, 0)` beim Überfahren auch
   auf dem Handy — dort ist das Untermenü aber `position: static`, und
   die Verschiebung um die halbe Breite schöbe es aus dem Bild. Genau
   dieser Fehler liess das Menue beim Hovern "verschwinden". */

@media (min-width: 1101px) {

  .unter {
    position: absolute;
    top: 100%; left: 50%;
    min-width: 248px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: linear-gradient(to bottom, var(--menue-oben), var(--menue-unten));
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    box-shadow: 0 26px 60px -12px rgba(0, 0, 0, .5);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    /* Verzögertes Schließen: wer diagonal zum Untermenü zieht, verliert es nicht */
    transition: opacity .2s ease .12s, transform .2s ease .12s, visibility .2s .12s;
  }

  /* Unsichtbare Brücke zwischen Menüpunkt und Klappe. Ohne sie reißt der
     Hover in der Lücke ab und das Menü flackert beim Hinuntergehen. */
  .unter::before {
    content: "";
    position: absolute;
    top: -14px; left: 0; right: 0;
    height: 14px;
  }

  .punkt:hover > .unter,
  .punkt:focus-within > .unter {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: 0s;
  }

  /* Pfeil dreht sich nur dort, wo Hover das Menü auch wirklich öffnet */
  .punkt.hat-unter:hover > a::before,
  .punkt.hat-unter:focus-within > a::before {
    transform: translateY(0) rotate(-135deg);
    opacity: 1;
  }

  .unter a {
    padding: 10px 14px 10px 26px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .82);
    font-size: .92rem;
    white-space: nowrap;
  }
  .unter a:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
    padding-left: 30px;
  }
  .unter a:hover::before { background: var(--akzent); transform: scale(1.4); }
}

/* ---------- Suche ---------- */

.suche {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  color: rgba(255, 255, 255, .9);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.suche:hover { background: rgba(255, 255, 255, .18); color: #fff; transform: scale(1.06); }
.suche:active { transform: scale(.96); }
.suche svg { width: 17px; height: 17px; }

/* ---------- Umschalter ---------- */

.burger {
  display: none;
  flex: none;
  width: 44px; height: 44px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background .2s ease;
}
.burger:hover { background: rgba(255, 255, 255, .16); }
.burger span {
  position: absolute;
  left: 50%; top: 50%;
  width: 19px; height: 2px;
  margin-left: -9.5px;
  border-radius: 2px;
  background: #fff;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .2s ease;
}
.burger span:nth-child(1) { transform: translateY(-7px); }
.burger span:nth-child(2) { transform: translateY(0); }
.burger span:nth-child(3) { transform: translateY(7px); }
.burger.auf span:nth-child(1) { transform: translateY(0) rotate(45deg); }
.burger.auf span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.burger.auf span:nth-child(3) { transform: translateY(0) rotate(-45deg); }

/* Abdunklung hinter der Schublade */
.menue-schatten {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 10, 5, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
}
.menue-schatten.an { opacity: 1; visibility: visible; }

/* Seiten ohne Hero brauchen Abstand unter der festen Leiste */
body:not(.hat-hero) { padding-top: var(--kopf-hoehe); }

/* ===================================================================
   Navigation — Handy und Tablet
   =================================================================== */

@media (max-width: 1100px) {
  :root { --kopf-hoehe: 68px; }

  .burger { display: block; margin-left: auto; }
  /* Lupe bleibt sichtbar, rechts direkt vor dem Menüknopf */
  .suche { order: 2; margin-left: auto; }
  .burger { order: 3; margin-left: 10px; }

  .hauptnav {
    position: fixed;
    top: var(--kopf-hoehe);
    right: 0;
    width: min(400px, 100%);
    height: calc(100dvh - var(--kopf-hoehe));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 14px 0 max(34px, env(safe-area-inset-bottom));
    display: block;
    z-index: 58;

    background: linear-gradient(to bottom, var(--menue-oben), var(--menue-unten));
    border-left: 1px solid rgba(255, 255, 255, .1);
    box-shadow: -18px 0 50px -14px rgba(0, 0, 0, .55);

    transform: translateX(100%);
    visibility: hidden;
    transition: transform .34s cubic-bezier(.4, 0, .2, 1), visibility .34s;
  }
  .hauptnav.offen { transform: translateX(0); visibility: visible; }

  .punkt { border-bottom: 1px solid rgba(255, 255, 255, .07); }
  .punkt:last-child { border-bottom: 0; }

  /* Hauptpunkt: großzügige Tippfläche, Trennlinie, Akzentbalken wenn aktiv */
  .punkt > a {
    padding: 0 22px;
    min-height: 56px;
    font-size: .8rem;
    letter-spacing: .13em;
    color: rgba(255, 255, 255, .92);
    border-left: 3px solid transparent;
    transition: background .18s ease, border-color .18s ease;
  }
  .punkt > a:active { background: rgba(255, 255, 255, .07); }
  .punkt > a.aktiv { border-left-color: var(--akzent); background: rgba(255, 255, 255, .05); }
  .punkt > a::after { display: none; }

  /* Der Pfeil sitzt rechts und dreht sich beim Aufklappen */
  .punkt.hat-unter > a::before {
    margin-left: auto;
    width: 8px; height: 8px;
    border-width: 2px;
    transform: translateY(-2px) rotate(45deg);
  }
  .punkt.hat-unter.offen > a::before {
    transform: translateY(2px) rotate(-135deg);
    opacity: 1;
  }
  .punkt.hat-unter.offen > a { background: rgba(255, 255, 255, .05); }

  /* Untermenü: geschlossen, klappt per Höhe auf — kein Springen */
  .unter {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, .22);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4, 0, .2, 1);
  }
  .unter::before { display: none; }
  .punkt.hat-unter.offen > .unter { max-height: var(--hoehe, 420px); }

  .unter li:first-child a { padding-top: 12px; }
  .unter li:last-child  a { padding-bottom: 14px; }

  .unter a {
    padding: 9px 22px 9px 44px;
    border-radius: 0;
    font-size: .9rem;
    color: rgba(255, 255, 255, .72);
    white-space: normal;
  }
  .unter a::before { left: 26px; }
  .unter a:hover, .unter a:active {
    padding-left: 44px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
  }
  .unter a:hover::before, .unter a:active::before {
    background: var(--akzent);
    transform: scale(1.4);
  }
}

/* Schmale Geräte: Schublade über die volle Breite */
@media (max-width: 480px) {
  .hauptnav { width: 100%; border-left: 0; }
  .marke-wort { letter-spacing: .2em; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .kopfleiste, .kopfleiste::before, .hauptnav, .unter, .punkt > a,
  .punkt > a::after, .punkt.hat-unter > a::before, .burger span,
  .marke-link img, .suche, .menue-schatten {
    transition: none !important;
  }
}

/* ===================================================================
   Handy-Schublade im Stil der Glaskarten (28.09.2026)

   Dieselbe Bildsprache wie Spielzentrale und Kennzahlen: Sinnbild in
   hellgrün mittig in einem halbdurchsichtigen Kreis, Untermenüs als
   Glaskacheln, unten das nächste Spiel. Auf dem Desktop bleibt alles,
   wie es war — Sinnbilder und Spielkarte gibt es dort nicht.
   =================================================================== */

.nav-sinnbild,
.menue-spiel { display: none; }

@media (max-width: 1100px) {

  .hauptnav { padding-top: 10px; }
  .punkt { border-bottom-color: rgba(255, 255, 255, .06); }

  /* Hauptpunkt: Sinnbild + Wort in normaler Schreibweise */
  .punkt > a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 0 20px 0 17px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
  }

  .nav-sinnbild {
    flex: none;
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--akzent);
    transition: background .18s ease, color .18s ease;
  }
  .nav-sinnbild svg { width: 19px; height: 19px; }

  .punkt > a.aktiv .nav-sinnbild,
  .punkt.hat-unter.offen > a .nav-sinnbild {
    background: var(--akzent);
    color: #0b2b19;
  }

  /* Untermenü als Raster aus Glaskacheln. Der Innenabstand kommt erst
     beim Aufklappen dazu — geschlossen muss die Klappe wirklich 0 hoch
     sein. Die gemessene Höhe (kopf.js) kennt diesen Abstand noch nicht,
     deshalb bekommt max-height einen Zuschlag. */
  .unter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: transparent;
    padding: 0 18px 0 69px;
  }
  .punkt.hat-unter.offen > .unter {
    max-height: calc(var(--hoehe, 420px) + 40px);
    padding-top: 4px;
    padding-bottom: 16px;
  }

  .unter li:first-child a,
  .unter li:last-child a,
  .unter a,
  .unter a:hover,
  .unter a:active {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: .88rem;
    line-height: 1.25;
  }
  .unter a {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    color: rgba(255, 255, 255, .85);
  }
  .unter a:hover, .unter a:active {
    background: rgba(142, 224, 173, .14);
    border-color: rgba(142, 224, 173, .4);
    color: #fff;
  }
  .unter a::before { display: none; }

  /* Nächstes Spiel am Ende der Schublade */
  .menue-spiel {
    display: block;
    margin: 22px 18px 0;
    padding: 14px 16px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    text-decoration: none;
  }
  .menue-spiel:active { background: rgba(255, 255, 255, .1); }

  .ms-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .ms-label {
    font-size: .64rem; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase;
    color: var(--akzent);
  }
  .ms-marke {
    font-size: .72rem; font-weight: 700;
    padding: 3px 10px; border-radius: 99px;
    background: var(--akzent); color: #0b2b19;
  }

  .ms-tafel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }
  .ms-team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
  .ms-wappen {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
  }
  .ms-wappen img { width: 27px; height: 27px; object-fit: contain; }
  .ms-wappen b { color: rgba(255, 255, 255, .7); }
  .ms-team.ist-wir .ms-wappen { background: rgba(142, 224, 173, .16); box-shadow: 0 0 0 2px var(--akzent) inset; }
  .ms-name { font-size: .78rem; line-height: 1.2; color: rgba(255, 255, 255, .75); overflow-wrap: anywhere; }
  .ms-team.ist-wir .ms-name { color: #fff; font-weight: 700; }
  .ms-zeit { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }

  .ms-fuss {
    display: block;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .78rem;
    color: rgba(255, 255, 255, .65);
    text-align: center;
  }
}
