/* =========================================
   STYLE.CSS - ATLASARC MASTER (High-End Design)
   ========================================= */

/* Twemoji Styles (Einheitliche Emojis) */
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

* {
    box-sizing: border-box;
    outline: none;
    -ms-overflow-style: none;
    /* IE und Edge */
    scrollbar-width: none;
    /* Firefox */
}

:root {
    --ui-font-size: 16px;

    /* --- MASTER THEME: DARK GLASS --- */
    --bg-color: #0f1115;
    --panel-bg: rgba(20, 25, 35, 0.75);
    --text-color: #ffffff;
    --highlight: #00bcd4;
    /* Leuchtendes Cyan */
    --accent-color: rgba(0, 188, 212, 0.2);
    --accent-hover: rgba(0, 188, 212, 0.4);

    --input-bg: rgba(0, 0, 0, 0.3);
    --input-border: rgba(255, 255, 255, 0.1);
    --panel-border: 1px solid rgba(255, 255, 255, 0.08);

    --radius: 8px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --backdrop: blur(15px);

    --font-heading: 'Cinzel', serif;
    /* Branding */
    --font-ui: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* Clean UI */

    --line-color: #00bcd4;
    --line-shadow: rgba(0, 188, 212, 0.4);
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.5s ease, color 0.5s ease;
    font-size: var(--ui-font-size);
    font-family: var(--font-ui);
    background: radial-gradient(circle at center, #1a1d24 0%, #0f1115 100%);
    color: var(--text-color);
}

/* --- LIGHT MODE (Override) --- */
body.light-mode {
    --bg-color: #f0f2f5;
    --panel-bg: rgba(255, 255, 255, 0.85);
    --text-color: #1a1d24;
    --highlight: #008ba3;
    /* Dunkleres Cyan fÃ¼r Kontrast auf WeiÃŸ */
    --accent-color: rgba(0, 139, 163, 0.15);
    --accent-hover: rgba(0, 139, 163, 0.25);

    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: rgba(0, 0, 0, 0.15);
    --panel-border: 1px solid rgba(0, 0, 0, 0.1);

    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --line-color: #008ba3;
    --line-shadow: rgba(0, 139, 163, 0.2);

    background: radial-gradient(circle at center, #ffffff 0%, #eef2f3 100%);
}

body.light-mode h1,
body.light-mode h2,
body.light-mode h3 {
    color: #2c3e50;
}

body.light-mode .map-label {
    fill: #008ba3;
    text-shadow: none;
    filter: drop-shadow(0 0 2px #fff);
}

body.light-mode select option {
    background-color: #ffffff;
    color: #333;
}

body.light-mode .setup-branding img {
    filter: drop-shadow(0 0 15px rgba(0, 139, 163, 0.3));
    /* Keep floating animation in light mode */
}

/* Light-Mode Setup Screen */
body.light-mode #setup-screen::before {
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(240, 242, 245, 0.88) 70%,
        rgba(240, 242, 245, 0.96) 100%
    );
}

body.light-mode .setup-box {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(245, 248, 250, 0.85) 50%,
        rgba(255, 255, 255, 0.9) 100%
    );
    border-color: rgba(0, 139, 163, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 0 1px rgba(0, 139, 163, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .setup-section {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .setup-section:hover {
    border-color: rgba(0, 139, 163, 0.2);
}

body.light-mode .setup-section::before {
    background: linear-gradient(180deg, var(--highlight), rgba(0, 139, 163, 0.15));
}

body.light-mode .setup-section h3 {
    color: #2c3e50;
    text-shadow: none;
}

body.light-mode .tab-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .tab-btn {
    color: rgba(0, 0, 0, 0.5);
}

body.light-mode .tab-btn:hover {
    color: #1a1d24;
    background: rgba(0, 0, 0, 0.05);
}

body.light-mode .tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 139, 163, 0.2), rgba(0, 110, 140, 0.15));
    color: #1a1d24;
    box-shadow: 0 0 10px rgba(0, 139, 163, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.light-mode .setup-toolbar-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #555;
}

body.light-mode .setup-toolbar-btn:hover {
    background: var(--accent-hover);
    color: #1a1d24;
}

body.light-mode .btn-main {
    background: linear-gradient(135deg, rgba(0, 139, 163, 0.2), rgba(0, 110, 140, 0.15));
    border-color: rgba(0, 139, 163, 0.3);
    color: #1a1d24;
}

body.light-mode .btn-main:hover {
    background: linear-gradient(135deg, rgba(0, 139, 163, 0.35), rgba(0, 110, 140, 0.25));
    color: #000;
}

body.light-mode .btn-main::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 40%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 60%,
        transparent 100%
    );
}

