/* ==========================================================================
   Design System & Globale Stile (Version v2.6.0 — Dynamic Responsive Rectangular Stage)
   ========================================================================== */

:root {
  --bg-primary: #0a0d14;
  --bg-surface: rgba(22, 27, 38, 0.72);
  --bg-surface-hover: rgba(35, 42, 58, 0.85);
  --bg-modal: rgba(14, 18, 26, 0.88);
  --bg-modal-backdrop: rgba(0, 0, 0, 0.55);
  --text-primary: #f9fafb;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-bright: rgba(255, 255, 255, 0.16);
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border-bright);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, #161b28 0%, #0a0d14 100%);
  color: var(--text-primary);
  font-family: var(--font-family);
  user-select: none;
  touch-action: none;
}

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
}

/* ==========================================================================
   Instant-Load bei gecachter Sitzung (Kein Aufblitzen des Preloaders)
   ========================================================================== */

.is-instant #appPreloader {
  display: none !important;
}

/* ==========================================================================
   Minimalistischer Preloader (Apple-Tech Ladebalken)
   ========================================================================== */

.preloader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 50% 50%, #161b28 0%, #0a0d14 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s var(--transition-smooth), visibility 0.5s, transform 0.5s var(--transition-smooth);
}

.preloader-overlay.is-loaded {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  pointer-events: none;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 320px;
  width: 80%;
}

.preloader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
}

.preloader-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.preloader-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress-bar-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
  transition: width 0.25s ease-out;
}

.progress-status {
  display: flex;
  justify-content: center;
}

.progress-percent {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Header & Menü-Schaltfläche (Oben Rechts)
   ========================================================================== */

.site-header {
  position: absolute;
  top: max(1.5rem, env(safe-area-inset-top, 1.5rem));
  right: max(1.5rem, env(safe-area-inset-right, 1.5rem));
  z-index: 50;
  pointer-events: auto;
}

.menu-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.6rem 1.15rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: all 0.25s var(--transition-smooth);
  outline: none;
}

.menu-toggle-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-bright);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
}

.menu-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 16px;
  height: 14px;
}

.menu-icon .bar {
  display: block;
  width: 100%;
  height: 1.5px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.25s ease;
}

.menu-label {
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ==========================================================================
   3D Canvas Viewport
   ========================================================================== */

#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: grab;
}

#canvas-container:active {
  cursor: grabbing;
}

/* ==========================================================================
   Interaktions-Hinweis
   ========================================================================== */

.interaction-hint {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 10;
  pointer-events: none;
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  font-size: 0.78125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  opacity: 0.85;
  transition: opacity 0.6s var(--transition-smooth);
}

.interaction-hint.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   Minimalistischer Footer mit Version
   ========================================================================== */

.site-footer {
  position: absolute;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  z-index: 10;
  pointer-events: auto;
}

.footer-link {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.45rem 1.1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  outline: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.site-version-badge {
  font-size: 0.6875rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

/* ==========================================================================
   Slide-Over Navigationsmenü (Rechts)
   ========================================================================== */

.side-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--transition-smooth), visibility 0.35s;
}

.side-menu-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 380px;
  height: 100%;
  height: 100dvh;
  background: var(--bg-modal);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--border-bright);
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.5);
  z-index: 95;
  display: flex;
  flex-direction: column;
  padding: max(2rem, env(safe-area-inset-top, 2rem)) max(1.75rem, env(safe-area-inset-right, 1.75rem)) max(2rem, env(safe-area-inset-bottom, 2rem)) 1.75rem;
  transform: translateX(100%);
  transition: transform 0.4s var(--transition-smooth);
}

.side-menu.is-active {
  transform: translateX(0);
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.side-menu-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--text-muted);
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.25s var(--transition-smooth);
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-subtle);
  transform: translateX(4px);
}

.menu-item.is-active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-bright);
}

.menu-number {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 600;
  color: var(--accent-cyan);
  opacity: 0.8;
}

