/* =========================================================================
   Admin-Bereich /admin/ — Anmeldung und Besucherstatistik
   Baut auf stil.css auf (Farben, Schriften, Knöpfe) und gilt nur für die
   Admin-Seite (body.ist-admin). Keine Animationen, kein Hintergrund.

   Diagrammfarben je Seite: Schritte aus der geprüften Referenzpalette,
   validiert für die Kartenfläche #1a1414 in genau dieser Reihenfolge
   (Helligkeitsband, Sättigung, Farbfehlsicht, Kontrast: alles bestanden).
   Reihenfolge und Werte nur zusammen mit einer neuen Prüfung ändern.
   ========================================================================= */

[hidden] { display: none !important; }

.ist-admin {
  --s-draco:   #d95926;
  --s-wardogs: #3987e5;
  --s-pz:      #c98500;
  --s-meccha:  #199e70;

  --a-flaeche: var(--karte);
  --a-gitter:  #2a2222;
  --a-achse:   #3a3030;
  --a-mehr:    #46d67f;
}

.a-bahn { width: min(100% - 2rem, var(--bahn)); margin-inline: auto; }

/* ------------------------------------------------------------- Kopfzeile */

.a-kopf {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12,9,8,.92);
  border-bottom: 1px solid var(--rand);
  backdrop-filter: blur(8px);
}
.a-kopf-innen { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; }
.a-marke { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text-hell); }
.a-marke img { width: 40px; height: 40px; }
.a-marke strong { display: block; font: 700 1.05rem/1.1 var(--display); letter-spacing: .02em; }
.a-marke strong em { font-style: normal; color: var(--glut); }
.a-marke small { display: block; color: var(--text-leise); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.a-wer { display: flex; align-items: center; gap: .9rem; }
.a-wer-name { text-align: right; line-height: 1.25; color: var(--text-hell); font-weight: 500; }
.a-wer-name small { display: block; color: var(--text-leise); font-weight: 400; font-size: .78rem; }

/* ------------------------------------------------------------- Anmeldung */

.a-laden { color: var(--text-leise); margin: 18vh 0; text-align: center; }

.a-anmeldung {
  max-width: 560px; margin: 12vh auto 4rem;
  padding: 2.2rem 2.4rem;
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--rund);
}
.a-anmeldung h1 { font-size: 2.2rem; }
.a-meldung {
  padding: .8rem 1rem; border-radius: 8px;
  background: rgba(208,59,59,.12); border: 1px solid rgba(208,59,59,.45); color: var(--text-hell);
}
.a-klein { color: var(--text-leise); font-size: .88rem; }

/* ------------------------------------------------------------ Statistik */

.a-statistik { padding: 2.2rem 0 4rem; transition: opacity .15s; }
.a-statistik.laedt { opacity: .55; pointer-events: none; }

.a-titelzeile { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .4rem 2rem; }
.a-titelzeile .a-titel { margin-bottom: .2em; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.a-stand { color: var(--text-leise); font-size: .9rem; margin: 0 0 .6rem; }

.a-warnung {
  margin: 1rem 0 0; padding: .8rem 1rem; border-radius: 8px;
  background: rgba(240,180,41,.1); border: 1px solid rgba(240,180,41,.4); color: var(--text-hell);
}

/* Zeitraum: eine Reihe über allem, was sie betrifft */
.a-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1.4rem 0 1.6rem; }
.a-filter button {
  font: 500 .9rem/1 var(--schrift);
  padding: .6rem 1rem; border-radius: 999px; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid var(--rand-stark);
}
.a-filter button:hover { color: var(--text-hell); background: rgba(255,255,255,.05); }
.a-filter button[aria-pressed="true"] { color: #fff; background: rgba(255,74,43,.16); border-color: var(--glut); }

/* Kennzahlen je Seite */
.a-kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.a-kachel {
  padding: 1.1rem 1.25rem 1.2rem;
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--rund);
}
.a-kachel h3 { display: flex; align-items: center; gap: .55rem; font: 500 .95rem/1.3 var(--schrift); color: var(--text-hell); margin: 0 0 .6rem; }
.a-zahl { font: 600 2.6rem/1 var(--schrift); color: var(--text-hell); margin: 0; }
.a-zahl-text { color: var(--text-leise); font-size: .85rem; margin: .25rem 0 .7rem; }
.a-delta { font-size: .88rem; margin: 0 0 .25rem; color: var(--text-leise); }
.a-delta.ist-mehr { color: var(--a-mehr); }
.a-neben { color: var(--text-leise); font-size: .88rem; margin: 0; }

.a-punkt { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }

/* Karten */
.a-karte {
  margin-top: 1.4rem; padding: 1.3rem 1.4rem 1.2rem;
  background: var(--a-flaeche); border: 1px solid var(--rand); border-radius: var(--rund);
}
.a-karte h2 { font-size: 1.25rem; margin: 0; }
.a-karte-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.4rem; margin-bottom: .9rem; }
.a-karte > .a-klein { margin: -.4rem 0 .8rem; }