body.light-mode .setup-footer::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 139, 163, 0.2) 30%,
        rgba(0, 139, 163, 0.35) 50%,
        rgba(0, 139, 163, 0.2) 70%,
        transparent 100%
    );
}

body.light-mode .custom-file-button {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .custom-file-button:hover {
    background: var(--accent-hover);
    border-color: var(--highlight);
}

body.light-mode .info-text {
    background: rgba(0, 139, 163, 0.06);
}

body.light-mode .rail-btn {
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .rail-btn:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.05);
}

/* Slider Thumb im Lightmode dunkel für Kontrast */
body.light-mode input[type=range]::-webkit-slider-thumb {
    border-color: var(--highlight);
    box-shadow: 0 0 5px var(--highlight);
}

/* Scrollbars fÃ¼r Chrome, Safari und Opera ausblenden */
::-webkit-scrollbar {
    display: none;
    width: 0;
    background: transparent;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    margin: 0 0 15px 0;
    letter-spacing: 1px;
    color: #e0e0e0;
    /* Silber fÃ¼r Headings */
    text-transform: uppercase;
    font-size: 1.5rem;
    text-shadow: none;
}

/* --- UI COMPONENTS --- */
.setup-box,
.controls,
#sound-menu,
.modal-content,
#map-hint,
#zoom-display {
    background: var(--panel-bg);
    border: var(--panel-border);
    border-radius: var(--radius);
    color: var(--text-color);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: var(--backdrop);
    backdrop-filter: var(--backdrop);
}

/* --- INPUTS --- */
input[type="text"],
input[type="number"],
textarea,
select {
    background-color: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--input-border);
    padding: 8px 12px;
    border-radius: 4px;
    width: 100%;
    margin-top: 5px;
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: normal;
    transition: border-color 0.2s, box-shadow 0.2s;
}

select option {
    background-color: #1a1d24;
    color: var(--text-color);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--highlight);
    box-shadow: 0 0 8px rgba(0, 188, 212, 0.3);
}

/* --- BUTTONS --- */
button,
.tab-btn,
.modal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-color);
    padding: 8px 16px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

button:hover,
.tab-btn:hover {
    background-color: var(--accent-hover);
    color: #fff;
    border-color: var(--highlight);
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-color);
}

.tab-btn.active,
button.active {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--highlight);
    box-shadow: 0 0 10px var(--accent-color);
}

.btn-main {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.3), rgba(0, 150, 180, 0.25));
    color: #fff;
    border: 1px solid rgba(0, 188, 212, 0.4);
    font-size: 1.15rem;
    padding: 14px;
    width: 100%;
    margin-top: 22px;
    letter-spacing: 2.5px;
    border-radius: 10px;
    box-shadow:
        0 0 20px rgba(0, 188, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    /* Stagger */
    opacity: 0;
    animation: staggerIn 0.5s ease-out 0.9s forwards;
}

/* Shimmer-Effekt */
.btn-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 40%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.08) 60%,
        transparent 100%
    );
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.btn-main:hover {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.5), rgba(0, 150, 180, 0.4));
    border-color: var(--highlight);
    box-shadow:
        0 0 35px rgba(0, 188, 212, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    letter-spacing: 3px;
}

/* --- DATEI INPUTS --- */
.hidden-file-input {
    display: none;
}

.custom-file-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.custom-file-button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(5px);
    letter-spacing: 0.5px;
}

.custom-file-button:hover {
    background: var(--accent-hover);
    border-color: var(--highlight);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.15);
}

.custom-file-name {
    font-size: 0.85rem;
    opacity: 0.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    font-style: italic;
}

/* --- SLIDER --- */
.slider-container {
    display: flex;
    flex-direction: column;
    min-width: 120px;
    text-align: center;
}

