/* =====================================================================
   LineBattle – Grund-Stylesheet (Konten, Einrichtung, Rechtliches, Bausteine)
   Designs: Hell (Whiteboard/Papier) · Dunkel · Tafel   – Spiel-Teile: public/css/lb-spiel.css
   1. Schriften  2. Tokens  3. Basis  4. Layout  5. Komponenten  6. Seiten  7. Bewegung
   ===================================================================== */

/* 1. Lokale Schriften (Lizenzen: public/assets/LIZENZEN.md) */
@font-face { font-family: "Patrick Hand"; src: url("../fonts/PatrickHand-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/Kalam-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("../fonts/Kalam-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("../fonts/PermanentMarker-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* 2. Tokens – Hell (Whiteboard / Papier) */
:root {
  color-scheme: light;
  --lb-bg: #F4F0E6;
  --lb-bg-glow: rgb(255 255 255 / 0.55);
  --lb-surface: #FFFCF6;
  --lb-surface-2: #EEE8DA;
  --lb-pressed: #E3DCCB;
  --lb-line: #B0AA9C;
  --lb-line-strong: #1A1A18;
  --lb-text: #1A1A18;
  --lb-text-muted: #4A4740;
  --lb-overlay: rgb(26 26 24 / 0.5);
  --lb-ink: #1A1A18;
  --lb-hilfe: #8A8A86;

  /* Seiten-Farben (Zeichen X / O / △ / □) */
  --lb-mag: #C2186A;  --lb-mag-soft: #F4D5E5;
  --lb-grn: #1B8A45;  --lb-grn-soft: #D3EDDA;
  --lb-blu: #1E5FA8;  --lb-blu-soft: #D4E3F4;
  --lb-org: #B45309;  --lb-org-soft: #F8E1C6;
  --lb-rand: #8A8A86;
  --lb-gelb: #FFE566;
  --lb-amber: #B8860B; --lb-amber-soft: #F3E6B8;

  /* Profilfarben (Konto) */
  --lb-blau: #2F6FDB;   --lb-blau-soft: #DCE7FA;
  --lb-gruen: #1B8A45;  --lb-gruen-soft: #D3EDDA;
  --lb-lila: #7B3FC4;   --lb-lila-soft: #EDE3FA;
  --lb-orange: #B45309; --lb-orange-soft: #F8E1C6;
  --lb-rot: #B42318;    --lb-rot-soft: #FCECEA;

  --lb-accent: #2F6FDB;
  --lb-accent-soft: #DCE7FA;
  --lb-on-accent: #F7F7F4;
  --lb-btn-a: #2A68D4; --lb-btn-b: #3A7DE6; --lb-btn-c: #2F70DB; --lb-btn-edge: #1A4A9A; --lb-btn-shadow: #163A78;

  --lb-ok: #1B7A3E;   --lb-ok-soft: #D3EDDA;
  --lb-warn: #7A5600; --lb-warn-soft: #F3E6B8;
  --lb-danger: #B42318; --lb-danger-soft: #FCECEA;
  --lb-focus: #1E5FA8;

  --font-hand: "Patrick Hand", "Segoe Print", "Bradley Hand", "Chalkboard SE", system-ui, sans-serif;
  --font-sans: var(--font-hand);
  --font-btn: "Kalam", "Patrick Hand", "Segoe Print", system-ui, sans-serif;
  --font-marker: "Permanent Marker", "Kalam", "Patrick Hand", system-ui, sans-serif;
  --font-mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --fs-xs: 0.9rem;
  --fs-sm: 1rem;
  --fs-md: 1.15rem;
  --fs-lg: 1.3rem;
  --fs-xl: 1.7rem;
  --fs-2xl: 2.3rem;
  --lh-tight: 1.1;
  --lh-body: 1.35;

  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.5rem; --sp-6: 2rem;

  --radius-sm: 8px;
  --radius-md: 14px 16px 13px 15px;
  --radius-lg: 16px 18px 14px 17px;
  --radius-pill: 999px;
  --shadow-1: 1px 2px 0 rgb(26 26 24 / 0.12);
  --shadow-2: 3px 5px 0 rgb(26 26 24 / 0.16), 0 10px 30px rgb(26 26 24 / 0.12);
  --shadow-btn: 1px 2px 0 var(--lb-ink);

  --touch: 48px;
  --content-max: 760px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-press: 120ms;
  --dur-ui: 200ms;
}

/* Dunkel */
:root[data-theme="dark"] {
  color-scheme: dark;
  --lb-bg: #1C1B19;
  --lb-bg-glow: rgb(255 255 255 / 0.03);
  --lb-surface: #262420;
  --lb-surface-2: #302D28;
  --lb-pressed: #3A3731;
  --lb-line: #5C574D;
  --lb-line-strong: #E8E2D2;
  --lb-text: #EFE9DA;
  --lb-text-muted: #BDB5A3;
  --lb-overlay: rgb(0 0 0 / 0.65);
  --lb-ink: #E8E2D2;
  --lb-hilfe: #77726A;
  --lb-mag: #F06AA8;  --lb-mag-soft: #4A1F33;
  --lb-grn: #5BC985;  --lb-grn-soft: #1D3A28;
  --lb-blu: #79A8E8;  --lb-blu-soft: #1F3149;
  --lb-org: #F0A050;  --lb-org-soft: #47301A;
  --lb-rand: #8E887C;
  --lb-gelb: #E5C93A;
  --lb-amber: #E0B440; --lb-amber-soft: #3D3214;
  --lb-blau: #79A8E8;   --lb-blau-soft: #1F3149;
  --lb-gruen: #5BC985;  --lb-gruen-soft: #1D3A28;
  --lb-lila: #C39BF5;   --lb-lila-soft: #33264A;
  --lb-orange: #F0A050; --lb-orange-soft: #47301A;
  --lb-rot: #FF8A7A;    --lb-rot-soft: #4A1F1B;
  --lb-accent: #79A8E8; --lb-accent-soft: #1F3149; --lb-on-accent: #101418;
  --lb-btn-a: #3F78D8; --lb-btn-b: #4E88E8; --lb-btn-c: #457FE0; --lb-btn-edge: #9CC0F5; --lb-btn-shadow: #0B1A33;
  --lb-ok: #6BD495; --lb-ok-soft: #1D3A28;
  --lb-warn: #F2CD5C; --lb-warn-soft: #3D3214;
  --lb-danger: #FF8A7A; --lb-danger-soft: #4A1F1B;
  --lb-focus: #9CC0F5;
  --shadow-1: 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-2: 3px 5px 0 rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.5);
}

/* Tafel (Kreide auf Grün) */
:root[data-theme="tafel"] {
  color-scheme: dark;
  --lb-bg: #24412C;
  --lb-bg-glow: rgb(255 255 255 / 0.05);
  --lb-surface: #2C4D35;
  --lb-surface-2: #335A3E;
  --lb-pressed: #3B6547;
  --lb-line: #6F8F76;
  --lb-line-strong: #F1E9C8;
  --lb-text: #F4EED6;
  --lb-text-muted: #CFD8C4;
  --lb-overlay: rgb(8 20 12 / 0.7);
  --lb-ink: #F1E9C8;
  --lb-hilfe: #7E9A84;
  --lb-mag: #FF9CC8;  --lb-mag-soft: #5A3046;
  --lb-grn: #C6F2A6;  --lb-grn-soft: #3F6A3C;
  --lb-blu: #A8CCFF;  --lb-blu-soft: #304A63;
  --lb-org: #FFC98A;  --lb-org-soft: #5C4426;
  --lb-rand: #B9C4B0;
  --lb-gelb: #F5E27A;
  --lb-amber: #F5D36A; --lb-amber-soft: #4D4524;
  --lb-blau: #A8CCFF;   --lb-blau-soft: #304A63;
  --lb-gruen: #C6F2A6;  --lb-gruen-soft: #3F6A3C;
  --lb-lila: #D9BEFF;   --lb-lila-soft: #46385F;
  --lb-orange: #FFC98A; --lb-orange-soft: #5C4426;
  --lb-rot: #FFAA9C;    --lb-rot-soft: #5A2F2A;
  --lb-accent: #A8CCFF; --lb-accent-soft: #304A63; --lb-on-accent: #10201A;
  --lb-btn-a: #F1E9C8; --lb-btn-b: #E6DDB8; --lb-btn-c: #EDE4C2; --lb-btn-edge: #F1E9C8; --lb-btn-shadow: #10201A;
  --lb-ok: #C6F2A6; --lb-ok-soft: #3F6A3C;
  --lb-warn: #F5D36A; --lb-warn-soft: #4D4524;
  --lb-danger: #FFAA9C; --lb-danger-soft: #5A2F2A;
  --lb-focus: #F5E27A;
  --shadow-1: 1px 2px 0 rgb(0 0 0 / 0.35);
  --shadow-2: 3px 5px 0 rgb(0 0 0 / 0.35), 0 12px 32px rgb(0 0 0 / 0.4);
}
:root[data-theme="tafel"] .btn--primary { color: #1E3826; }

/* Gaeste ohne Wahl: System-Dunkel = Dunkel */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --lb-bg: #1C1B19; --lb-surface: #262420; --lb-surface-2: #302D28; --lb-pressed: #3A3731;
    --lb-line: #5C574D; --lb-line-strong: #E8E2D2; --lb-text: #EFE9DA; --lb-text-muted: #BDB5A3;
    --lb-ink: #E8E2D2; --lb-hilfe: #77726A; --lb-overlay: rgb(0 0 0 / 0.65);
    --lb-mag: #F06AA8; --lb-mag-soft: #4A1F33; --lb-grn: #5BC985; --lb-grn-soft: #1D3A28;
    --lb-blu: #79A8E8; --lb-blu-soft: #1F3149; --lb-org: #F0A050; --lb-org-soft: #47301A;
    --lb-accent: #79A8E8; --lb-accent-soft: #1F3149; --lb-on-accent: #101418; --lb-focus: #9CC0F5;
    --lb-danger: #FF8A7A; --lb-danger-soft: #4A1F1B; --lb-warn: #F2CD5C; --lb-warn-soft: #3D3214;
    --lb-ok: #6BD495; --lb-ok-soft: #1D3A28; --lb-gelb: #E5C93A; --lb-amber-soft: #3D3214;
  }
}

/* Profil-Akzentfarbe: nur fuer Avatare/kleine Akzente, Knoepfe bleiben blau (Mockup) */
.lb-color-blau   { color: var(--lb-blau); }
.lb-color-gruen  { color: var(--lb-gruen); }
.lb-color-lila   { color: var(--lb-lila); }
.lb-color-orange { color: var(--lb-orange); }

/* 3. Basis */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.lb-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 20% 0%, var(--lb-bg-glow), transparent 52%),
    var(--lb-bg);
  background-attachment: fixed;
  color: var(--lb-text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  -webkit-font-smoothing: antialiased;
}

