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

:root {
    --blood-red: #8B0000;
    --dark-blood: #4a0000;
    --candle-orange: #FF6B35;
    --candle-yellow: #FFD700;
    --bone-white: #E8DCC4;
    --shadow-black: #0a0a0a;
    --fog-gray: #1a1a2e;
    --danger-red: #FF0033;
    --success-green: #00FF66;
}

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

/* Game Container */
#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#game-container canvas {
    display: block;
}

/* Screens */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a0a 50%, #0a0a0a 100%);
}

.screen.hidden {
    display: none;
}

/* Start Screen */
#start-screen {
    background: radial-gradient(ellipse at center, #1a0505 0%, #0a0000 70%, #000 100%);
}

.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.8) 100%);
    pointer-events: none;
}

.fog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>');
    pointer-events: none;
    animation: fogDrift 20s ease-in-out infinite;
}

@keyframes fogDrift {
    0%, 100% { transform: scale(1) translateX(0); opacity: 0.03; }
    50% { transform: scale(1.1) translateX(-2%); opacity: 0.05; }
}

.start-content {
    text-align: center;
    z-index: 10;
    animation: fadeInUp 1.5s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(3rem, 10vw, 8rem);
    color: var(--blood-red);
    text-shadow: 
        0 0 10px var(--blood-red),
        0 0 30px var(--dark-blood),
        0 0 60px rgba(139, 0, 0, 0.5),
        4px 4px 0 #000;
    letter-spacing: 0.1em;
    animation: titleFlicker 3s ease-in-out infinite;
}

@keyframes titleFlicker {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--blood-red), 0 0 30px var(--dark-blood), 0 0 60px rgba(139, 0, 0, 0.5), 4px 4px 0 #000; }
    92% { opacity: 1; }
    93% { opacity: 0.8; text-shadow: 0 0 5px var(--blood-red), 0 0 15px var(--dark-blood), 4px 4px 0 #000; }
    94% { opacity: 1; }
    96% { opacity: 0.9; }
    97% { opacity: 1; }
}

.subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--bone-white);
    margin-top: 0.5rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    opacity: 0.7;
}

.candle-icon {
    font-size: 4rem;
    margin: 2rem 0;
    animation: flashlightGlow 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px #ffffee);
}

@keyframes flashlightGlow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px #ffffee); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 40px #ffffff); }
}

.instructions {
    margin: 2rem 0;
    color: var(--bone-white);
    opacity: 0.8;
}

.instructions p {
    margin: 0.5rem 0;
    font-size: 1rem;
}

.key {
    display: inline-block;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid var(--blood-red);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-right: 0.5rem;
    font-size: 0.85rem;
    min-width: 60px;
}

.horror-btn {
    position: relative;
    padding: 1rem 3rem;
    font-family: 'Creepster', cursive;
    font-size: 1.5rem;
    color: var(--bone-white);
    background: linear-gradient(180deg, var(--shadow-black) 0%, var(--dark-blood) 100%);
    border: 2px solid var(--blood-red);
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 
        0 4px 15px rgba(139, 0, 0, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

.horror-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        0 6px 25px rgba(139, 0, 0, 0.6),
        inset 0 1px 0 rgba(255,255,255,0.2);
    background: linear-gradient(180deg, #a50000 0%, var(--blood-red) 100%);
}

.horror-btn:active {
    transform: scale(0.98);
}

.horror-btn.success {
    background: linear-gradient(180deg, #006633 0%, #003d1f 100%);
    border-color: var(--success-green);
    box-shadow: 0 4px 15px rgba(0, 255, 102, 0.3);
}

.horror-btn.success:hover {
    box-shadow: 0 6px 25px rgba(0, 255, 102, 0.5);
}

.warning {
    margin-top: 2rem;
    color: var(--candle-orange);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Game UI */
#game-ui {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
}

#game-ui.hidden {
    display: none;
}

.ui-container {
    position: absolute;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(139, 0, 0, 0.5);
    border-radius: 4px;
    backdrop-filter: blur(5px);
}

.ui-label {
    font-size: 0.7rem;
    color: var(--bone-white);
    letter-spacing: 0.2em;
    margin-bottom: 5px;
    opacity: 0.8;
}

/* Stamina */
.stamina-container {
    bottom: 30px;
    left: 30px;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}

.stamina-container .ui-label {
    display: none;
}

.stamina-bar {
    width: 150px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 3px;
    overflow: hidden;
}

.stamina-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--candle-orange), var(--candle-yellow));
    transition: width 0.1s ease;
    box-shadow: 0 0 8px var(--candle-orange);
}