.slider-container label {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    margin: 0;
}

#speed-val-display {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--highlight);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    margin: 10px 0;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--highlight);
    border: 2px solid var(--highlight);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* --- SETUP LAYOUT --- */
#setup-screen {
    position: absolute;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Atmosphärisches Hintergrundbild */
    background: url('logo/Background_AtlasArc.jpg') center center / cover no-repeat;
}

/* Dimming-Overlay über dem Hintergrundbild */
#setup-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(15, 17, 21, 0.75) 0%,
        rgba(15, 17, 21, 0.92) 70%,
        rgba(15, 17, 21, 0.98) 100%
    );
    z-index: 0;
}

#setup-screen > .setup-wrapper {
    position: relative;
    z-index: 1;
}

/* Wrapper: Logo links, Box rechts */
.setup-wrapper {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 150px;
    max-width: 1700px;
    width: 95%;
}

.setup-branding {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    animation: fadeInBrand 1.8s ease-out forwards;
    margin-bottom: 0;
}

.setup-branding img {
    width: 750px;
    max-width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 25px rgba(0, 188, 212, 0.4)) drop-shadow(0 0 80px rgba(0, 188, 212, 0.15));
    animation: logoFloat 6s ease-in-out infinite, logoPulse 4s ease-in-out infinite;
}

/* Logo Atem-Glow */
@keyframes logoPulse {
    0%, 100% { filter: drop-shadow(0 0 25px rgba(0, 188, 212, 0.4)) drop-shadow(0 0 80px rgba(0, 188, 212, 0.15)); }
    50% { filter: drop-shadow(0 0 35px rgba(0, 188, 212, 0.55)) drop-shadow(0 0 100px rgba(0, 188, 212, 0.25)); }
}

/* Logo schwebt sanft */
@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes fadeInBrand {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Setup-Box: Verstärkter Glassmorphism --- */
.setup-box {
    width: 650px;
    max-width: 95%;
    max-height: none;
    height: auto;
    min-height: 400px;
    padding: 25px 30px 40px 30px;
    overflow: visible;
    position: relative;
    /* Verstärkter Glaseffekt */
    background: linear-gradient(
        135deg,
        rgba(20, 25, 35, 0.85) 0%,
        rgba(15, 20, 30, 0.78) 50%,
        rgba(20, 25, 35, 0.85) 100%
    );
    border: 1px solid rgba(0, 188, 212, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 1px rgba(0, 188, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 0 30px rgba(0, 188, 212, 0.03);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border-radius: 12px;
    /* Stagger-Animation */
    opacity: 0;
    animation: fadeInBox 0.8s ease-out 0.3s forwards;
}

@keyframes fadeInBox {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Setup Toolbar (Language, Theme, Help) --- */
.setup-toolbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    z-index: 10;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.setup-toolbar-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.setup-toolbar-btn:hover {
    background: var(--accent-hover);
    border-color: var(--highlight);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-color), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.setup-lang-select {
    width: auto;
    min-width: 54px;
    padding: 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.5px;
    margin: 0;
}

/* --- Footer-Links: Gradient-Trennlinie + Underline-Animation --- */
.setup-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: none;
    text-align: center;
    font-size: 0.8rem;
    position: relative;
}

.setup-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 188, 212, 0.3) 30%,
        rgba(0, 188, 212, 0.5) 50%,
        rgba(0, 188, 212, 0.3) 70%,
        transparent 100%
    );
}

.setup-footer a {
    color: var(--text-color);
    opacity: 0.5;
    text-decoration: none;
    margin: 0 10px;
    transition: opacity 0.3s, color 0.3s;
    position: relative;
    padding-bottom: 2px;
}

.setup-footer a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1px;
    background: var(--highlight);
    transition: width 0.3s ease, left 0.3s ease;
}

.setup-footer a:hover {
    opacity: 1;
    color: var(--highlight);
}

.setup-footer a:hover::after {
    width: 100%;
    left: 0;
}

/* --- Section Card-Design --- */
.setup-section {
    margin-bottom: 20px;
    padding: 18px;
    border-bottom: none;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: border-color 0.3s ease;
    /* Stagger-Einblendung */
    opacity: 0;
    animation: staggerIn 0.5s ease-out forwards;
}

