* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Background */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('webbg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

/* Glitch Overlay Effects */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    mix-blend-mode: screen;
}

/* Distorted image flash */
.glitch-overlay.flash {
    background-size: cover;
    background-position: center;
    opacity: 0.7 !important;
    mix-blend-mode: hard-light;
}

/* VHS Scanlines */
.glitch-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 3px
    );
    opacity: 0.3;
    animation: vhs-scanlines 8s linear infinite;
}

/* CRT Effect */
.glitch-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    opacity: 0.5;
}

/* Glitch Animation */
@keyframes glitch {
    0% {
        opacity: 0;
        transform: translate(0);
    }
    2% {
        opacity: 1;
        transform: translate(-2px, 2px);
        filter: hue-rotate(90deg);
    }
    4% {
        opacity: 1;
        transform: translate(2px, -2px);
        filter: hue-rotate(180deg);
    }
    6% {
        opacity: 1;
        transform: translate(-2px, -2px);
        filter: hue-rotate(270deg);
    }
    8% {
        opacity: 0;
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    100% {
        opacity: 0;
    }
}

@keyframes vhs-scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

/* Chromatic Aberration */
@keyframes chromatic {
    0% {
        text-shadow: 
            -2px 0 0 rgba(255, 0, 0, 0.5),
            2px 0 0 rgba(0, 255, 255, 0.5);
    }
    50% {
        text-shadow: 
            2px 0 0 rgba(255, 0, 0, 0.5),
            -2px 0 0 rgba(0, 255, 255, 0.5);
    }
    100% {
        text-shadow: 
            -2px 0 0 rgba(255, 0, 0, 0.5),
            2px 0 0 rgba(0, 255, 255, 0.5);
    }
}

/* Apply glitch to background occasionally */
.background.glitching {
    animation: glitch 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Chromatic aberration on enter button during glitch */
.enter-button.glitching span {
    animation: chromatic 0.3s ease-in-out;
}

/* Enter Overlay */
.enter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.enter-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.enter-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 20px 50px;
    color: white;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.enter-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.enter-button:active {
    transform: translateY(0);
}

/* Volume Control */
.volume-control {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 15px 20px;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 80px;
    overflow: hidden;
}

.volume-control:hover {
    max-width: 300px;
    padding: 15px 25px;
}

.volume-icon {
    color: #ec4899;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.volume-icon:hover {
    color: #f472b6;
}

.volume-icon.muted {
    color: #94a3b8;
}

.volume-icon.muted #soundWaves {
    display: none;
}

/* Volume Slider Container */
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.volume-control:hover .volume-slider-container {
    opacity: 1;
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 150px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ec4899;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.volume-slider::-webkit-slider-thumb:hover {
    background: #f472b6;
    transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ec4899;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

.volume-slider::-moz-range-thumb:hover {
    background: #f472b6;
    transform: scale(1.1);
}

/* Volume Percentage */
.volume-percent {
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 40px;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .volume-control {
        top: 20px;
        left: 20px;
        padding: 12px 15px;
    }

    .volume-control:hover {
        max-width: 250px;
        padding: 12px 20px;
    }

    .volume-slider {
        width: 100px;
    }

    .enter-button {
        padding: 15px 40px;
        font-size: 16px;
    }
}

/* Cursor Trail Sparkles */
.sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, rgba(255, 182, 193, 1) 0%, rgba(255, 105, 180, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: sparkle-fade 1s ease-out forwards;
}

@keyframes sparkle-fade {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-30px);
    }
}

/* Alternative sparkle styles for variety */
.sparkle.star {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.8);
}

.sparkle.large {
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, rgba(236, 72, 153, 1) 0%, rgba(236, 72, 153, 0) 70%);
}

/* Creepy Overlay Lock */
.creepy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    animation: overlay-appear 1s ease-out;
}

.creepy-overlay.active {
    display: flex;
}

@keyframes overlay-appear {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.creepy-content {
    position: relative;
    width: 80%;
    max-width: 600px;
    background: rgba(20, 20, 20, 0.9);
    border: 2px solid #ff0000;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
    animation: content-shake 0.5s ease-in-out;
}

@keyframes content-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.creepy-content h1 {
    color: #ff0000;
    font-size: 48px;
    margin: 0 0 20px 0;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    animation: glitch-text 1s infinite;
}

@keyframes glitch-text {
    0%, 100% { 
        text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
    }
    50% { 
        text-shadow: -2px 0 0 #00ffff, 2px 0 0 #ff00ff;
    }
}

.creepy-content p {
    color: #ffffff;
    font-size: 20px;
    margin: 20px 0;
}

.fake-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 0, 0, 0.3);
    border: 2px solid #ff0000;
    border-radius: 50%;
    color: #ff0000;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fake-close-btn:hover {
    background: rgba(255, 0, 0, 0.5);
    transform: rotate(90deg);
}

/* Creepy cursor */
body.cursed {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><text y="24" font-size="24">💀</text></svg>'), auto;
}

body.cursed * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><text y="24" font-size="24">💀</text></svg>'), auto !important;
}

/* Hidden Button */
.hidden-button {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: none;
    border-radius: 10px;
    z-index: 9999;
    cursor: default;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, cursor 0.2s ease;
}

.hidden-button:hover {
    cursor: pointer;
    opacity: 0.15;
    background: rgba(236, 72, 153, 0.1);
}
