@import url('menu.css');

:root {
    --vh: 1vh;
}


html {
    height: 100%;
}

body { 
    container-type: inline-size;
    height: 100%;
    margin: 0; 
    overflow: hidden; 
    cursor: auto;
    background: transparent;
}
canvas { display: block; }

#debug-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(10, 12, 26, 0.55);
    color: #f2f3f7;
    font-family: "Quicksand", sans-serif;
    font-size: 12px;
    border-radius: 12px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    z-index: 12000;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 360px;
    max-height: calc(var(--vh) * 86);
    overflow: auto;
    transform: none !important;
}

#debug-panel button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font: inherit;
    padding: 5px 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

#debug-panel button:hover,
#debug-panel button:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

#debug-panel button.debug-control {
    width: 100%;
}

#debug-panel button.active {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.55);
}

#debug-panel.debug-disabled {
    opacity: 0.75;
}

#debug-fps-display.low {
    color: #ff6b6b;
}

#debug-panel .debug-checkbox {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    user-select: none;
}

#debug-panel .debug-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f2f3f7;
    cursor: pointer;
}

body.layout-mode * {
    transition: none !important;
    animation: none !important;
}

body.layout-mode #debug-section-container,
body.layout-mode .debug-copy-button {
    display: none;
}

.layout-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 6px 0 8px;
}

.layout-controls-row {
    display: flex;
    gap: 6px;
}

.layout-controls-row button,
.layout-controls-row select {
    flex: 1;
}

.layout-profile-select {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #f2f3f7;
    font: inherit;
    padding: 5px 8px;
    cursor: pointer;
}

.layout-profile-select option {
    background: #0d1024;
    color: #f2f3f7;
}

#layout-profile-badge {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 11800;
    padding: 5px 14px;
    border-radius: 8px;
    background: rgba(10, 12, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-family: monospace;
    font-size: 12px;
    color: rgba(242, 243, 247, 0.9);
    letter-spacing: 0.05em;
    user-select: none;
    pointer-events: none;
    backdrop-filter: blur(8px);
    display: none;
    white-space: nowrap;
}

body.layout-mode #layout-profile-badge {
    display: block;
}

body.layout-simulate {
    --vh: calc(var(--layout-sim-height, 100vh) / 100);
    width: var(--layout-sim-width, 100%);
    height: var(--layout-sim-height, 100%);
    transform: scale(var(--layout-sim-scale, 1));
    transform-origin: top center;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 20px 60px rgba(0, 0, 0, 0.25);
}

#layout-overlay {
    position: fixed;
    inset: 0;
    z-index: 13000;
    pointer-events: none;
}