.setup-section:nth-child(1) {
    animation-delay: 0.5s;
}

.setup-section:nth-child(2) {
    animation-delay: 0.7s;
}

@keyframes staggerIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-section:hover {
    border-color: rgba(0, 188, 212, 0.15);
}

/* Akzentlinie links */
.setup-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--highlight), rgba(0, 188, 212, 0.2));
    opacity: 0.6;
    transition: opacity 0.3s;
}

.setup-section:hover::before {
    opacity: 1;
}

/* Section Überschriften mit Glow */
.setup-section h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 20px rgba(0, 188, 212, 0.15);
}

/* --- Pill-Tabs --- */
.tab-content-wrapper {
    min-height: 240px;
    /* Reserviert Platz für den höchsten Tab-Inhalt */
    display: flex;
    flex-direction: column;
}

.tab-container {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    flex: 1;
    text-align: center;
    border-radius: 50px;
    padding: 8px 12px;
    font-size: 0.85rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    font-weight: 600;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 188, 212, 0.35), rgba(0, 150, 180, 0.25));
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 188, 212, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

.dim-inputs {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.dim-inputs>div {
    flex: 1;
    text-align: center;
}

.input-group {
    display: none;
    animation: fadeIn 0.3s;
}

.input-group.active {
    display: block;
}

/* Sound Rows */
.sound-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.05);
    padding: 8px;
    border-radius: var(--radius);
    border: 1px solid var(--input-border);
}

.sfx-name {
    flex: 1;
    margin-top: 0 !important;
}

.sfx-file {
    flex: 2;
    font-size: 0.8rem;
}

/* UPDATED INFO TEXT STYLING */
.info-text {
    font-size: 0.9rem !important;
    color: var(--text-color);
    /* Sicherstellen dass Text lesbar ist */
    margin-top: 12px;
    margin-bottom: 12px;
    background: rgba(0, 188, 212, 0.08);
    /* Dunkler Hintergrund für Kontrast */
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid var(--highlight);
    /* Akzentlinie */
    font-weight: 500;
    line-height: 1.4;
}

/* --- MAP AREA --- */
#camera {
    position: absolute;
    inset: 0;
    background: #000;
    overflow: hidden;
    display: none;
    touch-action: none;
}

#world {
    position: absolute;
    transform-origin: 0 0;
    will-change: transform;
}

/* KINO MODUS - VERSTECKT MARKER */
.cinema-mode svg circle {
    opacity: 0 !important;
    transition: opacity 0.5s;
}

#map-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/*
#map-layer.interactive {
    pointer-events: auto !important;
}
*/

#map-layer img,
#map-layer iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
}

#map-layer.pixelated img {
    image-rendering: pixelated;
}

svg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

/* --- MODERN UI: TOOL GRID (Left Menu) --- */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 5px 0;
}

.tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
}

.tool-btn .icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
    display: block;
}

.tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--accent-color);
    border-color: var(--highlight);
    background: var(--accent-color);
}

.tool-btn:active,
.tool-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--highlight);
    transform: translateY(0);
}

/* --- MODERN UI: CARD GRID (Right Menu) --- */
.card-grid {
    display: grid;
    gap: 15px;
    padding: 5px;
}

.card-grid.cols-1 {
    grid-template-columns: 1fr;
}

.card-grid.cols-2 {
    grid-template-columns: 1fr 1fr;
}

.grid-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.grid-card:hover {
    border-color: var(--highlight);
}

.grid-card h4 {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    color: var(--highlight);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-card input,
.grid-card select,
.grid-card button {
    width: 100%;
    margin-top: 5px;
    font-size: 0.8rem;
}


/* --- NEUES UI SYSTEM (Rail + Drawer) --- */

.nav-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 60px;
    background: var(--panel-bg);
    border: var(--panel-border);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
    gap: 10px;
    -webkit-backdrop-filter: var(--backdrop);
    backdrop-filter: var(--backdrop);
    box-shadow: var(--shadow);
}

#ui-left .nav-rail {
    left: 0;
    border-right: 1px solid var(--input-border);
    border-left: none;
    border-top: none;
    border-bottom: none;
}

#ui-right .nav-rail {
    right: 0;
    border-left: 1px solid var(--input-border);
    border-right: none;
    border-top: none;
    border-bottom: none;
}

