/* Cosmic Defender 2.0 - Modern Styles */

:root {
    /* Color Scheme */
    --primary: #00f9ff;
    --primary-dark: #008c8f;
    --secondary: #ff2d75;
    --secondary-dark: #cc245e;
    --accent: #7d42ff;
    --dark: #0a0a1a;
    --darker: #050510;
    --darkest: #020208;
    --light: #e0f4ff;
    --light-gray: #a0a8b0;
    
    /* Sizes */
    --header-height: 70px;
    --footer-height: 60px;
    --game-area-padding: 15px;
    
    /* Fonts */
    --font-main: 'Kanit', sans-serif;
    --font-accent: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
}


body {
    font-family: var(--font-main);
    background-color: var(--darker);
    color: var(--light);
    line-height: 1.5;
}

/* Background Effects */
.stars-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at bottom, #0d1b2a 0%, #050510 100%);
    animation: starPulse 15s infinite alternate;
}

@keyframes starPulse {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: 
        linear-gradient(rgba(0, 150, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 150, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.3;
}

/* Game Container */
.game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--game-area-padding);
}

/* Game Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(100, 120, 255, 0.1);
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
}

.logo {
    font-family: var(--font-accent);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    position: relative;
}

.logo-text {
    color: var(--light);
    line-height: 1;
}

.logo-highlight {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    line-height: 1.4;
}

.version-badge {
    position: absolute;
    bottom: -8px;
    right: 0;
    font-size: 0.6rem;
    color: var(--light-gray);
    font-family: var(--font-main);
    background: rgba(0, 0, 0, 0.3);
    padding: -1px 5px;
    border-radius: 10px;
}

.game-stats {
    display: flex;
    gap: 10px;
}

.stat-card {
    background: rgba(5, 5, 15, 0.5);
    border: 1px solid rgba(100, 120, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 80px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-card.highlight {
    border-color: var(--primary);
}

.stat-icon {
    color: var(--primary);
    font-size: 0.9rem;
}

.stat-value {
    font-family: var(--font-accent);
    font-size: 1.1rem;
}

.lives-container {
    display: flex;
    gap: 5px;
}

.life-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--secondary);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.life-indicator.active {
    opacity: 1;
    box-shadow: 0 0 8px var(--secondary);
}

/* Game Area */
.game-area {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(100, 120, 255, 0.1);
    background-color: rgba(5, 5, 15, 0.3);
    margin-bottom: 15px;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: var(--darkest);
}

/* Start Screen */
.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 16, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.start-content {
    text-align: center;
    max-width: 400px;
    padding: 30px;
    width: 100%;
}

.game-title {
    font-family: var(--font-accent);
    font-size: 2rem;
    color: var(--light);
    margin-bottom: 3px;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 1rem;
    color: var(--light-gray);
    margin-bottom: 30px;
}

.difficulty-selector {
    margin-bottom: 30px;
}

.difficulty-selector h3 {
    font-size: 0.9rem;
    color: var(--light-gray);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.difficulty-options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.difficulty-btn {
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid rgba(100, 120, 255, 0.1);
    color: var(--light);
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.difficulty-btn:hover {
    transform: translateY(-3px);
}

.difficulty-btn.active {
    background: rgba(0, 249, 255, 0.1);
    border-color: var(--primary);
}

.difficulty-btn i {
    font-size: 1.2rem;
    color: var(--primary);
    display: block;
    margin-bottom: 5px;
}

.start-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--darkest);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-family: var(--font-accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px auto;
    box-shadow: 0 0 20px rgba(0, 249, 255, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 249, 255, 0.5);
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    justify-content: space-between;
    padding: 10px;
    background: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(100, 120, 255, 0.1);
    backdrop-filter: blur(5px);
}

.mobile-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(20, 20, 40, 0.7);
    border: 1px solid rgba(100, 120, 255, 0.1);
    color: var(--primary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-btn:active {
    background: var(--primary);
    color: var(--darker);
    transform: scale(0.95);
}

.mobile-btn.fire-btn {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    color: white;
}

/* Game Footer */
.game-footer {
    background: rgba(10, 10, 26, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(100, 120, 255, 0.1);
    padding: 12px;
    backdrop-filter: blur(5px);
}

.controls-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 8px;
}

.control-key {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--light-gray);
}

.control-key i {
    color: var(--primary);
}

.credits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--light-gray);
}

.version-info {
    opacity: 0.7;
}

.dev-credit {
    color: var(--light-gray);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.dev-credit:hover {
    color: var(--primary);
}

/* Game Over Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: rgba(10, 10, 26, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(100, 120, 255, 0.1);
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.modal-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(100, 120, 255, 0.1);
}

.modal-header h2 {
    font-family: var(--font-accent);
    color: var(--secondary);
    margin-bottom: 10px;
}

.modal-body {
    padding: 20px;
    text-align: center;
}

.restart-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--darkest);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-family: var(--font-accent);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
}

.restart-btn:hover {
    transform: translateY(-3px);
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        --footer-height: 70px;
        --game-area-padding: 10px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .game-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-card {
        flex: 1;
        padding: 6px;
        min-width: auto;
    }
    
    .mobile-controls {
        display: flex;
    }
    
    .controls-info {
        display: none;
    }
    
    .game-title {
        font-size: 2rem;
    }
    
    .difficulty-options {
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
    
    .game-title {
        font-size: 1.8rem;
    }
    
    .credits {
        flex-direction: column;
        gap: 5px;
    }
}
