/* SPACE DEFENDER - Advanced CSS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #0a0e27 0%, #1a0033 50%, #2a0a3a 100%);
    color: #fff;
    font-family: 'Courier New', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
}

canvas {
    border: 4px solid #00ffff;
    background: radial-gradient(ellipse at 50% 50%, #0a0a2e 0%, #000000 100%);
    box-shadow: 0 0 30px #00ffff, 0 0 60px #ff00ff, inset 0 0 40px rgba(0, 255, 255, 0.1);
    display: block;
}

/* HUD - Game Statistics */
#gameHUD {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(10, 14, 39, 0.85);
    border-bottom: 3px solid #00ffff;
    backdrop-filter: blur(10px);
    z-index: 100;
}

#leftStats, #rightStats {
    display: flex;
    gap: 20px;
}

.stat-box {
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid #00ffff;
    padding: 8px 15px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.stat-label {
    font-size: 10px;
    color: #00ffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

#centerControls {
    display: flex;
    gap: 15px;
}

.btn-primary, .btn-secondary {
    padding: 10px 25px;
    border: 2px solid #00ffff;
    background: linear-gradient(135deg, #00ffff, #0088ff);
    color: #000;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    transition: all 0.3s;
    box-shadow: 0 0 15px #00ffff;
    font-family: 'Courier New', monospace;
}

.btn-primary:hover {
    box-shadow: 0 0 30px #00ffff, 0 0 60px #0088ff;
    transform: scale(1.08);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff00ff, #ff0088);
    border-color: #ff00ff;
    box-shadow: 0 0 15px #ff00ff;
    color: #fff;
}

.btn-secondary:hover {
    box-shadow: 0 0 30px #ff00ff, 0 0 60px #ff0088;
    transform: scale(1.08);
}

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.shop-container {
    background: linear-gradient(135deg, #0a0e27 0%, #1a0a3a 100%);
    border: 3px solid #00ffff;
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 50px #00ffff, 0 0 100px rgba(0, 255, 255, 0.3);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #ff0088;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px #ff0088;
}

.close-btn:hover {
    box-shadow: 0 0 30px #ff0088;
}

.shop-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 25px;
    margin-top: 10px;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff;
    letter-spacing: 3px;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.weapon-card {
    background: rgba(0, 170, 255, 0.1);
    border: 2px solid #0088ff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
}

.weapon-card.buyable {
    cursor: pointer;
    border-color: #ff00ff;
    background: rgba(255, 0, 136, 0.1);
}

.weapon-card.buyable:hover {
    box-shadow: 0 0 20px #ff00ff;
    transform: translateY(-5px);
}

.weapon-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.weapon-name {
    font-weight: bold;
    color: #ffff00;
    font-size: 14px;
    margin-bottom: 5px;
}

.weapon-desc {
    font-size: 11px;
    color: #aaffff;
    margin-bottom: 10px;
}

.weapon-cost {
    color: #00ff88;
    font-weight: bold;
    font-size: 12px;
}

.buy-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #00ff88, #00aa44);
    border: 1px solid #00ff88;
    color: #000;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 8px;
    font-family: 'Courier New', monospace;
}

.buy-btn:hover {
    box-shadow: 0 0 15px #00ff88;
    transform: scale(1.05);
}

.shop-upgrades {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #ffaa00;
    border-radius: 8px;
    padding: 20px;
}

.shop-upgrades h3 {
    color: #ffaa00;
    margin-bottom: 15px;
    text-shadow: 0 0 10px #ffaa00;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 170, 0, 0.05);
    border: 1px solid #ffaa00;
    border-radius: 5px;
    margin-bottom: 10px;
    color: #ffaa00;
}

.upgrade-btn {
    background: linear-gradient(135deg, #ffaa00, #ff7700);
    border: 1px solid #ffaa00;
    color: #000;
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.upgrade-btn:hover {
    box-shadow: 0 0 15px #ffaa00;
}

/* GAME OVER SCREEN */
.gameover-container {
    background: linear-gradient(135deg, #1a0000 0%, #330000 100%);
    border: 4px solid #ff0088;
    border-radius: 15px;
    padding: 50px;
    text-align: center;
    box-shadow: 0 0 60px #ff0088, 0 0 120px rgba(255, 0, 136, 0.3);
}

.gameover-title {
    font-size: 54px;
    color: #ff0088;
    text-shadow: 0 0 20px #ff0088, 0 0 40px #ff00ff;
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.gameover-stats {
    font-size: 22px;
    margin-bottom: 30px;
    color: #aaffff;
}

.gameover-stats p {
    margin: 10px 0;
}

.gameover-stats span {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 10px #ffff00;
}

#restartBtn {
    font-size: 18px;
    padding: 15px 40px;
}

.hidden {
    display: none !important;
}

/* Scrollbar styling for shop */
.shop-container::-webkit-scrollbar {
    width: 10px;
}

.shop-container::-webkit-scrollbar-track {
    background: rgba(0, 255, 255, 0.1);
}

.shop-container::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 5px;
}

.shop-container::-webkit-scrollbar-thumb:hover {
    background: #ff00ff;
}