.menu-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.menu-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.menu-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.menu-action-btn {
  font-family: inherit;
  border: 1px solid transparent;
}

.side-menu-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.side-menu-footer .version-label {
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  color: var(--text-muted);
}

/* ==========================================================================
   Nahtloses Familie-Overlay (Baustelle - 0s Ladezeit)
   ========================================================================== */

.familie-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 85;
  padding: max(1.5rem, env(safe-area-inset-top, 1.5rem)) max(1.5rem, env(safe-area-inset-right, 1.5rem)) max(1.5rem, env(safe-area-inset-bottom, 1.5rem)) max(1.5rem, env(safe-area-inset-left, 1.5rem));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--transition-smooth), visibility 0.35s;
}

.familie-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.construction-card {
  background: var(--bg-surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-modal);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2.5rem;
  max-width: 480px;
  max-height: calc(100dvh - 3rem);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
  transform: scale(0.96) translateY(12px);
  transition: transform 0.35s var(--transition-smooth);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.familie-overlay.is-active .construction-card {
  transform: scale(1) translateY(0);
}

.construction-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.2);
}

.construction-title {
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.construction-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.back-btn {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.75rem 1.6rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Modal Overlay (Frosted Glass Impressum)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: var(--bg-modal-backdrop);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: max(1.5rem, env(safe-area-inset-top, 1.5rem)) max(1.5rem, env(safe-area-inset-right, 1.5rem)) max(1.5rem, env(safe-area-inset-bottom, 1.5rem)) max(1.5rem, env(safe-area-inset-left, 1.5rem));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--transition-smooth), visibility 0.35s;
}

.modal-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100dvh - 3rem);
  display: flex;
  flex-direction: column;
  background: var(--bg-modal);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-modal);
  padding: 2rem;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.35s var(--transition-smooth);
  color: var(--text-primary);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-backdrop.is-active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  transform: scale(1.05);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  user-select: text;
}

.impressum-section h3 {
  font-size: 0.78125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.impressum-version-row {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.75rem;
  opacity: 0.7;
}

.strong-text {
  font-weight: 600;
  color: var(--text-primary);
}

.text-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.text-link:hover {
  opacity: 0.8;
}

.muted-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.muted-text code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   Responsive Optimierungen (Multi-Device: Handy, Tablet, Hoch- & Querformat)
   ========================================================================== */

/* 1. Smartphones Hochformat (Portrait) */
@media (max-width: 480px) {
  .site-header {
    top: max(0.85rem, env(safe-area-inset-top, 0.85rem));
    right: max(0.85rem, env(safe-area-inset-right, 0.85rem));
  }
  .menu-toggle-btn {
    padding: 0.5rem 0.95rem;
    font-size: 0.8125rem;
    min-height: 44px;
    min-width: 44px;
  }
  .site-footer {
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
  }
  .footer-link {
    padding: 0.4rem 0.95rem;
    font-size: 0.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .side-menu {
    max-width: 100%;
    width: 100%;
    border-left: none;
    padding: max(1.5rem, env(safe-area-inset-top, 1.5rem)) 1.25rem max(1.5rem, env(safe-area-inset-bottom, 1.5rem)) 1.25rem;
  }
  .modal-card, .construction-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
  }
  .construction-title {
    font-size: 1.35rem;
  }
  .construction-desc {
    font-size: 0.875rem;
  }
}

/* 2. Smartphones Querformat (Landscape mit geringer Höhe) */
@media (max-height: 520px) and (orientation: landscape) {
  .site-header {
    top: max(0.6rem, env(safe-area-inset-top, 0.6rem));
    right: max(0.85rem, env(safe-area-inset-right, 0.85rem));
  }
  .menu-toggle-btn {
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
    min-height: 38px;
  }
  .site-footer {
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
  }
  .footer-link {
    padding: 0.3rem 0.85rem;
    font-size: 0.75rem;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }
  .side-menu {
    max-width: 320px;
    padding: max(1rem, env(safe-area-inset-top, 1rem)) 1.25rem max(1rem, env(safe-area-inset-bottom, 1rem)) 1.25rem;
  }
  .side-menu-header {
    margin-bottom: 1rem;
  }
  .menu-list {
    gap: 0.5rem;
  }
  .menu-item {
    padding: 0.5rem 0.75rem;
  }
  .modal-card {
    max-height: calc(100dvh - 1.5rem);
    padding: 1.25rem 1.5rem;
  }
  .construction-card {
    max-height: calc(100dvh - 1.5rem);
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
  }
  .construction-icon-wrap {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .construction-title {
    font-size: 1.25rem;
  }
}

/* 3. Tablets (Hochformat & Querformat) */
@media (min-width: 481px) and (max-width: 1024px) {
  .site-header {
    top: max(1.5rem, env(safe-area-inset-top, 1.5rem));
    right: max(1.5rem, env(safe-area-inset-right, 1.5rem));
  }
  .side-menu {
    max-width: 360px;
  }
  .modal-card, .construction-card {
    max-width: 460px;
  }
}

/* ==========================================================================
   Familie Unterseite (page-familie) — Version v1.8.0
   ========================================================================== */

body.page-familie {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  user-select: none;
  touch-action: none;
  background-color: var(--bg-primary);
}

/* Top Navigation Bar */
.familie-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(0.85rem, env(safe-area-inset-top, 0.85rem)) max(1.25rem, env(safe-area-inset-right, 1.25rem)) 0 max(1.25rem, env(safe-area-inset-left, 1.25rem));
  z-index: 50;
  pointer-events: none;
  background: transparent;
  border-bottom: none;
}

.familie-header .home-btn,
.familie-header .menu-toggle-btn {
  pointer-events: auto;
}

.page-familie .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 1rem max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
  z-index: 50;
  pointer-events: none;
  margin: 0;
}
  z-index: 50;
  pointer-events: none;
  margin: 0;
}

