/* ===========================================================================
   Punktlicht - Oberflaeche fuer Praesentierende (decks.php, vorlagen.php).

   Gestaltung nach der Vorgabe vom 25.09.2026 (entwurf/Showcase-Vorgabe.md):
   warmer Papiergrund, Karten mit getoentem Bild, Pillenknoepfe, und ein
   einziger goldener Punkt als Licht. Bewegungen sind kurz und gleich
   gerichtet: Knoepfe und Karten heben sich, Blaetter fahren von unten
   herein, Meldungen von oben.

   Die dunkle Fassung gehoert uns, nicht der Vorgabe: Punktlicht laeuft auch
   abends in einem dunklen Raum. Sie ist dieselbe Ordnung mit anderen
   Werten.
   =========================================================================== */

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('schrift/nunito-latin.woff2') format('woff2');
}

:root {
  --bg: #FAF9F7; --ak: #243E63; --pill: #FFFEFC; --txt: #2E3A47; --mut: #66707C;
  --hov: #F5F4F1; --strich: #E9E7E3; --gold: #E3A63A;
  --sh:  0 3px 10px rgba(31, 56, 100, .13), 0 1px 3px rgba(31, 56, 100, .06);
  --shH: 0 8px 18px rgba(31, 56, 100, .18), 0 2px 5px rgba(31, 56, 100, .08);
  --shA: 0 14px 30px rgba(31, 56, 100, .22), 0 3px 8px rgba(31, 56, 100, .08);
  --ease: cubic-bezier(.32, .72, .24, 1);
  --weg: #A23B32;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Die dunkle Fassung: derselbe Aufbau, andere Werte. */
:root[data-darstellung="dunkel"] {
  --bg: #15181D; --ak: #7FA3D6; --pill: #1F242B; --txt: #D9DEE4; --mut: #8C96A2;
  --hov: #272D35; --strich: #2A2F37;
  --sh:  0 3px 10px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
  --shH: 0 8px 18px rgba(0, 0, 0, .5), 0 2px 5px rgba(0, 0, 0, .3);
  --shA: 0 14px 30px rgba(0, 0, 0, .55), 0 3px 8px rgba(0, 0, 0, .3);
  --weg: #E08A80;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-darstellung]) {
    --bg: #15181D; --ak: #7FA3D6; --pill: #1F242B; --txt: #D9DEE4; --mut: #8C96A2;
    --hov: #272D35; --strich: #2A2F37;
    --sh:  0 3px 10px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .3);
    --shH: 0 8px 18px rgba(0, 0, 0, .5), 0 2px 5px rgba(0, 0, 0, .3);
    --shA: 0 14px 30px rgba(0, 0, 0, .55), 0 3px 8px rgba(0, 0, 0, .3);
    --weg: #E08A80;
    color-scheme: dark;
  }
}

html { background: var(--bg); scroll-padding-top: 88px; }
*, *::before, *::after { box-sizing: inherit; }
body {
  margin: 0; background: var(--bg); color: var(--txt);
  font: 16px/1.55 'Nunito', system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
:root[data-schrift="gross"] body { zoom: 1.12; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--ak); }
:focus-visible { outline: 2px solid var(--ak); outline-offset: 2px; }
svg.i {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none;
}

/* ----------------------------------------------------------- Wortmarke */

.wm {
  margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: var(--ak);
  display: inline-block; white-space: nowrap; font-size: 27px; text-decoration: none;
}
.wm svg { display: inline-block; overflow: visible; }
.wm .lp-p { fill: var(--gold); opacity: 0; }     /* Es gibt nur ein Licht. */
.wm .ii { position: relative; display: inline-block; }
.wm .ii-s { display: inline-block; }
.wm .il {
  position: absolute; border-radius: 50%; background: var(--gold);
  transition: opacity .24s var(--ease);
}
body.lichtweg .wm .il { opacity: 0; }            /* das Licht ist gerade woanders */

/* --------------------------------------------------------------- Kopf */

