* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0f0f23 100%);
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
}

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

#gameScreen {
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a1a 100%);
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.ui-header {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    pointer-events: auto;
}

.ship-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.health-bar-container,
.shield-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-label {
    color: #ffffff;
    font-size: 12px;
    min-width: 40px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.health-bar,
.shield-bar {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ff6666 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.shield-fill {
    height: 100%;
    background: linear-gradient(90deg, #4444ff 0%, #6666ff 100%);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(68, 68, 255, 0.5);
}

.health-text,
.shield-text {
    color: #ffffff;
    font-size: 11px;
    min-width: 60px;
    text-align: right;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 120px;
}

.score-display,
.level-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
}

.info-value {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.weapon-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.weapon-display,
.ammo-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ui-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

.menu-header {
    text-align: center;
    margin-bottom: 40px;
}

.game-title {
    font-size: 48px;
    color: #ffffff;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(100, 200, 255, 0.8),
                 0 0 40px rgba(100, 200, 255, 0.4);
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(100, 200, 255, 0.8),
                     0 0 40px rgba(100, 200, 255, 0.4);
    }
    50% {
        text-shadow: 0 0 30px rgba(100, 200, 255, 1),
                     0 0 60px rgba(100, 200, 255, 0.6);
    }
}

.game-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 4px;
}

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

.menu-btn {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.2) 0%, rgba(50, 150, 255, 0.2) 100%);
    color: #ffffff;
    border: 2px solid rgba(100, 200, 255, 0.5);
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 250px;
}

.menu-btn:hover {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.4) 0%, rgba(50, 150, 255, 0.4) 100%);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(100, 200, 255, 0.3);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn.primary {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.3) 0%, rgba(255, 150, 50, 0.3) 100%);
    border-color: rgba(255, 200, 100, 0.6);
}

.menu-btn.primary:hover {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.5) 0%, rgba(255, 150, 50, 0.5) 100%);
    box-shadow: 0 10px 30px rgba(255, 200, 100, 0.3);
}

.player-stats {
    display: flex;
    gap: 30px;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.stat-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.upgrade-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.upgrade-header h2 {
    color: #ffffff;
    font-size: 28px;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.close-btn {
    background: rgba(255, 100, 100, 0.3);
    color: #ffffff;
    border: 2px solid rgba(255, 100, 100, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 100, 100, 0.5);
    transform: rotate(90deg);
}

.upgrade-content {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px 30px;
}

.resource-display {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 215, 0, 0.2);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    margin-bottom: 20px;
}

.resource-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.resource-value {
    color: #ffd700;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.upgrade-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.upgrade-section {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upgrade-section h3 {
    color: #ffffff;
    font-size: 20px;
    margin-bottom: 15px;
    text-shadow: 0 0 5px rgba(100, 200, 255, 0.5);
}

.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.upgrade-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.upgrade-name {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.upgrade-level {
    color: rgba(100, 200, 255, 0.8);
    font-size: 12px;
}

.upgrade-btn {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.3) 0%, rgba(50, 150, 255, 0.3) 100%);
    color: #ffffff;
    border: 2px solid rgba(100, 200, 255, 0.5);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, rgba(100, 200, 255, 0.5) 0%, rgba(50, 150, 255, 0.5) 100%);
    transform: scale(1.05);
}

.upgrade-btn:active {
    transform: scale(0.95);
}

.game-over-content {
    text-align: center;
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-over-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.game-over-title {
    font-size: 36px;
    color: #ff4444;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.game-over-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.game-over-stats .stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-over-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.pause-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 40px 60px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.pause-content h2 {
    color: #ffffff;
    font-size: 32px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

.pause-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 20px 40px;
    border-radius: 10px;
    border: 2px solid rgba(100, 200, 255, 0.5);
    font-size: 18px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    text-align: center;
}

.notification.show {
    opacity: 1;
    pointer-events: auto;
    animation: notificationPulse 0.5s ease-out;
}

@keyframes notificationPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .upgrade-sections {
        grid-template-columns: 1fr;
    }
    
    .game-over-stats {
        grid-template-columns: 1fr;
    }
    
    .ui-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .ship-status,
    .game-info,
    .weapon-info {
        min-width: 100%;
    }
}