.page-familie .site-footer .footer-link {
  pointer-events: auto;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.25s var(--transition-smooth);
}

.home-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.home-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.familie-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.2s ease;
}

.familie-brand:hover {
  opacity: 0.9;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 1.15rem;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.brand-text {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.familie-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-to-3d-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.25s var(--transition-smooth);
}

.back-to-3d-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Page Layout Stage Container (Pinch-to-Zoom & Pan Arbeitsfläche) */
.familie-stage-container,
.familie-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

/* Schwebender Zoom-Reset-Button (wird beim Zoomen aktiv) */
.zoom-reset-btn {
  position: fixed;
  bottom: max(3.5rem, calc(env(safe-area-inset-bottom, 0px) + 3.2rem));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(22, 27, 38, 0.92);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.25s ease, transform 0.25s var(--transition-smooth);
}

.zoom-reset-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.zoom-reset-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  transform: translateX(-50%) translateY(-2px);
}

/* Hero Section: Zentrierter Titel "Unsere Familie" */
.familie-hero {
  position: fixed;
  top: max(0.95rem, env(safe-area-inset-top, 0.95rem));
  left: 50%;
  transform: translateX(-50%);
  z-index: 45;
  text-align: center;
  pointer-events: none;
  width: auto;
  max-width: 65%;
  margin: 0;
  padding: 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.1rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--accent-cyan);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.familie-hero-title {
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0;
  white-space: nowrap;
}