/* Danger Indicator */
.danger-container {
    bottom: 30px;
    right: 30px;
    position: relative;
    background: transparent !important;
    border: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
}

.danger-container .ui-label {
    display: none;
}

.danger-indicator {
    width: 150px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 3px;
    overflow: hidden;
}

.danger-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff6600, var(--danger-red));
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--danger-red);
}

.danger-pulse {
    position: absolute;
    top: 50%;
    right: -30px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    background: var(--danger-red);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.danger-pulse.active {
    opacity: 1;
    animation: dangerPulse 0.5s ease-in-out infinite;
}

@keyframes dangerPulse {
    0%, 100% { transform: translateY(-50%) scale(1); box-shadow: 0 0 10px var(--danger-red); }
    50% { transform: translateY(-50%) scale(1.3); box-shadow: 0 0 20px var(--danger-red); }
}

/* Objective - hidden */
.objective {
    display: none;
}

.objective-icon {
    font-size: 1.2rem;
}

/* Key Indicator */
.key-indicator {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 20px;
    background: rgba(0, 100, 0, 0.6);
    border: 1px solid var(--success-green);
    border-radius: 4px;
    color: var(--success-green);
    font-size: 0.85rem;
    animation: keyPulse 1s ease-in-out infinite;
}

.key-indicator.hidden {
    display: none;
}

@keyframes keyPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 255, 102, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 102, 0.6); }
}

/* Interaction Prompt */
.interaction-prompt {
    position: absolute;
    bottom: 150px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--candle-orange);
    border-radius: 4px;
    color: var(--bone-white);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: promptBounce 1s ease-in-out infinite;
}

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

@keyframes promptBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.prompt-key {
    display: inline-block;
    background: var(--candle-orange);
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: bold;
}

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Screen Effects */
.damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(139, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
}

.fear-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Death Screen */
#death-screen {
    background: #000;
}

.death-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(139, 0, 0, 0.3) 0%, #000 70%);
}

.death-content {
    text-align: center;
    z-index: 10;
    animation: deathFadeIn 2s ease-out;
}

@keyframes deathFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.death-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(4rem, 15vw, 10rem);
    color: var(--blood-red);
    text-shadow: 
        0 0 20px var(--blood-red),
        0 0 40px var(--dark-blood),
        0 0 80px rgba(139, 0, 0, 0.5);
    animation: deathPulse 2s ease-in-out infinite;
}

@keyframes deathPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.death-subtitle {
    color: var(--bone-white);
    font-size: 1.2rem;
    margin: 1rem 0 2rem;
    opacity: 0.7;
}

/* Win Screen */
#win-screen {
    background: radial-gradient(ellipse at center, #0a1a0a 0%, #000 100%);
}

.win-content {
    text-align: center;
    z-index: 10;
    animation: winFadeIn 1.5s ease-out;
}

@keyframes winFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.win-title {
    font-family: 'Creepster', cursive;
    font-size: clamp(4rem, 12vw, 8rem);
    color: var(--success-green);
    text-shadow: 
        0 0 20px var(--success-green),
        0 0 40px rgba(0, 255, 102, 0.5);
}

.win-subtitle {
    color: var(--bone-white);
    font-size: 1.2rem;
    margin: 1rem 0;
    opacity: 0.8;
}

.stats {
    margin: 2rem 0;
    color: var(--bone-white);
    font-size: 1.1rem;
}

.stats span {
    color: var(--candle-yellow);
}

/* Loading Screen */
#loading-screen {
    background: #000;
}

.loading-content {
    text-align: center;
}

.loading-candle {
    font-size: 5rem;
    animation: loadingPulse 1s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px #ffffee); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 40px #ffffff); }
}

.loading-text {
    color: var(--bone-white);
    font-size: 1.2rem;
    margin: 1.5rem 0;
    letter-spacing: 0.2em;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--candle-orange), var(--candle-yellow));
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .stamina-container,
    .danger-container {
        bottom: 20px;
    }
    
    .stamina-container {
        left: 15px;
    }
    
    .danger-container {
        right: 15px;
    }
    
    .stamina-bar,
    .danger-indicator {
        width: 100px;
    }
    
    .instructions {
        display: none;
    }
}

/* Custom scrollbar (if needed) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: var(--blood-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a50000;
}