.nav-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 320px;
    background: var(--panel-bg);
    z-index: 1900;
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
    -webkit-backdrop-filter: var(--backdrop);
    backdrop-filter: var(--backdrop);
    box-shadow: var(--shadow);
}

#left-drawer {
    left: 60px;
    border-right: 1px solid var(--input-border);
    transform: translateX(-110%);
    /* Versteckt links unter der Rail */
}

#left-drawer.open {
    transform: translateX(0);
}

#right-drawer {
    right: 60px;
    border-left: 1px solid var(--input-border);
    transform: translateX(110%);
    /* Versteckt rechts */
}

#right-drawer.open {
    transform: translateX(0);
}

.rail-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
}

.rail-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.rail-btn.active {
    background-color: var(--accent-color);
    color: var(--highlight);
    box-shadow: 0 0 15px var(--accent-color);
}

/* Tutorial Button Highlight (Gold) */
#btn-tutorial:not(.seen) {
    background: rgba(255, 215, 0, 0.5);
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
}

#btn-tutorial:not(.seen):hover {
    background: rgba(255, 215, 0, 0.3);
    color: #fff;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Tutorial Button Highlight (Red for Light Mode) */
body.light-mode #btn-tutorial:not(.seen) {
    background: rgba(220, 20, 60, 0.5);
    color: #dc143c;
    border-color: rgba(220, 20, 60, 0.3);
    box-shadow: 0 0 10px rgba(220, 20, 60, 0.1);
}

body.light-mode #btn-tutorial:not(.seen):hover {
    background: rgba(220, 20, 60, 0.2);
    color: #b30000;
    border-color: #dc143c;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.25);
}

.drawer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: fadeIn 0.3s;
}

/* --- SOUND LISTE IN SIDEBAR --- */
.collapse-btn {
    font-size: 0.8rem;
    padding: 5px;
    margin-top: 5px;
    text-align: left;
    opacity: 0.9;
}

.sidebar-sound-item {
    font-size: 0.85rem;
    padding: 6px 8px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sidebar-sound-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.preview-play-btn {
    width: 26px !important;
    height: 26px !important;
    padding: 0 !important;
    min-width: 26px !important;
    font-size: 0.8rem !important;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- ATMOSPHERE: WEATHER & NIGHT --- */
#weather-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 5;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.7;
}

#world.night-mode {
    filter: brightness(0.6) contrast(1.2) hue-rotate(220deg) saturate(0.8);
}

#world.sepia-mode {
    filter: sepia(0.8) contrast(1.1);
}

#world.night-mode.sepia-mode {
    filter: brightness(0.6) contrast(1.2) hue-rotate(220deg) saturate(0.5) sepia(0.6);
}

/* Marker Items in der Liste */
.marker-item {
    background: rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    padding: 0;
    /* Padding nun in den inneren Elementen */
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Kompakte Header fÃ¼r Items */
.marker-item-header {
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    transition: background 0.2s;
}

.marker-item-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.marker-item-header .toggle-icon {
    font-size: 0.7rem;
    width: 15px;
    text-align: center;
    transition: transform 0.2s;
    opacity: 0.7;
}

.marker-item.expanded .marker-item-header .toggle-icon {
    transform: rotate(90deg);
}

.marker-item-info {
    font-size: 0.75rem;
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.marker-name-input {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--input-border) !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    flex: 1;
    font-size: 0.9rem !important;
    height: auto;
    font-weight: bold;
}

.marker-item-body {
    display: none;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.marker-item.expanded .marker-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.marker-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.marker-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.color-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

input[type="color"] {
    width: 40px;
    height: 25px;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
}

.palette-row {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.palette-swatch {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #fff;
    box-shadow: 0 0 2px #000;
}

/* --- OVERLAYS --- */
#zoom-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 25px;
    font-weight: bold;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 2px;
    display: none;
    z-index: 500;
    border-radius: 50px;
    color: var(--highlight);
}

/*
#map-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 80px;
    padding: 15px 30px;
    display: none;
    pointer-events: auto;
    z-index: 600;
    text-align: center;
}
*/

#sound-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    gap: 15px;
    min-width: 320px;
    padding: 30px;
    z-index: 9999;
}

#start-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.5s ease;
}

