/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    font-family: 'Rajdhani', sans-serif;
    background: #0a0a1a;
    color: #fff;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(180deg, rgba(10,10,30,0.98) 0%, rgba(10,10,30,0.9) 100%);
    border-bottom: 1px solid rgba(0,255,255,0.2);
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    font-size: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(45deg, #0ff, #f0f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.main-nav a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #0ff;
    transition: width 0.3s;
}

.main-nav a:hover {
    color: #0ff;
}

.main-nav a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

/* ===== GAME WRAPPER ===== */
.game-wrapper {
    padding-top: 60px;
}

#gameContainer {
    position: relative;
    width: 100%;
    height: calc(100vh - 60px);
    background: #000;
    overflow: hidden;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #0a1628 0%, #000510 100%);
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a1a3a 0%, #0a0a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    background: linear-gradient(45deg, #0ff, #f0f, #ff0, #0ff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 30px;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.loading-ship {
    font-size: 80px;
    animation: rocketBounce 1s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes rocketBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.loading-bar {
    width: 300px;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 20px;
    border: 1px solid rgba(0,255,255,0.3);
}

.loading-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0ff, #f0f);
    border-radius: 10px;
    animation: loadProgress 2.5s ease-out forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

.loading-text {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ===== MAIN MENU ===== */
.main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.menu-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0,255,255,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255,0,255,0.1) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a2a 0%, #000510 100%);
    overflow: hidden;
}

.menu-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='white' fill-opacity='0.3'/%3E%3C/svg%3E");
    animation: starsMove 50s linear infinite;
}

@keyframes starsMove {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.menu-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 20px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 56px;
    font-weight: 900;
    background: linear-gradient(45deg, #0ff, #f0f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 50px rgba(0,255,255,0.5);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.game-tagline {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 30px;
}

/* Ship Selector */
.ship-selector {
    margin-bottom: 30px;
}

.ship-selector h3 {
    font-family: 'Orbitron', sans-serif;
    color: #0ff;
    margin-bottom: 15px;
    font-size: 16px;
    letter-spacing: 2px;
}

.ships-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    max-width: 700px;
    margin: 0 auto;
}

.ship-option {
    background: rgba(255,255,255,0.05);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.ship-option:hover {
    border-color: rgba(0,255,255,0.5);
    background: rgba(0,255,255,0.1);
}

.ship-option.selected {
    border-color: #0ff;
    background: rgba(0,255,255,0.15);
    box-shadow: 0 0 20px rgba(0,255,255,0.3);
}

.ship-preview {
    font-size: 36px;
    margin-bottom: 5px;
}

.ship-name {
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 5px;
    color: #fff;
}

.ship-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    color: rgba(255,255,255,0.6);
}