.layout-selection-box {
    position: fixed;
    border: 1px solid rgba(80, 160, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    pointer-events: none;
}

.layout-selection-label {
    position: fixed;
    transform: translateY(calc(-100% - 4px));
    z-index: 13100;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(10, 12, 26, 0.82);
    border: 1px solid rgba(80, 160, 255, 0.7);
    font-family: monospace;
    font-size: 11px;
    color: rgba(80, 160, 255, 1);
    white-space: nowrap;
    pointer-events: none;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-handle {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: rgba(80, 160, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Seitengriffe: abgerundet, kleiner, anderer Farbton */
.layout-handle--n,
.layout-handle--s,
.layout-handle--e,
.layout-handle--w {
    width: 18px;
    height: 5px;
    border-radius: 6px;
    background: rgba(180, 130, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.layout-handle--e,
.layout-handle--w {
    width: 5px;
    height: 18px;
}

.layout-handle--hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 6px 2px rgba(80, 160, 255, 0.8);
}

/* Container-Margin-Linien */
.layout-margin-line {
    position: fixed;
    width: 2px;
    background: rgba(100, 220, 160, 0.7);
    pointer-events: auto;
    cursor: ew-resize;
    z-index: 13001;
}

.layout-margin-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: -6px;
    width: 14px;
    height: 100%;
}

.layout-margin-label {
    position: fixed;
    transform: translateX(-50%);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(20, 20, 20, 0.8);
    color: rgba(100, 220, 160, 0.95);
    pointer-events: none;
    z-index: 13001;
    white-space: nowrap;
}

.layout-anchor-guides {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.layout-anchor-line {
    position: fixed;
    background: rgba(255, 180, 50, 0.9);
    height: 1px;
}

.layout-anchor-line.layout-anchor-line--v {
    width: 1px;
}

.layout-anchor-label {
    position: fixed;
    transform: translate(-50%, -50%);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: rgba(20, 20, 20, 0.8);
    color: #ffd27a;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.layout-hover {
    outline: 2px solid rgba(80, 160, 255, 0.6);
    outline-offset: 2px;
}

.layout-selected {
    outline: 2px solid rgba(80, 160, 255, 0.95);
    outline-offset: 2px;
}

/* Verankerte Elemente im Layout-Modus */
body.layout-mode [data-layout-anchored] {
    outline: 2px dashed rgba(255, 180, 50, 0.85);
    outline-offset: 2px;
}

body.layout-mode [data-layout-anchored].layout-selected {
    outline: 2px solid rgba(255, 180, 50, 0.95);
    outline-offset: 2px;
}

#graphic-handle {
    position: fixed;
    width: 72px;
    height: 72px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
    z-index: 5;
}

body.layout-mode #graphic-handle {
    pointer-events: auto;
    opacity: 0.12;
    border: 1px dashed rgba(80, 160, 255, 0.8);
    background: rgba(80, 160, 255, 0.08);
    border-radius: 50%;
}

body.welcome-active #graphic-handle {
    display: none;
}

body.layout-mode .center-text {
    pointer-events: auto;
}

/* Burger-Bars ohne Animation sichtbar machen */
body.layout-mode .bar {
    background-color: #C870A0 !important;
}

/* Ausgeblendete Elemente im Layout-Modus halbtransparent zeigen */
body.layout-mode .layout-hidden {
    opacity: 0.2 !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* Ausgeblendete Elemente im Normalmodus vollständig verstecken */
.layout-hidden {
    visibility: hidden !important;
    pointer-events: none !important;
}

.debug-header {
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.debug-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

#debug-section-container {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.debug-section {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.debug-section summary {
    padding: 4px 8px;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.debug-section[open] summary {
    background: rgba(255, 255, 255, 0.04);
}

.debug-section-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px 8px 6px;
}

.debug-control-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 5px;
}

.debug-control-row.debug-range-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "label value"
        "slider slider";
    row-gap: 2px;
    column-gap: 6px;
    align-items: center;
}

.debug-control-row input[type="range"] {
    width: 100%;
    grid-area: slider;
    margin: 0;
}
.debug-control-row input[type="range"]::-webkit-slider-thumb {
    height: 10px;
    width: 10px;
}
.debug-control-row input[type="range"]::-moz-range-thumb {
    height: 10px;
    width: 10px;
}

.debug-control-row input[type="color"] {
    width: 52px;
    height: 28px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.debug-control-label {
    grid-column: 1 / -1;
    font-weight: 500;
}

.debug-control-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.debug-control-row.debug-range-row .debug-control-label {
    grid-area: label;
}

.debug-control-row.debug-range-row .debug-control-value {
    grid-area: value;
    justify-self: end;
    margin-bottom: 0;
}

.debug-control-changed {
    border-radius: 8px;
    background: rgba(96, 192, 208, 0.12);
    padding: 3px 5px;
}

.debug-copy-button {
    margin-top: 2px;
    width: 100%;
    font-weight: 600;
}

.debug-control-row.debug-checkbox-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.debug-control-row.debug-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #f2f3f7;
    cursor: pointer;
}

.popup-ease-preview-wrap {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-ease-preview-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 4px;
}

.popup-ease-preview {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* CSS-Variablen werden dynamisch über JS gesetzt */
:root {
    --gradient-hue: 200;
    --gradient-saturation: 70%;
    --gradient-lightness: 80%;
    --gradient-steepness: 60%;
    --content-text-width: 50cqw;
    --content-text-width-expanded: 50cqw; /* Breite bei ausgeklapptem Menü */
    --content-text-width-collapsed: 75cqw; /* Breite bei eingeklapptem Menü */
    --side-menu-font-size: 16px;
    --side-menu-title-size: 20px;
    --page-heading-size: 18px;
    --page-heading-line-height: 1.5;
    --page-paragraph-size: 16px;
    --page-paragraph-line-height: 1.7;
    --page-paragraph-measure: 52ch;
    --page-preview-solid-lines: 8;
    --page-preview-fade-lines: 4;
    --page-preview-total-lines: 12;
    --page-preview-fade-start: 66.6667%;
    --popup-list-item-gap: 6px;
    --popup-list-after-gap: 32px;
    --popup-inner-padding-bottom: 140px;
    --welcome-text-fade-distance: 34px;
    --layout-container-left: 0px;
    --layout-container-right: 0px;
}

#gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at center,
        hsla(var(--gradient-hue), 100%, var(--gradient-lightness), 0) 0%,
        color-mix(in srgb, hsla(var(--gradient-hue), 100%, var(--gradient-lightness), 1), var(--background-mix-color) var(--background-mix-strength)) var(--gradient-steepness),
        color-mix(in srgb, hsla(var(--gradient-hue), 100%, var(--gradient-lightness), 1), var(--background-mix-color) var(--background-mix-strength)) 100%
    );
    z-index: 0; /* Hinter Inhalt, aber sichtbar */
    transition: background 0.5s linear; /* Sanfte Übergänge für flüssige Animation */
}

