/* Space Explorer Game Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 50%, #000000 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background stars and meteors */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(3px 3px at 20px 30px, #ffffff, transparent),
        radial-gradient(4px 4px at 40px 70px, #ff6600, transparent),
        radial-gradient(2px 2px at 90px 40px, #ffffff, transparent),
        radial-gradient(3px 3px at 130px 80px, #ff6600, transparent),
        radial-gradient(5px 5px at 160px 30px, #ffffff, transparent),
        radial-gradient(6px 6px at 200px 120px, #ff8800, transparent),
        radial-gradient(2px 2px at 250px 60px, #ffffff, transparent),
        radial-gradient(4px 4px at 300px 90px, #ff6600, transparent),
        radial-gradient(3px 3px at 350px 150px, #ffffff, transparent),
        radial-gradient(7px 7px at 400px 80px, #ffaa00, transparent);
    background-repeat: repeat;
    background-size: 450px 200px;
    animation: stars 15s linear infinite;
    z-index: -1;
}

@keyframes stars {
    from { transform: translateY(0px); }
    to { transform: translateY(-200px); }
}

/* Additional meteor trails */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, transparent 30%, rgba(255, 102, 0, 0.3) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 40%, rgba(255, 136, 0, 0.2) 60%, transparent 80%),
        linear-gradient(30deg, transparent 20%, rgba(255, 170, 0, 0.4) 40%, transparent 60%);
    background-size: 300px 300px, 400px 400px, 500px 500px;
    animation: meteors 25s linear infinite;
    z-index: -1;
}

@keyframes meteors {
    from { transform: translateX(-300px) translateY(-300px); }
    to { transform: translateX(100vw) translateY(100vh); }
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.game-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(45deg, #ff6600, #ff8800, #ff6600);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(255, 102, 0, 0.3), 0 0 50px rgba(255, 102, 0, 0.1);
    border: 3px solid #ff6600;
    position: relative;
    overflow: hidden;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.game-header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ffffff, #ffcc00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-board {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.score-board > div {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid #ff6600;
    font-weight: bold;
    font-size: 1.1rem;
    min-width: 120px;
    text-align: center;
}

.score-board span {
    color: #ff6600;
    font-size: 1.3rem;
}

.game-area {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

#gameCanvas {
    border: 4px solid #ff6600;
    border-radius: 15px;
    background: linear-gradient(180deg, #000033 0%, #000066 50%, #000033 100%);
    box-shadow: 0 0 50px rgba(255, 102, 0, 0.5), inset 0 0 30px rgba(255, 102, 0, 0.1);
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    position: relative;
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 15px;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 102, 0, 0.1) 50%, transparent 60%);
    animation: canvasGlow 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes canvasGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 15px;
}

.overlay-content {
    text-align: center;
    max-width: 500px;
    padding: 40px;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    border-radius: 20px;
    border: 2px solid #ff6600;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.3);
}

.overlay-content h2 {
    color: #ff6600;
    font-size: 2rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #cccccc;
}

.controls {
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 1px solid #ff6600;
}

.controls p {
    margin: 8px 0;
    font-size: 0.9rem;
}

.game-button {
    background: linear-gradient(45deg, #ff6600, #ff8800, #ff6600);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3), 0 0 20px rgba(255, 102, 0, 0.2);
    margin: 10px;
    position: relative;
    overflow: hidden;
}

.game-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.game-button:hover::before {
    left: 100%;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.5);
    background: linear-gradient(45deg, #ff8800, #ff6600);
}

.game-button:active {
    transform: translateY(0);
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.control-button {
    background: linear-gradient(45deg, #333333, #444444);
    color: #ff6600;
    border: 2px solid #ff6600;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.2);
}

.control-button:hover {
    background: linear-gradient(45deg, #ff6600, #ff8800);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 102, 0, 0.4);
}

.control-button:active {
    transform: translateY(0);
}

.game-footer {
    text-align: center;
    padding: 20px;
    margin-top: auto;
    background: linear-gradient(45deg, #1a1a1a, #2a2a2a);
    border-radius: 10px;
    border: 1px solid #ff6600;
}

.game-footer p {
    color: #ff6600;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-container {
        padding: 10px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .score-board {
        flex-direction: column;
        align-items: center;
    }
    
    .score-board > div {
        min-width: 150px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-button {
        width: 200px;
    }
}

/* Animation for game elements */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.game-header h1 {
    animation: pulse 3s ease-in-out infinite;
}

/* Health Bar Styles */
.health-bar-container {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 1000;
    width: 200px;
}

.health-bar {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6600;
    border-radius: 10px;
    padding: 5px;
    position: relative;
    margin-bottom: 10px;
}

.health-fill {
    height: 20px;
    background: linear-gradient(90deg, #ff0000, #ff6600, #00ff00);
    border-radius: 5px;
    width: 100%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: healthShine 2s infinite;
}

@keyframes healthShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.health-regen {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 10px;
    display: none;
    text-align: center;
}

.regen-text {
    color: #00ffff;
    font-weight: bold;
    margin-bottom: 5px;
}

.regen-progress {
    height: 10px;
    background: rgba(0, 255, 255, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.regen-progress::before {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #00ffff, #0088ff);
    width: var(--regen-width, 0%);
    transition: width 0.1s ease;
}

/* Mini game styles removed */

/* Hide overlay when game is running */
.game-overlay.hidden {
    display: none;
}

/* Health Bar Warning */
.health-bar.warning {
    border-color: #ff0000;
    animation: healthWarning 1s ease-in-out infinite;
}

@keyframes healthWarning {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.8); }
}

.score-animate {
    animation: scorePop 0.4s cubic-bezier(0.4, 1.4, 0.6, 1) 1;
}

@keyframes scorePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.4); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,0,0,0.25);
    pointer-events: none;
    z-index: 9999;
    animation: flashRed 0.35s ease;
}

@keyframes flashRed {
    0% { opacity: 0.8; }
    80% { opacity: 0.3; }
    100% { opacity: 0; }
}

.mobile-controls {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    gap: 10px;
    background: rgba(0,0,0,0.7);
    border-radius: 15px;
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.mobile-btn {
    font-size: 2rem;
    background: linear-gradient(45deg, #ff6600, #ff8800);
    color: #fff;
    border: none;
    border-radius: 10px;
    margin: 0 5px;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(255,102,0,0.2);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.mobile-btn:active {
    background: #ff8800;
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        padding: 6px 4px;
        bottom: 10px;
        left: 50%;
        width: 98vw;
        max-width: 420px;
        box-sizing: border-box;
    }
    .mobile-btn {
        font-size: 1.3rem;
        padding: 7px 10px;
        margin: 2px 2px;
        min-width: 44px;
        min-height: 44px;
        flex: 1 1 18%;
        max-width: 70px;
    }
}