/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Main storm scene container */
.storm-scene {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Base background image layer */
.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Atmospheric glow layer - main red/orange pulsing */
.glow-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse 80% 50% at 50% 30%,
        rgba(180, 50, 20, 0.15) 0%,
        rgba(120, 30, 10, 0.1) 40%,
        transparent 70%
    );
    mix-blend-mode: screen;
    opacity: 0;
    z-index: 2;
    animation: glowPulse 4s ease-in-out infinite;
}

/* Cloud glow layer - illuminated storm clouds effect */
.cloud-glow-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: 
        radial-gradient(
            ellipse 40% 30% at 30% 25%,
            rgba(255, 100, 50, 0.12) 0%,
            transparent 60%
        ),
        radial-gradient(
            ellipse 50% 40% at 70% 35%,
            rgba(200, 60, 30, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse 60% 35% at 50% 20%,
            rgba(180, 40, 20, 0.08) 0%,
            transparent 70%
        );
    mix-blend-mode: screen;
    opacity: 0;
    z-index: 3;
    animation: cloudGlow 6s ease-in-out infinite 1s;
}

/* Lightning flash layers */
.lightning-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    z-index: 4;
    mix-blend-mode: screen;
}

/* Lightning 1 - Main center flash */
.lightning-1 {
    background: radial-gradient(
        ellipse 60% 40% at 50% 25%,
        rgba(255, 255, 240, 0.4) 0%,
        rgba(255, 200, 150, 0.2) 30%,
        rgba(255, 150, 100, 0.1) 50%,
        transparent 70%
    );
}

/* Lightning 2 - Left side flash */
.lightning-2 {
    background: radial-gradient(
        ellipse 40% 35% at 25% 30%,
        rgba(255, 240, 220, 0.35) 0%,
        rgba(255, 180, 120, 0.15) 40%,
        transparent 65%
    );
}

/* Lightning 3 - Right side flash (matching the visible lightning in image) */
.lightning-3 {
    background: radial-gradient(
        ellipse 35% 45% at 85% 40%,
        rgba(200, 230, 255, 0.3) 0%,
        rgba(150, 200, 255, 0.15) 35%,
        rgba(100, 150, 200, 0.08) 55%,
        transparent 70%
    );
}

/* Atmospheric brightness layer */
.atmosphere-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 200, 150, 0.05) 0%,
        rgba(180, 100, 80, 0.03) 30%,
        rgba(50, 30, 40, 0.02) 60%,
        transparent 100%
    );
    mix-blend-mode: overlay;
    opacity: 0;
    z-index: 5;
    animation: atmosphereShift 8s ease-in-out infinite;
}

/* Keyframe animations */

/* Main glow pulsing animation */
@keyframes glowPulse {
    0%, 100% {
        opacity: 0;
    }
    15% {
        opacity: 0.6;
    }
    30% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.8;
    }
    70% {
        opacity: 0.4;
    }
    85% {
        opacity: 0.7;
    }
}

/* Cloud illumination glow */
@keyframes cloudGlow {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    20% {
        opacity: 0.5;
        transform: scale(1.02);
    }
    40% {
        opacity: 0.3;
        transform: scale(1.01);
    }
    60% {
        opacity: 0.7;
        transform: scale(1.03);
    }
    80% {
        opacity: 0.4;
        transform: scale(1);
    }
}

/* Atmospheric brightness shifts */
@keyframes atmosphereShift {
    0%, 100% {
        opacity: 0;
    }
    25% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.2;
    }
    75% {
        opacity: 0.6;
    }
}

/* Lightning flash animation - triggered by JavaScript */
@keyframes lightningFlash {
    0% {
        opacity: 0;
    }
    5% {
        opacity: 0.9;
    }
    10% {
        opacity: 0.3;
    }
    15% {
        opacity: 0.7;
    }
    20% {
        opacity: 0.1;
    }
    25% {
        opacity: 0.5;
    }
    30%, 100% {
        opacity: 0;
    }
}

/* Subtle lightning flicker */
@keyframes lightningFlicker {
    0% {
        opacity: 0;
    }
    8% {
        opacity: 0.6;
    }
    12% {
        opacity: 0.2;
    }
    18% {
        opacity: 0.8;
    }
    25% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* Distant rumble flash - softer, longer */
@keyframes distantFlash {
    0% {
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    30% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.2;
    }
    70% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
    }
}

/* Active state classes for JavaScript-triggered lightning */
.lightning-layer.flash-active {
    animation: lightningFlash 0.4s ease-out forwards;
}

.lightning-layer.flicker-active {
    animation: lightningFlicker 0.6s ease-out forwards;
}

.lightning-layer.distant-active {
    animation: distantFlash 1.2s ease-out forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .glow-layer {
        background: radial-gradient(
            ellipse 100% 60% at 50% 35%,
            rgba(180, 50, 20, 0.12) 0%,
            rgba(120, 30, 10, 0.08) 50%,
            transparent 80%
        );
    }
    
    .cloud-glow-layer {
        height: 50%;
    }
}

@media (max-width: 480px) {
    .lightning-1 {
        background: radial-gradient(
            ellipse 80% 50% at 50% 30%,
            rgba(255, 255, 240, 0.35) 0%,
            rgba(255, 200, 150, 0.15) 40%,
            transparent 75%
        );
    }
}

/* =============================================
   TRENCHER THINGS TITLE STYLES
   ============================================= */

