/*
+==============================================================================+
|   _   _   _____   _____   ____    ___  __  __                                |
|  | \ | | | ____| |_   _| |  _ \  |_ _| \ \/ /                                |
|  |  \| | |  _|     | |   | |_) |  | |   \  /                                 |
|  | |\  | | |___    | |   |  _ <   | |   /  \                                 |
|  |_| \_| |_____|   |_|   |_| \_\ |___| /_/\_\                                |
|                                                                              |
|  IT | WEB | SOFTWARE | DIGITAL SOLUTIONS                                     |
|  Engineered by NETRIX                                                        |
|  https://www.netrix.de/                                                      |
|                                                                              |
+==============================================================================+
|  Projekt   : Berlins Bezirke                                                 |
|  Datei     : assets/css/zahlen.css                                           |
|  Version   : 0.7.0                                                           |
|  Copyright : (c) 2026 Netrix GmbH                                            |
|              Alle Rechte vorbehalten.                                        |
+==============================================================================+
*/

/* Berlin in Zahlen (/berlin-in-zahlen/): Stationen-Navigation, Stationskarten, farbige Balken, Vergleiche.
   Wird nur von dieser Seite geladen (tools/seiten-fakten.mjs). Farben je Station über --z (Grundton) und --z-hell. */

.z { --z: var(--rot); --z-hell: #fbe1dc; }
.z--gruen { --z: #4f9a5a; --z-hell: #dcefd9; }
.z--wasser { --z: #3d8fc2; --z-hell: #d6ebf6; }
.z--berg { --z: #9a6b3f; --z-hell: #f1e2cf; }
.z--unterwegs { --z: #e0a11b; --z-hell: #fbefcf; }
.z--bezirke { --z: #7a5aa6; --z-hell: #e7def3; }
.z--spiel { --z: var(--rot); --z-hell: #fbe1dc; }
:root[data-modus="dunkel"] .z { --z-hell: #2a2622; }

/* --- Stationen-Navigation (U-Bahn-Linie) --- */
.z-linie { position: sticky; top: 67px; z-index: 40; background: var(--papier); border-bottom: 2px dashed var(--linie); }
.z-linie ol { list-style: none; margin: 0 auto; padding: .7rem 0 .5rem; display: flex; justify-content: space-between; position: relative; width: min(100% - 32px, 1000px); overflow-x: auto; scrollbar-width: none; }
.z-linie ol::before { content: ""; position: absolute; left: 1.6rem; right: 1.6rem; top: 1.85rem; height: 6px; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--kontur) 0 14px, transparent 14px 20px); opacity: .55; }
.z-linie li { position: relative; flex: 0 0 auto; min-width: 4.6rem; text-align: center; }
.z-linie a { display: grid; justify-items: center; gap: .2rem; text-decoration: none; color: var(--text); font-size: .78rem; font-weight: 700; line-height: 1.15; padding: 0 .2rem; }
.z-linie__punkt { width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--flaeche); border: 3px solid var(--z); transition: transform .25s, background .25s; }
.z-linie__punkt svg { width: 1.35rem; height: 1.35rem; }
.z-linie a:hover .z-linie__punkt, .z-linie a:focus-visible .z-linie__punkt { transform: scale(1.12) rotate(-6deg); }
.z-linie a[aria-current="true"] .z-linie__punkt { background: var(--z); color: #fff; transform: scale(1.18); }
.z-linie a[aria-current="true"] .z-linie__punkt svg { stroke: #fff; }
.z-linie__name { max-width: 6.5rem; }
@media (max-width: 640px) { .z-linie__name { font-size: .68rem; } .z-linie li { min-width: 3.6rem; } .z-linie__punkt { width: 2.1rem; height: 2.1rem; } .z-linie ol::before { top: 1.65rem; } }

/* --- Stationen als Karten --- */
.z-station { padding-block: clamp(2.2rem, 5vw, 4rem); scroll-margin-top: 10rem; }
.z-karte { position: relative; background: var(--flaeche); border: 3px solid var(--kontur); border-radius: 14px 18px 12px 20px; box-shadow: 8px 8px 0 var(--z); padding: clamp(1.6rem, 4vw, 3rem); }
.z-karte::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--z-hell); opacity: .55; z-index: 0; pointer-events: none; }
.z-karte > * { position: relative; z-index: 1; }
.z-schild { display: inline-flex; align-items: center; gap: .55rem; margin: -3.4rem 0 1.2rem -.4rem; padding: .35rem .9rem .35rem .45rem; background: var(--z); color: #fff; font-weight: 800; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; border: 3px solid var(--kontur); border-radius: 999px; transform: rotate(-2deg); }
.z-schild svg { width: 1.6rem; height: 1.6rem; background: #fff; border-radius: 50%; padding: .2rem; stroke: var(--kontur); }
.z-karte h2 { margin-top: 0; }
.z-karte h3 { margin-top: 2.2rem; }
.z-einleitung { font-size: 1.12rem; max-width: 46rem; }

/* --- große Zahlenkacheln --- */
.z-kacheln { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.z-kachel { background: var(--flaeche); border: 2px solid var(--kontur); border-radius: 10px; padding: 1.2rem 1.2rem 1rem; display: flex; flex-direction: column; gap: .4rem; transition: transform .2s, box-shadow .2s; }
.z-kachel:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 5px 5px 0 var(--z); }
.z-kachel__kopf { display: flex; align-items: center; gap: .6rem; }
.z-kachel__kopf svg { width: 2.3rem; height: 2.3rem; flex: none; stroke: var(--z); }
.z-kachel__zahl { font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 800; line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums; }
.z-kachel__text { margin: 0; line-height: 1.45; }
.z-kachel .stand { font-size: .72rem; color: var(--leise); }

/* --- Ausklapper „Stell dir vor …“ --- */
.z-mehr { margin-top: .4rem; border-top: 2px dashed var(--linie); padding-top: .5rem; }
.z-mehr summary { cursor: pointer; font-weight: 800; font-size: .9rem; color: var(--z); list-style: none; display: flex; align-items: center; gap: .4rem; }
.z-mehr summary::-webkit-details-marker { display: none; }
.z-mehr summary::before { content: "+"; display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border: 2px solid currentColor; border-radius: 50%; font-size: .95rem; line-height: 1; transition: transform .25s; }
.z-mehr[open] summary::before { content: "–"; transform: rotate(180deg); }
.z-mehr p { margin: .5rem 0 0; font-size: .95rem; }
.z-mehr[open] p { animation: z-auf .35s ease-out; }
@keyframes z-auf { from { opacity: 0; transform: translateY(-4px); } }

/* --- große Ausklapp-Kästen --- */
.z-kasten { margin-top: 1.8rem; background: var(--flaeche); border: 2px solid var(--kontur); border-radius: 10px; }
.z-kasten > summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 800; display: flex; justify-content: space-between; gap: 1rem; list-style: none; }
.z-kasten > summary::-webkit-details-marker { display: none; }
.z-kasten > summary::after { content: "▾"; color: var(--z); transition: transform .25s; }
.z-kasten[open] > summary::after { transform: rotate(180deg); }
.z-kasten > div { padding: 0 1.2rem 1.2rem; }

/* --- Vergleichsbilder (Symbole in Reihen) --- */
.z-vergleich { display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.2rem; align-items: center; margin: 1.6rem 0 0; padding: 1.2rem; border: 2px dashed var(--z); border-radius: 12px; background: var(--flaeche); }
.z-vergleich svg { width: 4.2rem; height: 4.2rem; stroke: var(--z); }
.z-vergleich p { margin: 0; }
.z-vergleich strong { font-size: 1.25rem; }
.z-reihe { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.z-reihe span { width: 1.1rem; height: .8rem; border: 2px solid var(--z); border-radius: 2px; background: var(--z-hell); }

/* --- farbige Balken (Grundbalken aus berlin.css) --- */
.z-karte .balken { gap: .7rem; }
.z-karte .balken__spur { height: 1.6rem; border-radius: 999px; }
.z-karte .balken__wert { border-radius: 999px; }
.z-bunt li:nth-child(5n+1) { --bf: var(--z); }
.z-bunt li:nth-child(5n+2) { --bf: #f3b22a; }
.z-bunt li:nth-child(5n+3) { --bf: #8fcbe8; }
.z-bunt li:nth-child(5n+4) { --bf: #e4412d; }
.z-bunt li:nth-child(5n+5) { --bf: #9bc77a; }
.z-bunt a { cursor: default; }

/* --- Höhenprofil --- */
.z-profil { margin: 1.6rem 0 .4rem; width: 100%; height: auto; max-height: 320px; }
.z-profil text { font: 700 13px var(--schrift); fill: var(--text); }
.z-profil .z-profil__turm { stroke: var(--leise); stroke-dasharray: 5 4; }

/* --- Umschalter --- */
.z-umschalter { gap: .6rem; margin: 1.2rem 0 1.4rem; }
.z-umschalter .knopf[aria-pressed="true"] { transform: rotate(-1.5deg) scale(1.04); }

/* --- Schätzspiel --- */
.schaetzen { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1.4rem; counter-reset: frage; }
.schaetzen .spiel { counter-increment: frage; background: var(--flaeche); border: 2px solid var(--kontur); border-radius: 12px; padding: 1.2rem 1.4rem; position: relative; }
.schaetzen .spiel::before { content: counter(frage); position: absolute; left: -.9rem; top: -.9rem; width: 2rem; height: 2rem; display: grid; place-items: center; background: var(--z); color: #fff; border: 2px solid var(--kontur); border-radius: 50%; font-weight: 800; }
.schaetzen input[type="range"] { width: min(100%, 26rem); accent-color: var(--z); vertical-align: middle; }
.schaetzen output { display: inline-block; min-width: 4.5rem; font-size: 1.3rem; font-weight: 800; text-align: right; }
.schaetzen .spiel__rueckmeldung { font-weight: 700; }
.z-gesamt { font-size: 1.15rem; font-weight: 800; }

/* --- Aufklapper deutlich kennzeichnen (Wunsch Inhaber): Knopf-Optik, Hinweis „aufklappen/zuklappen“, Pfeil im Kreis --- */
.z-mehr summary { align-self: flex-start; padding: .35rem .8rem .35rem .4rem; border: 2px solid var(--z); border-radius: 999px; background: var(--z-hell); color: var(--text); transition: background .2s, transform .2s; }
.z-mehr summary::before { background: var(--z); color: #fff; border-color: var(--z); }
.z-mehr summary::after { content: "aufklappen"; font-weight: 600; font-size: .75rem; color: var(--leise); }
.z-mehr[open] summary::after { content: "zuklappen"; }
.z-mehr summary:hover, .z-mehr summary:focus-visible { background: var(--z); color: #fff; }
.z-mehr summary:hover::after, .z-mehr summary:focus-visible::after { color: #fff; }
.z-kasten { border-left: 8px solid var(--z); box-shadow: 4px 4px 0 var(--z-hell); }
.z-kasten > summary { align-items: center; }
.z-kasten > summary::before { content: "Aufklappen"; order: 2; margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .06em; }
.z-kasten[open] > summary::before { content: "Zuklappen"; }
.z-kasten > summary::after { order: 3; content: "▾"; display: inline-grid; place-items: center; width: 2rem; height: 2rem; flex: none; border-radius: 50%; background: var(--z); color: #fff; font-size: 1.1rem; }
.z-kasten > summary:hover { background: var(--z-hell); border-radius: 8px; }
.z-kasten > summary:focus-visible { outline: 3px solid var(--z); outline-offset: 2px; }
@media (max-width: 560px) { .z-kasten > summary::before { display: none; } }

/* --- Börli (Maskottchen, Pose „staunen“) mit Sprechblase in Handschrift --- */
.z-boerli { float: right; width: clamp(7.5rem, 18vw, 11rem); margin: -2.5rem 0 .6rem 1.2rem; position: relative; text-align: center; }
.z-boerli img { width: 100%; height: auto; display: block; }
.z-sprech { position: absolute; right: 85%; top: .2rem; width: max-content; max-width: 10rem; margin: 0; padding: .45rem .75rem; background: #fff; color: #2b2622; border: 2px solid var(--kontur); border-radius: 16px 16px 4px 16px; font: 700 1rem/1.2 "Segoe Print", "Bradley Hand", "Marker Felt", cursive; transform: rotate(-4deg); }
@media (max-width: 640px) { .z-boerli { width: 6.5rem; margin-top: -1.5rem; } .z-sprech { font-size: .85rem; max-width: 7.5rem; } }

/* --- Wusstest du? unten --- */
.z-wissen h2 { margin-top: .2rem; }

/* --- Bewegung --- */
@media (prefers-reduced-motion: no-preference) {
  .z-linie__punkt svg, .z-schild svg { transition: transform .4s; }
  .z-karte:hover .z-schild svg { transform: rotate(-12deg) scale(1.08); }
  .z-wackel { animation: z-wackel 3.5s ease-in-out infinite; transform-origin: 50% 90%; }
  @keyframes z-wackel { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
}
@media (prefers-reduced-motion: reduce) { .z-kachel, .z-linie__punkt, .z-mehr summary::before { transition: none; } .z-mehr[open] p { animation: none; } }

/* --- animierte Vergleiche (Start: zahlen.js setzt .z-los beim Hineinscrollen; ohne .z-js Endzustand) --- */
.z-vergleich > div { min-width: 0; }
.z-reihe--baum span { width: .9rem; height: 1.1rem; border-radius: 50% 50% 2px 2px; background: var(--z); border-color: var(--kontur); }
.z-reihe--mensch { gap: .18rem; margin: 0; }
.z-reihe--mensch span { width: .55rem; height: .55rem; border-radius: 50%; border: 0; background: var(--z); }
.z-feld { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr 3rem; gap: .8rem; align-items: center; margin-top: .7rem; }
.z-feld__name { font-weight: 700; font-size: .9rem; }
.z-feld__rasen { background: repeating-linear-gradient(90deg, #cfe8c4 0 18px, #bfdeb2 18px 36px); border: 2px solid #fff; outline: 2px solid var(--kontur); border-radius: 4px; padding: .45rem; min-height: 1.6rem; }
:root[data-modus="dunkel"] .z-feld__rasen { background: repeating-linear-gradient(90deg, #2f4a2c 0 18px, #29422a 18px 36px); }
.z-feld__zahl { font-weight: 800; font-size: 1.15rem; text-align: right; font-variant-numeric: tabular-nums; }
.z-rennen { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem 1.4rem; align-items: center; margin-top: 1rem; font-weight: 700; }
.z-rennen__spur { position: relative; height: 1.7rem; border: 2px solid var(--kontur); border-radius: 999px; background: var(--papier); }
.z-rennen__wert { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: #f3b22a; transition: width 2.6s cubic-bezier(.3, .1, .3, 1); }
.z-rennen__spur--wasser .z-rennen__wert { background: var(--z); }
.z-rennen__laeufer { position: absolute; right: -1.1rem; top: 50%; translate: 0 -50%; width: 2.2rem; height: 2.2rem; background: var(--flaeche); border: 2px solid var(--kontur); border-radius: 50%; display: grid; place-items: center; }
.z-vergleich .z-rennen__laeufer svg { width: 1.4rem; height: 1.4rem; stroke: var(--kontur); }
.z-vergleich svg.z-stapel { width: 9rem; height: auto; stroke: none; color: var(--text); }
.z-profil__berg, .z-stapel__berg { transform-box: fill-box; transform-origin: 50% 100%; }
@media (max-width: 560px) { .z-vergleich { grid-template-columns: 1fr; } .z-feld { grid-template-columns: 1fr 2.6rem; } .z-feld__name { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: no-preference) {
  .z-js .z-anim:not(.z-los) .z-reihe span { opacity: 0; transform: scale(0); }
  .z-js .z-anim .z-reihe span { transition: opacity .3s, transform .45s cubic-bezier(.3, 1.6, .5, 1); }
  .z-js .z-anim:not(.z-los) .z-rennen__wert { width: 0 !important; }
  .z-js .z-anim:not(.z-los) .z-profil__berg { transform: scaleY(0); }
  .z-js .z-anim .z-profil__berg { transition: transform 1.1s cubic-bezier(.3, 1.4, .5, 1); }
  .z-js .z-anim .z-profil__berg:nth-of-type(2) { transition-delay: .2s; } .z-js .z-anim .z-profil__berg:nth-of-type(3) { transition-delay: .4s; } .z-js .z-anim .z-profil__berg:nth-of-type(4) { transition-delay: .6s; }
  .z-js .z-anim:not(.z-los) .z-stapel__berg { transform: translateY(-120px); opacity: 0; }
  .z-js .z-anim .z-stapel__berg { transition: transform .7s cubic-bezier(.4, 1.5, .6, 1), opacity .3s; }
  .z-js .z-anim .z-stapel__berg:nth-of-type(3) { transition-delay: .7s; } .z-js .z-anim .z-stapel__berg:nth-of-type(4) { transition-delay: 1.4s; }
  .z-js .z-anim:not(.z-los) .z-stapel__turm { opacity: 0; }
  .z-js .z-anim .z-stapel__turm { transition: opacity .8s 2.1s; }
}