@keyframes hue-shift {
    0% {
        --gradient-hue: 200;
        --gradient-lightness: 80%;
    }
    50% {
        --gradient-hue: 240;
        --gradient-lightness: 85%;
    }
    100% {
        --gradient-hue: 200;
        --gradient-lightness: 80%;
    }
}

/* Initialer Zustand: Alle Menütexte mit Opacity 0 starten */
.menu-text {
    --pos-x: 0px;
    --pos-y: 0px;
    position: absolute;
    font-family: "Quicksand", sans-serif;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    padding: 12px 20px; /* Padding leicht erhöht für größeren Glow */
    background-color: white; 
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 1),   /* Innerster*/
                0 0 25px rgba(255, 255, 255, 0.9), /* Mittlerer Glow*/
                0 0 50px rgba(255, 255, 255, 0.6), /* Äußerer Glow*/
                0 0 80px rgba(255, 255, 255, 0.3); /* Weitester Glow*/
    left: 0;
    top: 0;
    transform: translate3d(var(--pos-x), var(--pos-y), 0) translate(-50%, -50%) scale(1); /* Initial scale hinzufügen */
    transform-origin: center center; /* Sicherstellen, dass die Skalierung vom Zentrum ausgeht */
    transition: font-weight 0.2s ease, 
                box-shadow 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.4s ease-in-out; /* Sanfter Übergang für spezifische Eigenschaften, NICHT left/top */
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    z-index: 10;
    will-change: transform, font-weight, box-shadow, opacity;
    opacity: 0; /* Alle Menütexte beginnen transparent */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
}

.menu-text.line-text:hover { /* Nur auf Linien-Texte anwenden */
    font-weight: 550;
    transform: translate3d(var(--pos-x), var(--pos-y), 0) translate(-50%, -50%) scale(1.05); /* Skalierung beim Hovern */
    box-shadow: 0 0 10px rgba(255, 255, 255, 1),   /* Innerster Hover, größer */
                0 0 30px rgba(255, 255, 255, 1),   /* Mittlerer Hover, größer */
                0 0 60px rgba(255, 255, 255, 0.7), /* Äußerer Hover, größer */
                0 0 100px rgba(255, 255, 255, 0.4);/* Weitester Hover, größer */
}