.lb-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

h1, h2, h3 {
  margin: 0;
  line-height: var(--lh-tight);
  font-family: var(--font-marker);
  font-weight: 400;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
p { margin: 0; max-width: 65ch; }
a { color: var(--lb-accent); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--lb-focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.mono { font-family: var(--font-mono); font-size: 0.92em; overflow-wrap: anywhere; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--lb-text-muted); }
.stack > * + * { margin-top: var(--sp-4); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: -9999px; top: var(--sp-2); z-index: 200;
  background: var(--lb-accent); color: var(--lb-on-accent);
  padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-md);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: var(--sp-2); }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 4. Layout */
.lb-main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--sp-4) + env(safe-area-inset-top, 0px)) var(--sp-4) calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
}

.panel {
  background: var(--lb-surface);
  border: 2px solid var(--lb-line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-1);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 35em) { .grid-2 { grid-template-columns: 1fr; } }

.lb-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.lb-inline { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: stretch; }
.lb-inline > .input { flex: 1 1 180px; min-width: 0; }

/* 5. Komponenten */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--touch); min-width: var(--touch);
  padding: 0 var(--sp-4);
  border-radius: var(--radius-md);
  border: 2.5px solid var(--lb-ink);
  background: var(--lb-surface);
  color: var(--lb-text);
  font-family: var(--font-btn);
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 400;
  box-shadow: var(--shadow-btn);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out), background-color var(--dur-press) ease, border-color var(--dur-press) ease;
}
.btn:active:not(:disabled):not(.btn--primary):not(.btn--danger) { transform: scale(0.97); background: var(--lb-pressed); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--primary {
  background: repeating-linear-gradient(118deg, var(--lb-btn-a) 0 3px, var(--lb-btn-b) 3px 6px, var(--lb-btn-c) 6px 8px);
  border-color: var(--lb-btn-edge); color: var(--lb-on-accent); box-shadow: 1px 2px 0 var(--lb-btn-shadow);
}
.btn--primary:active:not(:disabled) { transform: scale(0.97) translateY(1px); box-shadow: 0 1px 0 var(--lb-btn-shadow); filter: brightness(0.92); }
.btn--gross { min-height: 56px; font-size: 1.45rem; }
.btn--klein { min-height: 44px; padding: 0 var(--sp-3); font-size: 1.05rem; box-shadow: none; }
.btn--block.btn--gross { width: 100%; }
.btn--danger { background: var(--lb-danger); border-color: var(--lb-danger); color: #ffffff; }
.btn--danger:active:not(:disabled) { transform: scale(0.97); background: var(--lb-danger); color: #ffffff; filter: brightness(0.88); }
.btn--danger-quiet { border-color: var(--lb-danger); color: var(--lb-danger); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--link { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.btn--small { min-height: var(--touch); padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: var(--touch); }
.btn.is-active { background: var(--lb-accent-soft); border-color: var(--lb-accent); color: var(--lb-accent); }

/* Formulare */
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field__label { font-weight: 600; font-size: var(--fs-sm); }
.field__hint { font-size: var(--fs-xs); color: var(--lb-text-muted); }
.field__error {
  display: flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-sm); color: var(--lb-danger); font-weight: 500;
}
.field.has-error .input { border-color: var(--lb-danger); }

.input {
  width: 100%; min-width: 0;
  min-height: var(--touch);
  padding: var(--sp-2) var(--sp-3);
  border: 2.3px solid var(--lb-ink);
  border-radius: var(--radius-md);
  background: var(--lb-surface);
  color: var(--lb-text);
  font-size: 1.2rem; /* >= 16px gegen iOS-Zoom */
}
textarea.input { min-height: 90px; resize: vertical; line-height: 1.45; }
.input-group { display: flex; gap: var(--sp-2); align-items: stretch; }
.input-group > .input { flex: 1 1 auto; }

.lb-check {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: var(--touch); cursor: pointer;
}
.lb-check input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--lb-accent); flex: none; }
.lb-checks { display: flex; flex-direction: column; gap: var(--sp-1); }

/* Hinweise / Notices */
.notice {
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--lb-line);
  background: var(--lb-surface-2);
  font-size: var(--fs-sm);
}
.notice--error { background: var(--lb-danger-soft); border-color: var(--lb-danger); color: var(--lb-danger); }
.notice--warn { background: var(--lb-warn-soft); border-color: var(--lb-warn); color: var(--lb-warn); }
.lb-flash { margin-bottom: var(--sp-4); background: var(--lb-ok-soft); border-color: var(--lb-ok); color: var(--lb-ok); }

/* Tags */
.lb-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; font-style: normal;
  background: var(--lb-surface-2); border: 1px solid var(--lb-line);
  vertical-align: middle;
}
.lb-tag--super { background: var(--lb-lila-soft); border-color: var(--lb-lila); color: var(--lb-lila); }
.lb-tag--admin { background: var(--lb-blau-soft); border-color: var(--lb-blau); color: var(--lb-blau); }
.lb-tag--warn { background: var(--lb-warn-soft); border-color: var(--lb-warn); color: var(--lb-warn); }
.lb-tag--off { opacity: 0.65; }
.acc-tag--locked { background: var(--lb-danger-soft); border-color: var(--lb-danger); color: var(--lb-danger); }
.mfa-on { background: var(--lb-ok-soft); border-color: var(--lb-ok); color: var(--lb-ok); }

