* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html {
    height: 100%;
    height: -webkit-fill-available;
}

body {
    width: 100%;
    height: 100vh;
    height: -webkit-fill-available;
    overflow: hidden;
    background-color: #0a0a0a;
    font-family: 'Arial', sans-serif;
    position: fixed;
    overscroll-behavior: none;
}

#scene-container {
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    position: relative;
    touch-action: none;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
    filter: contrast(1.15) saturate(0.6) brightness(0.9);
}

#horror-filter {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.85) 100%),
        linear-gradient(0deg, rgba(140, 0, 0, 0.2), rgba(140, 0, 0, 0.2));
    mix-blend-mode: multiply;
}

#horror-filter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.18) 0px,
        rgba(0, 0, 0, 0.18) 1px,
        rgba(255, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0) 4px
    );
    opacity: 0.35;
    animation: horror-flicker 4.2s steps(2, end) infinite;
}

#horror-filter::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 0, 0, 0.08), rgba(0, 0, 0, 0) 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 0, 0.05), rgba(0, 0, 0, 0) 50%);
    opacity: 0.6;
    mix-blend-mode: screen;
}

@keyframes horror-flicker {
    0% { opacity: 0.25; }
    12% { opacity: 0.4; }
    25% { opacity: 0.3; }
    40% { opacity: 0.5; }
    65% { opacity: 0.28; }
    80% { opacity: 0.45; }
    100% { opacity: 0.32; }
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: none;
    }
}

/* Prevent pull-to-refresh on mobile */
@media (hover: none) and (pointer: coarse) {
    html, body {
        overscroll-behavior-y: contain;
    }
}

