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

body {
    background: #0a0a0a;
    overflow: hidden;
    font-family: 'Press Start 2P', monospace;
    color: #ffd700;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #1a0a2e 0%, #4a1942 30%, #8b2500 70%, #c74b16 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.title-container {
    text-align: center;
    margin-bottom: 60px;
    animation: titlePulse 2s ease-in-out infinite;
}

.title {
    font-size: clamp(2rem, 8vw, 5rem);
    text-shadow: 
        0 0 10px #ff6600,
        0 0 20px #ff3300,
        0 0 40px #ff0000,
        4px 4px 0 #000;
    letter-spacing: 0.2em;
    margin: 10px 0;
}

.title.doom {
    font-size: clamp(3rem, 12vw, 8rem);
    color: #ff0000;
    text-shadow: 
        0 0 20px #ff0000,
        0 0 40px #990000,
        0 0 60px #660000,
        6px 6px 0 #000;
}

.subtitle {
    font-size: clamp(0.6rem, 2vw, 1rem);
    color: #c9a227;
    letter-spacing: 0.3em;
    margin-top: 20px;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.start-prompt {
    font-size: clamp(0.7rem, 2vw, 1.2rem);
    color: #fff;
    margin-bottom: 40px;
}

.blink {
    animation: blink 1s infinite;
}

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

.controls-info {
    font-size: clamp(0.4rem, 1.2vw, 0.7rem);
    color: #aaa;
    text-align: center;
    line-height: 2;
}

.footer-link {
    position: absolute;
    bottom: 20px;
    font-size: 0.6rem;
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link:hover {
    color: #ff6b6b;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#scene-container {
    width: 100%;
    height: 100%;
}

#scene-container canvas {
    display: block;
    image-rendering: pixelated;
}

#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #fff;
    text-shadow: 0 0 4px #000;
    pointer-events: none;
    z-index: 10;
}

#hud {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(180deg, #3d2817 0%, #2a1b0f 50%, #1a0f08 100%);
    border-top: 4px solid #8b5a2b;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 20px;
    z-index: 10;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.8);
}

.hud-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-label {
    font-size: clamp(0.4rem, 1vw, 0.6rem);
    color: #8b7355;
}

.hud-value {
    font-size: clamp(1rem, 3vw, 1.8rem);
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
}

.hud-value.small {
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
}

.hud-percent {
    font-size: clamp(0.5rem, 1.2vw, 0.7rem);
    color: #ff0000;
}

.hud-face {
    width: 60px;
    height: 60px;
    background: #463020;
    border: 3px solid #8b5a2b;
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.face-eyes {
    width: 30px;
    height: 8px;
    display: flex;
    justify-content: space-between;
}

.face-eyes::before,
.face-eyes::after {
    content: '';
    width: 10px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
}

.face-mouth {
    width: 20px;
    height: 6px;
    background: #000;
    border-radius: 0 0 4px 4px;
}

.hud-face.healthy .face-eyes::before,
.hud-face.healthy .face-eyes::after {
    background: #00ff00;
}

.hud-face.hurt .face-eyes::before,
.hud-face.hurt .face-eyes::after {
    background: #ffff00;
}

.hud-face.critical .face-eyes::before,
.hud-face.critical .face-eyes::after {
    background: #ff0000;
    animation: eyeFlash 0.5s infinite;
}

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

#weapon-sprite {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 150px;
    background: url('/api/retrodiffusion/image/128/128/game_asset?prompt=bow+and+arrow+first+person+view+held+weapon+pixel+art+doom+style&remove_bg=true') no-repeat center bottom;
    background-size: contain;
    image-rendering: pixelated;
    pointer-events: none;
    z-index: 5;
    transition: transform 0.1s;
}

#weapon-sprite.shooting {
    transform: translateX(-50%) translateY(-10px) rotate(-5deg);
}

#notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #ffd700;
    text-shadow: 2px 2px 0 #000;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
    pointer-events: none;
}

#damage-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 30%, rgba(255,0,0,0.8) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
    z-index: 15;
}

#pause-menu,
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 100;
}

#pause-menu h2,
#game-over h2 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    color: #ff0000;
    text-shadow: 0 0 20px #ff0000;
}

#game-over p {
    font-size: clamp(0.5rem, 1.5vw, 0.8rem);
    color: #888;
    text-align: center;
    max-width: 80%;
}

button {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.6rem, 1.5vw, 1rem);
    padding: 15px 30px;
    background: linear-gradient(180deg, #8b2500 0%, #5a1800 100%);
    border: 3px solid #ffd700;
    color: #ffd700;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: linear-gradient(180deg, #aa3000 0%, #7a2000 100%);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 200;
}

.loading-text {
    font-size: clamp(0.6rem, 1.5vw, 1rem);
    color: #ffd700;
    animation: blink 0.5s infinite;
}

.loading-bar {
    width: 60%;
    max-width: 400px;
    height: 20px;
    background: #222;
    border: 3px solid #8b5a2b;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff0000, #ff6600, #ffcc00);
    transition: width 0.3s;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    #hud {
        height: 60px;
        padding: 0 10px;
    }
    
    .hud-face {
        width: 40px;
        height: 40px;
    }
    
    #weapon-sprite {
        width: 150px;
        height: 100px;
        bottom: 60px;
    }
    
    .controls-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .hud-section:nth-child(4) {
        display: none;
    }
}