/* Logo */
.lb-logo { font-family: var(--font-marker); font-weight: 400; display: inline-flex; align-items: baseline; letter-spacing: -0.02em; line-height: 1; }
.lb-logo__line { color: var(--lb-mag); }
.lb-logo__battle { color: var(--lb-grn); }
.lb-logo--hero { font-size: clamp(2.6rem, 13vw, 3.4rem); }

/* Avatar (rund, in Spielerfarbe umrandet) */
.lb-ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 2.3px solid var(--lb-ink);
  background: var(--lb-surface);
  overflow: hidden; flex-shrink: 0;
}
.lb-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-ava__svg { width: 76%; height: 76%; }
.lb-ava--sm { width: 38px; height: 38px; }
.lb-ava--md { width: 48px; height: 48px; border-width: 3px; }
.lb-ava--xl { width: 112px; height: 112px; border-width: 3.5px; }
.lb-ava--ring-blau   { border-color: var(--lb-blau); }
.lb-ava--ring-gruen  { border-color: var(--lb-gruen); }
.lb-ava--ring-lila   { border-color: var(--lb-lila); }
.lb-ava--ring-orange { border-color: var(--lb-orange); }

/* Farbauswahl (Blau, Gruen, Lila, Orange – kein Rot!) */
.lb-color-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.lb-color-opt { position: relative; cursor: pointer; display: inline-flex; }
.lb-color-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.lb-swatch {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 3px solid transparent;
  color: #ffffff;
  transition: transform var(--dur-press) var(--ease-out), box-shadow var(--dur-press) ease;
}
.lb-swatch--blau   { background: var(--lb-blau); }
.lb-swatch--gruen  { background: var(--lb-gruen); }
.lb-swatch--lila   { background: var(--lb-lila); }
.lb-swatch--orange { background: var(--lb-orange); }
.lb-swatch__check { opacity: 0; width: 22px; height: 22px; stroke-width: 2.8; }
.lb-color-opt input:checked + .lb-swatch { box-shadow: 0 0 0 3px var(--lb-bg), 0 0 0 6px var(--lb-text); }
.lb-color-opt input:checked + .lb-swatch .lb-swatch__check { opacity: 1; }
.lb-color-opt input:focus-visible + .lb-swatch { outline: 2.5px solid var(--lb-focus); outline-offset: 4px; }
.lb-color-opt:active .lb-swatch { transform: scale(0.95); }

