/* Modern Battle Royale Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    --secondary-gradient: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    --accent-gradient: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    --danger-gradient: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    --success-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);
    --warning-gradient: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    --dark-bg: #000000;
    --darker-bg: #0a0a0a;
    --card-bg: rgba(10, 10, 10, 0.95);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #e5e5e5;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --health-color: #22c55e;
    --armor-color: #3b82f6;
    --stamina-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-heavy: 0 8px 24px rgba(0, 0, 0, 0.7);
    --border-radius: 6px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* Dark Battlefield Background */
.battlefield-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 30% 70%, #1a1a1a 0%, #000000 50%, #0a0a0a 100%);
}

/* Game Container */
#gameContainer {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.screen.active {
    display: flex;
}

/* Main Menu Styles */
#mainMenu {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
}

.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
}

.menu-content {
    max-width: 500px;
    width: 90%;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-heavy);
    text-align: center;
}

.menu-header {
    margin-bottom: 2rem;
}

.game-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.title-icon {
    font-size: 1.2em;
    animation: pulse 2s infinite;
}

.title-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title-subtitle {
    font-size: 0.6em;
    color: var(--text-secondary);
    font-weight: 400;
}

.game-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.lobby-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lobby-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-icon {
    font-size: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.game-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.feature-icon {
    font-size: 1.2rem;
}

/* Game Screen */
#gameScreen {
    flex-direction: column;
    padding: 0;
}

.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    pointer-events: none;
}

.game-hud > * {
    pointer-events: auto;
}

.hud-top-left {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.hud-top-center {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.hud-top-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.hud-bottom {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
}

/* HUD Panels */
.health-panel,
.zone-panel,
.match-panel,
.weapon-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-light);
}

.panel-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Health Panel */
.vital-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.vital-bar:last-child {
    margin-bottom: 0;
}

.vital-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.vital-info {
    flex: 1;
    min-width: 100px;
}

.vital-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.25rem;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: var(--transition);
    border-radius: 4px;
}

.progress-fill.health {
    background: linear-gradient(90deg, var(--health-color), #22c55e);
}

.progress-fill.armor {
    background: linear-gradient(90deg, var(--armor-color), #60a5fa);
}

.progress-fill.stamina {
    background: linear-gradient(90deg, var(--stamina-color), #fbbf24);
}

.progress-text {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Zone Panel */
.zone-timer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.timer-icon {
    font-size: 1.5rem;
}

.timer-info {
    display: flex;
    flex-direction: column;
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timer-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Rajdhani', monospace;
    color: var(--text-primary);
}

.zone-info {
    text-align: center;
}

.zone-phase {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.zone-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--danger-gradient);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    animation: pulse 1s infinite;
}

.zone-warning.hidden {
    display: none;
}

/* Match Panel */
.match-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.match-stat:last-child {
    margin-bottom: 0;
}

.match-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.match-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 40px;
}

.match-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Weapon Panel */
.weapon-display {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weapon-icon {
    font-size: 2rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.weapon-info {
    display: flex;
    flex-direction: column;
}

.weapon-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ammo-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reload-text {
    color: var(--warning-color);
    font-weight: 600;
    animation: pulse 0.5s infinite;
}

.reload-text.hidden {
    display: none;
}

/* Controls Panel */
.controls-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

kbd {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 30px;
    text-align: center;
}

/* Game Canvas */
#gameCanvas {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.9) 100%);
}

/* Inventory Modal */
.inventory-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.inventory-modal.hidden {
    display: none;
}

.inventory-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.inventory-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-heavy);
    max-width: 600px;
    width: 90%;
    z-index: 1;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.inventory-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-primary);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
}

/* Game Over Screen */
#gameOverScreen {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.results-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
}

.results-content {
    max-width: 500px;
    width: 90%;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-heavy);
    text-align: center;
}

.results-header {
    margin-bottom: 2rem;
}

.results-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.rank-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.rank-icon {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.rank-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.rank-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-icon {
    font-size: 1.5rem;
}

.summary-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.summary-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn-primary:hover .btn-glow {
    left: 100%;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-content {
        padding: 2rem 1.5rem;
    }
    
    .lobby-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .lobby-stat {
        justify-content: center;
    }
    
    .game-features {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hud-top-left,
    .hud-top-center,
    .hud-top-right {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        margin-bottom: 1rem;
    }
    
    .game-hud {
        padding: 1rem;
        display: flex;
        flex-direction: column;
    }
    
    .hud-bottom {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        flex-direction: column;
        gap: 1rem;
        margin-top: auto;
    }
    
    .stats-summary {
        grid-template-columns: 1fr;
    }
    
    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2rem;
    }
    
    .vital-info {
        min-width: 100px;
    }
    
    .control-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .inventory-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .results-content {
        padding: 1.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .battlefield-bg {
        animation: none;
    }
}

/* Focus states */
button:focus,
.close-btn:focus {
    outline: 2px solid var(--accent-gradient);
    outline-offset: 2px;
}