.menu-text.fade-out {
    opacity: 0;
    /* transition: opacity 0.4s ease-out; - Verwende Transition von .menu-text */
}

.menu-text.fade-in {
    opacity: 1;
    /* transition: opacity 0.4s ease-in; - Verwende Transition von .menu-text */
}

.center-text {
    --pos-x: 0px;
    --pos-y: 0px;
    font-size: 22px; /* Größer für den zentralen Text */
    background-color: transparent; /* Kein Hintergrund für zentralen Text */
    filter: none; /* Kein Glow für zentralen Text */
    padding: 0;
    will-change: transform, opacity;
    transform: translate3d(var(--pos-x), var(--pos-y), 0) translate(-50%, -50%) scale(1);
    transform-origin: center center;
    transition: font-size 0.2s ease, font-weight 0.2s ease, opacity 0.4s ease-in-out;
    opacity: 0; /* Auch zentraler Text beginnt transparent */
    pointer-events: auto;
    cursor: pointer;
}

.center-text:hover {
    transform: translate3d(var(--pos-x), var(--pos-y), 0) translate(-50%, -50%) scale(1.1); /* Skalierung beim Hovern */
    font-weight: 500;
}

.top-left-menu {
    position: fixed;
    /* gleiche X-Position wie vorher, aber 5% höher als Mitte */
    left: 90px;
    top: calc(50% - calc(var(--vh) * 2));
    transform: translateY(-50%);
    font-family: "Quicksand", sans-serif;
    color: #000;
    z-index: 20; /* Sicherstellen, dass es über der Canvas liegt */
}

.top-left-menu .name {
    font-size: var(--side-menu-title-size, 20px);
    font-weight: 500;
    margin-bottom: 20px; /* Erhöhter Abstand zur Liste */
}

.top-left-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.top-left-menu li {
    font-size: var(--side-menu-font-size, 16px);
    font-weight: 450;
    margin-bottom: 8px;
    cursor: pointer;
    position: relative;
    width: fit-content;
}

/* Hover-Effekt für Menüeinträge */
.top-left-menu li:hover {
    font-weight: 550; 
}

/* Aktiver Menüpunkt */
.top-left-menu li.active-menu-item {
    font-weight: 500;
}

/* Keyframes nur für das Schrumpfen */
@keyframes text-click-shrink {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% { /* Schnell klein werden */
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Klasse für die Schrumpf-Animation */
.text-shrinking {
    /* Sehr kurze Animation, hält den Endzustand */
    animation: text-click-shrink 0.1s ease-out forwards;
    /* Wichtig: Transition während der Animation temporär deaktivieren,
       damit sie nicht mit der Animation interferiert */
    transition: none !important;
}

/* Stile für Popup-Inhalt */
.popup-content-heading {
    font-family: "Quicksand", sans-serif;
    font-weight: 400;
}

.popup-content-heading.centered {
    text-align: center;
}

.popup-content-paragraph {
    font-family: "Quicksand", sans-serif;
    font-size: 16px;
    font-weight: 400;
}

/* Willkommen-Overlay */
#welcome-screen {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    background: radial-gradient(
        circle at 30% 30%, 
        color-mix(in srgb, rgb(255, 255, 255), var(--background-mix-color) var(--background-mix-strength)) 0%, 
        color-mix(in srgb, rgb(250, 212, 232), var(--background-mix-color) var(--background-mix-strength)) 45%, 
        color-mix(in srgb, rgb(241, 185, 215), var(--background-mix-color) var(--background-mix-strength)) 100%
    );
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    z-index: 100;
    overflow: hidden;
}

body.welcome-active {
    cursor: auto;
}

