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

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    overflow-x: hidden;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    padding: 15px 0;
    z-index: 1000;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(45deg, #00ff00, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-buttons {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 14px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.main-content {
    margin-top: 80px;
    min-height: calc(100vh - 80px);
}

.project-section {
    display: none;
    width: 100%;
    height: calc(100vh - 80px);
    position: relative;
}

.project-section.active {
    display: block;
}

#spaceShooter {
    background: linear-gradient(45deg, #0a0a0a, #1a1a2e, #16213e);
}

.story-intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: hidden;
}

.story-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    animation: fadeInUp 1s ease-out;
}

.story-content h1 {
    font-family: 'Orbitron', monospace;
    font-size: 4.5rem;
    font-weight: 900;
    color: #00ffff;
    text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff, 0 0 90px #00ffff;
    margin-bottom: 40px;
    animation: glow 2s ease-in-out infinite alternate;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.story-text {
    margin-bottom: 50px;
}

.story-line {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0;
    animation: typewriter 0.8s ease-out forwards;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}

.story-line:nth-child(1) { animation-delay: 1s; }
.story-line:nth-child(2) { animation-delay: 2.5s; }
.story-line:nth-child(3) { animation-delay: 4s; }
.story-line:nth-child(4) { animation-delay: 5.5s; }
.story-line:nth-child(5) { animation-delay: 7s; }
.story-line:nth-child(6) { animation-delay: 8.5s; }

#startGameBtn {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    padding: 18px 45px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 1s ease-out 10s forwards;
    box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    transition: all 0.3s ease;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#startGameBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 107, 107, 0.8);
}

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

@keyframes typewriter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff, 0 0 90px #00ffff;
    }
    to {
        text-shadow: 0 0 40px #00ffff, 0 0 80px #00ffff, 0 0 120px #00ffff, 0 0 160px #00ffff;
    }
}

#spaceShooter #gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: none;
}

#spaceShooter #ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#spaceShooter #gameOver {
    pointer-events: auto;
}

#spaceShooter #hud {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    min-width: 100px;
    max-width: 140px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

#spaceShooter #hud::before {
    display: none !important;
}

#spaceShooter #score {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 3px;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
    font-weight: 600;
}

@keyframes pulse {
    0%, 100% { text-shadow: 0 0 15px #00ff00; }
    50% { text-shadow: 0 0 25px #00ff00, 0 0 35px #00ff00; }
}

#spaceShooter #health {
    font-size: 20px;
    color: #ff0000;
    margin-bottom: 10px;
    text-shadow: 0 0 15px #ff0000;
}

#spaceShooter #healthBar {
    width: 100%;
    height: 8px;
    background: rgba(255, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 5px;
    overflow: hidden;
}

#spaceShooter #healthFill {
    height: 100%;
    background: linear-gradient(90deg, #ff0000, #ff8800, #00ff00);
    width: 100%;
    transition: width 0.3s ease;
}

#spaceShooter #level {
    font-size: 12px;
    color: #ffffff;
    margin-bottom: 0;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

#spaceShooter #levelBar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 0, 0.3);
    border-radius: 3px;
    margin-top: 5px;
    overflow: hidden;
}

#spaceShooter #levelFill {
    height: 100%;
    background: linear-gradient(90deg, #ffff00, #00ffff);
    width: 0%;
    transition: width 0.5s ease;
}

#spaceShooter #weapon {
    font-size: 16px;
    color: #00ffff;
    text-shadow: 0 0 15px #00ffff;
    margin-bottom: 10px;
}

#spaceShooter #ammo {
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 0 10px #ffffff;
}

#spaceShooter #powerUps {
    font-size: 14px;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
    margin-top: 10px;
}

#spaceShooter #gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #ff0000;
    text-align: center;
    display: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
}

#spaceShooter #gameOver h2 {
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #ff0000;
    animation: gameOverPulse 1s infinite;
}

@keyframes gameOverPulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.08);
        filter: brightness(1.3);
    }
}

#spaceShooter #instructions {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: rgba(0, 0, 0, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(0, 136, 255, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
    font-size: 13px;
    backdrop-filter: blur(10px);
    line-height: 1.4;
    max-width: 300px;
    z-index: 100;
    transition: all 0.3s ease;
    transform-origin: bottom left;
}

#spaceShooter #instructions h3 {
    margin-bottom: 12px;
    font-size: 16px;
    margin-top: 0;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 8px;
}

#spaceShooter #instructions p {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

#spaceShooter #instructions .key {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 12px;
    min-width: 40px;
    text-align: center;
}

#spaceShooter #instructions.collapsed {
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0);
    transition: all 0.3s ease;
}

#spaceShooter #instructions.expanded {
    height: auto;
    padding: 15px 20px;
    opacity: 1;
    transform: scaleY(1);
    transition: all 0.3s ease;
}

