/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    overflow: hidden;
    height: 100vh;
    cursor: crosshair;
}

/* Menu Styles */
.menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0f3460 0%, #16213e 100%);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

.menu.hidden {
    opacity: 0;
    pointer-events: none;
}

.menu-container {
    max-width: 800px;
    width: 90%;
    text-align: center;
}

.logo {
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 4.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #00dbde, #fc00ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 30px rgba(0, 219, 222, 0.3);
    letter-spacing: 2px;
}

.subtitle {
    color: #8a8aff;
    font-size: 1.2rem;
    margin-top: -10px;
}

.menu-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.menu-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.menu-btn.primary {
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
}

.menu-btn.primary:hover {
    background: linear-gradient(45deg, #ff4b2b, #ff416c);
    transform: translateY(-2px) scale(1.05);
}

.game-modes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
}

.mode-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.mode-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.mode-card.active {
    border-color: #00dbde;
    background: rgba(0, 219, 222, 0.1);
    box-shadow: 0 0 30px rgba(0, 219, 222, 0.3);
}

.mode-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #00dbde, #fc00ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 15px;
}

.mode-card h3 {
    margin: 10px 0;
    color: #8a8aff;
}

.mode-card p {
    color: #aaa;
    font-size: 0.9rem;
}

.footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.player-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #00dbde;
}

.stat-label {
    color: #8a8aff;
    font-size: 0.9rem;
}

.controls-hint {
    margin-top: 20px;
    color: #aaa;
}

.key {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 5px;
    font-family: monospace;
}

/* Game Container */
#gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* HUD Styles */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.hud-top {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-bar, .shield-bar {
    width: 200px;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff416c, #ff4b2b);
    width: 100%;
    transition: width 0.3s ease;
}

.shield-fill {
    height: 100%;
    background: linear-gradient(90deg, #00dbde, #0072ff);
    width: 100%;
    transition: width 0.3s ease;
}

.health-text, .shield-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.kill-counter {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.kill-counter i {
    color: #ff416c;
}

.hud-bottom {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.weapon-slots {
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.weapon-slot {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.weapon-slot:hover {
    background: rgba(255, 255, 255, 0.2);
}

.weapon-slot.active {
    background: rgba(0, 219, 222, 0.2);
    border: 2px solid #00dbde;
    transform: scale(1.1);
}

.weapon-icon {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.build-icon {
    font-size: 1.8rem;
    color: #00dbde;
}

.ammo-count {
    font-size: 0.9rem;
    color: #aaa;
}

.build-material {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

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

.material.wood {
    border-left: 4px solid #8b4513;
}

.material.brick {
    border-left: 4px solid #b22222;
}

.material.metal {
    border-left: 4px solid #c0c0c0;
}

.material-icon {
    width: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.build-menu {
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.build-option {
    width: 100px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.build-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.build-option.active {
    background: rgba(0, 219, 222, 0.2);
    border: 2px solid #00dbde;
}

.build-preview {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    position: relative;
}

.build-preview.wall::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: linear-gradient(45deg, #8b4513, #d2691e);
    border-radius: 3px;
}

.build-preview.ramp::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: linear-gradient(45deg, #b22222, #ff4500);
    clip-path: polygon(0% 100%, 100% 100%, 100% 0%);
    border-radius: 3px;
}

.build-preview.floor::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background: linear-gradient(45deg, #c0c0c0, #a9a9a9);
    border-radius: 3px;
}

.build-option span {
    font-size: 0.9rem;
    color: #aaa;
}

/* Crosshair */
#crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 20;
}

.crosshair-dot {
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.crosshair-line {
    position: absolute;
    background: white;
}

.crosshair-line.top {
    width: 2px;
    height: 15px;
    top: calc(50% - 20px);
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-line.bottom {
    width: 2px;
    height: 15px;
    top: calc(50% + 5px);
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-line.left {
    width: 15px;
    height: 2px;
    top: 50%;
    left: calc(50% - 20px);
    transform: translateY(-50%);
}

.crosshair-line.right {
    width: 15px;
    height: 2px;
    top: 50%;
    left: calc(50% + 5px);
    transform: translateY(-50%);
}

/* Kill Feed */
#killFeed {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 300px;
    pointer-events: none;
}

/* Game Menu */
#gameMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.game-menu-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 400px;
}

.game-menu-content h2 {
    margin-bottom: 30px;
    color: #00dbde;
}

.game-menu-btn {
    display: block;
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Loading Screen */
#loadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #16213e;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.loading-content {
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-top: 5px solid #00dbde;
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

.loading-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #00dbde, #fc00ff);
    width: 0%;
    transition: width 0.3s ease;
}

.loading-tip {
    color: #8a8aff;
    margin-top: 20px;
    font-size: 0.9rem;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.active {
    display: block !important;
}

/* Responsive */
@media (max-width: 768px) {
    .menu-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .game-modes {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-card {
        width: 80%;
    }
    
    .weapon-slots {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .weapon-slot {
        width: 60px;
        height: 60px;
    }
}