/* Import a serif font similar to Stranger Things style */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&display=swap');

.title-container {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    text-align: center;
    pointer-events: none;
}

.title-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.title-word {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 5vw, 4rem);
    line-height: 0.85;
    letter-spacing: 0.15em;
    color: transparent;
    -webkit-text-stroke: 1.5px #cc0000;
    text-shadow: 
        0 0 10px rgba(200, 0, 0, 0.8),
        0 0 20px rgba(200, 0, 0, 0.6),
        0 0 40px rgba(200, 0, 0, 0.4),
        0 0 60px rgba(150, 0, 0, 0.3),
        0 0 80px rgba(100, 0, 0, 0.2);
    animation: titleGlow 3s ease-in-out infinite alternate;
}

/* Horizontal lines above and below the title */
.title-line {
    display: block;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #cc0000 15%, 
        #cc0000 85%, 
        transparent 100%
    );
    box-shadow: 
        0 0 10px rgba(200, 0, 0, 0.8),
        0 0 20px rgba(200, 0, 0, 0.5);
}

.title-line-top {
    margin-bottom: 8px;
}

.title-line-bottom {
    margin-top: 8px;
}

/* Title glow animation */
@keyframes titleGlow {
    0% {
        text-shadow: 
            0 0 10px rgba(200, 0, 0, 0.8),
            0 0 20px rgba(200, 0, 0, 0.6),
            0 0 40px rgba(200, 0, 0, 0.4),
            0 0 60px rgba(150, 0, 0, 0.3),
            0 0 80px rgba(100, 0, 0, 0.2);
        filter: brightness(1);
    }
    100% {
        text-shadow: 
            0 0 15px rgba(220, 0, 0, 0.9),
            0 0 30px rgba(220, 0, 0, 0.7),
            0 0 50px rgba(220, 0, 0, 0.5),
            0 0 70px rgba(180, 0, 0, 0.4),
            0 0 100px rgba(120, 0, 0, 0.3);
        filter: brightness(1.1);
    }
}

/* Responsive title adjustments */
@media (max-width: 768px) {
    .title-container {
        top: 30%;
    }
    
    .title-word {
        font-size: clamp(1.5rem, 6vw, 3rem);
        -webkit-text-stroke: 1px #cc0000;
        letter-spacing: 0.12em;
    }
    
    .title-line {
        height: 2px;
    }
    
    .title-line-top {
        margin-bottom: 5px;
    }
    
    .title-line-bottom {
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .title-container {
        top: 25%;
    }
    
    .title-word {
        font-size: clamp(1.2rem, 7vw, 2rem);
        -webkit-text-stroke: 1px #cc0000;
        letter-spacing: 0.1em;
    }
}

/* =============================================
   MONSTER ANIMATION STYLES
   ============================================= */

/* Monster container - positioned on left edge */
.monster-container {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-100%, -50%);
    z-index: 100;
    cursor: pointer;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
}

/* When monster is visible - show more of the head/neck */
.monster-container.monster-visible {
    transform: translate(-15%, -50%);
}

/* Monster image styling */
.monster-image {
    height: 45vh;
    width: auto;
    max-height: 450px;
    min-height: 200px;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.8));
}

/* Scream text coming from monster's mouth */
.monster-scream {
    position: absolute;
    left: 85%;
    top: 22%;
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 900;
    color: #ff4444;
    text-shadow: 
        0 0 15px rgba(255, 0, 0, 0.9),
        0 0 30px rgba(255, 0, 0, 0.7),
        0 0 45px rgba(255, 0, 0, 0.5),
        3px 3px 6px rgba(0, 0, 0, 0.95);
    letter-spacing: 4px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.3s ease 0.4s, transform 0.3s ease 0.4s;
    animation: screamShake 0.1s ease-in-out infinite;
    animation-play-state: paused;
}

/* Show scream text when monster is visible */
.monster-container.monster-visible .monster-scream {
    opacity: 1;
    transform: translateX(0);
    animation-play-state: running;
}

/* Scream text shake animation */
@keyframes screamShake {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-2px) rotate(-1deg);
    }
    50% {
        transform: translateX(2px) rotate(1deg);
    }
    75% {
        transform: translateX(-1px) rotate(-0.5deg);
    }
}

/* Monster slide in animation */
@keyframes monsterSlideIn {
    0% {
        transform: translate(-100%, -50%);
    }
    100% {
        transform: translate(-15%, -50%);
    }
}

/* Monster slide out animation */
@keyframes monsterSlideOut {
    0% {
        transform: translate(-15%, -50%);
    }
    100% {
        transform: translate(-100%, -50%);
    }
}

/* Responsive monster sizing */
@media (max-width: 768px) {
    .monster-image {
        height: 35vh;
        max-height: 300px;
    }
    
    .monster-scream {
        left: 80%;
        top: 20%;
        font-size: clamp(1.8rem, 5vw, 3.5rem);
    }
    
    .monster-container.monster-visible {
        transform: translate(-10%, -50%);
    }
}

@media (max-width: 480px) {
    .monster-image {
        height: 28vh;
        max-height: 220px;
        min-height: 150px;
    }
    
    .monster-scream {
        left: 75%;
        top: 18%;
        font-size: clamp(1.5rem, 4vw, 2.5rem);
        letter-spacing: 3px;
    }
    
    .monster-container.monster-visible {
        transform: translate(-5%, -50%);
    }
}