#spaceShooter #toggleInstructions {
    position: fixed !important;
    bottom: 30px !important;
    left: 20px !important;
    transform: none !important;
    background: linear-gradient(45deg, #0088ff, #00aaff) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    color: #ffffff !important;
    padding: 12px 20px !important;
    border-radius: 25px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 6px 20px rgba(0, 136, 255, 0.4) !important;
    z-index: 9999 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    font-family: Arial, sans-serif !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
}

#spaceShooter #toggleInstructions:hover {
    background: linear-gradient(45deg, #00aaff, #00ccff) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(0, 136, 255, 0.6) !important;
    scale: 1.05 !important;
}

#spaceShooter #minimap {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 200px;
    height: 200px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    z-index: 15;
}

#spaceShooter #minimapCanvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.power-up-info {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #ffffff;
}

.power-up-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 35px;
}

.power-up-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.power-up-icon.health {
    background: linear-gradient(45deg, #00ff00, #66ff66);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.power-up-icon.weapon {
    background: linear-gradient(45deg, #0088ff, #66bbff);
    box-shadow: 0 0 8px rgba(0, 136, 255, 0.5);
}

.power-up-icon.boost {
    background: linear-gradient(45deg, #ffff00, #ffff66);
    box-shadow: 0 0 8px rgba(255, 255, 0, 0.5);
}

.power-up-icon.shield {
    background: linear-gradient(45deg, #00ffff, #66ffff);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

#spaceShooter button {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    margin: 10px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

#spaceShooter button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

#spaceShooter button:active {
    transform: translateY(0);
}

#spaceShooter button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#spaceShooter button:hover::before {
    left: 100%;
}

#spaceShooter .key {
    background: linear-gradient(45deg, #333, #555);
    padding: 4px 8px;
    border-radius: 5px;
    font-family: monospace;
    border: 1px solid #666;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#spaceShooter .notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 255, 0, 0.9);
    color: black;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    display: none;
    z-index: 1000;
    animation: notificationSlide 3s ease-in-out;
}

@keyframes notificationSlide {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
}

canvas {
    display: block;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }

    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    #spaceShooter #hud {
        min-width: 200px;
        padding: 15px;
    }

    #spaceShooter #minimap {
        width: 150px;
        height: 150px;
    }

    #spaceShooter #instructions {
        max-width: 280px;
        padding: 12px 16px;
        font-size: 12px;
        bottom: 80px;
        left: 15px;
    }

    #spaceShooter #toggleInstructions {
        padding: 10px 20px;
        font-size: 12px;
        bottom: 15px;
    }

    .power-up-info {
        bottom: 70px;
        right: 10px;
        padding: 6px 8px;
        gap: 8px;
        font-size: 9px;
    }

    .power-up-item {
        min-width: 30px;
    }

    .power-up-icon {
        width: 14px;
        height: 14px;
    }
}

.control-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.control-buttons button {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.control-buttons button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.map-panel {
    position: absolute;
    top: 20px;
    right: 240px;
    background: rgba(0, 0, 0, 0.9);
    padding: 6px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    z-index: 15;
    min-width: 50px;
    transition: all 0.3s ease;
}

.map-panel.collapsed {
    min-width: 50px;
    padding: 4px;
}

.map-panel.expanded {
    min-width: 120px;
    padding: 8px;
}

#toggleMapSelection {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    width: 100%;
}

#toggleMapSelection:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

#mapContent {
    margin-top: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

#mapContent.collapsed {
    height: 0;
    margin-top: 0;
    opacity: 0;
}

#mapContent.expanded {
    height: auto;
    opacity: 1;
}

.map-panel h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #00ffff;
    text-align: center;
    text-shadow: 0 0 10px #00ffff;
}

.map-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.map-btn {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.map-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.map-btn.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.map-preview {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.space-station {
    background: linear-gradient(45deg, #1a1a2e, #16213e, #0f0f23);
}

.asteroid-field {
    background: linear-gradient(45deg, #2c1810, #8b4513, #654321);
}

.nebula {
    background: linear-gradient(45deg, #4a148c, #7b1fa2, #e91e63);
}

.geometric {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #ffe66d);
}

.map-btn span {
    font-size: 10px;
    color: #ffffff;
    text-align: center;
}

#currentMap {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 3px;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
    font-weight: 400;
}

#redFlash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 1000;
    transition: background-color 0.1s ease-out;
}

#spaceShooter #combo {
    color: #ffff00;
    font-size: 12px;
    margin-bottom: 5px;
}

.story-credit {
    color: #00ffff;
    font-size: 1.2rem;
    margin-top: 30px;
}

.control-group {
    margin-bottom: 8px;
}

.control-tips {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}