body.welcome-active #welcome-screen {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body:not(.welcome-active) #welcome-screen {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

body.welcome-active #gradient-background,
body.welcome-active .menu-text,
body.welcome-active .top-left-menu,
body.welcome-active #content-container,
body.welcome-active #popup-html-overlay {
    display: none !important;
}

body.welcome-active #lineCanvas {
    display: block !important;
    z-index: 1001 !important;
    pointer-events: none;
}

/* Partikel-Layer über dem Welcome-Screen sichtbar */
body.welcome-active #linesCanvas {
    display: block !important;
    z-index: 1000 !important; /* über Welcome-Screen (100) */
    pointer-events: none;
}

/* Cursor-Regeln für Welcome-Screen */
body.welcome-active #welcome-screen,
body.welcome-active #welcome-screen * {
    cursor: auto;
}

/* --- Welcome card layout: center image, text further left --- */
.welcome-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: min(85cqw, 1100px);
    flex: 0 1 auto;
    min-height: min(calc(var(--vh) * 82), 820px);
    padding: 48px 56px;
    border-radius: 42px;
    justify-content: center;
    margin: 0 auto;
}

.welcome-content-wrapper {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: center;
    position: relative;
    width: fit-content;
    max-height: 100%;
}

.welcome-text-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: max(280px, 35cqw);
    margin-right: -220px;
    z-index: 10;
    min-height: 0;
}

.welcome-text {
    position: relative;
    width: 100%;
    color: #2f1f2f;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 10px;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--welcome-top-fade-size, var(--welcome-text-fade-distance, 34px)),
        #000 calc(100% - var(--welcome-bottom-fade-size, var(--welcome-text-fade-distance, 34px))),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--welcome-top-fade-size, var(--welcome-text-fade-distance, 34px)),
        #000 calc(100% - var(--welcome-bottom-fade-size, var(--welcome-text-fade-distance, 34px))),
        transparent 100%
    );
}

.welcome-text::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.welcome-text h1 {
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-title-size, 28px);
    font-weight: var(--type-title-weight, 400);
    color: var(--type-title-color, #2f2138);
    margin: 0 0 20px 0;
}

.welcome-text h3 {
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-heading-size, 18px);
    line-height: var(--type-heading-height, 1.5);
    font-weight: var(--type-heading-weight, 500);
    color: var(--type-heading-color, #2f2138);
    margin-top: clamp(16px, 2cqw, 24px);
    margin-bottom: clamp(10px, 1.2cqw, 15px);
}

.welcome-text p {
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-paragraph-size, 16px);
    line-height: var(--type-paragraph-height, 1.7);
    font-weight: var(--type-paragraph-weight, 400);
    color: var(--type-paragraph-color, rgba(0, 0, 0, 0.85));
    margin: 0 0 clamp(10px, 1.2cqw, 16px) 0;
    white-space: pre-line;
}

.welcome-text blockquote {
    font-family: var(--typography-serif-font-family, 'EB Garamond', serif);
    font-size: var(--type-quote-size, 16px);
    line-height: var(--type-quote-height, 1.7);
    font-weight: var(--type-quote-weight, 400);
    font-style: var(--type-quote-style, italic);
    color: var(--type-quote-color, rgba(0, 0, 0, 0.85));
    margin: 0 0 clamp(10px, 1.2cqw, 16px) 0;
    margin-left: var(--type-quote-margin-left, 0);
    margin-right: var(--type-quote-margin-left, 0);
}

.welcome-text cite {
    display: block;
    width: 100%;
    align-self: stretch;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-source-size, 14px);
    line-height: var(--type-source-height, 1.5);
    font-weight: var(--type-source-weight, 400);
    color: var(--type-source-color, rgba(0, 0, 0, 0.6));
    text-align: right;
    margin-top: clamp(-10px, -0.8cqw, -5px);
    margin-bottom: clamp(10px, 1.2cqw, 16px);
    font-style: normal;
}

