/* iATMO – gemeinsame Gestaltung. Schriften liegen lokal auf diesem Server (kein CDN). */
@font-face { font-family: "Lexend"; src: url("/assets/fonts/lexend-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/assets/fonts/lexend-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f4f7fb; --karte: #ffffff; --text: #1f2a3a; --leise: #5a6678; --rand: #dbe3ee;
  --marke: #356aa0; --marke-hell: #e3edf8; --akzent: #cc0000; --stern: #f2b705;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --groesse: 18px; --zeile: 1.5; --abstand: normal; --wortabstand: normal;
  --radius: 18px; --schatten: 0 2px 10px rgba(31,42,58,.08);
  color-scheme: light;
}
html[data-farbe="ruhig"] { --bg: #f7f1e3; --karte: #fffaf0; --text: #2b2b2b; --leise: #5e5a50; --rand: #e6dcc6; --marke: #4f7a6b; --marke-hell: #e7efe9; }
html[data-farbe="dunkel"] { --bg: #151b24; --karte: #1f2733; --text: #eef2f7; --leise: #aab4c3; --rand: #2f3a4a; --marke: #7fb0e6; --marke-hell: #26364a; color-scheme: dark; }
html[data-schrift="leicht"] { --schrift: "Lexend", system-ui, sans-serif; }
html[data-groesse="2"] { --groesse: 21px; }
html[data-groesse="3"] { --groesse: 25px; }
html[data-abstand="weit"] { --zeile: 1.8; --abstand: .06em; --wortabstand: .2em; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--schrift); font-size: var(--groesse);
  line-height: var(--zeile); letter-spacing: var(--abstand); word-spacing: var(--wortabstand);
  display: flex; flex-direction: column; min-height: 100%;
}
button, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--marke); }
:focus-visible { outline: 3px solid var(--stern); outline-offset: 2px; }
.versteckt { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopfleiste */
.kopf { display: flex; align-items: center; gap: .5rem; padding: .5rem .9rem; background: var(--karte); border-bottom: 1px solid var(--rand); position: sticky; top: 0; z-index: 20; }
.logo { font-weight: 700; font-size: 1.35em; text-decoration: none; color: var(--text); margin-right: auto; white-space: nowrap; }
.logo b { color: var(--akzent); }
.knopf { display: inline-flex; align-items: center; gap: .4em; min-height: 48px; min-width: 48px; padding: .35em .8em; border-radius: 999px; border: 2px solid var(--rand); background: var(--karte); cursor: pointer; text-decoration: none; color: var(--text); }
.knopf:hover { border-color: var(--marke); }
.knopf[aria-pressed="true"] { background: var(--marke); color: #fff; border-color: var(--marke); }
.knopf .zahl { font-weight: 700; }
.nur-gross { display: none; }
@media (min-width: 760px) { .nur-gross { display: inline; } }

/* Startseite */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem; }
.gruss { margin: .5rem 0 1rem; }
.gruss h1 { font-size: 1.6em; margin: 0 0 .2em; line-height: 1.2; }
.gruss p { margin: 0; color: var(--leise); }
.ziel { display: flex; align-items: center; gap: .8rem; background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; box-shadow: var(--schatten); }
.ziel .balken { flex: 1; height: 14px; background: var(--marke-hell); border-radius: 99px; overflow: hidden; }
.ziel .balken span { display: block; height: 100%; width: 0; background: var(--stern); border-radius: 99px; transition: width .6s; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.kachel { position: relative; display: flex; flex-direction: column; background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); overflow: hidden; box-shadow: var(--schatten); }
.kachel > a { display: flex; flex-direction: column; color: inherit; text-decoration: none; flex: 1; }
.kachel .bild { aspect-ratio: 16/9; background: #fff; overflow: hidden; border-bottom: 4px solid var(--farbe, var(--marke)); }
.kachel .bild img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.kachel .inhalt { padding: .8rem 1rem 1rem; }
.kachel h2 { margin: 0 0 .25em; font-size: 1.2em; line-height: 1.25; }
.kachel p { margin: 0; color: var(--leise); }
.kachel .sterne { margin-top: .5rem; font-size: .9em; color: var(--leise); }
.kachel .vorlesen { position: absolute; top: .5rem; right: .5rem; background: var(--karte); }
.kachel > a:hover h2 { text-decoration: underline; }

.infobox { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); margin-top: 1.2rem; box-shadow: var(--schatten); }
.infobox summary { cursor: pointer; padding: .9rem 1rem; font-weight: 700; min-height: 48px; }
.infobox .text { padding: 0 1rem 1rem; max-width: 70ch; }
.infobox h3 { margin: 1em 0 .3em; font-size: 1em; }
.fuss { text-align: center; padding: 1rem; color: var(--leise); font-size: .85em; }

/* Werkzeug-Ansicht */
.werkzeug { display: none; flex: 1; flex-direction: column; min-height: 0; }
body.im-werkzeug main { display: none; }
body.im-werkzeug .werkzeug { display: flex; }
body.im-werkzeug .fuss { display: none; }
.werkzeug-leiste { display: flex; align-items: center; gap: .5rem; padding: .4rem .9rem; background: var(--marke-hell); border-bottom: 1px solid var(--rand); flex-wrap: wrap; }
.werkzeug-leiste h2 { font-size: 1.05em; margin: 0 auto 0 .3rem; }
.werkzeug iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: 70vh; }