.kopf {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.kopf .innen {
  max-width: 1180px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 12px;
}
.kopf .rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.seite { max-width: 1180px; margin: 0 auto; padding: 8px 28px 64px; }

/* -------------------------------------------------------------- Knopf */

.knopf {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 14px; background: var(--pill); box-shadow: var(--sh);
  font-weight: 700; font-size: 15px; color: var(--ak); text-decoration: none;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .3s, color .3s;
}
.knopf:hover { transform: translateY(-1px); box-shadow: var(--shH); }
.knopf:active { transform: none; box-shadow: var(--sh); }
.knopf.haupt { background: var(--ak); color: #fff; }
:root[data-darstellung="dunkel"] .knopf.haupt { color: #10213A; }
@media (prefers-color-scheme: dark) { :root:not([data-darstellung]) .knopf.haupt { color: #10213A; } }
.knopf[disabled] { opacity: .42; cursor: default; transform: none; box-shadow: var(--sh); }
.knopf.still { background: transparent; box-shadow: none; }
.knopf.still:hover { background: var(--hov); transform: none; box-shadow: none; }
.knopf.weg { color: var(--weg); }

/* ------------------------------------------------------- Einleitung */

.einl { margin: 22px 0 18px; }
.einl h2 { margin: 0; font-size: 27px; line-height: 1.2; color: var(--ak); font-weight: 800; }
.einl p { margin: 6px 0 0; color: var(--mut); max-width: 62ch; }
.einl .zeile { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.einl .zeile > div { flex: 1 1 320px; }

/* --------------------------------------------------- Suche und Filter */

.werkzeugleiste { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.suche {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border-radius: 14px; background: var(--pill); box-shadow: var(--sh); flex: 1; max-width: 380px;
  color: var(--mut);
}
.suche input { border: 0; background: none; outline: none; font: inherit; color: var(--txt); width: 100%; }
.filter { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--hov); }
.filter button {
  border: 0; background: none; border-radius: 999px; padding: 7px 14px; min-height: 36px;
  font-weight: 600; font-size: 14.5px; color: var(--mut); transition: background .2s, color .2s, box-shadow .2s;
}
.filter button[aria-pressed="true"] { background: var(--pill); box-shadow: var(--sh); font-weight: 700; color: var(--ak); }

/* -------------------------------------------------------------- Karten */

/* Karten einer Reihe sind gleich hoch: der Fuss steht damit auf einer Linie. */
.raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.raster.vier { grid-template-columns: repeat(4, 1fr); }

.karte {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%;
  padding: 10px 10px 14px; border: 0; border-radius: 20px; background: var(--pill); box-shadow: var(--sh);
  text-align: left; color: var(--txt); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.karte .bild {
  height: 92px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--rc) 8%, var(--pill)); transition: background .4s;
}
.karte.an .bild, .karte.gewaehlt .bild { background: color-mix(in srgb, var(--rc) 15%, var(--pill)); }
.karte .bild svg { width: 72px; height: 72px; display: block; overflow: visible; }
.karte.an, .karte.gewaehlt { transform: translateY(-2px); box-shadow: var(--shA); }
.karte .kopfz { display: flex; align-items: flex-start; gap: 8px; }
.karte b {
  display: block; font-size: 16px; font-weight: 700; color: var(--txt); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.karte .meta { display: block; font-size: 13.5px; color: var(--mut); margin-top: 2px; }
.karte .beschr { font-size: 14px; color: var(--mut); line-height: 1.4; }
.karte .fuss { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.karte .arten { display: flex; align-items: center; gap: 4px; color: var(--mut); }
.karte .arten svg.i { width: 15px; height: 15px; }
.karte .anz { font-size: 13px; color: var(--mut); margin-left: 2px; }

/* Zeichnung: Grundlinien immer da, Ergaenzungen zeichnen sich, Licht zuletzt. */
.karte { --rc: #3E6E9E; --zf: color-mix(in srgb, var(--rc) 50%, #C3C8CE); --za: color-mix(in srgb, var(--rc) 82%, #1F262E); }
:root[data-darstellung="dunkel"] .karte { --zf: color-mix(in srgb, var(--rc) 45%, #55606E); --za: color-mix(in srgb, var(--rc) 70%, #EAF0F6); }
@media (prefers-color-scheme: dark) {
  :root:not([data-darstellung]) .karte { --zf: color-mix(in srgb, var(--rc) 45%, #55606E); --za: color-mix(in srgb, var(--rc) 70%, #EAF0F6); }
}
.karte .ln {
  fill: none; stroke: var(--zf); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .45s;
}
.karte.an .ln, .karte.gewaehlt .ln { stroke: var(--za); }
.karte .er {
  fill: none; stroke: var(--za); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0;
  transition: stroke-dashoffset .3s ease-in, opacity 0s .3s;
}
.karte.an .er, .karte.gewaehlt .er {
  stroke-dashoffset: 0; opacity: 1;
  transition: stroke-dashoffset .65s var(--ease) calc(var(--i, 0) * .13s), opacity 0s;
}
.karte .erp {
  fill: var(--za); transform-box: fill-box; transform-origin: center; transform: scale(0);
  transition: transform .25s ease-in;
}
.karte.an .erp, .karte.gewaehlt .erp { transform: none; transition: transform .5s var(--ease) calc(var(--i, 0) * .13s); }
.karte .gp { fill: var(--gold); opacity: 0; }
.karte.licht .gp { opacity: 1; }

/* Statuspille am Fuss einer Deckkarte */
.status { border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.status.entwurf  { background: #EEF0F3; color: #5A6472; }
.status.live     { background: #E6ECF5; color: #2F4A70; }
.status.link     { background: #E3F0EF; color: #2A6A66; }
.status.erhebung { background: #E6F0E6; color: #3E6B45; }
:root[data-darstellung="dunkel"] .status { background: var(--hov); color: var(--mut); }
@media (prefers-color-scheme: dark) { :root:not([data-darstellung]) .status { background: var(--hov); color: var(--mut); } }

.mehr {
  margin-left: auto; border: 0; background: none; border-radius: 12px; color: var(--mut);
  width: 36px; height: 36px; display: grid; place-items: center; transition: background .2s, color .2s;
}
.mehr:hover { background: var(--hov); color: var(--ak); }

/* Die gestrichelte Karte "Neues Deck" */
.karte.neukarte {
  border: 1.5px dashed var(--strich); background: transparent; box-shadow: none;
  min-height: 176px; align-items: center; justify-content: center; gap: 6px; color: var(--ak); font-weight: 700;
}
.karte.neukarte:hover { border-color: var(--ak); background: var(--hov); transform: translateY(-2px); box-shadow: none; }
.karte.neukarte svg.i { width: 24px; height: 24px; stroke-width: 1.6; }

/* Frisch angelegt: die Karte landet. */
@keyframes landen { 0% { opacity: 0; transform: scale(.4); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
.karte.frisch { animation: landen .5s var(--ease); }

.leer-hinweis { color: var(--mut); padding: 28px 2px; }

/* --------------------------------------------------------- Vorlagen */

.band { margin: 0 0 26px; }
.bandkopf { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.bandkopf h3 { margin: 0; font-size: 17px; font-weight: 800; color: var(--txt); }
.bandkopf .zus { font-size: 14px; color: var(--mut); }
.nr {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--rc, var(--ak)); color: #fff; font-size: 13.5px; font-weight: 700; flex: none;
}

/* ------------------------------------------------------- Blatt (Sheet) */

.blattgrund {
  position: fixed; inset: 0; z-index: 29; background: rgba(20, 28, 44, .28);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.blattgrund.auf { opacity: 1; pointer-events: auto; }
.blatt {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, calc(100% + 40px));
  width: min(620px, calc(100% - 24px)); max-height: min(78vh, 760px); overflow: auto;
  background: var(--pill); border-radius: 22px;
  box-shadow: 0 22px 50px rgba(31, 56, 100, .28), 0 4px 12px rgba(31, 56, 100, .1);
  padding: 18px 20px 16px; z-index: 30; transition: transform .45s var(--ease);
}
.blatt.auf { transform: translate(-50%, 0); }
.blatt h3 { margin: 0 0 2px; font-size: 19px; color: var(--ak); }
.blatt .unter { margin: 0 0 12px; color: var(--mut); font-size: 14.5px; }
.blatt .knoepfe { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

.folienliste { display: flex; flex-direction: column; gap: 6px; }
.folienliste .fz {
  display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 9px 10px; border-radius: 14px; background: var(--hov); font-size: 14.5px; line-height: 1.35;
}
.folienliste .fz .n { color: var(--mut); font-size: 13px; text-align: right; }
.folienliste .fz .art { color: var(--mut); font-size: 13px; }

/* Zeilen im Menue-Blatt */
.zeile {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 2px; border-bottom: 1px solid var(--strich);
}
.zeile:last-child { border-bottom: 0; }
.zeile .txt { flex: 1 1 200px; }
.zeile .txt small { display: block; color: var(--mut); font-size: 13px; }
.zeile .wert { color: var(--mut); }
.wahlseg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--hov); margin-left: auto; }
.wahlseg button {
  border: 0; background: none; border-radius: 999px; padding: 6px 12px; min-height: 34px;
  font-size: 14px; font-weight: 600; color: var(--mut);
}
.wahlseg button[aria-pressed="true"] { background: var(--pill); box-shadow: var(--sh); color: var(--ak); font-weight: 700; }
.sw {
  width: 42px; height: 26px; border-radius: 999px; border: 0; background: #CCC8C2; position: relative;
  flex: none; margin-left: auto; transition: background .2s;
}
.sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease);
}
[aria-checked="true"] .sw, .sw[aria-checked="true"] { background: var(--ak); }
[aria-checked="true"] .sw::after, .sw[aria-checked="true"]::after { transform: translateX(16px); }

.liste { display: flex; flex-direction: column; gap: 4px; }
.liste .z {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: none; border: 0; text-align: left; color: var(--txt); text-decoration: none; width: 100%;
  transition: background .2s;
}
.liste .z:hover { background: var(--hov); }
/* min-width: sonst schrumpft ein langer Beisatz den Namen auf null. */
.liste .z .nm { flex: 1; min-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .z small { color: var(--mut); font-size: 13px; }
.liste .z.weg { color: var(--weg); }

/* -------------------------------------------------------------- Meldung */

.toast {
  position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px));
  transform: translate(-50%, -80px); background: #2E3A47; color: #fff; border-radius: 14px;
  padding: 10px 16px; font-size: 14px; z-index: 60; transition: transform .4s var(--ease);
  max-width: min(520px, calc(100% - 24px)); box-shadow: var(--shA);
}
.toast.auf { transform: translate(-50%, 0); }
.toast.fehler { background: var(--weg); }
.toast .knopf { background: rgba(255, 255, 255, .15); color: #fff; min-height: 34px; margin-left: 10px; padding: 0 12px; }

/* =======================================================================
   Erklaermodus: Laterne, Lichtkegel, Ring und Sprechblase.
   Vorgabe vom 25.09.2026, Abschnitt 10.
   ======================================================================= */

.eule-knopf .laterne { margin: -4px -2px -4px -4px; }
.eule-knopf .linie  { fill: none; stroke: var(--ak); stroke-width: 1.1; stroke-linecap: round; }
.eule-knopf .rahmen { fill: var(--pill); stroke: var(--ak); stroke-width: 1.2; stroke-linejoin: round; transition: fill .4s; }
.eule-knopf .glas   { fill: #F4F1EA; stroke: var(--ak); stroke-width: 1.2; transition: fill .4s; }
.eule-knopf .flamme {
  fill: none; stroke: var(--ak); stroke-width: 1.1; stroke-linejoin: round;
  transform-box: fill-box; transform-origin: 50% 75%; transition: fill .3s, stroke .3s;
}
.eule-knopf .schein { fill: var(--gold); opacity: 0; transition: opacity .6s; }
.eule-knopf .schwing { transform-box: view-box; transform-origin: 16px 3.4px; }
.eule-knopf:hover .schwing { animation: pendel 1.2s ease-in-out; }
@keyframes pendel {
  0% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 55% { transform: rotate(6deg); }
  80% { transform: rotate(-2deg); } 100% { transform: rotate(0); }
}
.eule-knopf[aria-pressed="true"] { background: #FDF6E8; box-shadow: inset 0 0 0 1.5px #EBCB8B, var(--sh); }
.eule-knopf[aria-pressed="true"]:hover { box-shadow: inset 0 0 0 1.5px #EBCB8B, var(--shH); }
.eule-knopf.entzuendet .flamme { fill: var(--gold); stroke: #B9822A; animation: zuenden .5s var(--ease); }
.eule-knopf.entzuendet .schein { opacity: .26; }
.eule-knopf.entzuendet .glas { fill: #FCEFD6; }
@keyframes zuenden { 0% { transform: scale(.2); } 60% { transform: scale(1.15); } 100% { transform: none; } }

/* Der Funke, der das Licht von seinem Platz in die Laterne traegt. */
.funke {
  position: fixed; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--gold);
  opacity: 0; pointer-events: none; z-index: 60; will-change: transform;
}

/* Im Erklaermodus wird die Farbwelt kuehler: die Seite tritt zurueck. */
body.blick {
  --bg: #DCE2EA; --pill: #EDF1F6; --hov: #D5DCE6; --txt: #1F2B42; --mut: #52607A; --strich: #CAD2DE;
}
body.wechsel, body.wechsel * {
  transition: background-color .6s ease, color .6s ease, fill .6s, stroke .6s, box-shadow .6s,
              outline-color .4s !important;
}

@property --kx { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --ky { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --kr { syntax: '<length>'; inherits: true; initial-value: 230px; }
.kegel {
  position: fixed; inset: 0; z-index: 35; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: radial-gradient(circle var(--kr) at var(--kx) var(--ky),
    rgba(255, 208, 146, .12) 0, rgba(32, 24, 28, 0) 48%, rgba(32, 24, 28, .18) 100%);
}
body.blick .kegel { opacity: 1; }

body.blick [data-e] { cursor: help; }
body.blick .blickziel {
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .25s;
  transform: translateY(-1px); box-shadow: 0 5px 13px rgba(31, 56, 100, .14), 0 1px 3px rgba(31, 56, 100, .06);
}
body.blick .blickziel[data-flach] {
  background-color: var(--pill); box-shadow: 0 0 0 5px var(--pill), 0 5px 13px rgba(31, 56, 100, .14);
  border-radius: 10px;
}

/* Der Ring hebt das erklaerte Stueck heraus, alles andere liegt im Schatten. */
.fokus {
  position: fixed; z-index: 44; pointer-events: none; border-radius: 16px;
  box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--bg) 55%, transparent); opacity: 0;
  transition: opacity .25s, left .25s var(--ease), top .25s var(--ease),
              width .25s var(--ease), height .25s var(--ease);
}
.fokus.auf { opacity: 1; }

.erkl {
  position: fixed; z-index: 48; width: min(330px, calc(100vw - 24px));
  background: color-mix(in srgb, var(--pill) 70%, var(--bg)); color: var(--txt); border-radius: 16px;
  box-shadow: 0 10px 26px rgba(20, 32, 60, .16), 0 2px 6px rgba(20, 32, 60, .08);
  padding: 14px 16px 12px; opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity .2s, transform .3s var(--ease);
}
.erkl.auf { opacity: 1; transform: none; pointer-events: auto; }
.erkl .pfeil {
  display: block; position: absolute; width: 12px; height: 12px; background: inherit;
  transform: rotate(45deg); border-radius: 2px; left: var(--px, 50%); top: var(--py, -6px);
}
.erkl h4 { margin: 0 24px 4px 0; font-size: 15.5px; color: var(--ak); }
.erkl p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--txt); }
.erkl .einord {
  margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--strich);
  font-size: 12.5px; color: var(--mut);
}
.erkl .zu {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; background: none;
  border-radius: 10px; color: var(--mut); display: grid; place-items: center;
}
.erkl .zu:hover { background: var(--hov); color: var(--ak); }

/* ------------------------------------------------------------ Hinweise */

.testinstanz {
  background: #FDF6E8; color: #8A5300; text-align: center; font-size: 13.5px; font-weight: 700;
  padding: 6px 12px;
}

/* ------------------------------------------------------------ Schmaler */

@media (max-width: 1020px) {
  .raster { grid-template-columns: repeat(2, 1fr); }
  .raster.vier { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .kopf .innen { padding: 12px 16px; }
  .seite { padding: 6px 16px 72px; }
  .wm { font-size: 23px; }
  .einl h2 { font-size: 23px; }
  .raster, .raster.vier { grid-template-columns: 1fr; }
  .suche { max-width: none; }
  /* Vorlagenkarten werden zur Zeile: Bild links, Text rechts. */
  .raster.vier .karte { flex-direction: row; align-items: center; gap: 12px; }
  .raster.vier .karte .bild { width: 84px; height: 84px; flex: none; }
  .raster.vier .karte .bild svg { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===========================================================================
   Bearbeitungsmodus (bearbeiten.php, Vorgabe 7.3)

   Zwei Spalten: 250 px Folienliste, daneben die Buehne mit genau einer
   Frage. Die Frageblöcke stammen aus lib/formular.php - sie bekommen hier
   dasselbe Papier und dieselben Pillen wie der Rest.
   =========================================================================== */

.kopf .innen.breit { max-width: 1400px; gap: 10px; }
.kopfstrich { width: 1px; height: 22px; background: var(--strich); flex: none; }
.wm.klein { font-size: 21px; }

.deckname {
  flex: 1 1 140px; min-width: 0; font: 700 17px/1.3 inherit; color: var(--txt);
  background: none; border: 0; border-radius: 10px; padding: 6px 8px;
  text-overflow: ellipsis; transition: background .2s;
}
.deckname:hover { background: var(--hov); }
.deckname:focus { background: var(--pill); outline: 2px solid var(--ak); outline-offset: 0; }

.editor {
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px;
  max-width: 1400px; margin: 0 auto; padding: 18px 28px 64px; align-items: start;
}
.folienspalte { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 8px; }
.spaltentitel { margin: 0 0 2px 4px; font-size: 13px; font-weight: 700; color: var(--mut);
  text-transform: uppercase; letter-spacing: .04em; }
.folien { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 220px); overflow: auto; }

.folie {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1.5px solid transparent; border-radius: 14px;
  background: var(--pill); box-shadow: var(--sh); color: var(--txt);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.folie:hover { transform: translateY(-1px); box-shadow: var(--shH); }
.folie.aktiv { border-color: var(--ak); box-shadow: var(--shH); }
.folie .fnr {
  flex: none; width: 21px; height: 21px; border-radius: 7px; background: var(--hov);
  color: var(--mut); font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.folie.aktiv .fnr { background: var(--ak); color: var(--pill); }
.folie svg.i { color: var(--mut); }
.folie .ft { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }

/* Abzweige: die Gabel an der Folie, die Wege oeffnet, und die kleine
   Zeile ueber einer Folie, auf die ein Weg fuehrt. */
.folie .gabel { margin-left: auto; color: var(--ak); width: 16px; height: 16px; }
.folie.amweg { border-left: 3px solid color-mix(in srgb, var(--ak) 45%, var(--pill)); }
.folien .weg {
  display: block; font-size: 11.5px; color: var(--mut); padding: 2px 0 0 12px; margin-bottom: -2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wege { display: grid; gap: 8px; margin: 4px 0 2px; }
.wegzeile {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--hov); border-radius: 12px; margin: 0; font-weight: 400;
}
.wegzeile span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.wegzeile select {
  border: 1.5px solid var(--strich); border-radius: 10px; padding: 7px 9px; background: var(--pill);
  color: var(--txt); font: inherit; max-width: 230px;
}

.neuefolie {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 10px; border: 1.5px dashed var(--strich); border-radius: 14px;
  background: transparent; color: var(--mut); font-size: 14.5px; transition: border-color .2s, color .2s;
}
.neuefolie:hover { border-color: var(--ak); color: var(--ak); }

/* --------------------------------------------------------- Werkzeugzeile */

.werkzeugzeile { display: flex; align-items: stretch; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.typknopf {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 0;
  border-radius: 999px; background: var(--pill); box-shadow: var(--sh); color: var(--txt);
  font-weight: 700; transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.typknopf:hover { transform: translateY(-1px); box-shadow: var(--shH); }
.kachel {
  width: 74px; min-height: 58px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 6px 4px; border: 0; border-radius: 14px;
  background: var(--pill); box-shadow: var(--sh); color: var(--mut); font-size: 11.5px;
  line-height: 1.15; text-align: center; transition: transform .18s var(--ease), box-shadow .18s var(--ease), color .2s;
}
.kachel:hover { transform: translateY(-1px); box-shadow: var(--shH); color: var(--ak); }
.kachel svg.i { width: 20px; height: 20px; }

/* -------------------------------------------------------------- Buehne */

.mitte { min-width: 0; }
.buehne { max-width: 680px; }
.buehne .fragenbau { display: none; }
.buehne .fragenbau.aktiv { display: block; }
.buehne .fragenbau > .typwahl { display: none; }        /* die Art steht oben im Klappknopf */

.fragenbau {
  background: var(--pill); border-radius: 18px; box-shadow: var(--sh); padding: 18px 20px 20px;
}
.fragenbau .kopfzeile { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
/* .nr und .mehr gibt es in der Deckuebersicht schon: dort ein Kreis mit
   Zahl und der Knopf "...". Hier sind es die Kopfzeile eines Frageblocks
   und der zugeklappte Bereich - also zurueckgesetzt. */
.fragenbau .nr {
  display: inline; width: auto; height: auto; background: none; border-radius: 0;
  font-size: 13px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .04em;
}
.fragenbau .mehr {
  display: block; width: auto; height: auto; background: none; border-radius: 0; margin: 16px 0 0;
}
.fragenbau .mehr:hover { background: none; color: inherit; }
.fragenbau .typname { margin-right: auto; color: var(--ak); }
.fragenbau .schieben, .fragenbau .entfernen {
  border: 0; background: none; border-radius: 10px; color: var(--mut); padding: 5px 8px;
  display: inline-flex; align-items: center; gap: 4px; font-size: 14px; transition: background .2s, color .2s;
}
.fragenbau .schieben:hover, .fragenbau .entfernen:hover { background: var(--hov); color: var(--ak); }
.fragenbau .entfernen { color: var(--weg); }

.fragenbau label, .blatt label { display: block; margin: 14px 0 5px; font-weight: 700; font-size: 14.5px; }
.fragenbau label:first-of-type { margin-top: 0; }
.fragenbau .neben, .blatt .neben { font-weight: 400; color: var(--mut); font-size: 13px; }
.feld {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--strich); border-radius: 12px;
  background: var(--bg); color: var(--txt); font: inherit;
}
.feld:focus { outline: 2px solid var(--ak); outline-offset: 0; border-color: transparent; }
textarea.feld { resize: vertical; }
select.feld { width: auto; min-width: 140px; }
input[type="file"].feld { padding: 8px; font-size: 14px; }

.fragenbau .typwahl, .blatt .typwahl {
  display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--hov); flex-wrap: wrap;
}
.fragenbau .typwahl button {
  border: 0; background: none; border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--mut);
}
.fragenbau .typwahl button[aria-pressed="true"] {
  background: var(--pill); box-shadow: var(--sh); font-weight: 700; color: var(--ak);
}
.fragenbau .zweispalt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fragenbau .zeilenwahl { display: flex; align-items: center; gap: 16px; margin-top: 10px; flex-wrap: wrap; }
.fragenbau .richtigwahl { display: flex; flex-direction: column; gap: 4px; }
.richtigoption { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; }
.fragenbau .vorlagen { display: flex; gap: 8px; flex-wrap: wrap; }
.fragenbau .vorlagen button {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 104px; padding: 8px;
  border: 1.5px solid var(--strich); border-radius: 14px; background: var(--bg); font-size: 12.5px;
  color: var(--mut);
}
.fragenbau .vorlagen button[aria-pressed="true"] { border-color: var(--ak); color: var(--ak); font-weight: 700; }
.fragenbau .vorlagen img { width: 100%; height: 56px; object-fit: contain; }
.fragenbau .mehr, .einlesen { margin-top: 16px; }
.fragenbau .mehr > summary, .einlesen > summary {
  cursor: pointer; font-weight: 700; color: var(--ak); padding: 8px 0; font-size: 14.5px;
}
.hilfe { color: var(--mut); font-size: 14px; }
.hilfe.abbruch { margin-top: 18px; }
.hinweis {
  background: var(--hov); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; font-size: 14.5px;
}
.fehler { color: var(--weg); font-weight: 700; margin: 0 0 14px; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.einlesen { max-width: 680px; background: var(--pill); border-radius: 18px; box-shadow: var(--sh); padding: 4px 20px 16px; }
.einlesen .schritt { font-size: 15px; color: var(--ak); margin: 18px 0 6px; }
.einlesen .prompttext { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.hinweisliste { margin: .4rem 0 0; padding-left: 1.2rem; color: var(--mut); font-size: 14px; }
.dateiknopf { display: inline-flex; align-items: center; }
.gut { color: #2E7D5B; font-weight: 700; }

/* Vogelperspektive im Blatt */
.vogel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vfolie {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px 8px;
  padding: 10px 12px; border: 1.5px solid transparent; border-radius: 14px; background: var(--hov);
  text-align: left; color: var(--txt);
}
.vfolie.aktiv { border-color: var(--ak); }
.vfolie b { grid-column: 1 / -1; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vfolie small { grid-column: 1 / -1; color: var(--mut); font-size: 12.5px; }
.liste .z.gewaehlt { background: var(--hov); font-weight: 700; }

/* ------------------------------------------------- Seite "Starten" (7.4) */

.raster.drei { grid-template-columns: repeat(3, 1fr); }
/* display: grid schlaegt sonst das Attribut hidden - die Kaesten staenden
   dann schon da, bevor eine Art gewaehlt ist. */
.startunten[hidden] { display: none; }
.startunten { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 22px; align-items: start; }
.kasten { background: var(--pill); border-radius: 18px; box-shadow: var(--sh); padding: 16px 18px 18px; }
.kasten h3 { margin: 0 0 10px; font-size: 16px; color: var(--ak); }
.kasten .zeile {
  display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--strich);
}
.kasten .zeile:first-of-type { border-top: 0; }
.kasten .zeile.stapel { display: block; }
.kasten .zeile.stapel .feld { margin-top: 8px; }
.kasten .txt { flex: 1; min-width: 0; font-weight: 700; font-size: 14.5px; }
.kasten .txt small { display: block; font-weight: 400; color: var(--mut); font-size: 13px; margin-top: 2px; }
.kasten .wert { color: var(--mut); font-variant-numeric: tabular-nums; }
.kasten input[type="date"] { width: auto; }

.pzeile { display: grid; grid-template-columns: auto auto 1fr; align-items: start; gap: 10px; padding: 9px 0;
          border-top: 1px solid var(--strich); }
.pzeile:first-child { border-top: 0; }
.pzeile .psym { color: #4E8A5A; display: grid; place-items: center; padding-top: 1px; }
.pzeile.hinweis .psym { color: var(--mut); }
.pzeile.wahl .psym { color: var(--gold); }
.pzeile .pnr {
  width: 21px; height: 21px; border-radius: 7px; background: var(--hov); color: var(--mut);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.pzeile .ptext { min-width: 0; font-size: 14.5px; }
.pzeile .ptext b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pzeile .ptext small { color: var(--mut); font-size: 13px; line-height: 1.4; display: block; margin-top: 1px; }

@media (max-width: 1020px) {
  .startunten { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* minmax(0, 1fr) statt 1fr: sonst zieht die Folienleiste die Spalte auf
     ihre volle Breite, und die Seite laesst sich seitwaerts schieben. */
  .editor { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 56px; }
  .folienspalte { position: static; min-width: 0; }
  .kopf .rechts { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
  .folien { flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .folie { width: auto; flex: 0 0 auto; max-width: 190px; }
  .kopf .innen.breit { flex-wrap: wrap; }
  .deckname { order: 3; flex-basis: 100%; }
  .vogel { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Startseite (index.php ohne Code)

   Zwei Wege, sonst nichts. Die Wortmarke steht gross in der Mitte, weil das
   Licht in ihr die Marke ist - und weil jede Zeile mehr von den zwei
   Entscheidungen ablenkt, die es hier gibt.
   =========================================================================== */

.testband {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 7px 18px; background: #FFF6E3; color: #6B4A12; font-size: 13px;
  border-bottom: 1px solid #F0E0BE;
}
.testband b { font-weight: 800; letter-spacing: .02em; }
.testband span { color: #8A6A2C; }
:root[data-darstellung="dunkel"] .testband { background: #2C2412; color: #E9CE94; border-color: #3E3524; }
@media (prefers-color-scheme: dark) {
  :root:not([data-darstellung]) .testband { background: #2C2412; color: #E9CE94; border-color: #3E3524; }
}

.start {
  max-width: 760px; margin: 0 auto; padding: min(12vh, 96px) 24px 40px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.startmarke { margin: 0 0 10px; }
.wm.gross { font-size: clamp(42px, 10vw, 84px); }
.startunter { margin: 0 0 34px; color: var(--mut); font-size: 16px; max-width: 44ch; }

/* display: grid schlaegt sonst das Attribut hidden - dann staenden beide
   Wege und das Kennungsfeld gleichzeitig da. */
.startwahl[hidden] { display: none; }
.startwahl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; width: 100%; }
.startwahl .karte {
  text-align: left; border: 0; font: inherit; color: var(--txt); cursor: pointer;
}
.startwahl .karte .bild svg { width: 84px; height: 84px; }
.startwahl .karte b { font-size: 19px; }
.startwahl .karte .beschr { margin-top: -2px; }

.startfeld { width: 100%; max-width: 440px; text-align: left; }
.startfeld[hidden] { display: none; }
.startfeld h2 { margin: 0 0 4px; font-size: 21px; color: var(--ak); }
.startfeld .hilfe { color: var(--mut); font-size: 14px; margin: 10px 0 0; }
.startfeld .fehler { color: var(--weg); font-weight: 700; margin: 10px 0 0; }
.startfeld .zurueck { margin-top: 18px; }
.startfeld label { display: block; margin: 14px 0 5px; font-weight: 700; font-size: 14.5px; }
.startfeld .feld:not(.code) {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--strich); border-radius: 12px;
  background: var(--pill); color: var(--txt); font: inherit;
}
.startfeld .feld:not(.code):focus { outline: 2px solid var(--ak); outline-offset: 0; border-color: transparent; }
.startfeld .knopf.gross { margin-top: 16px; width: 100%; justify-content: center; padding: 12px; font-size: 16px; }
a.startmarke { text-decoration: none; }
.codezeile { display: flex; gap: 10px; margin-top: 12px; }
.codezeile .feld {
  flex: 1; min-width: 0; padding: 14px 16px; border: 1.5px solid var(--strich); border-radius: 14px;
  background: var(--pill); color: var(--txt); font: 700 24px/1.1 inherit;
  letter-spacing: .14em; text-transform: uppercase; text-align: center;
}
.codezeile .feld:focus { outline: 2px solid var(--ak); outline-offset: 0; border-color: transparent; }
.codezeile .knopf { white-space: nowrap; }

.startfuss { text-align: center; color: var(--mut); font-size: 13px; padding: 0 24px 28px; margin: 0; }
.startfuss a { color: var(--mut); }

/* Das Licht kommt an: Beim Laden faellt der Punkt der Wortmarke ein.
   Bewusst ohne "both" und ohne Verzoegerung: Laeuft die Bewegung nicht -
   weil der Tab im Hintergrund liegt oder jemand "Bewegung reduzieren"
   eingestellt hat -, ist der Punkt einfach da. Mit "both" hielt er den
   Anfangszustand fest und blieb unsichtbar. */
@keyframes lichtan {
  from { opacity: 0; transform: translateY(-10px) scale(.4); }
  to   { opacity: 1; transform: none; }
}
.start .wm .il { animation: lichtan .5s var(--ease); }
@media (prefers-reduced-motion: reduce) { .start .wm .il { animation: none; } }

@media (max-width: 620px) {
  .start { padding-top: 48px; }
  .startwahl { grid-template-columns: 1fr; }
  .startwahl .karte .bild svg { width: 64px; height: 64px; }
}

/* ===========================================================================
   Die Kurzanleitung (hilfe.php)

   Eine Spalte Text im Bild der Startseite: Band, Wortmarke, dann lesen.
   Der Erklaermodus erklaert einzelne Knoepfe - hier steht der Zusammenhang.
   =========================================================================== */

.hilfeseite {
  max-width: 720px; margin: 0 auto; padding: 40px 24px 24px;
}
.hilfeseite .startmarke { display: block; text-align: center; text-decoration: none; margin-bottom: 26px; }
.hilfeseite h1 { margin: 0 0 6px; font-size: 30px; color: var(--ak); }
.hilfeseite h2 { margin: 34px 0 10px; font-size: 20px; color: var(--ak); }
.hilfeseite p, .hilfeseite li { line-height: 1.6; }
.hilfeseite .unter { color: var(--mut); margin: 0; }
.hilfeseite ol { padding-left: 1.2em; margin: 0; }
.hilfeseite ol li { margin: 10px 0; }
.hilfeseite .zurueckzeile { margin: 34px 0 0; }

.hilfetabelle { width: 100%; border-collapse: collapse; }
.hilfetabelle th, .hilfetabelle td {
  text-align: left; vertical-align: top; padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--strich); line-height: 1.5;
}
.hilfetabelle th { width: 32%; font-weight: 700; color: var(--txt); }
.hilfetabelle td { color: var(--mut); }

@media (max-width: 560px) {
  .hilfetabelle th, .hilfetabelle td { display: block; width: auto; border: 0; padding: 0; }
  .hilfetabelle th { padding-top: 12px; }
  .hilfetabelle td { padding-bottom: 12px; border-bottom: 1px solid var(--strich); }
}
