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

body {
    background: #000;
    overflow: hidden;
    font-family: 'VT323', monospace;
    color: #d4a574;
    cursor: none;
}

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

/* Title Screen */
#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    animation: scanlineFlicker 0.1s infinite;
}

@keyframes scanlineFlicker {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.85; }
}

#title-content {
    z-index: 1002;
    text-align: center;
    animation: vhsGlitch 4s infinite;
}

@keyframes vhsGlitch {
    0%, 95%, 100% { transform: translate(0, 0); filter: none; }
    96% { transform: translate(-3px, 1px); filter: hue-rotate(90deg); }
    97% { transform: translate(2px, -1px); filter: hue-rotate(-90deg); }
    98% { transform: translate(-1px, 2px); filter: saturate(2); }
}

#rec-indicator {
    font-family: 'VT323', monospace;
    color: #ff0000;
    font-size: 18px;
    margin-bottom: 40px;
    animation: recBlink 1s infinite;
}

@keyframes recBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#title-text {
    font-family: 'Creepster', cursive;
    font-size: clamp(48px, 10vw, 120px);
    color: #8b4513;
    text-shadow: 0 0 20px rgba(139, 69, 19, 0.5), 0 0 40px rgba(139, 0, 0, 0.3);
    letter-spacing: 8px;
    animation: titleFlicker 3s infinite;
}

@keyframes titleFlicker {
    0%, 90%, 100% { opacity: 1; }
    91% { opacity: 0.4; }
    92% { opacity: 1; }
    93% { opacity: 0.6; }
    94% { opacity: 1; }
}

#subtitle-text {
    font-family: 'Special Elite', cursive;
    font-size: clamp(16px, 3vw, 28px);
    color: #666;
    margin: 10px 0 20px;
    letter-spacing: 4px;
}

#tagline {
    font-family: 'Special Elite', cursive;
    font-size: clamp(12px, 2vw, 18px);
    color: #554433;
    font-style: italic;
    margin-bottom: 40px;
}

#enter-btn {
    font-family: 'Creepster', cursive;
    font-size: clamp(20px, 4vw, 36px);
    color: #d4a574;
    background: linear-gradient(145deg, #2a1a0a, #1a0f05);
    border: 2px solid #8b4513;
    padding: 15px 50px;
    cursor: pointer;
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
    transition: all 0.3s;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 15px rgba(139, 69, 19, 0.3);
}

#enter-btn:hover {
    background: linear-gradient(145deg, #3a2a1a, #2a1f15);
    border-color: #d4a574;
    text-shadow: 0 0 20px rgba(212, 165, 116, 0.8);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 25px rgba(139, 69, 19, 0.5);
}

#warning-text {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #8b0000;
    margin-top: 30px;
    animation: recBlink 2s infinite;
}

/* HUD */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

#hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px;
}

#hud-left {
    background: rgba(10, 10, 15, 0.75);
    padding: 12px 18px;
    border: 1px solid rgba(139, 69, 19, 0.3);
    border-radius: 4px;
}

#location-label {
    font-family: 'Creepster', cursive;
    font-size: 22px;
    color: #d4a574;
    letter-spacing: 3px;
    text-shadow: 0 0 8px rgba(212, 165, 116, 0.4);
}

#exploring-text {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

#blink-dot {
    animation: dotBlink 1s infinite steps(1);
}

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

#flashlight-bar-container {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#flashlight-label {
    font-size: 12px;
    color: #888;
}

#flashlight-bar-bg {
    width: 100px;
    height: 6px;
    background: rgba(30, 30, 30, 0.8);
    border: 1px solid #333;
    border-radius: 3px;
    overflow: hidden;
}

#flashlight-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #8b4513, #d4a574);
    transition: width 0.3s;
    border-radius: 3px;
}

#rec-hud {
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: #ff0000;
    animation: recBlink 1s infinite;
    background: rgba(10, 10, 15, 0.6);
    padding: 6px 12px;
    border-radius: 3px;
}

#controls-info {
    position: fixed;
    bottom: 60px;
    left: 20px;
    font-family: 'VT323', monospace;
    font-size: 16px;
    color: rgba(150, 150, 150, 0.8);
    background: rgba(10, 10, 15, 0.6);
    padding: 8px 14px;
    border-radius: 4px;
    border: 1px solid rgba(80, 80, 80, 0.3);
    transition: opacity 1s;
}

#interact-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 40px);
    font-family: 'Creepster', cursive;
    font-size: 24px;
    color: #d4a574;
    text-shadow: 0 0 10px rgba(212, 165, 116, 0.6);
    background: rgba(10, 10, 15, 0.7);
    padding: 8px 20px;
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-radius: 4px;
    animation: promptPulse 2s infinite;
}

@keyframes promptPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#inspect-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Special Elite', cursive;
    font-size: 18px;
    color: #ccc;
    background: rgba(10, 10, 15, 0.92);
    padding: 25px 30px;
    border: 2px solid rgba(139, 69, 19, 0.5);
    border-radius: 6px;
    max-width: 500px;
    text-align: center;
    line-height: 1.6;
    pointer-events: auto;
}

#inspect-close {
    display: block;
    margin-top: 15px;
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #666;
}

#minimap-container {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(139, 69, 19, 0.4);
    border-radius: 4px;
    padding: 4px;
}

#minimap {
    display: block;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: rgba(212, 165, 116, 0.5);
    pointer-events: none;
}

/* Vignette overlay */
#hud::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 99;
}

/* Scanline overlay for gameplay */
#hud::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.06) 0px,
        rgba(0, 0, 0, 0.06) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 98;
}

#footer-link {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 102;
    font-family: 'Special Elite', cursive;
    font-size: 11px;
    color: rgba(100, 80, 60, 0.4);
    text-decoration: none;
    pointer-events: auto;
}

#footer-link:hover {
    color: rgba(150, 120, 90, 0.6);
}