.a-legende { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .88rem; color: var(--text); }
.a-legende span { display: inline-flex; align-items: center; gap: .45rem; }
.a-legende strong { color: var(--text-hell); font-weight: 500; }

/* Diagramme (SVG) */
.a-diagramm { position: relative; min-height: 240px; }
.a-diagramm-flach { min-height: 200px; }
.a-svg { display: block; width: 100%; height: auto; overflow: visible; }
.a-svg:focus-visible { outline: 2px solid var(--glut-hell); outline-offset: 4px; }
.a-gitter { stroke: var(--a-gitter); stroke-width: 1; }
.a-achse { stroke: var(--a-achse); stroke-width: 1; }
.a-achsentext { fill: var(--text-leise); font: 400 12px var(--schrift); font-variant-numeric: tabular-nums; }
.a-trefffeld { fill: transparent; cursor: crosshair; }
.a-spalte.ist-aktiv .a-teil { filter: brightness(1.28); }
.a-spalte.ist-vorlaeufig .a-teil { opacity: .7; }
.a-leer { fill: var(--a-gitter); }

/* Farben je Seite: Flächen in SVG und HTML, color für Linien (Live-Ringe) */
.s-draco   { fill: var(--s-draco);   background: var(--s-draco);   color: var(--s-draco); }
.s-wardogs { fill: var(--s-wardogs); background: var(--s-wardogs); color: var(--s-wardogs); }
.s-pz      { fill: var(--s-pz);      background: var(--s-pz);      color: var(--s-pz); }
.s-meccha  { fill: var(--s-meccha);  background: var(--s-meccha);  color: var(--s-meccha); }
/* mehrere Seiten zusammen (Listen unter der Karte): keine Seitenfarbe vortäuschen */
.s-neutral { fill: #9a91a6; background: #9a91a6; color: #9a91a6; }

/* Schwebende Anzeige: Wert vorn, Name dahinter */
.a-tip {
  position: fixed; z-index: 60; pointer-events: none;
  min-width: 190px; max-width: 280px;
  padding: .65rem .8rem;
  background: var(--karte-hoch); border: 1px solid var(--rand-stark); border-radius: 8px;
  box-shadow: var(--schatten);
  font-size: .85rem; line-height: 1.45; color: var(--text);
}
.a-tip-titel { color: var(--text-leise); margin-bottom: .25rem; }
.a-tip-summe { color: var(--text-hell); font-weight: 600; margin-bottom: .3rem; }
.a-tip-zeile { display: grid; grid-template-columns: 14px 2.4em 1fr; align-items: center; gap: .45rem; }
.a-tip-zeile strong { color: var(--text-hell); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.a-tip-zeile.ohne-zahl { grid-template-columns: 14px 1fr; }
.a-tip-strich { height: 2px; border-radius: 1px; }

/* Tabellenansicht */
.a-tabelle { margin-top: .9rem; }
.a-tabelle summary { cursor: pointer; color: var(--text-leise); font-size: .88rem; }
.a-tabelle summary:hover { color: var(--text-hell); }
.a-tabelle-rahmen { overflow-x: auto; margin-top: .6rem; max-height: 420px; overflow-y: auto; }
.a-tabelle table { border-collapse: collapse; width: 100%; font-size: .86rem; font-variant-numeric: tabular-nums; }
.a-tabelle th, .a-tabelle td { padding: .35rem .7rem; text-align: right; border-bottom: 1px solid var(--rand); white-space: nowrap; }
.a-tabelle th:first-child, .a-tabelle td:first-child { text-align: left; }
.a-tabelle thead th { position: sticky; top: 0; background: var(--a-flaeche); color: var(--text-hell); font-weight: 500; }

/* Einzelne Seiten */
.a-seiten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 0 1.4rem; }
.a-seite h2 { display: flex; align-items: center; gap: .6rem; }
.a-seite > .a-neben { margin: .2rem 0 1rem; }
.a-block + .a-block { margin-top: 1.1rem; }
.a-block h3 { font: 500 .8rem/1.2 var(--schrift); text-transform: uppercase; letter-spacing: .08em; color: var(--text-leise); margin: 0 0 .5rem; }
.a-block p { margin: 0; color: var(--text-leise); font-size: .88rem; }

/* Waagerechte Balken: Name | Balken | Wert */
.a-balken { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 3.2em; align-items: center; gap: .35rem .7rem; font-size: .88rem; }
.a-balken-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.a-balken-spur { display: block; height: 10px; }
.a-balken-fuell { display: block; height: 10px; min-width: 2px; border-radius: 0 4px 4px 0; }
.a-balken-wert { text-align: right; color: var(--text-hell); font-variant-numeric: tabular-nums; }

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

.a-kartenwahl { display: flex; flex-wrap: wrap; gap: .4rem; }
.a-kartenwahl button, .a-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  font: 500 .85rem/1 var(--schrift);
  padding: .5rem .85rem; border-radius: 999px; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid var(--rand-stark);
}
.a-kartenwahl button:hover, .a-chip:hover { color: var(--text-hell); background: rgba(255,255,255,.05); }
.a-kartenwahl button[aria-pressed="true"] { color: #fff; background: rgba(255,74,43,.16); border-color: var(--glut); }
.a-kartenwahl strong { color: var(--text-hell); font-weight: 600; }
.a-live-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--a-mehr); flex: none; }
.a-karte-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .8rem; }
.a-chip[aria-pressed="false"] { color: var(--text-leise); border-style: dashed; }
.a-chip[aria-pressed="false"] .a-punkt { opacity: .35; }