.gradient-text {
  background: linear-gradient(135deg, #38bdf8 0%, #c084fc 50%, #38bdf8 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shineGradient 6s linear infinite;
}

@keyframes shineGradient {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.familie-hero-subtitle {
  display: none;
}

/* Fünfeck-Bühne: Viewport-Füllend, zentrierter Arbeitsbereich für die Kacheln */
.pentagon-stage,
.pentagon-ensemble {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  transform-origin: center center;
  will-change: transform;
  touch-action: none;
  z-index: 20;
}

/* Pentagon Cards Allgemein */
.pentagon-card {
  position: absolute;
  aspect-ratio: 1.0515 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  outline: none !important;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.4s var(--transition-smooth), filter 0.4s var(--transition-smooth);
}

.pentagon-card,
.pentagon-card *,
#centerPentagonCard,
#centerPentagonCard * {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  outline: none !important;
}

.pentagon-card:focus,
.pentagon-card:active,
.pentagon-card:focus-visible,
#centerPentagonCard:focus,
#centerPentagonCard:active,
#centerPentagonCard:focus-visible {
  outline: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Mittelkachel: EXAKT MITTIG VOM BILDSCHIRM (senkrecht wie waagerecht) - Größer als Außenkacheln */
.pentagon-card.center-card,
.pentagon-card.tile-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  cursor: pointer;
  width: clamp(280px, 24vw, 380px);
  max-height: 58vh;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 28px rgba(56, 189, 248, 0.35));
  will-change: transform;
  margin: 0;
}

.pentagon-card.center-card:hover,
.pentagon-card.tile-center:hover {
  transform: translate(-50%, calc(-50% - 6px)) scale(1.03);
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 40px rgba(56, 189, 248, 0.6));
}

.pentagon-card.center-card.is-playing,
.pentagon-card.tile-center.is-playing {
  transform: translate(-50%, -50%) scale(1.02);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 32px rgba(56, 189, 248, 0.55));
}

/* Außenkacheln Allgemein (Desktop / Querformat-Rechteck) */
.pentagon-card.outer-card {
  position: absolute;
  width: clamp(140px, 12vw, 200px);
  max-height: 28vh;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 14px rgba(56, 189, 248, 0.12));
}

.pentagon-card.outer-card:hover {
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(56, 189, 248, 0.28));
}

/* Querformat-Rechteck der Außenkacheln (Desktop / Querformat) */
.pentagon-card.tile-1,
.tile-1 {
  top: max(4.5rem, 12vh);
  left: max(2rem, 11vw);
  z-index: 20;
}
.pentagon-card.tile-1:hover {
  transform: translateY(-4px) scale(1.03);
}

.pentagon-card.tile-2,
.tile-2 {
  top: max(4.5rem, 12vh);
  right: max(2rem, 11vw);
  z-index: 20;
}
.pentagon-card.tile-2:hover {
  transform: translateY(-4px) scale(1.03);
}

.pentagon-card.tile-3,
.tile-3 {
  bottom: max(3rem, 10vh);
  left: max(2rem, 11vw);
  z-index: 20;
}
.pentagon-card.tile-3:hover {
  transform: translateY(-4px) scale(1.03);
}

.pentagon-card.tile-4,
.tile-4 {
  bottom: max(3rem, 10vh);
  right: max(2rem, 11vw);
  z-index: 20;
}
.pentagon-card.tile-4:hover {
  transform: translateY(-4px) scale(1.03);
}

/* Inner Clipped Shape */
.pentagon-shape {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(50% 0%, 100% 38.2%, 80.9% 100%, 19.1% 100%, 0% 38.2%);
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pentagon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s var(--transition-smooth);
}

.pentagon-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 2;
  will-change: opacity;
  transform: translateZ(0);
}

.pentagon-card.center-card.is-playing .pentagon-video {
  opacity: 1 !important;
}

.pentagon-card.center-card.is-playing {
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 32px rgba(56, 189, 248, 0.55));
}

.pentagon-card.center-card.is-playing .pentagon-border-svg polygon {
  stroke-width: 2.8;
  stroke: rgba(56, 189, 248, 1);
}

.pentagon-card:hover .pentagon-img {
  transform: scale(1.06);
}

/* SVG Pentagon Border */
.pentagon-border-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}

