/* Präsi — Darstellung.
   Dunkel, ruhig, kontraststark. Der Prompter soll aus zwei Metern Abstand
   lesbar sein, die Verwaltung drumherum aber wie eine normale App wirken. */

:root {
  --grund: #08090b;
  --flaeche: #131417;
  --flaeche-hoch: #1b1d22;
  --rand: #282b32;
  --rand-hell: #3a3e47;
  --text: #f3f4f6;
  --text-still: #9aa1ad;
  --text-leise: #6b7280;
  --akzent: #ffb562;
  --akzent-tief: #b8763a;
  --gut: #4ade80;
  --gefahr: #f87171;
  --radius: 14px;
  --radius-klein: 9px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Elemente mit eigenem display würden hidden sonst überstimmen und als
   unsichtbare Fläche Klicks abfangen. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--grund);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }

.ansicht {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--grund);
}

.ansicht[hidden] { display: none; }

.mitte { align-items: center; justify-content: center; }

/* ------------------------------------------------------------- Wortmarke */

.wortmarke {
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.wortmarke::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--akzent);
  vertical-align: 3px;
}

.wortmarke.gross { font-size: 34px; }

/* ------------------------------------------------------------- Anmeldung */

.anmeldekarte {
  width: min(360px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 34px 28px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 20px;
  text-align: center;
}

.anmeldekarte .unterzeile {
  margin: -6px 0 8px;
  color: var(--text-still);
  font-size: 14px;
}

input[type="password"], input[type="text"], textarea, .titelfeld {
  width: 100%;
  padding: 12px 14px;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  outline: none;
  transition: border-color .15s ease;
}

input:focus, textarea:focus { border-color: var(--rand-hell); }

textarea { resize: vertical; line-height: 1.55; }

.fehler { margin: 0; color: var(--gefahr); font-size: 14px; }

/* ----------------------------------------------------------------- Knopf */

.knopf {
  padding: 10px 16px;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  cursor: pointer;
  font-weight: 520;
  transition: background .15s ease, border-color .15s ease, transform .08s ease;
  white-space: nowrap;
}

.knopf:hover { background: #23262c; }
.knopf:active { transform: scale(.98); }

.knopf.akzent {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #241503;
  font-weight: 640;
}

.knopf.akzent:hover { background: #ffc182; }

.knopf.still { background: transparent; color: var(--text-still); }
.knopf.still:hover { background: var(--flaeche-hoch); color: var(--text); }
.knopf.gefahr:hover { color: var(--gefahr); border-color: #4b2626; }
.knopf.klein { padding: 6px 11px; font-size: 13px; }
.knopf.voll { width: 100%; }

/* ------------------------------------------------------------------ Kopf */

.kopf {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--rand);
  background: var(--grund);
  flex: none;
}

.kopf-knoepfe {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.titelfeld {
  flex: 1;
  max-width: 460px;
  background: transparent;
  border-color: transparent;
  font-size: 17px;
  font-weight: 560;
}

.titelfeld:hover { border-color: var(--rand); }

.speicherstand {
  font-size: 13px;
  color: var(--text-leise);
  min-width: 74px;
  text-align: right;
}

.inhalt {
  flex: 1;
  overflow-y: auto;
  padding: 22px 20px 40px;
  -webkit-overflow-scrolling: touch;
}

/* ------------------------------------------------------------ Bibliothek */

.kartengitter {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  max-width: 1100px;
  margin: 0 auto;
}

.skriptkarte {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s ease, transform .1s ease;
}

.skriptkarte:hover { border-color: var(--rand-hell); transform: translateY(-1px); }

.skriptkarte h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skriptkarte .karten-zeile {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-still);
}

.skriptkarte .karten-fuss {
  margin-top: auto;
  display: flex;
  gap: 8px;
  padding-top: 6px;
}

.karten-start {
  padding: 7px 12px;
  font-size: 13px;
  background: var(--akzent);
  color: #241503;
  border: none;
  border-radius: var(--radius-klein);
  font-weight: 620;
  cursor: pointer;
}

.leerhinweis {
  max-width: 460px;
  margin: 60px auto;
  text-align: center;
  color: var(--text-still);
}

.leerhinweis h2 { color: var(--text); font-size: 22px; margin-bottom: 8px; }
.leerhinweis p { line-height: 1.6; margin-bottom: 20px; }

/* ---------------------------------------------------------------- Editor */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.editor-spalte { min-width: 0; }

.werkzeugleiste {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.werkzeug-titel { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-leise); }
.werkzeug-knoepfe { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.abschnitte { display: flex; flex-direction: column; gap: 12px; }

.abschnitt {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  overflow: hidden;
}

.abschnitt-kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--rand);
  background: #101115;
}

.abschnitt-nummer {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  font-size: 12px;
  color: var(--text-still);
  flex: none;
}

.abschnitt-titel {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 560;
}

.abschnitt-titel:hover { border-color: var(--rand); }
.abschnitt-titel::placeholder { color: var(--text-leise); font-weight: 400; }

.abschnitt-werkzeug { display: flex; gap: 3px; }

.mini {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-leise);
  cursor: pointer;
  font-size: 14px;
}

.mini:hover { background: var(--flaeche-hoch); color: var(--text); border-color: var(--rand); }
.mini:disabled { opacity: .3; cursor: default; }
.mini.gefahr:hover { color: var(--gefahr); }

.abschnitt textarea {
  border: none;
  border-radius: 0;
  background: transparent;
  min-height: 130px;
  padding: 14px;
  font-size: 15px;
  line-height: 1.7;
}

.abschnitt-fuss {
  display: flex;
  justify-content: space-between;
  padding: 6px 14px 10px;
  font-size: 12px;
  color: var(--text-leise);
}

.hinweis {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-left: 3px solid var(--akzent-tief);
  border-radius: var(--radius-klein);
  color: var(--text-still);
  font-size: 13.5px;
  line-height: 1.65;
}

.editor-seite {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
}

.kennzahlen {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kennzahl {
  padding: 12px 8px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius-klein);
  text-align: center;
}

.kennzahl span { display: block; font-size: 19px; font-weight: 640; }
.kennzahl label { display: block; margin-top: 3px; font-size: 11px; color: var(--text-leise); }

.feldgruppe { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-still); }
.feldgruppe > span { font-weight: 560; color: var(--text); }
.feldgruppe em { font-style: normal; font-size: 12px; color: var(--text-leise); }