.welcome-text p:last-of-type {
    margin-bottom: 0;
}

.welcome-image {
    flex: 0 0 auto;
    transform: none;
    width: clamp(300px, 55cqw, 65cqw);
    height: auto;
    max-width: 80cqw;
    max-height: calc(var(--vh) * 70);
    border-radius: var(--image-border-radius);
    display: block;
    opacity: 0.8;
    object-fit: contain;
}

/* Partikel-Spawner-Handle */
#particle-spawner {
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 30;
}

body.layout-mode #particle-spawner {
    pointer-events: auto;
    outline: 2px dashed rgba(200, 112, 160, 0.6);
    border-radius: 50%;
    background: rgba(200, 112, 160, 0.15);
    cursor: move;
}

.welcome-button {
    border: none;
    border-radius: 999px;
    padding: 10px 30px;
    font-family: "Quicksand", sans-serif;
    font-size: 16px;
    letter-spacing: 0.5px;
    color: #fff;
    background-color: #C870A0;
    animation: welcome-button-cycle 15s linear infinite;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    margin-top: 0;
}

.welcome-button-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    padding-top: clamp(16px, 2cqw, 28px);
    flex: 0 0 auto;
}

.welcome-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(200, 112, 160, 0.35);
}

.welcome-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(200, 112, 160, 0.4);
}