/* Eigenes Modal (<dialog>, Standard 6.1) */
dialog.ui-modal {
  padding: 0; border: 0; background: transparent;
  max-width: min(460px, calc(100vw - 2rem)); width: 100%;
  color: var(--lb-text); margin: auto;
}
dialog.ui-modal--wide { max-width: min(640px, calc(100vw - 2rem)); }
dialog.ui-modal::backdrop { background: var(--lb-overlay); }
.ui-modal__panel {
  background: var(--lb-surface);
  border: 2px solid var(--lb-line-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
dialog.ui-modal.is-danger .ui-modal__panel { border-color: var(--lb-danger); }
.ui-modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.ui-modal__title { font-size: var(--fs-xl); }
.ui-modal__text { color: var(--lb-text-muted); }
.ui-modal__err { color: var(--lb-danger); font-weight: 600; font-size: var(--fs-sm); }
.ui-modal__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }

/* Toasts */
.toasts {
  position: fixed; left: 50%; bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 150;
  display: flex; flex-direction: column; gap: var(--sp-2);
  width: min(420px, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--lb-text); color: var(--lb-bg);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); font-weight: 500; text-align: center;
}
.toast--error { background: var(--lb-danger); color: #ffffff; }
.toast--ok { background: var(--lb-ok); color: #ffffff; }

/* Netz-, Update-, Installations- und Cookie-Banner */
.net-banner, .lb-update {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  background: var(--lb-warn-soft); color: var(--lb-warn);
  border-bottom: 1.5px solid var(--lb-warn); font-size: var(--fs-sm); font-weight: 600;
}
.lb-update { position: fixed; top: 0; left: 0; right: 0; z-index: 140; background: var(--lb-surface); color: var(--lb-text); border-bottom-color: var(--lb-accent); box-shadow: var(--shadow-1); }
.lb-update { flex-wrap: wrap; padding-top: calc(var(--sp-2) + env(safe-area-inset-top, 0px)); }
.lb-update > span::after { content: " –"; }

.lb-install {
  position: fixed; right: var(--sp-4); bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px)); z-index: 120;
  max-width: min(320px, calc(100vw - 2rem));
  background: var(--lb-surface); border: 2px solid var(--lb-accent);
  border-radius: var(--radius-lg); padding: var(--sp-4); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.lb-install__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-1); }