.pentagon-border-svg polygon {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.pentagon-card:hover .pentagon-border-svg polygon {
  stroke: rgba(56, 189, 248, 0.85);
  stroke-width: 2.2;
}

.pentagon-card.center-card .pentagon-border-svg polygon {
  stroke-width: 2.5;
}

/* Center Card Hover Overlay */
.pentagon-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 3rem 1.25rem 1.5rem;
  background: linear-gradient(to top, rgba(10, 13, 20, 0.95) 0%, rgba(10, 13, 20, 0.6) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.92;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.pentagon-card.center-card:hover .pentagon-overlay {
  opacity: 1;
}

.pentagon-badge {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.pentagon-hint {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Placeholder Styling for Outer Tiles */
.placeholder-body {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08) 0%, rgba(22, 27, 38, 0.88) 100%);
}

.placeholder-icon {
  font-size: 1.8rem;
  opacity: 0.85;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.pentagon-card:hover .placeholder-icon {
  transform: scale(1.15) translateY(-2px);
}

.placeholder-num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.placeholder-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.placeholder-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

/* Showcase Caption & Hint */
.showcase-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

/* Hofstaat Profile Cards */
.hofstaat-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hofstaat-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hofstaat-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hofstaat-subtitle {
  font-size: 0.9375rem;
  color: var(--text-muted);
  max-width: 580px;
}

.hofstaat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.hofstaat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--transition-smooth), border-color 0.3s ease, box-shadow 0.3s ease;
}

.hofstaat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.15);
}

.hofstaat-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.hofstaat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.hofstaat-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hofstaat-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.hofstaat-role {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

.hofstaat-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  width: fit-content;
}

.hofstaat-desc {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.hofstaat-review {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.review-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.review-text {
  font-size: 0.8125rem;
  color: #fbbf24;
  font-weight: 500;
}

/* Lightbox Modal */
.lightbox-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 13, 20, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 120;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--transition-smooth), visibility 0.35s;
}

.lightbox-backdrop.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 920px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.35s var(--transition-smooth);
}

.lightbox-backdrop.is-active .lightbox-content {
  transform: scale(1) translateY(0);
}

.lightbox-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-modal);
  background: #000;
}

.lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.lightbox-caption strong {
  color: var(--text-primary);
}

.lightbox-close-btn {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 27, 38, 0.95);
  border: 1px solid var(--border-bright);
  color: var(--text-primary);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  transform: scale(1.1);
}

/* Responsive Optimierungen für Familie */
@media (max-width: 960px) and (min-width: 769px) {
  .pentagon-card.center-card,
  .pentagon-card.tile-center {
    width: clamp(260px, 28vw, 340px);
  }
  .pentagon-card.outer-card {
    width: clamp(130px, 14vw, 175px);
  }
  .pentagon-card.tile-1,
  .tile-1 {
    top: max(4.5rem, 11vh);
    left: max(1.5rem, 8vw);
  }
  .pentagon-card.tile-2,
  .tile-2 {
    top: max(4.5rem, 11vh);
    right: max(1.5rem, 8vw);
  }
  .pentagon-card.tile-3,
  .tile-3 {
    bottom: max(3rem, 9vh);
    left: max(1.5rem, 8vw);
  }
  .pentagon-card.tile-4,
  .tile-4 {
    bottom: max(3rem, 9vh);
    right: max(1.5rem, 8vw);
  }
}