@keyframes welcome-button-cycle {
    0% { background-color: #C870A0; box-shadow: 0 14px 30px rgba(200, 112, 160, 0.25); }
    25% { background-color: #5080C0; box-shadow: 0 14px 30px rgba(80, 128, 192, 0.25); }
    50% { background-color: #60C0D0; box-shadow: 0 14px 30px rgba(96, 192, 208, 0.25); }
    75% { background-color: #E04040; box-shadow: 0 14px 30px rgba(224, 64, 64, 0.25); }
    100% { background-color: #C870A0; box-shadow: 0 14px 30px rgba(200, 112, 160, 0.25); }
}

@media (max-width: 1200px) {
    body:not(.desktop-device) .welcome-text-panel {
        width: clamp(240px, 32cqw, 380px);
    }

    body:not(.desktop-device) .welcome-image {
        width: clamp(280px, 50cqw, 60cqw);
    }
}

@media (max-width: 960px) {
    body:not(.desktop-device) .welcome-text-panel {
        width: clamp(200px, 30cqw, 320px);
    }

    body:not(.desktop-device) .welcome-image {
        width: clamp(260px, 48cqw, 55cqw);
    }
}

@media (max-width: 768px) {
    body:not(.desktop-device) #welcome-screen {
        align-items: center;
        justify-content: center;
        padding-top: 40px;
    }

    body:not(.desktop-device) .welcome-card {
        flex-direction: column;
        text-align: center;
        padding: 40px;
        padding-left: 40px;
        flex: 0;
    }

    body:not(.desktop-device) .welcome-text-panel {
        width: 100%;
        margin-right: 0;
        align-items: flex-start;
    }

    body:not(.desktop-device) .welcome-text {
        position: static;
        transform: none;
        text-align: left;
        align-items: flex-start;
    }

    body:not(.desktop-device) .welcome-text h1 {
        margin-bottom: 16px;
        font-size: clamp(22px, 2.5cqw, 28px);
    }

    body:not(.desktop-device) .welcome-text h3 {
        font-size: var(--type-heading-size, 18px);
    }

    body:not(.desktop-device) .welcome-text p {
        margin-bottom: 14px;
        font-size: var(--type-paragraph-size, 16px);
    }

    body:not(.desktop-device) .welcome-text blockquote {
        font-size: var(--type-quote-size, 16px);
    }

    body:not(.desktop-device) .welcome-text cite {
        font-size: var(--type-source-size, 14px);
    }

    body:not(.desktop-device) .welcome-button-row {
        justify-content: center;
    }

    body:not(.desktop-device) .welcome-image {
        transform: none;
        width: 80cqw;
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    body:not(.desktop-device) .welcome-card {
        gap: 28px;
        padding: 32px 24px;
        border-radius: 28px;
    }

    body:not(.desktop-device) .welcome-button {
        width: 100%;
        max-width: 260px;
    }
}

body.layout-simulate.layout-sim-1200 .welcome-text-panel {
    width: max(240px, 32cqw);
}

body.layout-simulate.layout-sim-1200 .welcome-image {
    width: clamp(280px, 50cqw, 60cqw);
}

body.layout-simulate.layout-sim-960 .welcome-text-panel {
    width: max(200px, 30cqw);
}

body.layout-simulate.layout-sim-960 .welcome-image {
    width: clamp(260px, 48cqw, 55cqw);
}

body.layout-simulate.layout-sim-768 #welcome-screen {
    align-items: center;
    justify-content: center;
    padding-top: 40px;
}

body.layout-simulate.layout-sim-768 .welcome-card {
    flex-direction: column;
    text-align: center;
    padding: 40px;
    padding-left: 40px;
    flex: 0;
}

body.layout-simulate.layout-sim-768 .welcome-text-panel {
    width: 100%;
    margin-right: 0;
    align-items: flex-start;
}

body.layout-simulate.layout-sim-768 .welcome-text {
    position: static;
    transform: none;
    text-align: left;
    align-items: flex-start;
}

body.layout-simulate.layout-sim-768 .welcome-text h1 {
    margin-bottom: 16px;
    font-size: clamp(22px, 2.5cqw, 28px);
}

body.layout-simulate.layout-sim-768 .welcome-text h3 {
    font-size: var(--type-heading-size, 18px);
}

body.layout-simulate.layout-sim-768 .welcome-text p {
    margin-bottom: 14px;
    font-size: var(--type-paragraph-size, 16px);
}

body.layout-simulate.layout-sim-768 .welcome-text blockquote {
    font-size: var(--type-quote-size, 16px);
}

body.layout-simulate.layout-sim-768 .welcome-text cite {
    font-size: var(--type-source-size, 14px);
}

body.layout-simulate.layout-sim-768 .welcome-button-row {
    justify-content: center;
}

body.layout-simulate.layout-sim-768 .welcome-image {
    transform: none;
    width: 80cqw;
    max-width: 400px;
}

body.layout-simulate.layout-sim-600 .welcome-card {
    gap: 28px;
    padding: 32px 24px;
    border-radius: 28px;
}

body.layout-simulate.layout-sim-600 .welcome-button {
    width: 100%;
    max-width: 260px;
}

/* Admin-System Styles */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.content-quote {
    font-family: var(--typography-serif-font-family, 'EB Garamond', serif);
    font-size: var(--type-quote-size, 16px);
    line-height: var(--type-quote-height, 1.7);
    font-weight: var(--type-quote-weight, 400);
    font-style: var(--type-quote-style, italic);
    text-align: var(--type-quote-align, left);
    color: var(--type-quote-color, rgba(0, 0, 0, 0.85));
    margin-left: var(--type-quote-margin-left, 0);
    margin-right: var(--type-quote-margin-left, 0);
    margin-bottom: var(--type-quote-margin, 22px);
    margin-top: 0;
}

.content-source {
    display: block;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-source-size, 14px);
    line-height: var(--type-source-height, 1.5);
    font-weight: var(--type-source-weight, 400);
    font-style: var(--type-source-style, normal);
    color: var(--type-source-color, rgba(0, 0, 0, 0.6));
    text-align: var(--type-source-align, right);
    margin-top: var(--type-source-margin-top, -10px);
    margin-bottom: var(--type-source-margin-bottom, 22px);
}

[contenteditable="true"]:focus {
    outline: none;
}

[contenteditable="true"]:hover {
    background: rgba(52, 152, 219, 0.05);
}

/* HTML-basiertes Popup-Overlay */
#popup-html-overlay {
    position: fixed;
    pointer-events: none;
    z-index: 50;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#popup-html-overlay.active {
    pointer-events: auto;
}

.popup-html-content {
    position: absolute;
    background: transparent;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    border-radius: 15px;
    transform-origin: top left;
    will-change: transform, opacity;
    contain: layout paint style;
    backface-visibility: hidden;
}

.popup-html-content::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 44px;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(to top, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 70%, rgba(255,255,255,0) 100%);
}

.popup-html-content.visible {
    opacity: 1;
    pointer-events: auto;
}

.popup-html-inner {
    padding: 72px 40px 0 40px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.popup-html-inner::after {
    content: '';
    display: block;
    height: var(--popup-inner-padding-bottom, 40px);
}

.popup-html-inner::-webkit-scrollbar {
    display: none;
}

.popup-html-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 40px;
    text-align: center;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-title-size, 22px);
    line-height: var(--type-title-height, 1.4);
    font-weight: var(--type-title-weight, 400);
    color: var(--type-title-color, #2f2138);
    background: linear-gradient(to bottom, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.9) 70%, rgba(255,255,255,0) 100%);
    z-index: 1;
}