/* Menu Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    margin-bottom: 30px;
}

.menu-btn {
    padding: 15px 40px;
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-play {
    background: linear-gradient(135deg, #00ff88 0%, #00aa55 100%);
    color: #000;
    box-shadow: 0 5px 20px rgba(0,255,136,0.4);
}

.btn-play:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,255,136,0.6);
}

.btn-levels {
    background: linear-gradient(135deg, #0088ff 0%, #0055aa 100%);
    color: #fff;
}

.btn-settings {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-icon {
    font-size: 18px;
}

/* Controls Info */
.controls-info {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.controls-info h4 {
    font-family: 'Orbitron', sans-serif;
    color: #0ff;
    font-size: 14px;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.key {
    background: rgba(0,255,255,0.2);
    padding: 4px 10px;
    border-radius: 5px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: #0ff;
}

.action {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

/* ===== GAME HUD ===== */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score-display, .coins-display {
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid rgba(0,255,255,0.3);
}

.score-label {
    font-size: 10px;
    color: rgba(255,255,255,0.6);
    display: block;
}

.score-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 900;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coin-icon {
    font-size: 20px;
}

.coins-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffd700;
}

.level-display {
    background: linear-gradient(135deg, #f0f, #60f);
    padding: 8px 20px;
    border-radius: 25px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.level-display span:first-child {
    font-size: 10px;
    opacity: 0.8;
}

.level-value {
    font-size: 20px;
    margin-left: 5px;
}

.hud-btn {
    pointer-events: auto;
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.hud-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 30px;
}

.power-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(0,255,255,0.3);
}

.power-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
}

.power-icon {
    font-size: 18px;
}

.power-bar {
    width: 200px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.power-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #00ff88, #00ffff);
    border-radius: 10px;
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(0,255,255,0.5);
}

.power-fill.warning {
    background: linear-gradient(90deg, #ff8800, #ffaa00);
}

.power-fill.danger {
    background: linear-gradient(90deg, #ff0000, #ff4400);
    animation: powerPulse 0.5s infinite;
}

@keyframes powerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.power-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.super-blast-container {
    background: rgba(0,0,0,0.6);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,0,255,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.blast-icon {
    font-size: 24px;
}

.blast-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: #f0f;
}

.blast-key {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}

/* ===== PAUSE MENU ===== */
.pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.pause-content {
    text-align: center;
}

.pause-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    color: #0ff;
    margin-bottom: 30px;
    text-shadow: 0 0 30px rgba(0,255,255,0.5);
}

.pause-content .menu-btn {
    margin: 10px 0;
    min-width: 200px;
}

/* ===== LEVEL COMPLETE ===== */
.level-complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.complete-content {
    text-align: center;
    background: linear-gradient(135deg, rgba(0,50,30,0.9), rgba(0,20,10,0.9));
    padding: 40px 60px;
    border-radius: 20px;
    border: 2px solid #00ff88;
    box-shadow: 0 0 50px rgba(0,255,136,0.3);
}

.complete-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 36px;
    color: #00ff88;
    margin-bottom: 20px;
}

.level-stars {
    font-size: 50px;
    margin-bottom: 20px;
}

.level-stats {
    margin-bottom: 30px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 18px;
}

.stat-row span:last-child {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #0ff;
}

.complete-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== GAME OVER ===== */
.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.gameover-content {
    text-align: center;
}

.gameover-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 56px;
    color: #f00;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(255,0,0,0.5);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.explosion-emoji {
    font-size: 100px;
    margin-bottom: 20px;
    animation: explode 0.5s ease-out;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); opacity: 1; }
}

.final-score {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    margin-bottom: 30px;
}

.final-score span:last-child {
    font-size: 48px;
    color: #0ff;
    display: block;
    margin-top: 10px;
}

.gameover-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ===== MOBILE CONTROLS ===== */
.mobile-controls {
    display: none;
    position: absolute;
    bottom: 100px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    pointer-events: none;
    z-index: 60;
}

.joystick-container {
    position: absolute;
    left: 30px;
    bottom: 30px;
    pointer-events: auto;
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    position: relative;
}

.joystick-stick {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0,255,255,0.6);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0,255,255,0.5);
}

.mobile-buttons {
    position: absolute;
    right: 30px;
    bottom: 30px;
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.mobile-fire, .mobile-blast {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-fire {
    background: linear-gradient(135deg, #ff4400, #ff0000);
    box-shadow: 0 0 20px rgba(255,68,0,0.5);
}

.mobile-blast {
    background: linear-gradient(135deg, #f0f, #60f);
    box-shadow: 0 0 20px rgba(255,0,255,0.5);
}

.mobile-fire:active, .mobile-blast:active {
    transform: scale(0.9);
}

/* ===== GAME INFO SECTION ===== */
.game-info {
    background: #0a0a1a;
    padding: 60px 20px;
    border-top: 1px solid rgba(0,255,255,0.2);
}

.info-container {
    max-width: 900px;
    margin: 0 auto;
}

.game-info h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 28px;
    color: #0ff;
    margin-bottom: 20px;
}

.game-info h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    color: #f0f;
    margin: 30px 0 15px;
}

.game-info p {
    color: rgba(255,255,255,0.8);
    line-height: 1.8;
    font-size: 16px;
}

.game-info ul {
    list-style: none;
    color: rgba(255,255,255,0.8);
}

.game-info li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.game-info li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: #0ff;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #050510;
    border-top: 1px solid rgba(0,255,255,0.2);
    padding: 40px 20px 20px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: #0ff;
    font-size: 18px;
    margin-bottom: 15px;
}

.footer-section p {
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 5px 0;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #0ff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .game-title {
        font-size: 32px;
    }

    .ships-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ship-stats {
        display: none;
    }

    .controls-info {
        display: none;
    }

    .hud-bottom {
        flex-direction: column;á
        gap: 10px;
    }

    .power-bar {
        width: 150px;
    }

    .mobile-controls {
        display: block;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .ships-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .menu-btn {
        min-width: 200px;
        font-size: 14px;
        padding: 12px 30px;
    }
}