#start-message {
    font-size: 3rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 5px;
    padding: 30px 60px;
    border-radius: var(--radius);
    color: #fff;
    background: var(--accent-color);
    border: 3px double var(--highlight);
    box-shadow: 0 0 30px var(--line-shadow);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    animation: pulseStart 2s infinite ease-in-out;
}

/* --- SPEICHER MODAL --- */
#custom-modal,
#input-modal {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

#custom-modal.visible,
#input-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    padding: 40px;
    text-align: center;
    width: 500px;
    max-width: 90%;
    transform: translateY(20px);
    transition: transform 0.4s;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.7);
}

#custom-modal.visible .modal-content,
#input-modal.visible .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    border-bottom: 2px solid var(--highlight);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--highlight);
}

.modal-content p {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: var(--text-color);
    font-weight: 500;
}

.modal-content .modal-btn {
    width: 200px;
    padding: 15px;
    font-size: 1.2rem;
    margin: 0 auto;
    display: block;
}

/* --- SVG --- */
.travel-line {
    fill: none;
    stroke: var(--line-color);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 2px var(--line-shadow));
    vector-effect: non-scaling-stroke;
    pointer-events: stroke;
    /* WICHTIG: Macht die Linie klickbar */
    transition: stroke-width 0.2s, stroke 0.2s;
}

/* SPEED MODE STYLES */
body.mode-cutter .travel-line,
body.mode-sound .travel-line {
    cursor: pointer;
}

body.mode-cutter .travel-line:hover,
body.mode-sound .travel-line:hover {
    stroke-width: 8;
    filter: drop-shadow(0 0 5px var(--highlight));
    opacity: 1 !important;
    /* Immer voll sichtbar beim Hover */
}

.travel-line.selection-start {
    stroke: #ff9800 !important;
    stroke-width: 8 !important;
    opacity: 1 !important;
}

.travel-line.in-range {
    stroke: #ffeb3b !important;
    stroke-width: 8 !important;
    filter: drop-shadow(0 0 8px orange);
    opacity: 1 !important;
}

/* --- SEGMENT FOKUS (Highlight) --- */
.travel-line.focused {
    stroke: #fff !important;
    filter: drop-shadow(0 0 8px var(--highlight)) drop-shadow(0 0 15px var(--accent-color));
    opacity: 1 !important;
    animation: focusPulse 0.5s infinite alternate;
}

@keyframes focusPulse {
    0% {
        stroke-width: 6;
    }

    100% {
        stroke-width: 12;
    }
}

/* --- MARKER FOKUS (Punkt-Highlight) --- */
circle.focused-marker {
    stroke: #fff !important;
    stroke-width: 2px !important;
    animation: markerFocusPulse 0.5s infinite alternate;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes markerFocusPulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(2.5);
        filter: drop-shadow(0 0 5px var(--highlight));
    }
}

.historic-line {
    fill: none;
    stroke: var(--text-color);
    stroke-width: 4;
    opacity: 0.6;
    stroke-linecap: round;
}

.anchor-marker {
    fill: var(--highlight);
    stroke: #000;
    stroke-width: 1;
}

.target-marker {
    fill: var(--line-color);
    stroke: #fff;
    stroke-width: 2;
}

.start-marker {
    fill: #fff;
    stroke: #000;
    opacity: 0.5;
}

.portal-marker {
    stroke: #fff;
    stroke-width: 2;
    fill-opacity: 0.8;
}

.portal-marker.entry {
    fill: #00bcd4;
    /* Cyan fÃ¼r Eingang */
}

.portal-marker.exit {
    fill: #ff9800;
    /* Orange fÃ¼r Ausgang */
}

/* Portal Pfad (gestrichelt) */
.portal-connection {
    /* stroke-dasharray wird nun via JS gesetzt, damit Animation funktioniert */
    opacity: 0.7;
}