/* 1. Smartphone & Tablet Hochformat (Portrait) — Hochformat-Rechteck der Außenkacheln */
@media (max-width: 768px) and (orientation: portrait), (max-width: 600px) {
  .familie-hero {
    top: max(0.95rem, env(safe-area-inset-top, 0.95rem));
    max-width: 65%;
  }

  .familie-hero-title {
    font-size: clamp(1.2rem, 4.8vw, 1.65rem);
  }

  /* Mittelkachel: EXAKT MITTIG VOM BILDSCHIRM (senkrecht wie waagerecht) - Deutlich größer als Außenkacheln */
  .pentagon-card.center-card,
  .pentagon-card.tile-center {
    width: clamp(230px, 62vw, 300px);
    max-height: 42vh;
  }

  /* Außenkacheln: kleiner als Mittelkachel, passen sich dynamisch an */
  .pentagon-card.outer-card {
    width: clamp(105px, 29vw, 145px);
    max-height: 20vh;
  }

  /* Hochformat-Rechteck: Vertikaler Abstand groß, horizontaler Abstand an Displaybreite angepasst */
  .pentagon-card.tile-1,
  .tile-1 {
    top: max(4.6rem, calc(env(safe-area-inset-top, 0px) + 4.2rem), 13vh);
    left: max(0.85rem, calc(env(safe-area-inset-left, 0px) + 0.6rem), 5vw);
  }

  .pentagon-card.tile-2,
  .tile-2 {
    top: max(4.6rem, calc(env(safe-area-inset-top, 0px) + 4.2rem), 13vh);
    right: max(0.85rem, calc(env(safe-area-inset-right, 0px) + 0.6rem), 5vw);
  }

  .pentagon-card.tile-3,
  .tile-3 {
    bottom: max(2.8rem, calc(env(safe-area-inset-bottom, 0px) + 2.4rem), 10vh);
    left: max(0.85rem, calc(env(safe-area-inset-left, 0px) + 0.6rem), 5vw);
  }

  .pentagon-card.tile-4,
  .tile-4 {
    bottom: max(2.8rem, calc(env(safe-area-inset-bottom, 0px) + 2.4rem), 10vh);
    right: max(0.85rem, calc(env(safe-area-inset-right, 0px) + 0.6rem), 5vw);
  }

  .placeholder-body {
    padding: 0.55rem 0.4rem;
    gap: 0.15rem;
  }

  .placeholder-icon {
    font-size: 1.35rem;
  }

  .placeholder-num {
    font-size: 0.72rem;
  }

  .placeholder-text {
    font-size: 0.68rem;
  }

  .placeholder-hint {
    display: none;
  }
}

/* 2. Smartphone & Tablet Querformat (Landscape) — Querformat-Rechteck der Außenkacheln */
@media (orientation: landscape) and (max-height: 560px) {
  .familie-hero {
    top: max(0.35rem, env(safe-area-inset-top, 0.35rem));
  }

  .familie-hero-title {
    font-size: clamp(1.1rem, 3.8vh, 1.4rem);
  }

  /* Mittelkachel: 50%/50% mittig zentriert, größer als Außenkacheln */
  .pentagon-card.center-card,
  .pentagon-card.tile-center {
    width: auto;
    height: min(240px, 62vh);
    max-width: 44vw;
  }

  /* Außenkacheln */
  .pentagon-card.outer-card {
    width: auto;
    height: min(105px, 27vh);
  }

  /* Querformat-Rechteck: Horizontaler Abstand groß, vertikaler Abstand an Displayhöhe angepasst */
  .pentagon-card.tile-1,
  .tile-1 {
    top: max(2.6rem, calc(env(safe-area-inset-top, 0px) + 2.2rem), 9vh);
    left: max(1.2rem, calc(env(safe-area-inset-left, 0px) + 1rem), 6vw);
  }

  .pentagon-card.tile-2,
  .tile-2 {
    top: max(2.6rem, calc(env(safe-area-inset-top, 0px) + 2.2rem), 9vh);
    right: max(1.2rem, calc(env(safe-area-inset-right, 0px) + 1rem), 6vw);
  }

  .pentagon-card.tile-3,
  .tile-3 {
    bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.8rem), 7vh);
    left: max(1.2rem, calc(env(safe-area-inset-left, 0px) + 1rem), 6vw);
  }

  .pentagon-card.tile-4,
  .tile-4 {
    bottom: max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.8rem), 7vh);
    right: max(1.2rem, calc(env(safe-area-inset-right, 0px) + 1rem), 6vw);
  }

  .placeholder-body {
    padding: 0.35rem;
    gap: 0.1rem;
  }

  .placeholder-icon {
    font-size: 1.1rem;
  }

  .placeholder-num {
    font-size: 0.65rem;
  }

  .placeholder-text {
    font-size: 0.6rem;
  }

  .placeholder-hint {
    display: none;
  }
}