.a-welt {
  position: relative; height: clamp(300px, 50vw, 520px);
  border-radius: 8px; overflow: hidden;
  background: #151010; border: 1px solid var(--rand);
}
/* Alle Gesten gehören der Karte (pan-y ließ den Browser senkrechte Zwei-Finger-Gesten als Scrollen
   abbrechen); weitergescrollt wird neben der Karte, darauf weist .a-welt-hinweis hin */
.a-welt-svg { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; }
.a-welt-svg:active { cursor: grabbing; }
.a-welt-svg:focus-visible { outline: 2px solid var(--glut-hell); outline-offset: -2px; }
.a-land { fill: #241d1c; stroke: #3b302d; stroke-width: 1; vector-effect: non-scaling-stroke; }
.a-land:hover { fill: #4a3c38; }
/* Länder mit Besuchern: ein Farbton, heller = mehr (1+, 5+, 25+, 100+). Gleich spezifisch wie
   .a-land:hover und danach: Die Stufe bleibt beim Überfahren und wird nur heller. */
.a-land.a-land-s1 { fill: #3a2a25; }
.a-land.a-land-s2 { fill: #53362d; }
.a-land.a-land-s3 { fill: #6e4434; }
.a-land.a-land-s4 { fill: #8c533c; }
.a-land[class*="a-land-s"]:hover { filter: brightness(1.18); }
.a-bundesland { fill: none; stroke: #3b302d; stroke-width: .6; vector-effect: non-scaling-stroke; pointer-events: none; }
.a-ort, .a-live { stroke: var(--a-flaeche); cursor: pointer; }
.a-ort:hover, .a-live:hover { stroke: var(--text-hell); }
.a-live-ring {
  fill: none !important; stroke: currentColor; pointer-events: none;
  transform-box: fill-box; transform-origin: center;
  animation: a-puls 2.2s ease-out infinite;
}
@keyframes a-puls {
  from { transform: scale(.35); opacity: .9; }
  to   { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .a-live-ring { animation: none; opacity: .35; }
}

.a-welt-knoepfe { position: absolute; top: .6rem; right: .6rem; display: flex; flex-direction: column; gap: .3rem; z-index: 2; }
.a-welt-knoepfe button {
  width: 34px; height: 34px; border-radius: 7px; cursor: pointer;
  font: 600 1.05rem/1 var(--schrift); color: var(--text-hell);
  background: rgba(26,20,20,.88); border: 1px solid var(--rand-stark);
}
.a-welt-knoepfe button:hover { border-color: var(--glut); }
.a-welt-leer {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem;
  padding: 1.5rem; text-align: center; background: rgba(21,16,16,.92); color: var(--text);
}
.a-welt-leer p { max-width: 52ch; margin: 0; }
.a-karte > .a-welt-zeile { margin: .7rem 0 0; }
/* Bedienhinweis nur bei Touch-Bedienung */
.a-karte > .a-welt-hinweis { display: none; margin: .6rem 0 0; }
@media (pointer: coarse) {
  .a-karte > .a-welt-hinweis { display: block; }
}

.a-zwei { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem 1.6rem; margin-top: 1rem; }
.a-zwei > .a-block + .a-block { margin-top: 0; }
.a-live-eintrag { display: flex; align-items: center; gap: .5rem; margin: 0 0 .35rem; font-size: .88rem; color: var(--text); }
.a-karte > .a-quelle { margin: 1rem 0 0; }
.a-textknopf {
  font: inherit; color: var(--glut-hell); background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.a-textknopf:disabled { color: var(--text-leise); cursor: wait; }

/* Methode und Filter */
.a-methode { margin-top: 2.4rem; max-width: 78ch; color: var(--text-leise); font-size: .92rem; }
.a-methode h2 { font-size: 1.1rem; color: var(--text); }

@media (max-width: 640px) {
  .a-anmeldung { padding: 1.6rem 1.3rem; margin-top: 6vh; }
  .a-karte { padding: 1.1rem 1rem; }
  .a-balken { grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) 2.8em; }
  .a-wer-name small { display: none; }
}
