* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: white;
    overflow: hidden;
}

/* Common Screen Styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.9), rgba(42, 82, 152, 0.9));
    z-index: 100;
}

.hidden {
    display: none !important;
}

.menu-content {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

h1 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #FFD700;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.menu-btn {
    background: linear-gradient(to bottom, #4CAF50, #45a049);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.menu-btn:hover {
    background: linear-gradient(to bottom, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.menu-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.back-btn {
    background: linear-gradient(to bottom, #f44336, #d32f2f);
    margin-top: 20px;
}

.back-btn:hover {
    background: linear-gradient(to bottom, #d32f2f, #f44336);
}

.credits {
    margin-top: 30px;
    font-size: 14px;
    opacity: 0.7;
}

/* Options Menu */
.option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.option-item label {
    flex: 1;
    text-align: left;
    font-weight: bold;
}

.option-item input[type="range"] {
    flex: 2;
    margin: 0 10px;
}

.option-item span {
    flex: 0.5;
    text-align: right;
}

.option-item.checkbox {
    justify-content: flex-start;
    gap: 10px;
}

.difficulty-options {
    display: flex;
    gap: 10px;
}

.difficulty-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.difficulty-btn.selected {
    background: #4CAF50;
    font-weight: bold;
}

/* How to Play Screen */
.instructions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 5px;
}

.instruction-icon {
    width: 60px;
    text-align: center;
    font-size: 20px;
}

.space-key {
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 14px;
}

/* Game Container */
#gameContainer {
    position: relative;
    background: #87CEEB;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
}

/* Game UI */
#gameUI {
    position: absolute;
    width: 100%;
    padding: 10px;
    z-index: 10;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    pointer-events: none;
}

.ui-top {
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 10px;
}

.ui-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ui-item.fps {
    opacity: 0.7;
    font-size: 14px;
}

.ui-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ui-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    pointer-events: auto;
    transition: all 0.2s;
}

.ui-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

#powerupIndicator {
    background: rgba(255, 215, 0, 0.7);
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Game Over & Level Complete */
#gameOver, #levelComplete {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 20;
    min-width: 300px;
}

.level-stats {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: left;
}

/* Mobile Controls */
#mobileControls {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.mobile-left, .mobile-right {
    display: flex;
    gap: 20px;
}

.control-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0.9);
}

@media (max-width: 850px) {
    #mobileControls {
        display: flex;
    }
    
    h1 {
        font-size: 36px;
    }
    
    h2 {
        font-size: 28px;
    }
    
    .menu-btn {
        font-size: 16px;
        padding: 10px 16px;
    }
}