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

body {
    font-family: 'Courier New', monospace;
    background-color: #1a1a1a;
    color: #fff;
    overflow: hidden;
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.start-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c3e50, #34495e, #1a1a1a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.start-menu-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 2px solid #3498db;
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.3);
}

.game-title {
    font-size: 4em;
    font-weight: bold;
    color: #3498db;
    text-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
    margin-bottom: 10px;
    line-height: 1.1;
}

.game-subtitle {
    font-size: 1.2em;
    color: #e67e22;
    margin-bottom: 30px;
    font-style: italic;
}

.menu-instructions {
    margin-bottom: 30px;
}

.menu-instructions h3 {
    color: #2ecc71;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-decoration: underline;
}

.instruction-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 5px;
}

.key {
    background: #3498db;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
    min-width: 60px;
    text-align: center;
    font-size: 0.9em;
}

.action {
    color: #bdc3c7;
    font-size: 0.9em;
}

.game-features {
    background: rgba(46, 204, 113, 0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #2ecc71;
}

.game-features p {
    margin: 8px 0;
    font-size: 1.1em;
    color: #ecf0f1;
}

.menu-buttons {
    margin-top: 30px;
}

.play-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    padding: 20px 40px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2em;
    color: white;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.play-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.button-text {
    font-size: 1.3em;
    font-weight: bold;
    letter-spacing: 1px;
}

.button-subtitle {
    font-size: 0.8em;
    opacity: 0.9;
    margin-top: 3px;
}

.difficulty-info {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #34495e;
}

.difficulty-info p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #bdc3c7;
}

.start-menu-footer {
    position: absolute;
    bottom: 20px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* GAME UI STYLES - FIXED FRAMING */
.game-ui {
    width: 100%;
    height: 100%;
    position: relative;
}

.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 8px;
    border: 2px solid #444;
}

.level-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: bold;
    color: #3498db;
}

.health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    width: 200px;
    height: 25px;
    background-color: #333;
    border: 2px solid #666;
    border-radius: 12px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 100%;
    transition: width 0.3s ease;
}

.ammo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bullets {
    display: flex;
    gap: 4px;
}

.bullet-slot {
    width: 12px;
    height: 25px;
    background-color: #333;
    border: 2px solid #666;
    border-radius: 3px;
    transition: all 0.2s;
}

.bullet-slot.filled {
    background-color: #FFD700;
    box-shadow: 0 0 5px #FFD700;
}

.reload-status {
    color: #ff6b6b;
    font-weight: bold;
    min-height: 20px;
    text-align: center;
}

.score-container {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

/* FIXED CANVAS POSITIONING */
#gameCanvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid #444;
    cursor: crosshair;
    background: linear-gradient(to bottom, #2c3e50, #34495e);
    z-index: 1;
}

/* OVERLAY STYLES */
.level-transition {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    border: 3px solid #3498db;
}

.level-transition h2 {
    color: #2ecc71;
    margin-bottom: 15px;
    font-size: 2.5em;
}

.progress-bar {
    width: 300px;
    height: 20px;
    background-color: #333;
    border: 2px solid #666;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 0%;
    transition: width 0.1s ease;
}

.game-over, .victory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    z-index: 100;
    border: 3px solid #e74c3c;
}

.victory {
    border-color: #f1c40f;
}

.game-over h2 {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.victory h2 {
    color: #f1c40f;
    margin-bottom: 20px;
    font-size: 2.5em;
}

.game-over button, .victory button {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: background 0.3s;
}

.menu-button {
    background: #95a5a6 !important;
}

.game-over button:hover, .victory button:hover {
    background: #2980b9;
}

.menu-button:hover {
    background: #7f8c8d !important;
}

.credit {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 20px;
    font-style: italic;
}

/* FIXED INSTRUCTIONS POSITIONING */
.instructions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #bdc3c7;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 10;
}

.instructions p {
    margin: 5px 0;
}

/* FIXED MADE BY POSITIONING */
.made-by {
    position: absolute;
    bottom: 5px;
    right: 20px;
    color: #7f8c8d;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    z-index: 10;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.made-by:hover {
    opacity: 1;
    color: #bdc3c7;
}

/* RESPONSIVE DESIGN - COMPLETE REWRITE */
@media (max-width: 1200px) {
    .game-title {
        font-size: 3em;
    }
    
    .start-menu-content {
        max-width: 600px;
        padding: 30px;
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
    }
    
    .hud {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .level-info {
        flex-direction: row;
        gap: 15px;
    }
    
    .health-bar {
        width: 150px;
        height: 20px;
    }
    
    #gameCanvas {
        width: 90vw;
        height: 60vh;
    }
}

@media (max-width: 800px) {
    .game-title {
        font-size: 2.5em;
    }
    
    .start-menu-content {
        max-width: 90%;
        padding: 20px;
    }
    
    .game-features p {
        font-size: 1em;
    }
    
    .instruction-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .play-button {
        padding: 15px 30px;
        font-size: 1.1em;
    }
    
    #gameCanvas {
        width: 95vw;
        height: 65vh;
    }
    
    .hud {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .instructions {
        display: none;
    }
    
    .made-by {
        bottom: 2px;
        right: 10px;
        font-size: 8px;
    }
    
    .level-transition,
    .game-over,
    .victory {
        padding: 20px;
        max-width: 90vw;
    }
    
    .level-transition h2,
    .game-over h2,
    .victory h2 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2em;
        line-height: 1.2;
    }
    
    .game-subtitle {
        font-size: 1em;
    }
    
    .start-menu-content {
        padding: 15px;
        margin: 10px;
    }
    
    .menu-instructions h3 {
        font-size: 1.2em;
    }
    
    .game-features p {
        font-size: 0.9em;
    }
    
    .play-button {
        padding: 12px 25px;
        font-size: 1em;
        min-width: 150px;
    }
    
    .difficulty-info p {
        font-size: 0.8em;
    }
    
    #gameCanvas {
        width: 98vw;
        height: 70vh;
    }
    
    .hud {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 6px 10px;
    }
    
    .health-bar {
        width: 100px;
        height: 15px;
    }
    
    .bullet-slot {
        width: 10px;
        height: 20px;
    }
    
    .level-info,
    .health-container,
    .ammo-container,
    .score-container {
        font-size: 12px;
    }
}
