/* Base styles */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #333;
    font-family: 'Arial', sans-serif;
}

/* Game Canvas */
#gameCanvas {
    border: 2px solid #666;
    background-color: #000000;
    display: block;
    width: 100%;
    height: 100%;
}

/* Menu and UI Styles */
.menu-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.menu-content {
    text-align: center;
    color: white;
}

.game-title {
    font-size: 4rem;
    margin-bottom: 2rem;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.menu-button {
    display: block;
    margin: 1rem auto;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.menu-button.primary {
    background: #4CAF50;
    color: white;
    font-weight: bold;
}

.menu-button.primary:hover {
    background: #45a049;
}

/* New styles for the Space instruction text */
.menu-button .space-to-start {
    display: block;
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.8;
    margin-top: 4px;
}

/* Add a focus state for accessibility and clarity */
.menu-button:focus {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

/* Footer Styles */
.game-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

.separator {
    margin: 0 10px;
    opacity: 0.5;
}

/* Modal Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 1rem 0;
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Game Over Screen */
#gameOverScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.game-over-content {
    text-align: center;
    color: white;
}

.game-over-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-over-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }
    
    .menu-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem);
    }
    
    .game-footer {
        font-size: 0.8rem;
    }
}