/* Einstellungen */
.einstellungen { position: fixed; inset: auto 0 0 0; max-height: 85vh; overflow: auto; background: var(--karte); border-top: 1px solid var(--rand); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.15); padding: 1rem 1rem 1.5rem; z-index: 50; transform: translateY(105%); transition: transform .25s; }
.einstellungen.offen { transform: none; }
@media (min-width: 760px) { .einstellungen { inset: 70px 1rem auto auto; width: 380px; border-radius: 22px; border: 1px solid var(--rand); transform: translateY(-10px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; } .einstellungen.offen { opacity: 1; transform: none; pointer-events: auto; } }
.einstellungen h2 { margin: 0 0 .6rem; font-size: 1.2em; }
.gruppe { border: 0; padding: 0; margin: 0 0 .9rem; }
.gruppe legend { font-weight: 700; margin-bottom: .3rem; }
.wahl { display: flex; flex-wrap: wrap; gap: .4rem; }
.wahl label { position: relative; }
.wahl input { position: absolute; opacity: 0; }
.wahl span { display: inline-flex; align-items: center; min-height: 44px; padding: .3em .9em; border: 2px solid var(--rand); border-radius: 999px; cursor: pointer; }
.wahl input:checked + span { background: var(--marke); border-color: var(--marke); color: #fff; }
.wahl input:focus-visible + span { outline: 3px solid var(--stern); outline-offset: 2px; }
.schliessen { float: right; }

/* Feier */
.feier { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%) scale(.6); background: var(--karte); color: var(--text); border: 3px solid var(--stern); border-radius: 24px; padding: 1rem 1.4rem; font-size: 1.3em; font-weight: 700; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.2); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; }
.feier.zeigen { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.feier .gross { font-size: 2.4em; display: block; line-height: 1.1; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
html[data-ruhe="an"] * { transition: none !important; animation: none !important; }
.wahl .a1{font-size:.9em}.wahl .a2{font-size:1.1em}.wahl .a3{font-size:1.35em}.zielmin{align-self:center}

/* Schmale Bildschirme */
html, body { overflow-x: hidden; }
.kopf { flex-wrap: wrap; row-gap: .4rem; }
.kopf .knopf { letter-spacing: normal; word-spacing: normal; }
@media (max-width: 520px) {
  .kopf { padding: .4rem .6rem; gap: .35rem; }
  .kopf .knopf { min-height: 44px; min-width: 44px; padding: .25em .55em; font-size: 16px; }
  .logo { font-size: 1.2em; }
  main { padding: .7rem; }
  .gruss h1 { font-size: 1.35em; }
  .ziel { flex-wrap: wrap; }
  .ziel .balken { flex-basis: 100%; order: 3; }
}

/* Kachel-Bilder als farbige Symbol-Flächen */
.kachel .bild { aspect-ratio: 16/8; display: flex; align-items: center; justify-content: center; border-bottom: 0 !important;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0 18%, transparent 19%), radial-gradient(circle at 85% 80%, rgba(255,255,255,.25) 0 22%, transparent 23%), linear-gradient(135deg, var(--farbe, #356aa0), color-mix(in srgb, var(--farbe, #356aa0) 60%, #fff)); }
.kachel .bild .emoji { font-size: clamp(54px, 9vw, 76px); letter-spacing: .08em; filter: drop-shadow(0 4px 8px rgba(0,0,0,.18)); transition: transform .25s; }
.kachel > a:hover .bild .emoji, .kachel > a:focus-visible .bild .emoji { transform: scale(1.12) rotate(-4deg); }
.kachel .vorlesen { top: .6rem; right: .6rem; }
.sprachwahl { gap: 4px; }
.sprachwahl select { border: 0; background: transparent; font: inherit; font-weight: 700; color: inherit; cursor: pointer; max-width: 7.5em; }
