/* ZombeX — Atmospheric Landing Page */

:root {
    --bg-dark: #0d0b09;
    --text-primary: #e0d5c4;
    --text-secondary: #a89a85;
    --text-gold: #d6ae72;
    --text-light: #e8d5b5;
    --text-dim: #8a7e6d;
    --accent: #c49a52;
    --font-title: "Silkscreen", monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-title);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* === Dunkelheit mit echten ausgestanzten Lichtlöchern === */
#oil-lamp {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.93);
    pointer-events: none;
    z-index: 9998;
}

/* === Warmes Gold-Glühen für Öllampe & Fackeln === */
.torch-light {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
}

/* === Dungeon Scene === */
.dungeon-scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.dungeon-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    opacity: 0.78;
    filter: brightness(0.95) saturate(0.95);
    z-index: 1;
}

/* === Fackel-Wrapper === */
.torch-wrapper {
    position: absolute;
    top: 38%;
    width: 36px;
    height: 36px;
    transform: translate(-50%, -50%);
    z-index: 10000;
    user-select: none;
    -webkit-user-select: none;
}

.torch-wrapper.dragging {
    cursor: grabbing !important;
}

.torch {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 8px rgba(255, 180, 50, 0.95))
            drop-shadow(0 0 22px rgba(255, 120, 10, 0.7))
            brightness(1.35);
    opacity: 1;
    pointer-events: none;
}

/* === Glühende Fackel-Funken === */
.ember {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffaa33;
    box-shadow: 0 0 6px #ff6600;
    pointer-events: none;
    z-index: 10001;
    animation: ember-rise 2.4s ease-out forwards;
}

@keyframes ember-rise {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--drift, 12px), -75px) scale(0.3); }
}

/* === Titel === */
.title-group {
    position: absolute;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    text-align: center;
    opacity: 0;
    animation: fade-in 1.5s ease-out 0.3s forwards;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.game-title {
    font-family: "Jersey 10", sans-serif;
    font-weight: 400;
    font-size: clamp(3.8rem, 9vw, 6.2rem);
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 12px;
    animation: title-glow 4s ease-in-out infinite alternate;
}

@keyframes title-glow {
    0% { text-shadow: 0 0 20px rgba(255, 180, 80, 0.3), 0 0 60px rgba(255, 140, 0, 0.15); }
    100% { text-shadow: 0 0 30px rgba(255, 180, 80, 0.5), 0 0 80px rgba(255, 140, 0, 0.3); }
}

.coming-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 5px 18px;
    border: 1px solid var(--accent);
    color: var(--text-gold);
    font-size: 0.8rem;
    letter-spacing: 4px;
    background: rgba(0, 0, 0, 0.4);
    animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(196, 154, 82, 0); }
    50% { box-shadow: 0 0 10px rgba(196, 154, 82, 0.2); }
}

/* === Info-Boxen (About/Status) === */
.info-box {
    position: absolute;
    text-align: center;
    z-index: 20;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.95);
    max-width: 180px;
    opacity: 0;
    animation: fade-in-simple 1s ease-out 1.2s forwards;
}

@keyframes fade-in-simple {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.info-box h2 {
    color: var(--text-gold);
    font-size: 0.75rem;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.info-box p {
    color: var(--text-secondary);
    font-size: 0.7rem;
    line-height: 1.7;
}

.about { top: 28%; left: 15%; }
.status { top: 28%; right: 15%; }

/* === Haupttext === */
.main-room {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 20;
    width: 450px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.95);
    opacity: 0;
    animation: fade-in 1.5s ease-out 0.8s forwards;
}

.main-room h3 {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 1.3rem;
    letter-spacing: 2px;
}

.main-room p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.quote {
    color: var(--text-dim) !important;
    font-style: italic;
    font-size: 0.85rem !important;
    margin-top: 25px !important;
}

/* === Zombies (Mehrere möglich, klickbar, ohne roten Schein) === */
.zombie-silhouette {
    position: absolute;
    width: 115px;
    height: auto;
    image-rendering: pixelated;
    z-index: 15;
    opacity: 0.35;
    filter: brightness(0.7);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.25s ease, filter 0.25s ease, transform 0.15s ease;
}

.zombie-silhouette.spotted {
    opacity: 0.95 !important;
    filter: brightness(1.05) !important;
}

.zombie-silhouette:active {
    transform: scale(0.95);
}

body:has(#export-btn) .zombie-silhouette {
    opacity: 0.95 !important;
    filter: brightness(1.1) !important;
    z-index: 10000 !important;
}

/* === Sound-Toggle Button === */
.sound-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10003;
    background: rgba(0, 0, 0, 0.55);
    color: var(--text-dim);
    border: 1px solid rgba(196, 154, 82, 0.4);
    padding: 8px 14px;
    font-family: var(--font-title);
    font-size: 0.75rem;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.sound-btn:hover,
.sound-btn.active {
    color: var(--text-gold);
    border-color: var(--accent);
    background: rgba(196, 154, 82, 0.18);
    box-shadow: 0 0 12px rgba(196, 154, 82, 0.25);
}

/* === Editor-UI === */
.drag-hint {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 14px;
    border-radius: 3px;
    animation: hint-fade 8s ease-in forwards;
}

@keyframes hint-fade {
    0%, 60% { opacity: 0.8; }
    100% { opacity: 0; pointer-events: none; }
}

.pos-readout {
    position: fixed;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-gold);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 3px;
    pointer-events: none;
    white-space: nowrap;
    transform: translateX(-50%);
    display: none;
}

