/* Rotwake — Atmospheric Landing Page (Final Clean Version) */

: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;
}

html, body {
    background: #000000;
    color: var(--text-primary);
    font-family: var(--font-title);
    overflow: hidden;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
    overscroll-behavior: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Dunkelheit mit 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 === */
.torch-light {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: screen;
}

/* === Desktop: Volle Bildschirmfläche === */
.dungeon-scene {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
}

.dungeon-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    image-rendering: pixelated;
    opacity: 0.78;
    filter: brightness(0.95) saturate(0.95);
    z-index: 1;
}

/* === Fackeln (Desktop: 36px wie im Editor) === */
.torch-wrapper {
    position: absolute;
    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 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 (Desktop: Originalgröße) === */
.title-group {
    position: absolute;
    z-index: 20;
    text-align: center;
    transform: translateX(-50%);
    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: 5rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 10px;
    line-height: 1;
    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.75rem;
    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);
    width: 240px;
    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.65rem;
    line-height: 1.7;
}

/* === Haupttext === */
.main-room {
    position: absolute;
    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.15rem;
    letter-spacing: 2px;
}

.main-room p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.quote {
    color: var(--text-dim) !important;
    font-style: italic;
    font-size: 0.75rem !important;
    margin-top: 25px !important;
}

/* === Zombies (Desktop: 115px wie im Editor) === */
.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.65);
    color: var(--text-dim);
    border: 1px solid rgba(196, 154, 82, 0.4);
    padding: 8px 14px;
    font-family: var(--font-title);
    font-size: 0.7rem;
    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.7rem;
    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: 8px 16px;
    font-family: var(--font-title);
    font-size: 0.75rem;
    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);
}

/* === 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: 17.00%; top: 21.00%; right: auto; }
.info-box.status { left: 78.00%; top: 21.00%; 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: 91.00%; top: 12.00%; right: auto; bottom: auto; }

/* === Handy & Tablet (Hoch- und Querformat — alle Zeilen komplett sichtbar) === */
@media (max-width: 1024px) {
    .dungeon-scene {
        width: 100vw;
        height: 56.25vw;
        max-width: 177.78vh;
        max-height: 100vh;
    }

    .torch-wrapper {
        width: min(2.3vw, 4.1vh);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .zombie-silhouette {
        width: min(7.2vw, 12.8vh);
    }

    .game-title {
        font-size: min(4.2vw, 7.5vh);
        letter-spacing: min(0.5vw, 0.9vh);
    }

    .coming-badge {
        margin-top: min(0.5vw, 0.9vh);
        padding: min(0.25vw, 0.45vh) min(0.9vw, 1.6vh);
        font-size: min(0.68vw, 1.2vh);
        letter-spacing: min(0.22vw, 0.4vh);
    }

    .info-box {
        width: min(17vw, 30vh);
    }

    .info-box h2 {
        font-size: min(0.68vw, 1.2vh);
        letter-spacing: min(0.16vw, 0.3vh);
        margin-bottom: min(0.4vw, 0.7vh);
    }

    .info-box p {
        font-size: min(0.55vw, 0.98vh);
        line-height: 1.45;
    }

    .main-room {
        width: min(36vw, 64vh);
        top: 56% !important;
    }

    .main-room h3 {
        font-size: min(0.92vw, 1.65vh);
        margin-bottom: min(0.4vw, 0.7vh);
    }

    .main-room p {
        font-size: min(0.64vw, 1.14vh);
        line-height: 1.4;
        margin-bottom: min(0.45vw, 0.8vh);
    }

    .quote {
        font-size: min(0.58vw, 1.03vh) !important;
        margin-top: min(0.4vw, 0.7vh) !important;
    }
}