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

body {
    background: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
}

#game-container {
    flex: 1;
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#start-screen,
#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    z-index: 10;
    padding: 20px;
    text-align: center;
}

#start-screen h1,
#game-over-screen h1 {
    color: #4AA8FF;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    text-shadow: 3px 3px 0 #000, 0 0 20px #4AA8FF;
    margin-bottom: 20px;
    line-height: 1.4;
}

#start-screen h1 .revenge {
    color: #FF4444;
    text-shadow: 3px 3px 0 #000, 0 0 20px #FF4444;
    display: block;
    font-size: 1.2em;
    animation: pulse 1s ease-in-out infinite;
}

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

.subtitle {
    color: #87CEEB;
    font-size: clamp(0.6rem, 2vw, 0.9rem);
    margin-bottom: 30px;
}

.stats-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 25px;
    border-radius: 8px;
    border: 2px solid #FF4444;
    margin-bottom: 30px;
}

.stats-display p {
    color: #FFD700;
    font-size: clamp(0.5rem, 2vw, 0.75rem);
}

#start-btn,
#restart-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.8rem, 3vw, 1rem);
    padding: 15px 40px;
    background: #32CD32;
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #228B22, 0 0 20px rgba(50, 205, 50, 0.3);
}

#start-btn:hover,
#restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #228B22, 0 0 30px rgba(50, 205, 50, 0.5);
}

#start-btn:active,
#restart-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #228B22;
}

.instructions {
    color: #666;
    font-size: clamp(0.4rem, 1.5vw, 0.6rem);
    margin-top: 20px;
}

.final-stats {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 30px;
    border-radius: 8px;
    border: 2px solid #4AA8FF;
    margin-bottom: 30px;
}

.final-stats p {
    color: #87CEEB;
    font-size: clamp(0.5rem, 2vw, 0.7rem);
    margin: 10px 0;
}

.final-stats .revenge-stat {
    color: #FF4444;
    text-shadow: 0 0 10px #FF4444;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    z-index: 5;
    pointer-events: none;
}

.hud-left,
.hud-center,
.hud-right {
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 4px;
    border: 2px solid #333;
}

.hud-left .label,
.hud-center .label,
.hud-right .label {
    color: #888;
    font-size: clamp(0.4rem, 1.5vw, 0.5rem);
    display: block;
    margin-bottom: 4px;
}

#score,
#round {
    color: #FFD700;
    font-size: clamp(0.7rem, 2.5vw, 1rem);
}

#ammo-display {
    display: flex;
    gap: 4px;
}

.shell {
    width: 12px;
    height: 20px;
    background: linear-gradient(180deg, #FFD700 0%, #FF6600 50%, #8B0000 100%);
    border-radius: 2px 2px 4px 4px;
    border: 1px solid #333;
}

.shell.empty {
    background: #333;
    opacity: 0.5;
}

#revenge-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #FF4444;
    font-size: clamp(2rem, 8vw, 4rem);
    text-shadow: 4px 4px 0 #000, 0 0 40px #FF4444;
    animation: revengeAnim 1s ease-out forwards;
    z-index: 20;
    pointer-events: none;
}

@keyframes revengeAnim {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    30% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.hidden {
    display: none !important;
}

footer {
    background: #0a0a14;
    padding: 10px;
    text-align: center;
}

footer a {
    color: #4AA8FF;
    text-decoration: none;
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    transition: color 0.2s;
}

footer a:hover {
    color: #87CEEB;
}

/* Mobile adjustments */
@media (max-height: 500px) {
    #start-screen h1 {
        margin-bottom: 10px;
    }
    
    .subtitle {
        margin-bottom: 15px;
    }
    
    .stats-display {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
}