.editor-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10003;
    display: flex;
    gap: 10px;
}

.export-btn, .reset-btn {
    background: rgba(196, 154, 82, 0.2);
    color: var(--text-gold);
    border: 1px solid var(--accent);
    padding: 10px 18px;
    font-family: var(--font-title);
    font-size: 0.8rem;
    letter-spacing: 1px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.reset-btn {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-dim);
    border-color: rgba(196, 154, 82, 0.4);
}

.export-btn:hover, .reset-btn:hover {
    background: rgba(196, 154, 82, 0.35);
    color: var(--text-gold);
    box-shadow: 0 0 15px rgba(196, 154, 82, 0.3);
}

/* === Mobile Anpassungen === */
@media (max-width: 768px) {
    .game-title { letter-spacing: 5px; }
    .info-box { max-width: 140px; }
    .info-box h2 { font-size: 0.65rem; }
    .info-box p { font-size: 0.6rem; }
    .about { left: 5%; }
    .status { right: 5%; }
    .main-room { width: 300px; }
    .zombie-silhouette { width: 75px; }
}
/* === Gespeicherte Layout-Positionen === */
.torch-wrapper[data-id='left'] { left: 40.73%; top: 31.80%; }
.torch-wrapper[data-id='right'] { left: 70.98%; top: 31.72%; }
.title-group { left: 56.41%; top: 17.11%; }
.info-box.about { left: 23.06%; top: 20.23%; right: auto; }
.info-box.status { left: 84.44%; top: 20.23%; right: auto; }
.main-room { left: 56.41%; top: 69.14%; }
.zombie-silhouette[data-zombie='1'] { left: 93.37%; top: 76.64%; right: auto; bottom: auto; }
.zombie-silhouette[data-zombie='2'] { left: 1.75%; top: 42.97%; right: auto; bottom: auto; }
.zombie-silhouette[data-zombie='3'] { left: 87.85%; top: 10.47%; right: auto; bottom: auto; }

/* === Handy-Layout (überschreibt Desktop-Positionen sauber) === */
@media (max-width: 768px) {
    .dungeon-bg {
        object-fit: cover;
        object-position: center;
    }

    .title-group {
        left: 50% !important;
        top: 12% !important;
        transform: translateX(-50%) !important;
        width: 92vw;
    }

    .game-title {
        font-size: 3.1rem !important;
        letter-spacing: 6px !important;
    }

    .coming-badge {
        font-size: 0.65rem;
        padding: 4px 12px;
    }

    .torch-wrapper[data-id='left'] {
        left: 14% !important;
        top: 29% !important;
        width: 28px;
        height: 28px;
    }

    .torch-wrapper[data-id='right'] {
        left: 86% !important;
        top: 29% !important;
        width: 28px;
        height: 28px;
    }

    .info-box {
        max-width: 42vw !important;
    }

    .info-box h2 {
        font-size: 0.7rem;
        margin-bottom: 6px;
    }

    .info-box p {
        font-size: 0.6rem;
        line-height: 1.5;
    }

    .info-box.about {
        left: 6% !important;
        top: 38% !important;
        text-align: left;
    }

    .info-box.status {
        left: auto !important;
        right: 6% !important;
        top: 38% !important;
        text-align: right;
    }

    .main-room {
        left: 50% !important;
        top: 63% !important;
        transform: translateX(-50%) !important;
        width: 88vw !important;
    }

    .main-room h3 {
        font-size: 1rem;
    }

    .main-room p {
        font-size: 0.75rem;
        line-height: 1.6;
    }

    .zombie-silhouette {
        width: 68px !important;
    }

    .zombie-silhouette[data-zombie='1'] { left: 78% !important; top: 82% !important; }
    .zombie-silhouette[data-zombie='2'] { left: 6% !important; top: 80% !important; }
    .zombie-silhouette[data-zombie='3'] { left: 80% !important; top: 18% !important; }

    .sound-btn {
        bottom: 14px;
        left: 14px;
        font-size: 0.65rem;
        padding: 6px 10px;
    }
}