@media (max-width: 600px) {
  .lb-install {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(420px, calc(100vw - 1.5rem));
    max-width: none;
  }
}

.lb-body--game .lb-install,
.lb-body--game .lb-cookie,
.lb-game-active .lb-install,
.lb-game-active .lb-cookie {
  display: none !important;
}

.lb-cookie {
  position: fixed; left: 50%; bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 110;
  width: min(560px, calc(100vw - 1.5rem));
  background: var(--lb-surface); border: 1.5px solid var(--lb-line-strong);
  border-radius: var(--radius-md); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-2);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2);
  font-size: var(--fs-sm);
}

/* 6. Seiten */

/* 6. Seiten */

.lb-menu-wrap { position: relative; }
.lb-avatar-btn {
  padding: 0; border: 0; background: transparent; cursor: pointer;
  border-radius: 50%; min-width: 48px; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-press) var(--ease-out);
}
.lb-avatar-btn:active { transform: scale(0.95); }

.lb-dropdown {
  position: absolute; right: 0; top: calc(100% + var(--sp-2)); z-index: 90;
  min-width: 240px; padding: var(--sp-2);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: var(--shadow-2);
}
.lb-dropdown__who { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--lb-line); margin-bottom: var(--sp-1); }
.lb-dropdown__who strong { display: block; overflow-wrap: anywhere; }
.lb-dropdown__item {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  min-height: var(--touch); padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--lb-text); text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; text-align: left;
}
.lb-dropdown__item[aria-checked="true"] { color: var(--lb-accent); font-weight: 600; }
.lb-dropdown__item--danger { color: var(--lb-danger); }
.lb-dropdown__sep { border: 0; border-top: 1px solid var(--lb-line); margin: var(--sp-1) 0; }
@media (hover: hover) and (pointer: fine) {
  .lb-dropdown__item:hover { background: var(--lb-surface-2); }
}

