/* --- GLOBAL & UTILITIES --- */
:root {
    --danger-red: #ff0000;
    --danger-dark: #700000;
    --sweet-pink: #ffdde1;
    --sweet-gold: #ffd700;
}

body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: #000;
    font-family: 'Black Ops One', cursive;
    user-select: none;
}

.hidden {
    display: none !important;
}

.full-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: all 0.5s;
}

/* --- PAGE 1: DANGER ENTRY --- */
#page1 {
    background-color: var(--danger-dark);
    color: var(--danger-red);
    animation: alarmFlash 0.5s infinite alternate;
    z-index: 10;
    cursor: pointer;
}

.warning-text {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.sub-warning {
    font-size: 1.2rem;
    color: white;
}

@keyframes alarmFlash {
    from {
        background-color: var(--danger-dark);
    }

    to {
        background-color: #300000;
    }
}

/* --- PAGE 2: DANGEROUS BUTTON --- */
#page2 {
    background-color: #000;
    color: white;
}

.danger-btn {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, #ff5555 0%, #ff0000 100%);
    border: 5px solid #8b0000;
    border-radius: 50%;
    box-shadow: 0 0 20px var(--danger-red), inset 0 0 20px #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: white;
    text-shadow: 2px 2px 4px #000;
    animation: pulseBtn 1s infinite alternate;
}

.danger-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 10px var(--danger-red);
}

@keyframes pulseBtn {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
        box-shadow: 0 0 40px var(--danger-red);
    }
}

/* --- PAGE 3: LOCKED BOX --- */
#page3 {
    background: #2a2a2a;
    color: #ddd;
}

.mystery-box {
    width: 250px;
    height: 250px;
    background: #8d6e63;
    border: 10px solid #5d4037;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4rem;
    color: #3e2723;
}

.shake-hard {
    animation: shakeHard 0.2s infinite;
}

.box-breaking {
    background: #a1887f;
    border-color: #8d6e63;
}

@keyframes shakeHard {
    0% {
        transform: translate(0, 0) rotate(0);
    }

    25% {
        transform: translate(-10px, 5px) rotate(-5deg);
    }

    50% {
        transform: translate(5px, -10px) rotate(5deg);
    }

    75% {
        transform: translate(-5px, 10px) rotate(-3deg);
    }

    100% {
        transform: translate(0, 0) rotate(0);
    }
}

/* --- PAGE 4: CAKE --- */
#page4 {
    background: radial-gradient(circle, #4a148c 0%, #000 100%);
    color: white;
    font-family: 'Sacramento', cursive;
}

.svg-cake-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin-bottom: 50px;
}

.candle-container-svg {
    position: absolute;
    top: 35px;
    left: 65px;
    z-index: 10;
    display: flex;
    gap: 18px;
}

.candle-base {
    width: 6.4px;
    height: 15px;
    position: relative;
}

.candle-base:nth-child(even) {
    transform: translateY(15px);
}

.candle-base:nth-child(odd) {
    transform: translateY(10px);
}

.flame {
    width: 7px;
    height: 15px;
    background: orange;
    border-radius: 50% 50% 20% 20%;
    position: absolute;
    top: 0;
    left: 30px;
    box-shadow: 0 0 10px yellow;
    animation: flicker 0.5s infinite alternate;
    transition: opacity 0.5s, transform 0.5s;
}

.flame.out {
    opacity: 0;
    transform: scale(0.5) translateY(-20px);
}

@keyframes flicker {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.mic-instruction {
    position: absolute;
    top: 100px;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    color: var(--sweet-gold);
    text-shadow: 0 0 10px var(--sweet-gold);
}

.mic-status {
    position: absolute;
    bottom: 70px;
    font-family: sans-serif;
    font-size: 0.9rem;
    color: #aaa;
}

.flame.out {
    opacity: 0;
    transform: scale(0);
    width: 0;
    height: 0;
    box-shadow: none;
}



/* --- PAGE 5: MEMORIES --- */
#page5 {
    background-color: var(--sweet-pink);
    background-image: radial-gradient(#e0dcd3 1px, transparent 1px);
    background-size: 20px 20px;
    font-family: 'Indie Flower', cursive;
    color: #4a4a4a;
    overflow-y: auto;
    display: block;
    padding-bottom: 50px;
}

.final-header {
    font-family: 'Sacramento', cursive;
    font-size: 3.5rem;
    color: #d63384;
    margin-top: 30px;
}

.polaroid-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 40px;
    align-items: center;
    padding: 20px;
}

.polaroid {
    background: white;
    padding: 15px 15px 40px 15px;
    box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.15);
    transform: rotate(-3deg);
    width: 80%;
    max-width: 350px;
    transition: transform 0.3s;
    animation: slideUp 1s forwards;
    opacity: 0;
}

.polaroid:nth-child(even) {
    transform: rotate(3deg);
    animation-delay: 0.5s;
}

.polaroid img {
    width: 100%;
    height: auto;
    filter: contrast(1.1) sepia(0.2);
}

.tape {
    background-color: rgba(255, 255, 255, 0.6);
    width: 100px;
    height: 35px;
    position: absolute;
    top: -15px;
    left: 35%;
    transform: rotate(-2deg);
    z-index: 10;
}

@keyframes slideUp {
    from {
        transform: translateY(100px) rotate(0);
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

/* --- NEW EFFECT OVERLAYS --- */
#effect-overlay {
    z-index: 9999;
    transition: opacity 0.1s;
    opacity: 0;
}

/* 1. Flame Effect (Page 1 -> 2) */
.flame-effect {
    display: flex !important;
    opacity: 1 !important;
    background: radial-gradient(circle at bottom, orange 0%, red 70%, black 100%);
    box-shadow: 0 0 100px 50px orange;
    animation: firepulse 0.2s infinite alternate;
}

@keyframes firepulse {
    from {
        opacity: 0.8;
    }

    to {
        opacity: 1;
        transform: scale(1.01);
    }
}

/* 2 & 3. Shatter/Explosion Effect (Page 2 -> 3 and Page 3 -> 4) */
.shatter-effect {
    display: flex !important;
    opacity: 1 !important;
    animation: bombFlash 0.1s forwards;
}

@keyframes bombFlash {
    0% {
        background-color: white;
    }

    100% {
        background-color: rgba(255, 0, 0, 0.8);
    }
}

.shake-screen {
    animation: shakeScreen 0.2s ease-in-out;
}

@keyframes shakeScreen {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    25% {
        transform: translate(-3px, 0px) rotate(5deg);
    }

    50% {
        transform: translate(3px, 1px) rotate(0deg);
    }

    75% {
        transform: translate(-1px, -3px) rotate(-5deg);
    }

    100% {
        transform: translate(1px, 1px) rotate(0deg);
    }
}