/* RESET & CORE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #050505;
    /* Very dark grey, almost black */
    color: #fff;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    font-family: 'Courier New', Courier, monospace;
    /* FIX: Prevent mobile scroll/bounce */
    overscroll-behavior: none;
    touch-action: none;
}

/* LAYER 1: THE NOISE GENERATOR (Bottom) */
canvas#noise {
    position: fixed;
    /* FIX: Use fixed to stay pinned to viewport */
    top: 0;
    left: 0;
    /* We set width/height via JS for pixel precision */
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* LAYER 2: THE MASKING OVERLAY (Top) */
svg.overlay-layer {
    position: fixed;
    /* FIX: Use fixed to stay pinned to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 0;
    transition: opacity 6s ease-in-out;
    pointer-events: none;
}

svg.overlay-layer.active {
    opacity: 1;
}

/* PLAY BUTTON INTERACTION */
.click-layer {
    position: absolute;
    width: 100px;
    height: 70px;
    z-index: 20;
    cursor: pointer;
    display: none;
    border-radius: 18px;
    transition: box-shadow 0.3s ease;
    /* FIX: Ensure taps work on mobile without delay */
    touch-action: manipulation;
}

.click-layer:hover {
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
}

/* TOOLTIP STYLES */
#tooltip {
    position: fixed;
    background: #000;
    /* Fallback */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    padding: 8px 12px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 100;
    text-shadow: 0 0 2px black;
    font-size: 14px;
    font-weight: bold;
}

/* FOREST LAYER */
#forest-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind everything */
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    transform-origin: top center;
}

#forest-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.melt-down {
    transform: translateY(100%) scaleY(1.1);
}