.merkliste { margin: 0; padding-left: 18px; line-height: 1.7; font-size: 13px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: var(--rand);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--akzent);
  cursor: pointer;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--akzent);
  cursor: pointer;
}

/* -------------------------------------------------------------- Prompter */

.prompter {
  background: #000;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.buehne {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.textfluss {
  position: absolute;
  left: 50%;
  top: 0;
  /* Oben Luft lassen: dort sitzen Statusmeldungen, auf dem Handy die
     Systemleiste, und darüber liegt der Weichzeichner. Der Abstand muss
     größer sein als dessen Höhe, sonst startet der Text im Dunkeln. */
  padding-top: max(80px, calc(env(safe-area-inset-top, 0px) + 17vh));
  width: var(--textbreite, 82%);
  transform: translate(-50%, 0);
  will-change: transform;
  font-size: var(--schriftgroesse, 46px);
  line-height: var(--zeilenabstand, 1.5);
  font-weight: 500;
  letter-spacing: -0.005em;
  text-align: left;
  text-wrap: pretty;
}

.prompter.gespiegelt .textfluss { transform: translate(-50%, 0) scaleX(-1); }

.wort {
  color: #fff;
  transition: color .35s ease, opacity .35s ease;
}

.prompter.dimmen .wort.gesagt { color: #4a4d55; }
.wort.aktuell { color: var(--akzent); }
.absatz { margin: 0 0 .55em; }

.lesezone {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--lesezeile, 40%);
  height: 0;
  border-top: 1px solid rgba(255, 181, 98, .22);
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.prompter.marke .lesezone { opacity: 1; }

.lesezone::before, .lesezone::after {
  content: "";
  position: absolute;
  top: -7px;
  border: 7px solid transparent;
}

.lesezone::before { left: 0; border-left-color: var(--akzent); }
.lesezone::after { right: 0; border-right-color: var(--akzent); }

.verlauf {
  position: absolute;
  left: 0;
  right: 0;
  height: 15%;
  pointer-events: none;
}

.verlauf.oben {
  top: 0;
  height: 12%;
  background: linear-gradient(#000 40%, rgba(0, 0, 0, .7) 75%, transparent);
}
.verlauf.unten { bottom: 0; background: linear-gradient(transparent, #000); }

/* Übergang zwischen zwei Abschnitten */

.tor {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .95);
  backdrop-filter: blur(10px);
  z-index: 5;
  animation: einblenden .25s ease;
}

.tor[hidden] { display: none; }

@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

.tor-inhalt { text-align: center; padding: 24px; max-width: 640px; }
.tor-oben { margin: 0 0 6px; color: var(--text-leise); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.tor-inhalt h2 { margin: 0 0 14px; font-size: clamp(26px, 5vw, 40px); font-weight: 620; }
.tor-vorschau { margin: 0 0 26px; color: var(--text-still); font-size: clamp(15px, 2.4vw, 20px); line-height: 1.55; }

.tor-knopf {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--akzent);
  border-radius: 999px;
  color: var(--akzent);
  font-size: 15px;
  animation: pulsieren 2.4s ease-in-out infinite;
}

@keyframes pulsieren { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.tor-reihe { display: flex; gap: 10px; justify-content: center; }

/* Bedienleiste */

.leiste {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .85) 40%);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.prompter.leiste-sichtbar .leiste { opacity: 1; transform: none; pointer-events: auto; }

.leiste-knopf {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  color: #e8e9ec;
  cursor: pointer;
  font-size: 15px;
}

.leiste-knopf:active { background: rgba(255, 255, 255, .16); }
.leiste-luecke { flex: 1; }

.mikro .punkt {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
  flex: none;
}

.mikro.hoert .punkt { background: var(--gut); animation: atmen 1.8s ease-in-out infinite; }
.mikro.fehler .punkt { background: var(--gefahr); }
.mikro-text { font-size: 13px; }

@keyframes atmen { 0%, 100% { opacity: .45; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.15); } }

.leiste-lage {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 12px;
  color: var(--text-still);
  line-height: 1.25;
  padding: 0 6px;
}

.lage-rest { color: var(--text-leise); font-size: 11px; }

.statusband {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  padding: 7px 14px;
  background: rgba(20, 21, 25, .92);
  border: 1px solid var(--rand);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-still);
  white-space: nowrap;
  pointer-events: none;
}

.einstellungsblatt {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(360px, 92vw);
  z-index: 8;
  background: var(--flaeche);
  border-left: 1px solid var(--rand);
  display: flex;
  flex-direction: column;
  animation: hereinschieben .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

@keyframes hereinschieben { from { transform: translateX(100%); } to { transform: none; } }

.blatt-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rand);
}