/* --- MAP LABELS (TEXT) --- */
.map-label {
    pointer-events: auto;
    /* Wichtig fÃ¼r Klicks */
    cursor: grab;
    text-anchor: middle;
    font-weight: bold;
    -webkit-user-select: none;
    user-select: none;
    font-size: 24px;
    transition: opacity 0.5s ease, transform 0.2s;
    /* Schnellerer Fade fÃ¼r Editor-Feedback */
    transform-box: fill-box;
    transform-origin: center;
    text-rendering: geometricPrecision;
    shape-rendering: geometricPrecision;
    /* SchÃ¤rfe-Optimierung & Anti-Aliasing */
    -webkit-font-smoothing: antialiased;
    will-change: transform;
    transform: translateZ(0);
    opacity: 1;
    /* Immer sichtbar im Editor */
}

.map-label:active {
    cursor: grabbing;
}

.map-label:hover {
    transform: scale(1.1) translateZ(0);
}

.map-label.selected {
    /* Visueller Indikator fÃ¼r Auswahl */
    filter: drop-shadow(0 0 8px var(--highlight));
    outline: 1px dashed var(--highlight);
    outline-offset: 4px;
}

/* KINO MODUS: Labels verstecken bis sie aufgedeckt werden */
.cinema-mode .map-label {
    opacity: 0;
}

.cinema-mode .map-label.revealed {
    opacity: 1;
}

/* MASTER LABEL STYLE: Neon Glow */
.map-label {
    /* Styles are now handled by JS (globalLabelStyle) */
    stroke: none;
}

/* --- PORTAL ANIMATIONEN (Kino Modus) --- */
.portal-visual {
    position: absolute;
    width: 12px;
    height: 12px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
    border-radius: 50%;
    transition: opacity 0.5s ease-out;

    /* MASTER PORTAL STYLE */
    border: 2px solid #00f3ff;
    box-shadow: 0 0 15px #00f3ff, inset 0 0 10px #00f3ff;
    background: rgba(0, 243, 255, 0.1);
    animation: portalSpin 4s linear infinite;
}

.portal-visual::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #fff;
    animation: portalPing 1s infinite;
}

@keyframes portalSpin {
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes portalPing {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes pulseStart {
    0% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--line-shadow);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px var(--line-shadow);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--line-shadow);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PREVIEW PLAYER UI --- */
#preview-ui {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    border: var(--panel-border);
    padding: 10px 25px;
    border-radius: 50px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 3000;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    width: 600px;
    max-width: 90vw;
}

.preview-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

#preview-ui button {
    min-width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

#preview-ui input[type=range] {
    flex: 1;
    margin: 0;
    cursor: pointer;
}

#preview-ui span {
    font-family: monospace;
    font-size: 1rem;
    font-weight: bold;
    color: var(--highlight);
    min-width: 50px;
    text-align: center;
}

/* --- LABEL EDITING UI --- */
.selection-box {
    fill: none;
    stroke: var(--highlight);
    stroke-width: 1px;
    stroke-dasharray: 4, 4;
    pointer-events: none;
    /* Klicks gehen durch */
    opacity: 0.8;
}

.resize-handle {
    fill: var(--bg-color);
    stroke: var(--highlight);
    stroke-width: 1.5px;
    width: 10px;
    height: 10px;
    cursor: nwse-resize;
    /* Diagonal-Cursor */
    pointer-events: auto;
    /* Muss klickbar sein */
    transition: transform 0.1s;
}

.resize-handle:hover {
    fill: var(--highlight);
}

/* --- DONATION BUTTON --- */
.donation-btn {
    position: absolute;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, rgba(20, 25, 30, 0.8), rgba(10, 15, 20, 0.9));
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 10px 24px;
    border-radius: 50px;
    color: #e0d0a0;
    text-decoration: none;
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    z-index: 2000;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(212, 175, 55, 0.05);
}

.donation-icon {
    font-size: 1.3em;
    filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.4));
}

.donation-btn:hover {
    background: linear-gradient(135deg, rgba(30, 35, 40, 0.95), rgba(15, 20, 25, 0.98));
    color: #fff;
    border-color: rgba(212, 175, 55, 0.8);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 175, 55, 0.4), inset 0 0 15px rgba(212, 175, 55, 0.2);
}

/* =========================================
   MOBILE OPTIMIZATION & RESPONSIVE LAYOUT
   ========================================= */