.popup-html-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 2;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.popup-html-close:hover {
    opacity: 1;
}

.popup-html-close::before,
.popup-html-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 2px;
    background: currentColor;
}

.popup-html-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.popup-html-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.popup-html-heading {
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-heading-size, 18px);
    line-height: var(--type-heading-height, 1.5);
    font-weight: var(--type-heading-weight, 500);
    color: var(--type-heading-color, #2f2138);
    margin-top: var(--type-heading-margin-top, 24px);
    margin-bottom: var(--type-heading-margin-bottom, 15px);
}

.popup-html-heading:first-child {
    margin-top: 0;
}

.popup-html-paragraph {
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-paragraph-size, 16px);
    line-height: var(--type-paragraph-height, 1.7);
    font-weight: var(--type-paragraph-weight, 400);
    color: var(--type-paragraph-color, rgba(0, 0, 0, 0.85));
    margin-bottom: var(--type-paragraph-margin, 22px);
    white-space: pre-line;
}

.popup-html-list {
    margin: 0 0 var(--popup-list-after-gap, 32px) 0;
    padding-left: 1.2em;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-paragraph-size, 16px);
    line-height: var(--type-paragraph-height, 1.7);
    font-weight: var(--type-paragraph-weight, 400);
    color: var(--type-paragraph-color, rgba(0, 0, 0, 0.85));
}

.popup-html-list li {
    margin: 0 0 var(--popup-list-item-gap, 6px) 0;
}

.popup-html-list li:last-child {
    margin-bottom: 0;
}

.popup-html-quote {
    font-family: var(--typography-serif-font-family, 'EB Garamond', serif);
    font-size: var(--type-quote-size, 16px);
    line-height: var(--type-quote-height, 1.7);
    font-weight: var(--type-quote-weight, 400);
    font-style: var(--type-quote-style, italic);
    color: var(--type-quote-color, rgba(0, 0, 0, 0.85));
    margin-left: var(--type-quote-margin-left, 0);
    margin-right: var(--type-quote-margin-left, 0);
    margin-bottom: var(--type-quote-margin, 22px);
}

.popup-html-source {
    display: block;
    font-family: var(--typography-font-family, 'Quicksand', sans-serif);
    font-size: var(--type-source-size, 14px);
    line-height: var(--type-source-height, 1.5);
    font-weight: var(--type-source-weight, 400);
    color: var(--type-source-color, rgba(0, 0, 0, 0.6));
    text-align: right;
    margin-top: var(--type-source-margin-top, -10px);
    margin-bottom: var(--type-source-margin-bottom, 22px);
}