.blatt-kopf h3 { margin: 0; font-size: 16px; }
.blatt-inhalt { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.blatt-fuss { margin: 0; font-size: 12.5px; color: var(--text-leise); line-height: 1.6; }

.schalterreihe { display: flex; flex-wrap: wrap; gap: 8px; }

.schalter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-still);
}

.schalter input { accent-color: var(--akzent); margin: 0; }
.schalter:has(input:checked) { color: var(--text); border-color: var(--rand-hell); }

.drehhinweis {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 28px;
  background: #000;
  text-align: center;
  color: var(--text-still);
}

.drehhinweis > * { max-width: 320px; }
.dreh-symbol { font-size: 46px; animation: kippen 2.2s ease-in-out infinite; }
.dreh-gross { font-size: 17px; color: var(--text); margin: 14px 0 8px; }
.dreh-klein { font-size: 13px; line-height: 1.6; margin: 0; }

@keyframes kippen { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(90deg); } }

/* ----------------------------------------------------------------- Wolke */

.wolke {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 50;
  padding: 10px 18px;
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand-hell);
  border-radius: 999px;
  font-size: 14px;
  animation: einblenden .2s ease;
  max-width: 90vw;
  text-align: center;
}

/* ---------------------------------------------------------------- Schmal */

@media (max-width: 860px) {
  .editor { grid-template-columns: 1fr; }
  .editor-seite { position: static; }
  .kopf { flex-wrap: wrap; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .titelfeld { order: 3; width: 100%; max-width: none; flex-basis: 100%; }
  .inhalt { padding: 16px 14px 40px; }
  .speicherstand { display: none; }
}

@media (max-width: 520px) {
  .werkzeug-knoepfe .knopf { flex: 1; }
}