.lb-code-pill {
  padding: 2px var(--sp-3); border-radius: var(--radius-sm);
  border: 2px solid var(--lb-line-strong); background: var(--lb-surface-2);
  font-size: var(--fs-md);
}

/* Auth & Setup */
.auth, .setup { max-width: 460px; margin: var(--sp-3) auto 0; }
.setup { max-width: 680px; }
.auth__brand { display: flex; align-items: center; gap: var(--sp-2); font-size: 1.5rem; margin-bottom: var(--sp-3); }
.brand__mark { display: inline-flex; color: var(--lb-accent); }
.auth__title, .setup__title { font-size: var(--fs-2xl); margin-bottom: var(--sp-2); }
.acc-note { margin-top: var(--sp-4); font-size: var(--fs-sm); }

/* Setup-Schritte (5 Schritte) */
.steps {
  list-style: none; padding: 0; margin: var(--sp-4) 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--sp-2);
}
.steps__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  font-size: var(--fs-xs); color: var(--lb-text-muted);
}
.steps__num {
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--lb-line-strong); font-weight: 700;
}
.steps__item.is-current { color: var(--lb-accent); font-weight: 700; }
.steps__item.is-current .steps__num { border-color: var(--lb-accent); background: var(--lb-accent-soft); }
.steps__item.is-done { color: var(--lb-ok); }
.steps__item.is-done .steps__num { border-color: var(--lb-ok); background: var(--lb-ok-soft); }

.setup__form { display: flex; flex-direction: column; gap: var(--sp-4); }
.setup-step {
  border: 2px solid var(--lb-line); border-radius: var(--radius-lg);
  background: var(--lb-surface); padding: var(--sp-4); margin: 0;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.setup-step:disabled { opacity: 0.6; }
.setup-step__title { font-family: var(--font-hand); font-size: var(--fs-lg); font-weight: 700; padding: 0 var(--sp-1); }
.setup-step__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.setup-step__result { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); font-weight: 600; color: var(--lb-ok); }

.env-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.env-item { display: flex; align-items: flex-start; gap: var(--sp-2); font-size: var(--fs-sm); }
.env-item__icon { flex: none; margin-top: 2px; }
.env-item.is-ok .env-item__icon { color: var(--lb-ok); }
.env-item.is-fail .env-item__icon { color: var(--lb-danger); }
.env-item.is-opt .env-item__icon { color: var(--lb-text-muted); }
.env-item__body { display: flex; flex-direction: column; min-width: 0; }
.lb-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-1); }

/* Konto / Profil / Admin */
.acc-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin-bottom: var(--sp-4); padding-bottom: var(--sp-3); border-bottom: 1.5px solid var(--lb-line);
}
.lb-brand { display: inline-flex; align-items: center; gap: var(--sp-2); text-decoration: none; font-size: 1.3rem; }
.acc-top__nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.acc { display: flex; flex-direction: column; gap: var(--sp-4); }
.acc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.acc-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.acc-danger { border-color: var(--lb-danger); }

.lb-profile-hero__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.lb-profile-avatar { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); text-align: center; }
.lb-profile-meta { font-size: var(--fs-sm); }
.lb-profile-logout { display: flex; justify-content: center; }

