@import url('/font/standard.css');

:root {
  --ink: #1b2130;
  --panel: #252d3f;
  --panel-2: #2e3850;
  --line: #3a4560;
  --text: #eef0f4;
  --muted: #98a2b6;
  --honey: #f2b544;
  --honey-ink: #2a1f05;
  --red: #e5484d;
  --dazwischen: #ff5e7a;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --font: 'Bricolage Grotesque Variable', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

.hidden { display: none !important; }

/* ---------- Buttons & Felder ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  background: var(--panel-2);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--line); }
.btn.primary { background: var(--honey); color: var(--honey-ink); }
.btn.primary:hover { background: #f7c565; }
.btn.danger { background: transparent; color: #ff8a8d; }
.btn.danger:hover { background: rgba(229, 72, 77, 0.15); }
.btn.small { padding: 7px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--ink);
}
.field:focus { border-color: var(--honey); outline: none; }

svg.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(10px);
  background: var(--text);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Verwaltung ---------- */
.admin {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.admin h1 {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  font-stretch: 88%;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0 0 8px;
}
.admin .lead { color: var(--muted); margin: 0 0 32px; max-width: 52ch; }

.create { display: flex; gap: 10px; margin-bottom: 36px; }
.create .field { flex: 1; }

.room-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.room {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.room-name { font-size: 22px; font-weight: 700; margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* Der Name ist ein Feld, kein Dialog: anklicken, tippen, fertig. Sieht aus wie
   Text, bis man hineingeht. */
.room-name-feld {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  margin: -2px -6px;
  min-width: 8ch;
  flex: 1 1 12ch;
}
.room-name-feld:hover { border-color: var(--line); }
.room-name-feld:focus { border-color: var(--honey); background: var(--panel); outline: none; }
.room-schloss { font-size: 13px; font-weight: 600; color: var(--honey); }
/* Woher der Raum kommt - eine Feststellung, keine Auszeichnung, deshalb
   dieselbe Größe wie die Schloss-Marke, aber in Grau. */
.room-herkunft { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Rollen und Zugangslinks stehen ausgeklappt unter dem Raum - im Alltag
   interessiert das nicht, und die Zeile soll nicht zuwachsen. */
/* Reiter */
.reiter { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.reiter-knopf {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
}
.reiter-knopf:hover { color: var(--text); }
.reiter-knopf.active { color: var(--honey); border-bottom-color: var(--honey); }
#bereich-raeume.hidden, #bereich-konten.hidden { display: none; }
/* Das Fenster zeigt eine ganze Raumkarte - dafür braucht es mehr Breite als
   der Kontodialog. */
.karte.breit { width: min(720px, 100%); }
.karte.breit .room-list { margin: 0; }
.karte.breit .room { padding: 0; border: 0; }

/* Suchen und Blättern über der Liste */
.listen-kopf {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
/* Zwischen „Raum erstellen" und der Suche gehört eine Trennung: darüber legt
   man etwas an, darunter sucht man in dem, was es gibt. */
.listen-kopf.getrennt { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.listen-kopf .suche { flex: 1 1 220px; min-width: 0; }
.listen-zahl { font-size: 13px; color: var(--muted); white-space: nowrap; }
.listen-kopf .btn:disabled { opacity: 0.35; cursor: not-allowed; }
/* Der Besitzer ist ein Filter: ein Klick zeigt alles, was ihm gehört. Sieht
   aus wie Text, reagiert aber wie ein Knopf. */
.room-besitzer { color: var(--muted); }
button.room-besitzer {
  padding: 0;
  font: inherit;
  background: none;
  border: 0;
  border-bottom: 1px dotted transparent;
  cursor: pointer;
}
button.room-besitzer:hover { color: var(--honey); border-bottom-color: var(--honey); }
/* Der Punkt trennt „angelegt am" von „gehört wem". In Linienfarbe war er auf
   dunklem Grund praktisch unsichtbar. */
.room-meta span + span::before { content: ' · '; color: var(--muted); }
.konto-raeume { margin: 0 0 10px 12px; padding-left: 10px; border-left: 2px solid var(--line); }
.konto-raeume.hidden { display: none; }
.btn.leer-knopf { opacity: 0.45; }

.room-fach { grid-column: 1 / -1; position: relative; margin-top: 10px; padding: 12px 14px; background: var(--panel); border-radius: var(--radius-sm); }
/* Zuklappen von innen. Der Knopf, der das Fach geöffnet hat, sieht nicht so
   aus, als täte er es auch wieder zu - also hier, wo man es erwartet. */
.fach-zu {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.fach-zu:hover { color: var(--text); background: var(--line); }
.room-fach h3 { margin: 4px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.room-fach h3 + .leer, .room-fach .leer { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.fach-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fach-zeile:last-of-type { border-bottom: none; }
.fach-name { font-weight: 600; flex: 1 1 10ch; min-width: 0; }
.fach-rang { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--honey); color: var(--honey-ink); }
.fach-rang.aus { background: var(--red); color: var(--text); }
.fach-datum { font-size: 13px; color: var(--muted); }
/* Die Seite für den geschlossenen Betrieb. Sie hat nichts zu tun, deshalb
   steht sie nicht oben am Rand, sondern dort, wo man hinsieht. */
.zu { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.zu .lead { margin-bottom: 8px; }
.zu .konto-zeile { margin-top: 28px; text-align: left; }

.start h2 { font-size: 19px; margin-top: 28px; }
.start .hint { margin: -6px 0 0; }
/* ---------- Zahlen ---------- */
.zahlen-gruppe { margin: 22px 0 0; }
.zahlen-gruppe h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.zahlen-gruppe .leer { margin: 0 0 10px; max-width: 62ch; }
.zahlen-zeile {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.zahlen-zeile:last-child { border-bottom: 0; }
.zahlen-was { flex: 1 1 auto; color: var(--muted); }
.zahlen-wert { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Der Verlauf: ein Balken je Tag, der höchste gibt den Maßstab. Zahlen an
   jeden Tag zu schreiben, liest niemand - die stehen im Tooltip. */
.verlauf {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 90px;
  padding: 6px 0 0;
  border-bottom: 1px solid var(--line);
}
.verlauf-balken { flex: 1 1 0; min-width: 4px; background: var(--honey); border-radius: 2px 2px 0 0; }
.verlauf-balken.leer { background: var(--line); }

.konten { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 8px; }
.konten h2 { font-size: 19px; }
.fach-neu { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
/* Der eben erzeugte Zugangs- oder Einladungslink. Auffällig, weil er genau
   einmal dasteht - und das Feld nimmt den Platz, damit man ihn ganz sieht. */
.frischer-link {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--honey);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.frischer-link .leer { margin: 0; }
.frischer-link .link-feld {
  flex: 1 1 100%;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  resize: vertical;
  word-break: break-all;
}
.fach-einmal { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.field.klein { padding: 6px 10px; font-size: 14px; width: auto; }
/* Zwei Zahlenfelder nebeneinander (eigene und übernommene Räume) - ohne feste
   Breite zieht das erste die Zeile auseinander. */
.field.klein.zahl { width: 6.5em; }
.fach-regeln { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 6px; }
.fach-regel { display: flex; align-items: center; gap: 5px; font-size: 14px; }
.room-meta { color: var(--muted); font-size: 14px; }
.room-meta .live { color: var(--honey); }
/* Dass ein Raum von selbst verschwindet, gehört sichtbar dazu - aber es ist
   keine Warnung, sondern der Normalfall für alles ohne angemeldeten Besitzer. */
.room-meta .vergeht { color: var(--muted); }
.room-actions { grid-row: span 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--muted); padding: 28px 0; }

@media (max-width: 560px) {
  .create { flex-direction: column; }
  .room { grid-template-columns: 1fr; }
  .room-actions { grid-row: auto; justify-content: flex-start; }
}

/* ---------- Vorraum (Lobby) ---------- */
.lobby {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.lobby-inner { width: 100%; max-width: 560px; }
.lobby h1 {
  font-size: clamp(36px, 9vw, 60px);
  font-weight: 800;
  font-stretch: 88%;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 6px;
  overflow-wrap: anywhere;
}
.lobby .who { color: var(--muted); margin: 0 0 20px; min-height: 1.45em; }

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  margin-bottom: 20px;
}
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.preview .toggles { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; }

.join-row { display: flex; gap: 10px; }
.join-row .field { flex: 1; }
.hint { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

.message { max-width: 44ch; }
.message h1 { font-size: clamp(30px, 6vw, 44px); }
.message p { color: var(--muted); }

/* ---------- Call ---------- */
.call {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.call-top {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 18px 0;
  min-height: 42px;
}
.call-top .title { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-top .count { color: var(--muted); font-size: 14px; white-space: nowrap; }
/* Gleich breite Ziffern, sonst zappelt die Anzeige im Sekundentakt. */
.call-top .dauer {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.call-top .status { color: var(--honey); font-size: 14px; }

/* Jede Kachel sitzt an einer in JS berechneten Stelle. Dadurch passen immer alle
   auf den Schirm, und beim Umsortieren gleiten sie an ihren neuen Platz. */
.buehne {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 10px;
  padding-right: 0;
}

#grid {
  flex: 1;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.tile {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  cursor: grab;
  touch-action: none;
  transition: transform 0.25s ease, width 0.25s ease, height 0.25s ease, box-shadow 0.2s ease;
}

/* Die Kachel am Finger soll nicht hinterherhinken. */
.tile.dragging {
  transition: none;
  cursor: grabbing;
  z-index: 10;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.tile-actions {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.tile.knoepfe-an .tile-actions,
.tile:focus-within .tile-actions { opacity: 1; pointer-events: auto; }

/* Nur wo es einen Mauszeiger gibt. Am Handy würde ein Antippen sonst als
   Zeigen hängen bleiben, und die Knöpfe blieben für immer im Bild. */
@media (hover: hover) {
  .tile:hover .tile-actions { opacity: 1; pointer-events: auto; }
}

.tile-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(20, 25, 36, 0.72);
  backdrop-filter: blur(6px);
  color: var(--text);
  cursor: pointer;
}
.tile-btn:hover { background: rgba(20, 25, 36, 0.92); }
.tile-btn svg.icon { width: 16px; height: 16px; }
.tile.pinned .tile-btn.pin { background: var(--honey); color: var(--honey-ink); }
.tile-btn.off { background: var(--text); color: var(--ink); }
.tile.video-aus { outline: 2px dashed var(--line); outline-offset: -2px; }

/* Wer nicht senden darf, wird auch nicht gezeigt. Durchgesetzt wird das hier,
   beim Empfänger - der Server kann Ton und Bild im Mesh nicht abschalten. */
.tile.unterdrueckt video { visibility: hidden; }
.tile.unterdrueckt .avatar { display: grid; }
.ctrl.gesperrt { opacity: 0.4; cursor: not-allowed; }

/* Wer spricht, bekommt einen Rahmen. Als Umrandung, nicht als innerer Schatten:
   der läge unter dem Video und wäre nicht zu sehen. */
.tile.speaking {
  outline: 3px solid var(--honey);
  outline-offset: -3px;
}

/* Reden mehrere gleichzeitig, wechselt die Farbe bei allen Sprechenden - auch
   bei der eigenen Kachel. Keine Zuordnung, wer angefangen hat; die Aussage ist
   nur, dass man gerade nichts versteht. */
#grid.durcheinander .tile.speaking { outline-color: var(--dazwischen); }

/* Mikrofon und Bildschirmton laufen in eigenen Elementen, nicht im Videobild.
   Sie sollen nur klingen, nicht im Weg stehen. */
.tile audio { display: none; }
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.tile.me video { transform: scaleX(-1); }
.tile.screen video { object-fit: contain; transform: none; }
.tile.cam-off video, .preview.cam-off video, .tile.video-aus video { visibility: hidden; }

.avatar {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
}
.tile.cam-off .avatar, .preview.cam-off .avatar, .tile.video-aus .avatar { display: grid; }
.avatar span {
  width: min(96px, 30%);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--honey);
  color: var(--honey-ink);
  font-weight: 800;
  font-size: clamp(22px, 4vw, 40px);
}

.label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: rgba(20, 25, 36, 0.72);
  backdrop-filter: blur(6px);
  font-size: 14px;
  font-weight: 600;
}
.label .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label .mic-off { display: none; color: #ff8a8d; }
.label .mic-off svg.icon { width: 16px; height: 16px; }
.tile.mic-off .label .mic-off { display: inline-flex; }

/* Läuft die Verbindung direkt oder über den Server? */
.label .weg {
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.label .weg::before { content: "· "; }
.label .weg.relay { color: var(--honey); }

/* Lautstärke für einzelne Teilnehmer */
.volume {
  position: absolute;
  top: 46px;
  left: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(20, 25, 36, 0.85);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.tile.volume-open .volume { opacity: 1; visibility: visible; }
.volume input {
  width: 96px;
  display: block;
  accent-color: var(--honey);
  touch-action: auto;
  cursor: pointer;
}

/* Teilt jemand Ton mit, kommt ein zweiter Regler dazu: Stimme und Film sind
   selten gleich laut. Nur dann - ein Regler ohne Wirkung wäre schlimmer als
   keiner. Aus der Pille wird dabei ein Kasten. */
.volume-zeile { display: flex; align-items: center; gap: 8px; }
.volume-zeile + .volume-zeile { margin-top: 8px; }
.volume .ton-zeile { display: none; }
.tile.ton-geteilt .volume .ton-zeile { display: flex; }
.tile.ton-geteilt .volume { border-radius: var(--radius-sm); }

/* Bei nur einem Regler ist ohnehin klar, worum es geht - dann bleibt das
   Symbol weg und der Aufklapper so schmal wie bisher. Das zählt: bei sechs
   Leuten sind die Kacheln keine 200 Pixel breit. */
.volume-sym { display: none; color: var(--muted); }
.tile.ton-geteilt .volume-sym { display: flex; }
.volume-sym svg.icon { width: 14px; height: 14px; }
.tile.muted-peer .label .name { opacity: 0.55; }

/* Hinweis an der Tür: Passwort nötig oder falsch. Auffällig, aber nicht rot -
   „du hast dich vertippt" ist kein Fehler des Nutzers. */
.hint.tuer { color: var(--honey); font-weight: 600; }

.conn {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 25, 36, 0.72);
  color: var(--honey);
  font-size: 13px;
}
.conn:empty { display: none; }

/* Eigenes Bild ausgeblendet, Kamera läuft weiter. Deutlich sichtbar, aber
   ruhig: nichts blinkt, nichts bewegt sich. */
.kamera-laeuft {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  background: rgba(20, 25, 36, 0.82);
  backdrop-filter: blur(6px);
  color: #ff9b9e;
  font-size: 13px;
  font-weight: 600;
}
.kamera-laeuft .punkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}

/* Steuerleiste */
.controls {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
  flex-wrap: wrap;
}
.ctrl {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  cursor: pointer;
}
.ctrl:hover { background: var(--line); }
.ctrl.off { background: var(--text); color: var(--ink); }
.ctrl.active { background: var(--honey); color: var(--honey-ink); }
/* Wer klopft, wartet auf eine Antwort - das darf man nicht übersehen. */
.ctrl.wartet { box-shadow: 0 0 0 2px var(--honey); }
.ctrl.leave { background: var(--red); width: 70px; border-radius: 27px; }
.ctrl.leave:hover { background: #f0666a; }
.controls .spacer { width: 12px; }

.preview .ctrl { background: rgba(20, 25, 36, 0.7); backdrop-filter: blur(6px); }
.preview .ctrl.off { background: var(--text); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  #toast { transition: none; }
  .tile { transition: none; }
}


/* ---------- Chat ---------- */
/* Die Kacheln rücken zusammen, wenn der Chat aufgeht: #grid wird schmaler, und
   die Layout-Rechnung merkt das von selbst über den ResizeObserver. */
.chat {
  width: 0;
  flex: 0 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-lg);
  transition: flex-basis 0.2s ease, width 0.2s ease;
}
.chat-offen .chat {
  width: min(360px, 34vw);
  flex: 0 0 min(360px, 34vw);
  margin: 0 12px 0 0;
}

/* ---------- Leute ---------- */
/* Dieselbe Mechanik wie beim Chat. Moderation gehört nicht auf die Kachel: die
   Knöpfe dort verdecken am Handy schon jetzt das halbe Bild. */
.leute {
  width: 0;
  flex: 0 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-lg);
  transition: flex-basis 0.2s ease, width 0.2s ease;
}
.leute-offen .leute {
  width: min(340px, 34vw);
  flex: 0 0 min(340px, 34vw);
  margin: 0 12px 0 0;
}
.leute-liste, .leute-gesperrt, .leute-warten { overflow-y: auto; padding: 10px 12px; }
.leute-gesperrt { border-top: 1px solid var(--line); }
.leute-warten { border-bottom: 1px solid var(--line); background: rgba(242, 181, 68, 0.08); }
.leute-gesperrt h3, .leute-warten h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.leute-warten h3 { color: var(--honey); }
.leute-tun { padding: 10px 12px 0; }

/* ---------- Konto ---------- */
/* Die Zahlenzeile am Fuß der Startseite: da, aber leise. */
.zahlen-zeile-fuss { margin: 28px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.konto-zeile { margin: 14px 0 0; text-align: center; }
.leise {
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 1px dotted var(--line);
  padding: 2px 0;
  cursor: pointer;
}
.leise:hover { color: var(--honey); border-bottom-color: var(--honey); }
.konto-kuerzel { color: var(--honey); font-weight: 600; }

.huelle {
  position: fixed;
  inset: 0;
  background: rgba(12, 15, 22, 0.7);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 16px;
}
.karte {
  background: var(--panel);
  border-radius: var(--radius-lg);
  width: min(420px, 100%);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}
.karte-kopf { display: flex; align-items: center; gap: 8px; padding: 14px 12px 10px 18px; border-bottom: 1px solid var(--line); }
.karte-kopf h2 { margin: 0; font-size: 19px; flex: 1; }
.karte-inhalt { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.karte-inhalt .field { width: 100%; }
.karte-inhalt h3 { margin: 8px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.karte-inhalt .warnung { color: var(--muted); font-size: 14px; margin: 0; }
.konto-fehler { color: var(--red); margin: 0 18px 14px; }
.sitzung { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sitzung:last-child { border-bottom: none; }
.sitzung .wo { flex: 1; }
.sitzung .jetzt { color: var(--honey); font-weight: 600; font-size: 12px; }
.leute-tun .btn.hidden { display: none; }

/* Regeln für alle */
.leute-regeln { padding: 10px 12px 0; }
.leute-regeln.hidden { display: none; }
.regeln-auf {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.regeln-auf::after { content: ' ▾'; }
.regeln-auf.offen { color: var(--honey); border-color: var(--honey); }
.regeln-auf.offen::after { content: ' ▴'; }
.regeln-auf:hover { color: var(--text); }
.regeln-inhalt { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px 0; }
.regeln-inhalt .vortrag { align-self: flex-start; margin-bottom: 6px; }
.vortragende-zeile { font-size: 13px; color: var(--honey); margin: 0 0 8px; }
.regeln-inhalt .vortrag.active { border-color: var(--honey); color: var(--honey); }
.regeln-inhalt.hidden { display: none; }
.regel-zeile { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 3px 0; }
.alle-zeile { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.alle-zeile .btn { flex: 1 1 auto; }
.btn.sperre.active { border-color: var(--red); color: var(--red); }
.btn.sperre:disabled { opacity: 0.45; cursor: not-allowed; }
.ausnahmen-zeile {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--honey);
}

.person { padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: none; }
.person-kopf { display: flex; align-items: center; gap: 8px; }
.person-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-rang {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.person-rang.hoch { background: var(--honey); color: var(--honey-ink); }
.person-rang.aus { background: var(--red); color: var(--text); }
.person-tun { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.person-tun:empty, .person-tun.hidden { display: none; }
/* Überschriften im Menü: sie trennen „darf" von „Rolle" von „aus dem Raum" -
   ohne das stünde „Sperren" gleichberechtigt neben „Mikrofon: ja". */
.person-tun h4 {
  flex: 0 0 100%;
  margin: 6px 0 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.person-tun h4:first-child { margin-top: 0; }
/* ---------- Melden und Reaktionen ---------- */
.reaktionen {
  /* An der Steuerleiste ausgerichtet, nicht am Fensterrand: die Leiste bricht
     auf schmalen Geräten um, und ein fester Abstand von unten verdeckte dann
     den Knopf, der die Auswahl öffnet. */
  position: absolute;
  bottom: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  z-index: 20;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
}
.reaktionen.hidden { display: none; }
.reaktion {
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.reaktion:hover { background: var(--panel-2); }
.reaktion.hand.an { border-color: var(--honey); background: rgba(242, 181, 68, 0.15); }

/* Fliegt einmal hoch und ist weg. pointer-events: none, sonst fängt sie den
   Klick auf die Kachel darunter ab. */
.reaktion-flug {
  position: absolute;
  left: 50%;
  bottom: 12%;
  font-size: 40px;
  pointer-events: none;
  animation: reaktion-hoch 2.5s ease-out forwards;
  z-index: 6;
}
@keyframes reaktion-hoch {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.1); }
  30% { transform: translate(-50%, -10px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .reaktion-flug { animation: reaktion-blenden 2.5s ease-out forwards; }
  @keyframes reaktion-blenden { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
}

/* Eine erhobene Hand bleibt, bis sie gesenkt wird. Oben RECHTS: oben links
   sitzen die Kachel-Knöpfe (.tile-actions), dort lag sie zuerst und verdeckte
   sie. */
.tile.meldet::after {
  content: '✋';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 20px;
  background: var(--honey);
  border-radius: 999px;
  padding: 3px 6px;
  line-height: 1;
  z-index: 5;
}

.person-marken { display: flex; gap: 4px; align-items: center; }
.person-marken .marke.meldet { font-size: 14px; }
.person-marken .marke { display: inline-flex; color: var(--red); }
.person-marken .icon { width: 15px; height: 15px; }
.person-mehr {
  font: inherit;
  line-height: 1;
  letter-spacing: 0.08em;
  padding: 2px 8px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.person-mehr:hover { color: var(--text); border-color: var(--line); }
.person-mehr.offen { color: var(--honey); border-color: var(--honey); }
.mini {
  font: inherit;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.mini:hover { border-color: var(--honey); }
.mini.warn { border-color: var(--red); color: var(--red); }

.chat-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 10px 10px 14px;
  border-bottom: 1px solid var(--line);
}
.chat-titel { font-weight: 700; }
.chat-fluechtig { flex: 1; color: var(--muted); font-size: 12px; }

.chat-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}
.chat-btn:hover { background: var(--panel-2); color: var(--text); }
.chat-btn svg.icon { width: 18px; height: 18px; }
.chat-btn.senden { background: var(--honey); color: var(--honey-ink); }
.chat-btn.senden:hover { background: #f7c565; }

.chat-verlauf {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

.chat-zeile { max-width: 100%; }

/* Meldungen des Programms. Kein Kasten, sondern schlichter Text im Verlauf -
   nur blasser und kursiv, damit man sie nicht für jemandes Nachricht hält. */
.chat-zeile.hinweis {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.hinweis-text { flex: 1; min-width: 0; }
.hinweis-weg {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.chat-zeile.hinweis:hover .hinweis-weg,
.chat-zeile.hinweis:focus-within .hinweis-weg { opacity: 1; }
@media (pointer: coarse) { .hinweis-weg { opacity: 1; } }
.hinweis-weg:hover { background: var(--panel-2); color: var(--text); }
.hinweis-weg svg.icon { width: 13px; height: 13px; }

.chat-kopf { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.chat-name { font-weight: 600; font-size: 14px; }
.chat-zeile.selbst .chat-name { color: var(--honey); }
.chat-zeit { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Knopf zum Entfernen, erscheint an der Nachricht */
.chat-kopf { position: relative; }
.chat-mehr {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 24px;
  height: 20px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.chat-mehr svg.icon { width: 16px; height: 16px; }
.chat-zeile:hover .chat-mehr,
.chat-zeile:focus-within .chat-mehr { opacity: 1; }
.chat-mehr:hover { background: var(--panel-2); color: var(--text); }
@media (pointer: coarse) { .chat-mehr { opacity: 1; } }

.chat-menue {
  position: absolute;
  top: 22px;
  left: 0;
  z-index: 5;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.chat-menue button {
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}
.chat-menue button:hover { background: var(--line); }
.chat-menue button.warnung { color: #ff8a8d; }

/* Was übrig bleibt, wenn eine Nachricht fort ist */
.chat-zeile.weggeraeumt {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.chat-wieder {
  border: 0;
  background: transparent;
  color: var(--honey);
  cursor: pointer;
  font-size: 13px;
  font-style: normal;
  padding: 0;
  text-decoration: underline;
}

/* Laufender Versand mit Abbruch */
.chat-abbruch {
  border: 0;
  background: transparent;
  color: var(--honey);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}
.chat-fortschritt { flex-basis: 100%; }

.chat-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.chat-text a { color: var(--honey); }

/* Bilder und Videos im Verlauf */
.chat-vorschau {
  position: relative;
  display: block;
  cursor: zoom-in;
  line-height: 0;
}
.chat-vorschau img,
.chat-vorschau video {
  max-width: 100%;
  max-height: 260px;
  border-radius: var(--radius-sm);
  display: block;
  background: #000;
}
.chat-abspielen {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(20, 25, 36, 0.72);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.chat-abspielen::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 16px solid var(--text);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  transform: translateX(3px);
}

/* Abgelaufene Dateien bleiben sichtbar, aber sichtlich vorbei. */
.chat-datei.abgelaufen { opacity: 0.5; }

/* Große Ansicht über der Seite */
.lichtkasten {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 56px 20px 20px;
  background: rgba(12, 15, 22, 0.92);
  backdrop-filter: blur(4px);
}
/* Gegen die Fenstergröße gerechnet, nicht gegen die Zelle: Deren Höhe richtet
   sich selbst nach dem Bild, weshalb "max-height: 100%" große Bilder unten aus
   dem Fenster schieben würde. Kleine Bilder bleiben in ihrer Größe - max-*
   verkleinert nur, es vergrößert nie. */
.lichtkasten img,
.lichtkasten video {
  max-width: calc(100vw - 40px);
  max-height: calc(100dvh - 76px);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
  object-fit: contain;
}
.lichtkasten-leiste {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}
.lichtkasten-leiste span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.lichtkasten-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  text-decoration: none;
}
.lichtkasten-btn:hover { background: var(--panel-2); }
.lichtkasten-btn svg.icon { width: 18px; height: 18px; }

.chat-datei {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  text-decoration: none;
  color: inherit;
}
.chat-datei:hover { background: var(--line); }
.chat-datei-symbol { color: var(--muted); display: grid; place-items: center; flex: none; }
.chat-datei-info { min-width: 0; display: flex; flex-direction: column; }
.chat-datei-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-datei-groesse { color: var(--muted); font-size: 12px; }

.chat-fortschritt {
  height: 4px;
  border-radius: 999px;
  background: var(--panel-2);
  margin-top: 6px;
  overflow: hidden;
}
.chat-fortschritt div { height: 100%; width: 0; background: var(--honey); transition: width 0.15s linear; }

.chat-eingabe {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.chat-eingabe textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ink);
  padding: 9px 12px;
  height: 38px;
  min-height: 38px;
  max-height: 120px;
  line-height: 1.35;
}
.chat-eingabe textarea:focus { border-color: var(--honey); outline: none; }

/* Zähler für Ungelesenes am Chat-Knopf */
.ctrl { position: relative; }
.ctrl .zaehler {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--honey);
  color: var(--honey-ink);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* Etwas ins Fenster gezogen */
.ablage-hinweis {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: rgba(20, 25, 36, 0.72);
  backdrop-filter: blur(3px);
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
}
.chat-ablage-an .ablage-hinweis { display: grid; }

/* Am Handy legt sich der Chat über das Bild, statt daneben zu stehen. */
@media (max-width: 720px) {
  .chat-offen .chat {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* Nicht die volle Fensterhöhe, sondern das, was neben der Tastatur übrig
       bleibt - sonst steht das Eingabefeld hinter ihr. */
    height: var(--sichthoehe, 100dvh);
    z-index: 40;
    width: auto;
    flex: none;
    margin: 0;
    border-radius: 0;
  }
}

@media (max-width: 720px) {
  /* Am Handy legt sich das Panel über alles, wie der Chat. */
  .leute-offen .leute {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--sichthoehe, 100dvh);
    z-index: 40;
    width: auto;
    flex: none;
    margin: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat, .leute { transition: none; }
}