@media (max-width: 1700px) {

    /* Setup: Logo oben, Box darunter auf schmalen Screens */
    #setup-screen {
        justify-content: flex-start;
        flex-direction: column;
        padding: 20px 10px;
        overflow-y: auto;
    }

    .setup-wrapper {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }

    .setup-branding {
        position: static;
        margin-bottom: 0;
        opacity: 1;
        text-align: center;
        width: 100%;
        display: flex;
        justify-content: center;
        animation: none;
    }

    .setup-branding img {
        width: 180px;
        max-width: 60%;
        animation: logoFloat 6s ease-in-out infinite;
    }

    .setup-box {
        width: 100%;
        max-width: 500px;
        height: auto;
        max-height: none;
        margin-bottom: 40px;
        overflow: visible;
        opacity: 1;
        animation: none;
    }

    .setup-section {
        opacity: 1;
        animation: none;
    }

    .btn-main {
        opacity: 1;
        animation: none;
    }

    /* Pill-Tabs kompakter auf Mobile */
    .tab-btn {
        font-size: 0.78rem;
        padding: 7px 8px;
    }

    .setup-toolbar {
        opacity: 1;
        animation: none;
    }

    /* Drawer: Volle Breite auf Mobile (minus Rail) */
    .nav-drawer {
        width: calc(100vw - 60px);
    }

    /* Größere Touch-Ziele für Buttons */
    .rail-btn {
        height: 55px;
        margin-bottom: 8px;
    }

    /* Preview UI mobilfreundlich */
    #preview-ui {
        width: 95%;
        padding: 15px;
        flex-wrap: wrap;
        bottom: 15px;
    }

    #preview-ui input[type=range] {
        min-width: 100%;
        order: 5;
        /* Slider in neue Zeile */
        margin-top: 15px;
    }

    /* Sound Menu mobil */
    #sound-menu {
        width: 95%;
        min-width: auto;
    }

    .setup-toolbar {
        top: 8px;
        right: 8px;
    }

    /* Donation Button Mobil: Nicht fixiert, sondern am Ende der Liste */
    .donation-btn {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 20px;
        width: auto;
        justify-content: center;
    }
}

/* Optimierung für flache Bildschirme (z.B. 1024x600 Landscape Tablets) */
@media (max-height: 750px) {
    .setup-branding img {
        width: 140px;
        /* Logo deutlich kleiner */
        margin-bottom: 10px;
    }

    .setup-box {
        padding: 15px;
        margin-bottom: 10px;
    }

    .setup-section {
        padding: 12px;
    }
}

/* =========================================
   TUTORIAL SYSTEM
   ========================================= */
#tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
    /* Blockiert Klicks auf die App */
    overflow: hidden;
    display: none;
}

#tutorial-spotlight {
    position: absolute;
    border-radius: 4px;
    /* Der Schatten verdunkelt den Rest des Screens */
    box-shadow: none;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10000;
    border: 2px solid var(--highlight);
}

#tutorial-tooltip {
    position: absolute;
    width: 320px;
    background: var(--panel-bg);
    border: 1px solid var(--highlight);
    border-radius: var(--radius);
    padding: 20px;
    color: var(--text-color);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    z-index: 10001;
    transition: all 0.4s ease;
}

#tutorial-tooltip h3 {
    margin-top: 0;
    color: var(--highlight);
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.tut-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.tut-btn-primary {
    background: var(--highlight);
    color: #000;
    border: none;
}

.tut-btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tut-btn-primary:hover,
.tut-btn-secondary:hover {
    transform: translateY(-2px);
}

/* =========================================
   LEGAL / COOKIE BANNER
   ========================================= */
#legal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: none;
    justify-content: center;
    align-items: center;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

#legal-banner {
    width: 90%;
    max-width: 600px;
    background: var(--panel-bg);
    border: 1px solid var(--highlight);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.5s ease-out;
}

.legal-content h3 {
    margin-top: 0;
    color: var(--highlight);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.legal-content p {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.5;
}

.legal-content a {
    color: var(--highlight);
    text-decoration: underline;
}

.legal-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.legal-buttons button {
    width: auto;
    min-width: 120px;
}

.legal-buttons button.secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-color);
}

.legal-buttons button.secondary:hover {
    border-color: var(--highlight);
    background: rgba(255, 255, 255, 0.05);
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Visually hidden for SEO */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}