.acc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.acc-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-3); border: 1.5px solid var(--lb-line); border-radius: var(--radius-md);
  background: var(--lb-bg);
}
.acc-user__who { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; flex: 1 1 220px; }
.acc-user__meta { min-width: 0; overflow-wrap: anywhere; }
.acc-user__actions { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.acc-protected { display: inline-flex; align-items: center; gap: 4px; color: var(--lb-text-muted); font-size: var(--fs-sm); }
.acc-newlink {
  padding: var(--sp-3); border-radius: var(--radius-md);
  background: var(--lb-accent-soft); border: 1.5px solid var(--lb-accent);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.acc-secret { font-family: var(--font-mono); word-break: break-all; padding: var(--sp-2); background: var(--lb-surface); border-radius: var(--radius-sm); }
.acc-box__sum {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  cursor: pointer; list-style: none; font-family: var(--font-hand); font-size: var(--fs-lg); font-weight: 700;
  min-height: var(--touch);
}
.acc-box__sum::-webkit-details-marker { display: none; }
.acc-box__title { display: inline-flex; align-items: center; gap: var(--sp-2); }
.acc-box__count { margin-left: auto; font-family: var(--font-sans); font-size: var(--fs-sm); color: var(--lb-text-muted); }
.acc-box[open] .acc-box__chev { transform: rotate(90deg); }
.acc-box__body { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.acc-search { position: relative; }
.acc-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--lb-text-muted); pointer-events: none; }
.acc-search .input { padding-left: 40px; }
.acc-pager { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); }

/* MFA & Avatar-Crop */
.mfa-qr { width: 200px; max-width: 100%; background: #ffffff; padding: var(--sp-2); border-radius: var(--radius-md); border: 1px solid var(--lb-line); margin: var(--sp-2) 0; }
.mfa-qr svg { width: 100%; height: auto; display: block; }
.mfa-codes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); font-family: var(--font-mono); }
.mfa-codes li { padding: var(--sp-2); background: var(--lb-surface); border-radius: var(--radius-sm); text-align: center; }
.mfa-code { font-family: var(--font-mono); letter-spacing: 0.12em; }
.mfa-h3 { font-size: var(--fs-lg); margin-top: var(--sp-2); }

.acc-crop__stage { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: var(--radius-md); overflow: hidden; background: var(--lb-surface-2); touch-action: none; }
.acc-crop__stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.acc-crop__ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgb(0 0 0 / 0.45); border: 2px solid #ffffff; pointer-events: none; }
.acc-crop__zoom { width: 100%; min-height: var(--touch); }

/* Rechtliches */
.lb-legal { display: flex; flex-direction: column; gap: var(--sp-3); }
.lb-legal h2 { font-size: var(--fs-lg); margin-top: var(--sp-2); }
.lb-legal ul { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: var(--sp-1); }
.lb-legal__fields { display: grid; gap: var(--sp-2); margin: 0; }
.lb-legal__fields dt { font-weight: 600; font-size: var(--fs-sm); }
.lb-legal__fields dd { margin: 0; }
.lb-legal__missing { color: var(--lb-warn); font-weight: 600; }
.lb-legal-dlg__body { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; padding-right: var(--sp-1); }
.lb-legal-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-4); margin-top: var(--sp-5); font-size: var(--fs-sm); }

.lb-ack { border: 1.5px solid var(--lb-line); border-radius: var(--radius-md); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); }
.lb-ack__legend { font-weight: 600; font-size: var(--fs-sm); padding: 0 var(--sp-1); }
.lb-ack__item { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--sp-2); align-items: start; }
.lb-ack__box { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--lb-accent); }
.lb-ack__err { grid-column: 1 / -1; }

/* Fehlerseite */
.center-panel { max-width: 460px; margin: var(--sp-6) auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.center-panel__icon { color: var(--lb-accent); }
.center-panel__icon .icon { width: 40px; height: 40px; }

/* 7. Reduzierte Bewegung (System + App-Schalter) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:active, .lb-avatar-btn:active, .lb-color-opt:active .lb-swatch { transform: none !important; }
}
:root[data-reduced-motion="1"] *,
:root[data-reduced-motion="1"] *::before,
:root[data-reduced-motion="1"] *::after {
  transition: none !important; animation: none !important; scroll-behavior: auto !important;
}
:root[data-reduced-motion="1"] .btn:active,
:root[data-reduced-motion="1"] .lb-avatar-btn:active {
  transform: none !important;
}
