@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Nosifer&family=Special+Elite&display=swap');

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

body {
    background: #000;
    font-family: 'Special Elite', monospace;
    overflow: hidden;
    cursor: none;
}

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
}

#ui-overlay .screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
}

#ui-overlay .screen.active {
    display: block;
}

/* Main Menu */
#main-menu {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9)), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect width="100%" height="100%" fill="%23001122"/><circle cx="20" cy="30" r="2" fill="%23ffaa00" opacity="0.6"/><circle cx="80" cy="70" r="1" fill="%23ff4400" opacity="0.8"/></svg>');
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.menu-bg {
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 10px;
    border: 3px solid #8B0000;
    backdrop-filter: blur(5px);
}

.game-title {
    font-family: 'Nosifer', cursive;
    font-size: 4rem;
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    margin-bottom: 10px;
    animation: flicker 2s infinite alternate;
}

.camp-title {
    font-family: 'Creepster', cursive;
    font-size: 2rem;
    color: #ffaa00;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px #000;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.menu-btn {
    background: linear-gradient(145deg, #654321, #4a2c17);
    border: 3px solid #8B0000;
    color: #fff;
    font-family: 'Special Elite', monospace;
    font-size: 1.2rem;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 1px 1px 2px #000;
    border-radius: 5px;
    pointer-events: all;
}

.menu-btn:hover {
    background: linear-gradient(145deg, #8B0000, #654321);
    box-shadow: 0 0 20px #ff0000;
    transform: translateY(-2px);
}

/* Game HUD */
#game-hud {
    pointer-events: none;
}

.clipboard {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(222, 184, 135, 0.9);
    border: 2px solid #8B4513;
    border-radius: 5px;
    padding: 20px;
    max-width: 300px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.5);
    color: #333;
}

.health-section {
    margin-bottom: 15px;
}

.health-bar, .stamina-bar {
    background: #333;
    height: 25px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.health-fill {
    background: linear-gradient(90deg, #ff0000, #ff6666);
    height: 100%;
    width: 100%;
    transition: width 0.3s;
}

.stamina-fill {
    background: linear-gradient(90deg, #00ff00, #66ff66);
    height: 100%;
    width: 100%;
    transition: width 0.3s;
}

.health-label, .stamina-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px #000;
    color: white;
}

.flashlight-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.battery-icon {
    width: 30px;
    height: 15px;
    border: 2px solid #333;
    border-radius: 2px;
    background: #ffaa00;
    position: relative;
}

.battery-icon::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 3px;
    width: 3px;
    height: 9px;
    background: #333;
    border-radius: 0 2px 2px 0;
}

.noise-meter {
    position: absolute;
    bottom: 100px;
    left: 20px;
    width: 200px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fff;
}

.noise-fill {
    background: linear-gradient(90deg, #ffff00, #ff0000);
    height: 100%;
    width: 0%;
    transition: width 0.2s;
}

.noise-label {
    position: absolute;
    top: -25px;
    left: 0;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
}

.objective {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px;
    border-radius: 5px;
    border-left: 5px solid #ffaa00;
    font-size: 1.1rem;
    text-shadow: 1px 1px 2px #000;
}

.interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2rem;
    border: 2px solid #ffaa00;
}

.interaction-prompt.hidden {
    display: none !important;
}

.danger-warning {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    padding: 20px;
    border-radius: 10px;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    border: 3px solid #ff0000;
    animation: pulse 1s infinite;
    box-shadow: 0 0 30px #ff0000;
}

.danger-warning.hidden {
    display: none !important;
}

/* Game Over */
#game-over {
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
}

.game-over-content {
    text-align: center;
    color: #fff;
    background: rgba(139, 0, 0, 0.8);
    padding: 40px;
    border-radius: 10px;
    border: 3px solid #ff0000;
}

.game-over-title {
    font-family: 'Nosifer', cursive;
    font-size: 4rem;
    color: #ff0000;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff0000;
}

.survival-time {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: #ffaa00;
}

/* Loading Screen */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-text {
    color: #fff;
    font-size: 2rem;
    font-family: 'Creepster', cursive;
    animation: pulse 1.5s infinite;
}

/* Animations */
@keyframes flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% {
        text-shadow: 0 0 20px #ff0000, 0 0 40px #ff0000;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

@keyframes pulse {
    0% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        opacity: 0.8;
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .camp-title {
        font-size: 1.5rem;
    }
    
    .menu-btn {
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .clipboard {
        max-width: 250px;
        padding: 15px;
    }
    
    .noise-meter {
        width: 150px;
    }
    
    .objective {
        font-size: 1rem;
        padding: 10px;
    }
    
    .danger-warning {
        font-size: 1.5rem;
        padding: 15px;
    }
}

/* Film grain effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="4" height="4"><rect width="100%" height="100%" fill="%23000" opacity="0.02"/><circle cx="1" cy="1" r="0.5" fill="%23fff" opacity="0.1"/><circle cx="3" cy="3" r="0.3" fill="%23fff" opacity="0.05"/></svg>');
    pointer-events: none;
    z-index: 1000;
    animation: grain 0.2s steps(10) infinite;
}

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