/* HUD Styles - Madness Combat Theme */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

* { box-sizing: border-box; }

html, body { 
    margin: 0; 
    padding: 0;
    overflow: hidden; 
    background: #000; 
    font-family: 'Courier Prime', monospace; 
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    color: #fff;
}

canvas { display: block; position: absolute; top: 0; left: 0; z-index: 1; }

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

/* Madness Style Utilities */
.madness-panel {
    background: rgba(10, 10, 10, 0.95);
    border: 2px solid #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    position: relative;
}

.madness-panel::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border: 1px solid #666;
    pointer-events: none;
    z-index: 1;
}

.madness-text {
    font-family: 'Impact', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
}

.madness-red { color: #f00; }
.madness-grey { color: #aaa; }

/* HUD Elements */
#ammo-display { 
    position: absolute;
    bottom: 30px; 
    right: 30px; 
    font-family: 'Impact', sans-serif;
    font-size: 48px; 
    color: #fff;
    text-shadow: 3px 3px 0 #000;
    text-align: right; 
}
#ammo-display span { font-size: 24px; color: #aaa; }

#hp-display { 
    position: absolute;
    bottom: 30px; 
    left: 30px; 
    font-family: 'Impact', sans-serif;
    font-size: 48px; 
    color: #f00;
    text-shadow: 3px 3px 0 #000;
}

/* Mobile Top Right Container - Groups ping, menu btn, leaderboard */
#mobile-top-right {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

#ping-display { 
    font-size: 12px; 
    color: #666; 
    font-weight: bold;
}

/* Mobile menu button - hidden on PC */
#mobile-menu-btn {
    display: none;
}

/* Energy Leaderboard - Top Right */
#energy-leaderboard {
    width: 160px;
    margin-top: 5px;
    background: rgba(10, 10, 10, 0.85);
    border: 1px solid #333;
    border-left: 3px solid #0af;
    padding: 8px 10px;
    font-family: 'Rajdhani', sans-serif;
    z-index: 20;
    pointer-events: none;
}

#energy-leaderboard .leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    color: #0af;
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

#energy-leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.energy-leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.energy-leaderboard-entry:last-child {
    border-bottom: none;
}

.energy-leaderboard-entry .rank {
    color: #666;
    font-weight: bold;
    width: 18px;
}

.energy-leaderboard-entry .rank.top1 { color: #ffd700; }
.energy-leaderboard-entry .rank.top2 { color: #c0c0c0; }
.energy-leaderboard-entry .rank.top3 { color: #cd7f32; }

.energy-leaderboard-entry .name {
    flex: 1;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0 5px;
}

.energy-leaderboard-entry.me .name {
    color: #0f0;
    font-weight: bold;
}

.energy-leaderboard-entry .energy {
    color: #0af;
    font-weight: bold;
    font-family: 'Share Tech Mono', monospace;
}

#weapon-name { 
    position: absolute;
    bottom: 80px; 
    right: 30px; 
    font-family: 'Courier Prime', monospace;
    font-size: 18px; 
    color: #f00; 
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: #000;
    padding: 2px 5px;
}

/* Weapon Selection HUD */
#weapon-slots { 
    position: absolute; 
    bottom: 30px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 15px; 
}

.weapon-slot { 
    width: 70px; 
    height: 70px; 
    background: #111; 
    border: 2px solid #333; 
    position: relative; 
    transition: all 0.1s;
    transform: skew(-5deg);
}

.weapon-slot.active { 
    border-color: #f00; 
    background: #200; 
    transform: skew(-5deg) scale(1.1); 
    box-shadow: 0 0 15px rgba(255,0,0,0.3);
    z-index: 2;
}

.slot-content { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 24px; 
    color: #444; 
    transform: skew(5deg); /* Counter-skew content */
}

.weapon-slot.active .slot-content { color: #fff; }

.slot-number {
    position: absolute;
    top: 2px;
    left: 5px;
    font-size: 12px;
    color: #666;
    font-weight: bold;
    transform: skew(5deg);
}
.weapon-slot.active .slot-number { color: #f00; }

/* Rust/Madness UI Container */
#rust-ui {
    display: none; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 900px; 
    height: 620px; 
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%); 
    border: 2px solid #1a1a1a; 
    flex-direction: column; 
    font-family: 'Rajdhani', sans-serif; 
    z-index: 1000; 
    pointer-events: auto;
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.9),
        0 0 100px rgba(255, 10, 10, 0.1),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    clip-path: polygon(
        0 0,
        calc(100% - 20px) 0,
        100% 20px,
        100% 100%,
        20px 100%,
        0 calc(100% - 20px)
    );
}

#rust-ui::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(90deg, rgba(255, 10, 10, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 10, 10, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    pointer-events: none;
    z-index: 0;
}

#rust-ui::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 10, 10, 0.05) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* UI Header */
.rust-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    background: linear-gradient(90deg, rgba(255, 10, 10, 0.1) 0%, transparent 50%, rgba(255, 10, 10, 0.1) 100%);
    border-bottom: 1px solid rgba(255, 10, 10, 0.3); 
    padding: 18px 25px;
    position: relative;
    z-index: 1;
}

.rust-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff0a0a, transparent);
}

.rust-title {
    font-family: 'Orbitron', sans-serif;
    color: #fff; 
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 10, 10, 0.5);
}
.rust-title span { 
    color: #ff0a0a;
    text-shadow: 0 0 30px rgba(255, 10, 10, 0.8);
}

.rust-close-hint {
    font-family: 'Share Tech Mono', monospace;
    color: #666; 
    font-size: 11px; 
    letter-spacing: 2px;
}

/* Tabs */
.rust-tabs {
    display: flex; 
    gap: 2px; 
    background: #0a0a0a;
    padding: 0 10px;
    position: relative;
    z-index: 1;
}

.rust-tab { 
    background: transparent; 
    border: none;
    border-bottom: 2px solid transparent; 
    color: #555; 
    padding: 14px 24px; 
    cursor: pointer; 
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
}

.rust-tab:hover { 
    color: #fff;
    background: rgba(255, 10, 10, 0.05);
}

.rust-tab.active { 
    color: #ff0a0a;
    border-bottom-color: #ff0a0a;
    background: rgba(255, 10, 10, 0.1);
    text-shadow: 0 0 20px rgba(255, 10, 10, 0.5);
}

.rust-tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #ff0a0a;
    border-radius: 50%;
    box-shadow: 0 0 10px #ff0a0a;
}

/* Content Area */
#rust-content {
    flex: 1; 
    overflow-y: auto; 
    padding: 20px 25px; 
    position: relative;
    z-index: 1;
    background: transparent;
}

/* Inventory Grid */
.rust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rust-slot { 
    border: 1px solid #2a2a2a; 
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%); 
    height: 95px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    position: relative; 
    transition: all 0.2s ease;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.rust-slot::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, rgba(255, 10, 10, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
}

.rust-slot:hover { 
    border-color: #ff0a0a; 
    background: linear-gradient(135deg, #1f1f1f 0%, #111 100%);
    box-shadow: 0 0 20px rgba(255, 10, 10, 0.15);
}

.rust-slot:hover::before { opacity: 1; }

.rust-slot.selected { 
    border-color: #ff0a0a; 
    box-shadow: 0 0 25px rgba(255, 10, 10, 0.3), inset 0 0 20px rgba(255, 10, 10, 0.1);
}

.rust-slot.empty { opacity: 0.6; }

.drag-over { 
    border-color: #fff !important; 
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

/* Crafting Categories */
.crafting-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
    scrollbar-color: #ff0a0a #111;
}

.crafting-categories::-webkit-scrollbar {
    height: 4px;
}

.crafting-categories::-webkit-scrollbar-track {
    background: #111;
}

.crafting-categories::-webkit-scrollbar-thumb {
    background-color: #ff0a0a;
    border-radius: 2px;
}

.craft-cat-btn {
    background: #1a1a1a;
    color: #888;
    border: 1px solid #333;
    padding: 6px 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border-radius: 2px;
}

.craft-cat-btn:hover {
    background: #2a2a2a;
    color: #ccc;
}

.craft-cat-btn.active {
    background: linear-gradient(135deg, #cc0000 0%, #880000 100%);
    color: #fff;
    border-color: #ff0a0a;
    box-shadow: 0 0 8px rgba(255, 10, 10, 0.4);
}

/* Crafting Grid */
.rust-recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

/* Crafting List / Card */
.rust-recipe { 
    display: flex; 
    flex-direction: column;
    padding: 10px; 
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%); 
    border: 1px solid #2a2a2a;
    border-top: 2px solid #333; 
    margin-bottom: 0; 
    transition: all 0.2s ease;
    height: 100%;
}

.rust-recipe:hover { 
    background: linear-gradient(180deg, #222 0%, #151515 100%); 
    border-top-color: #ff0a0a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.rust-recipe.unavailable { opacity: 0.5; filter: grayscale(0.8); }
.rust-recipe.cant-afford { border-top-color: #500; opacity: 0.7; }

.recipe-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    flex: 1;
}

.recipe-info {
    flex: 1;
    padding: 0 0 0 10px;
}

.recipe-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #222;
    padding-top: 8px;
    margin-top: auto;
}

.recipe-cost-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.recipe-cost-tag {
    font-size: 9px;
    padding: 2px 5px;
    background: #000;
    border: 1px solid #333;
    border-radius: 2px;
    color: #aaa;
    font-family: 'Courier Prime', monospace;
}

.recipe-cost-tag.resource-metal { border-color: #555; color: #ccc; }
.recipe-cost-tag.resource-energy { border-color: #05a; color: #0cf; }
.recipe-cost-tag.resource-health { border-color: #050; color: #0f0; }
.recipe-cost-tag.resource-xp { border-color: #505; color: #f0f; }

.recipe-btn {
    background: linear-gradient(135deg, #ff0a0a 0%, #cc0000 100%);
    color: #fff;
    border: none;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
}

.recipe-btn:hover {
    background: linear-gradient(135deg, #ff3333 0%, #ff0a0a 100%);
    box-shadow: 0 0 15px rgba(255, 10, 10, 0.5);
}

.recipe-btn:disabled { 
    background: #222; 
    color: #555; 
    cursor: not-allowed;
    box-shadow: none;
}

/* Team List */
.rust-player { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 12px 15px; 
    background: linear-gradient(90deg, #1a1a1a 0%, #111 100%); 
    border: 1px solid #2a2a2a;
    border-left: 3px solid #444; 
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.rust-player:hover {
    background: linear-gradient(90deg, #222 0%, #1a1a1a 100%);
    transform: translateX(3px);
}

.rust-player.teammate { 
    border-left-color: #00ff00;
    background: linear-gradient(90deg, rgba(0, 255, 0, 0.05) 0%, #111 100%);
}

.rust-player.enemy { 
    border-left-color: #ff0a0a;
    background: linear-gradient(90deg, rgba(255, 10, 10, 0.05) 0%, #111 100%);
}

/* Chat */
#chat-container { 
    position: absolute; 
    bottom: 120px; 
    left: 20px; 
    width: calc(100vw / 3 - 40px); 
    max-width: 33.33vw;
    max-height: 50vh;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    max-height: calc(50vh - 50px);
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
}

.chat-message { 
    font-size: 14px; 
    background: rgba(0,0,0,0.5);
    padding: 2px 5px;
    margin-bottom: 2px;
    border-left: 2px solid #333;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.chat-message { transition: opacity 3s ease; opacity: 1; }
.chat-message.fading { opacity: 0; }
.chat-message .player-name { color: #f00; font-weight: bold; }

#chat-input { 
    width: 100%; 
    padding: 8px; 
    background: rgba(0,0,0,0.8); 
    border: 1px solid #333; 
    color: #fff; 
    font-family: 'Courier Prime', monospace;
    outline: none; 
}
#chat-input:focus { border-color: #f00; }

/* Scrollbars */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, #333 0%, #222 100%); 
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { 
    background: linear-gradient(180deg, #ff0a0a 0%, #aa0000 100%); 
}

/* Drag Ghost */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 2000;
    opacity: 0.8;
    transform: scale(1.1);
}

/* Drop Discard Overlay */
.drop-discard-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 998;
    pointer-events: none;
    transition: background 0.2s ease;
    background: transparent;
}
.drop-discard-overlay.active {
    background: rgba(255, 0, 0, 0.08);
    border: 3px dashed rgba(255, 0, 0, 0.4);
}
.drop-discard-text {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: #f00;
    font-family: 'Impact', sans-serif;
    font-size: 22px;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 20px rgba(255, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.drop-discard-overlay.active .drop-discard-text {
    opacity: 1;
}

/* ============================================
   CRAFT HINT BUTTON (B) - Left side PC only
   ============================================ */
#craft-hint-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 70px;
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.92) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 1px solid #333;
    border-left: none;
    clip-path: polygon(0 0, 100% 12%, 100% 88%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    z-index: 50;
    overflow: hidden;
    transition: width 0.2s ease, background 0.2s ease;
}

#craft-hint-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255, 10, 10, 0.08) 0%, transparent 100%);
    pointer-events: none;
}

#craft-hint-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-right: 2px solid rgba(255, 10, 10, 0.3);
    clip-path: polygon(0 0, 100% 12%, 100% 88%, 0 100%);
    pointer-events: none;
}

#craft-hint-btn:hover {
    width: 46px;
    background: linear-gradient(135deg, rgba(40, 10, 10, 0.95) 0%, rgba(20, 5, 5, 0.98) 100%);
}

#craft-hint-btn:hover::after {
    border-right-color: rgba(255, 10, 10, 0.6);
}

.craft-hint-letter {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3), 0 0 20px rgba(255, 10, 10, 0.2);
    letter-spacing: 1px;
    z-index: 2;
    position: relative;
    animation: craft-hint-pulse 3s ease-in-out infinite;
}

@keyframes craft-hint-pulse {
    0%, 100% { 
        opacity: 0.7;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 10, 10, 0.1);
    }
    50% { 
        opacity: 1;
        text-shadow: 0 0 12px rgba(255, 255, 255, 0.5), 0 0 25px rgba(255, 10, 10, 0.3);
    }
}

.craft-hint-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    animation: craft-hint-shimmer 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes craft-hint-shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.is-mobile #craft-hint-btn {
    display: none !important;
}

/* Zone/Compass */
#zone-info {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Impact', sans-serif;
    font-size: 24px;
    color: #f00;
    text-shadow: 2px 2px 0 #000;
    letter-spacing: 2px;
}

/* --- RESTORED / FIXED MENUS --- */

/* ESC Menu (Settings) */
#settings-menu { 
    display: none; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    width: 380px; 
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%); 
    border: 2px solid #1a1a1a; 
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.9),
        0 0 100px rgba(255, 10, 10, 0.1);
    padding: 25px; 
    color: #fff; 
    z-index: 2000; 
    pointer-events: auto; 
    flex-direction: column;
    font-family: 'Rajdhani', sans-serif;
    clip-path: polygon(
        0 0,
        calc(100% - 15px) 0,
        100% 15px,
        100% 100%,
        15px 100%,
        0 calc(100% - 15px)
    );
}

#settings-menu::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(90deg, rgba(255, 10, 10, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 10, 10, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

/* Respawn UI */
#respawn-ui { 
    display: none; 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.9); 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
    pointer-events: auto; 
    z-index: 2000;
}

/* Spectator UI */
#spectator-ui { 
    display: none; 
    position: absolute; 
    bottom: 100px; 
    width: 100%; 
    text-align: center; 
    color: #aaa; 
    font-size: 18px; 
    font-family: 'Impact', sans-serif;
}

/* Connection status */
#connection-status {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    color: #ff0;
    padding: 20px 40px;
    border: 2px solid #ff0;
    font-size: 18px;
    z-index: 3000;
    text-align: center;
}

#connection-status.error { border-color: #f00; color: #f00; }
#connection-status.reconnecting { border-color: #ff0; color: #ff0; }

/* Day/Night Compass (Top) */
#day-night-hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

#compass-container {
    width: 300px;
    height: 30px;
    overflow: hidden;
    position: relative;
    background: rgba(0,0,0,0.5);
    border: 1px solid #666;
    margin-bottom: 5px;
}

#compass-strip {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    color: white;
    font-family: monospace;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
}

#compass-arrow {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    color: #f00;
    font-size: 20px;
}

#night-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* PERF: removed mix-blend-mode:multiply — it forces CPU-side pixel blending
       which costs 10-15 FPS. Simple alpha overlay looks nearly identical */
    background: radial-gradient(circle at center, rgba(0,0,0,0) 20%, rgba(0,0,0,0.7) 80%);
    opacity: 0;
    transition: opacity 2s;
    z-index: 5;
}

/* Mobile: минимальный эффект ночи чтобы не затемнять кнопки управления */
.is-mobile #night-overlay {
    background: radial-gradient(circle at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.15) 100%);
}

/* Radar HUD - Madness Combat Style */
#radar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.9);
    border: 3px solid #333;
    box-shadow: 
        0 0 15px rgba(255, 0, 0, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.9);
    overflow: hidden;
    z-index: 20;
}

#radar-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

#radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    z-index: 2;
}

/* ============================================
   HUD ANIMATIONS - Madness Combat Style
   ============================================ */

/* Ammo shake animation */
@keyframes ammo-shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-3px) rotate(-1deg); }
    20% { transform: translateX(3px) rotate(1deg); }
    30% { transform: translateX(-3px) rotate(-1deg); }
    40% { transform: translateX(3px) rotate(1deg); }
    50% { transform: translateX(-2px); }
    60% { transform: translateX(2px); }
    70% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    90% { transform: translateX(0); }
}

#ammo-display.shaking {
    animation: ammo-shake 0.4s ease-out;
    color: #f00 !important;
}

#ammo-display.low-ammo {
    color: #f00 !important;
    text-shadow: 3px 3px 0 #000, 0 0 10px rgba(255, 0, 0, 0.5);
}

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

@keyframes hp-critical-pulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 3px 3px 0 #000;
    }
    50% { 
        transform: scale(1.15);
        text-shadow: 3px 3px 0 #000, 0 0 20px #f00, 0 0 40px #f00;
    }
}

@keyframes hp-damage-flash {
    0% { color: #fff; transform: scale(1.2); }
    100% { color: #f00; transform: scale(1); }
}

@keyframes hp-heal-flash {
    0% { color: #0f0; transform: scale(1.2); text-shadow: 0 0 20px #0f0; }
    100% { color: #f00; transform: scale(1); text-shadow: 3px 3px 0 #000; }
}

#hp-display {
    transition: color 0.3s, transform 0.2s;
}

#hp-display.critical {
    animation: hp-critical-pulse 0.8s ease-in-out infinite;
}

#hp-display.damage {
    animation: hp-damage-flash 0.3s ease-out;
}

#hp-display.heal {
    animation: hp-heal-flash 0.5s ease-out;
}

#hp-display.medium-hp {
    color: #fa0 !important;
}

/* Weapon Slot Animations */
@keyframes slot-select {
    0% { transform: skew(-5deg) scale(1); }
    50% { transform: skew(-5deg) scale(1.2); }
    100% { transform: skew(-5deg) scale(1.1); }
}

@keyframes slot-deselect {
    0% { transform: skew(-5deg) scale(1.1); }
    100% { transform: skew(-5deg) scale(1); }
}

.weapon-slot {
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.weapon-slot.selecting {
    animation: slot-select 0.25s ease-out forwards;
}

.weapon-slot.deselecting {
    animation: slot-deselect 0.2s ease-out forwards;
}

/* Reload bar animations */
@keyframes reload-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 0, 0, 0.4), inset 0 0 20px rgba(255, 0, 0, 0.1); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.8), inset 0 0 30px rgba(255, 0, 0, 0.2); }
}

@keyframes reload-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

@keyframes reload-glow {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 3px currentColor); }
    50% { filter: brightness(1.3) drop-shadow(0 0 8px currentColor); }
}

@keyframes reload-appear {
    0% { transform: translateX(-50%) scaleY(0); opacity: 0; }
    50% { transform: translateX(-50%) scaleY(1.2); opacity: 1; }
    100% { transform: translateX(-50%) scaleY(1); opacity: 1; }
}

@keyframes reload-disappear {
    0% { transform: translateX(-50%) scaleY(1); opacity: 1; }
    100% { transform: translateX(-50%) scaleY(0); opacity: 0; }
}

#reload-bar-container.hiding {
    animation: reload-disappear 0.2s ease-in forwards !important;
}

@keyframes reload-text-pulse {
    0%, 100% { opacity: 0.7; letter-spacing: 3px; }
    50% { opacity: 1; letter-spacing: 5px; }
}

@keyframes reload-complete-flash {
    0% { background: #0f0; box-shadow: 0 0 30px #0f0; }
    100% { background: transparent; box-shadow: none; }
}

#reload-bar-container {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 12px;
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    border: 2px solid #333;
    border-radius: 2px;
    display: none;
    z-index: 1000;
    animation: reload-pulse 0.4s ease-in-out infinite, reload-appear 0.2s ease-out forwards;
    overflow: hidden;
}

#reload-bar-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 4px,
        rgba(0, 0, 0, 0.3) 4px,
        rgba(0, 0, 0, 0.3) 5px
    );
    pointer-events: none;
    z-index: 2;
}

#reload-bar-container.complete {
    animation: reload-complete-flash 0.3s ease-out forwards;
}

#reload-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, 
        #ff6600 0%, 
        #ff0000 30%, 
        #cc0000 70%, 
        #990000 100%
    );
    position: relative;
    transition: width 0.05s linear;
    animation: reload-glow 0.3s ease-in-out infinite;
}

#reload-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(255, 255, 255, 0.1) 5px,
        rgba(255, 255, 255, 0.1) 10px
    );
    animation: reload-stripes 0.5s linear infinite;
}

#reload-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
}

#reload-text {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 12px;
    color: #ff3300;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 2px 2px 0 #000;
    letter-spacing: 3px;
    animation: reload-text-pulse 0.4s ease-in-out infinite;
    white-space: nowrap;
}

#reload-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 10px;
    color: #fff;
    text-shadow: 1px 1px 2px #000, 0 0 5px rgba(0,0,0,0.8);
    z-index: 3;
    pointer-events: none;
}

/* Weapon name fade animation */
@keyframes weapon-name-switch {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

#weapon-name.switching {
    animation: weapon-name-switch 0.3s ease-out;
}

/* ============================================
   SKILLS TAB STYLES - Premium Dopamine Edition
   ============================================ */

.skills-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 10, 10, 0.2);
    flex-shrink: 0;
    position: relative;
}

.skills-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ff0a0a, transparent);
}

.skills-xp-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 10, 10, 0.15) 0%, rgba(139, 0, 0, 0.1) 100%);
    padding: 6px 14px;
    border: 1px solid rgba(255, 10, 10, 0.4);
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
    position: relative;
    overflow: hidden;
}

.skills-xp-badge::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: xp-shimmer 3s ease-in-out infinite;
}

@keyframes xp-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.skills-xp-badge .xp-icon {
    font-size: 16px;
    animation: xp-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(255, 180, 0, 0.6));
}

.skills-xp-badge .xp-amount {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #ffcc00;
    text-shadow: 0 0 12px rgba(255, 200, 0, 0.5);
}

.skills-xp-badge .xp-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #888;
    letter-spacing: 2px;
}

@keyframes xp-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.15) rotate(5deg); }
}

.skills-subtitle {
    text-align: center;
    color: #555;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    padding: 4px 8px;
    flex-shrink: 0;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

/* Skill Card - Main Row */
.skill-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(90deg, #141414 0%, #0e0e0e 100%);
    border: 1px solid #222;
    border-left: 3px solid #333;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    min-height: 0;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255, 10, 10, 0.04) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
    z-index: 0;
}

.skill-card.animate-in {
    animation: skill-slide-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.skill-card:hover {
    border-color: rgba(255, 10, 10, 0.4);
    border-left-color: #ff0a0a;
    transform: translateX(4px);
    box-shadow: 0 2px 20px rgba(255, 10, 10, 0.12);
}

.skill-card:hover::before { opacity: 1; }

.skill-card.maxed {
    border-left-color: #00cc44;
    background: linear-gradient(90deg, #0c150c 0%, #0a0f0a 100%);
}

.skill-card.maxed:hover {
    border-color: rgba(0, 200, 60, 0.3);
    border-left-color: #00ff44;
    box-shadow: 0 2px 20px rgba(0, 255, 68, 0.1);
}

.skill-card.maxed::before {
    background: linear-gradient(90deg, rgba(0, 255, 68, 0.03) 0%, transparent 40%);
}

@keyframes skill-slide-in {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Icon Section */
.skill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    min-height: 48px;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-right: 1px solid #222;
    position: relative;
    z-index: 1;
    transition: all 0.25s;
}

.skill-card:hover .skill-icon {
    background: rgba(255, 10, 10, 0.08);
}

.skill-card.maxed .skill-icon {
    background: rgba(0, 200, 60, 0.06);
}

/* Info Section */
.skill-info {
    flex: 1;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.skill-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #e0e0e0;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-desc {
    font-size: 9px;
    color: #666;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-effect {
    font-size: 10px;
    font-weight: 700;
    color: #0af;
    font-family: 'Share Tech Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-card.maxed .skill-effect {
    color: #0f8;
}

/* Progress Bar - Animated */
.skill-progress-container {
    position: relative;
    height: 10px;
    background: #0a0a0a;
    border: 1px solid #222;
    overflow: hidden;
    margin-top: 3px;
}

.skill-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #cc0000, #ff3300, #ff6600);
    background-size: 200% 100%;
    animation: progress-flow 2s linear infinite;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 6px rgba(255, 50, 0, 0.4);
    position: relative;
}

.skill-progress-bar::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: progress-shine 1.5s ease-in-out infinite;
}

@keyframes progress-flow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes progress-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skill-card.maxed .skill-progress-bar {
    background: linear-gradient(90deg, #006622, #00aa44, #00ff66);
    background-size: 200% 100%;
    box-shadow: 0 0 6px rgba(0, 255, 68, 0.4);
}

.skill-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    color: #fff;
    text-shadow: 0 0 3px #000, 0 0 5px #000;
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 1;
}

/* Action / Button Section */
.skill-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 1px solid #222;
    min-width: 65px;
    position: relative;
    z-index: 1;
}

.skill-cost {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #ffcc00;
    margin-bottom: 4px;
    white-space: nowrap;
}

.skill-cost .xp-icon {
    font-size: 11px;
    filter: drop-shadow(0 0 3px rgba(255, 200, 0, 0.5));
}

.skill-btn {
    padding: 5px 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #444;
    background: #151515;
    border: 1px solid #2a2a2a;
    cursor: not-allowed;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    clip-path: polygon(0 0, calc(100% - 3px) 0, 100% 3px, 100% 100%, 3px 100%, 0 calc(100% - 3px));
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.skill-btn.affordable {
    color: #fff;
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    border-color: #ff0a0a;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 10, 10, 0.3);
}

.skill-btn.affordable::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    animation: btn-shimmer 2.5s ease-in-out infinite;
}

@keyframes btn-shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.skill-btn.affordable:hover {
    background: linear-gradient(135deg, #ff2222 0%, #cc0000 100%);
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 10, 10, 0.5);
}

.skill-btn.affordable:active {
    transform: scale(0.93);
    box-shadow: 0 0 5px rgba(255, 10, 10, 0.3);
}

.skill-maxed {
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: #00ff44;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(0, 255, 68, 0.5);
    animation: maxed-glow 2s ease-in-out infinite;
}

@keyframes maxed-glow {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(0, 255, 68, 0.5); }
    50% { opacity: 0.8; text-shadow: 0 0 20px rgba(0, 255, 68, 0.8); }
}

/* Level Badge */
.skill-level-badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #888;
    letter-spacing: 1px;
}

.skill-level-badge .current-lvl {
    color: #ffcc00;
    font-weight: 700;
}

.skill-card.maxed .skill-level-badge .current-lvl {
    color: #00ff44;
}

/* Scrollbar styling for skills grid */
.skills-grid::-webkit-scrollbar {
    width: 4px;
}

.skills-grid::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.skills-grid::-webkit-scrollbar-thumb {
    background: #2a2a2a;
}

.skills-grid::-webkit-scrollbar-thumb:hover {
    background: #ff0a0a;
}

/* ============================================
   LOADING SCREEN
   ============================================ */

#loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0a0a0a 0%, #000 100%);
    z-index: 5000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#loading-screen.visible {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 8px;
    margin-bottom: 40px;
}

.loading-logo .logo-m {
    color: #f00;
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.8);
}

.loading-logo .logo-rest {
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.loading-bar-container {
    width: 300px;
    height: 6px;
    background: #1a1a1a;
    border: 1px solid #333;
    margin: 0 auto 20px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f00 0%, #ff0 50%, #f00 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s ease-in-out infinite;
    transition: width 0.3s ease;
}

@keyframes loading-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.loading-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: #fff;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.loading-hint {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    color: #666;
    letter-spacing: 2px;
}

/* ============================================
   MOBILE HUD ADAPTATIONS
   ============================================ */

/* Mobile Detection Class - Added via JS */
body.is-mobile #ui {
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* Tablet Styles */
@media screen and (max-width: 1024px) and (pointer: coarse) {
    /* Radar - Smaller */
    #radar-container {
        width: 100px;
        height: 100px;
        top: 10px;
        left: 10px;
    }
    
    #radar-canvas {
        width: 100px;
        height: 100px;
    }
    
    #radar-center {
        width: 4px;
        height: 4px;
    }
    
    /* HP Display - Smaller */
    #hp-display {
        font-size: 28px;
        bottom: 20px;
        left: 15px;
    }
    
    /* Ammo Display - Smaller */
    #ammo-display {
        font-size: 28px;
        bottom: 20px;
        right: 15px;
    }
    
    #ammo-display span {
        font-size: 14px;
    }
    
    /* Weapon Name */
    #weapon-name {
        font-size: 12px;
        bottom: 55px;
        right: 15px;
        padding: 2px 4px;
    }
    
    /* Energy Leaderboard - Smaller, Keep Right */
    #energy-leaderboard {
        top: 10px;
        right: 10px;
        left: auto !important;
        width: 120px;
        padding: 6px 8px;
    }
    
    #energy-leaderboard .leaderboard-title {
        font-size: 8px;
        letter-spacing: 1px;
        margin-bottom: 4px;
    }
    
    .energy-leaderboard-entry {
        font-size: 9px;
        padding: 1px 0;
    }
    
    .energy-leaderboard-entry .rank {
        width: 14px;
    }
    
    /* Weapon Slots - Smaller */
    #weapon-slots {
        bottom: 15px;
        gap: 8px;
    }
    
    .weapon-slot {
        width: 50px;
        height: 50px;
    }
    
    .slot-content {
        font-size: 18px;
    }
    
    .slot-number {
        font-size: 10px;
    }
    
    /* Compass - Smaller */
    #compass-container {
        width: 200px;
        height: 24px;
    }
    
    #compass-strip {
        font-size: 11px;
    }
    
    #compass-arrow {
        font-size: 16px;
    }
    
    /* Day Night HUD */
    #day-night-hud {
        top: 10px;
    }
    
    /* Ping Display */
    #ping-display {
        font-size: 10px;
        top: 5px;
        right: 5px;
    }
    
    /* Chat - Visible on Mobile */
    #chat-container {
        display: flex !important;
        flex-direction: column !important;
        position: absolute !important;
        bottom: 85px !important;
        left: 75px !important;
        width: 140px !important;
        max-width: 140px !important;
        max-height: 65px !important;
        font-size: 8px;
        background: rgba(0,0,0,0.5) !important;
        border-radius: 4px;
        padding: 4px;
        border: 1px solid rgba(255,255,255,0.15);
        z-index: 50;
        pointer-events: auto !important;
    }
    
    #chat-messages {
        max-height: 35px !important;
        overflow-y: auto;
        margin-bottom: 2px;
        pointer-events: auto !important;
    }
    
    #chat-messages .chat-message {
        font-size: 8px;
        padding: 1px 0;
        line-height: 1.2;
    }
    
    #chat-input-container {
        display: block !important;
        pointer-events: auto !important;
    }
    
    #chat-input {
        display: block !important;
        font-size: 10px;
        padding: 4px 6px;
        width: 100%;
        box-sizing: border-box;
        background: rgba(0,0,0,0.6);
        border: 1px solid rgba(0,170,255,0.4);
        color: #fff;
        border-radius: 3px;
        pointer-events: auto !important;
    }
    
    /* Reload Bar */
    #reload-bar-container {
        width: 150px;
        height: 6px;
        bottom: 80px;
    }
    
    /* Revive Hint */
    #revive-hint {
        font-size: 14px;
    }
}

/* Mobile specific styles */
@media screen and (max-width: 768px) and (pointer: coarse) {
    .rust-recipe-grid {
        grid-template-columns: 1fr;
    }
    
    .rust-recipe {
        padding: 8px;
    }
    
    .recipe-info {
        padding: 0 0 0 8px;
    }
    
    .recipe-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    .crafting-categories {
        margin-bottom: 10px;
    }
}

/* Mobile Portrait Styles */
@media screen and (max-width: 768px) and (pointer: coarse) {
    /* Reload Bar - Mobile - centered, visible */
    #reload-bar-container {
        width: 150px !important;
        height: 10px !important;
        bottom: 140px !important;
        top: auto !important;
        right: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    #reload-text {
        font-size: 9px !important;
        top: -16px !important;
    }
    
    #reload-percent {
        font-size: 8px !important;
    }
    
    /* Radar - Even Smaller */
    #radar-container {
        width: 80px;
        height: 80px;
        top: 8px;
        left: 8px;
        border-width: 2px;
    }
    
    #radar-canvas {
        width: 80px;
        height: 80px;
    }
    
    #radar-center {
        width: 3px;
        height: 3px;
    }
    
    /* HP Display */
    #hp-display {
        font-size: 22px;
        bottom: 15px;
        left: 10px;
    }
    
    /* Ammo Display */
    #ammo-display {
        font-size: 22px;
        bottom: 15px;
        right: 10px;
    }
    
    #ammo-display span {
        font-size: 12px;
    }
    
    /* Weapon Name */
    #weapon-name {
        font-size: 10px;
        bottom: 45px;
        right: 10px;
    }
    
    /* Energy Leaderboard - Compact */
    #energy-leaderboard {
        width: 100px;
        padding: 5px 6px;
        top: 8px;
        right: 8px;
    }
    
    #energy-leaderboard .leaderboard-title {
        font-size: 7px;
        margin-bottom: 3px;
    }
    
    .energy-leaderboard-entry {
        font-size: 8px;
    }
    
    .energy-leaderboard-entry .rank {
        width: 12px;
    }
    
    .energy-leaderboard-entry .energy {
        font-size: 8px;
    }
    
    /* Weapon Slots */
    #weapon-slots {
        bottom: 12px;
        gap: 6px;
    }
    
    .weapon-slot {
        width: 42px;
        height: 42px;
        border-width: 1px;
    }
    
    .weapon-slot.active {
        transform: skew(-5deg) scale(1.05);
    }
    
    .slot-content {
        font-size: 14px;
    }
    
    .slot-content img {
        width: 32px !important;
        height: 32px !important;
    }
    
    .slot-number {
        font-size: 8px;
        top: 1px;
        left: 3px;
    }
    
    .slot-details {
        display: none !important;
    }
    
    /* Compass */
    #compass-container {
        width: 160px;
        height: 20px;
    }
    
    #compass-strip {
        font-size: 10px;
    }
    
    #compass-arrow {
        font-size: 14px;
        top: -4px;
    }
    
    /* Day Night HUD */
    #day-night-hud {
        top: 8px;
    }
    
    /* Reload Bar */
    #reload-bar-container {
        width: 120px;
        height: 5px;
        bottom: 65px;
    }
    
    /* Revive Hint - Mobile Adapted */
    #revive-hint {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* Zone Info */
    #zone-info {
        font-size: 16px;
        top: 35px;
    }
}

/* Small Mobile Screens */
@media screen and (max-width: 480px) and (pointer: coarse) {
    /* Radar */
    #radar-container {
        width: 65px;
        height: 65px;
        top: 6px;
        left: 6px;
    }
    
    #radar-canvas {
        width: 65px;
        height: 65px;
    }
    
    /* HP Display */
    #hp-display {
        font-size: 18px;
        bottom: 12px;
        left: 8px;
    }
    
    /* Ammo Display */
    #ammo-display {
        font-size: 18px;
        bottom: 12px;
        right: 8px;
    }
    
    #ammo-display span {
        font-size: 10px;
    }
    
    /* Weapon Name */
    #weapon-name {
        font-size: 9px;
        bottom: 38px;
    }
    
    /* Energy Leaderboard - Semi-transparent */
    #energy-leaderboard {
        width: 85px;
        padding: 4px 5px;
        top: 6px;
        right: 6px;
        background: rgba(0, 0, 0, 0.35) !important;
        border-left: 2px solid rgba(0, 170, 255, 0.8);
        border-top: 1px solid rgba(0, 170, 255, 0.2);
        border-right: 1px solid rgba(0, 170, 255, 0.2);
        border-bottom: 1px solid rgba(0, 170, 255, 0.2);
    }
    
    #energy-leaderboard .leaderboard-title {
        font-size: 6px;
    }
    
    .energy-leaderboard-entry {
        font-size: 7px;
        background: transparent;
    }
    
    .energy-leaderboard-entry .rank {
        width: 10px;
    }
    
    /* Weapon Slots - Right middle area */
    #weapon-slots {
        bottom: auto;
        top: 50%;
        right: 8px;
        left: auto;
        transform: translateY(-50%);
        gap: 6px;
        flex-direction: column;
    }
    
    .weapon-slot {
        width: 38px;
        height: 38px;
    }
    
    .slot-content {
        font-size: 10px;
    }
    
    .slot-content img {
        width: 26px !important;
        height: 26px !important;
    }
    
    /* Hide slot ammo text on mobile */
    .slot-ammo {
        display: none !important;
    }
    
    /* Weapon Name - tiny, under weapon slots */
    #weapon-name {
        top: calc(50% + 55px);
        right: 8px;
        bottom: auto;
        left: auto;
        transform: none;
        font-size: 6px;
        padding: 1px 3px;
        letter-spacing: 0.5px;
        max-width: 45px;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* HP Display - Bottom Left */
    #hp-display {
        bottom: 8px;
        left: 8px;
        font-size: 16px;
    }
    
    /* Compass */
    #compass-container {
        width: 130px;
        height: 18px;
    }
    
    #compass-strip {
        font-size: 9px;
    }
    
    #compass-arrow {
        font-size: 12px;
    }
    
    /* Reload Bar - under weapon slots on right */
    #reload-bar-container {
        width: 45px;
        height: 4px;
        bottom: auto;
        top: calc(50% + 65px);
        right: 8px;
        left: auto;
        transform: none;
        z-index: 100;
        background: rgba(0,0,0,0.6);
        border: 1px solid #444;
    }
    
    /* Chat - smaller screens override */
    #chat-container {
        bottom: 80px;
        left: 70px;
        width: 120px;
        max-height: 60px;
    }
    
    #chat-messages {
        max-height: 30px;
    }
    
    #chat-input {
        font-size: 9px;
        padding: 3px 5px;
    }
}

/* ============================================
   MOBILE TOP RIGHT CONTAINER
   ============================================ */

/* Touch devices - use flex layout for top-right elements */
@media screen and (pointer: coarse) {
    #mobile-top-right {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 6px;
    }
    
    /* Mobile menu button - PIXI style (circular, dark gray with red accent) */
    #mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(51, 51, 51, 0.4);
        border: 2px solid rgba(102, 102, 102, 0.3);
        border-radius: 50%;
        color: #666;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
        pointer-events: auto;
        transition: all 0.15s ease;
        -webkit-tap-highlight-color: transparent;
        order: -1;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    }
    
    #mobile-menu-btn:active {
        background: rgba(204, 0, 0, 0.5);
        border-color: rgba(255, 0, 0, 0.7);
        color: #ff4444;
        box-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
    }
    
    /* Ping display - compact 2x2 grid layout */
    #ping-display {
        display: grid;
        grid-template-columns: auto auto;
        gap: 2px 8px;
        font-size: 9px;
        line-height: 1.2;
        order: 0;
    }
    
    /* Hide conn info on mobile */
    #ping-display #conn-display {
        display: none !important;
    }
    
    #energy-leaderboard {
        width: 120px;
        margin-top: 0;
        order: 1;
    }
}

@media screen and (max-width: 480px) and (pointer: coarse) {
    #mobile-top-right {
        top: 8px;
        right: 8px;
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
    }
    
    #mobile-menu-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        order: 0;
    }
    
    #ping-display {
        font-size: 7px;
        gap: 1px 6px;
        order: 1;
    }
    
    #energy-leaderboard {
        width: 100px;
        padding: 4px 6px;
        order: 2;
    }
    
    #energy-leaderboard .leaderboard-title {
        font-size: 8px;
        margin-bottom: 3px;
    }
    
    .energy-leaderboard-entry {
        font-size: 9px;
    }
}

/* ============================================
   LANDSCAPE / TOUCH DEVICE CHAT
   ============================================ */

/* Touch devices - hide default chat container, use mobile overlay instead */
@media screen and (pointer: coarse) {
    #chat-container {
        display: none !important;
    }
}

/* ============================================
   MOBILE WEAPON SLOTS (via JS .is-mobile class)
   ============================================ */

/* Weapon Slots - Right middle area for mobile */
.is-mobile #weapon-slots {
    bottom: auto;
    top: 50%;
    right: 10px;
    left: auto;
    transform: translateY(-50%);
    gap: 8px;
    flex-direction: column;
}

.is-mobile .weapon-slot {
    width: 42px;
    height: 42px;
}

.is-mobile .slot-content {
    font-size: 10px;
}

.is-mobile .slot-content img {
    width: 28px !important;
    height: 28px !important;
}

/* Hide slot details (name & ammo) on mobile - prevents touch blocking */
.is-mobile .slot-details {
    display: none !important;
}

/* Weapon Name - tiny, under weapon slots */
.is-mobile #weapon-name {
    top: calc(50% + 60px);
    right: 10px;
    bottom: auto;
    left: auto;
    transform: none;
    font-size: 7px;
    padding: 2px 4px;
    letter-spacing: 0.5px;
    max-width: 50px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Reload Bar - centered on mobile */
.is-mobile #reload-bar-container,
body.is-mobile #reload-bar-container {
    width: 150px;
    height: 10px;
    bottom: 140px;
    top: auto;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.is-mobile #reload-text,
body.is-mobile #reload-text {
    font-size: 9px;
    top: -16px;
}

.is-mobile #reload-percent,
body.is-mobile #reload-percent {
    font-size: 8px;
}

/* Mobile Chat Overlay */
#mobile-chat-overlay {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 500;
    pointer-events: auto;
}

#mobile-chat-overlay.visible {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

#mobile-chat-panel {
    background: linear-gradient(180deg, rgba(15, 15, 15, 0.98) 0%, rgba(10, 10, 10, 0.99) 100%);
    border-top: 2px solid #ff0a0a;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
    animation: mobile-chat-slide-up 0.2s ease-out;
}

@keyframes mobile-chat-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#mobile-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 10, 10, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mobile-chat-header .chat-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    color: #ff0a0a;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#mobile-chat-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 4px;
    color: #ff4444;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#mobile-chat-close:active {
    background: rgba(255, 0, 0, 0.4);
    transform: scale(0.95);
}

#mobile-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    max-height: 40vh;
    min-height: 100px;
}

#mobile-chat-messages .chat-message {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 8px;
    margin-bottom: 4px;
    border-left: 2px solid #333;
    border-radius: 0 3px 3px 0;
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.3;
}

#mobile-chat-messages .chat-message .player-name {
    color: #ff0a0a;
    font-weight: bold;
}

#mobile-chat-messages .chat-message.system-message {
    color: #888;
    font-style: italic;
    border-left-color: #0af;
}

#mobile-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#mobile-chat-input {
    flex: 1;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 10, 10, 0.3);
    border-radius: 4px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    outline: none;
}

#mobile-chat-input:focus {
    border-color: #ff0a0a;
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.2);
}

#mobile-chat-input::placeholder {
    color: #666;
}

#mobile-chat-send {
    padding: 10px 16px;
    background: linear-gradient(135deg, #ff0a0a 0%, #cc0000 100%);
    border: none;
    border-radius: 4px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#mobile-chat-send:active {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    transform: scale(0.95);
}

#mobile-chat-empty {
    text-align: center;
    color: #555;
    font-style: italic;
    padding: 30px;
    font-size: 13px;
}

/* ============================================
   RUST UI / SHOP MOBILE ADAPTATIONS
   ============================================ */

/* Slot selection for tap-to-swap */
.rust-slot.selected,
.rust-slot.mobile-selected {
    outline: 3px solid #0af !important;
    outline-offset: -3px;
    background: rgba(0, 170, 255, 0.25) !important;
    animation: slot-pulse 0.8s ease-in-out infinite;
}

@keyframes slot-pulse {
    0%, 100% { outline-color: #0af; box-shadow: 0 0 8px rgba(0, 170, 255, 0.5); }
    50% { outline-color: #0ff; box-shadow: 0 0 15px rgba(0, 255, 255, 0.7); }
}

/* Mobile inventory hint */
@media screen and (pointer: coarse) {
    .rust-slot {
        min-height: 60px;
        touch-action: manipulation;
    }
    
    /* Skills - Touch devices: compact row layout */
    .skills-grid {
        gap: 8px !important;
    }
    
    .skill-icon {
        width: 50px !important;
        min-width: 50px !important;
        font-size: 22px !important;
    }
    
    .skill-info {
        padding: 10px 12px !important;
        gap: 4px !important;
    }
    
    .skill-name { font-size: 13px !important; }
    .skill-desc { font-size: 11px !important; white-space: normal !important; }
    .skill-effect { font-size: 12px !important; }
    .skill-progress-container { height: 14px !important; }
    .skill-progress-text { font-size: 10px !important; }
    
    .skill-action {
        min-width: 80px !important;
        width: 80px !important;
        padding: 8px !important;
        gap: 6px !important;
    }
    
    .skill-cost { font-size: 13px !important; }
    .skill-btn { padding: 8px 12px !important; font-size: 10px !important; width: 100% !important; text-align: center !important; }
    .skill-maxed { font-size: 10px !important; }
    
    .skills-xp-badge { padding: 6px 12px !important; }
    .skills-xp-badge .xp-amount { font-size: 16px !important; }
}

@media screen and (max-width: 1024px) and (pointer: coarse) {
    #rust-ui {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        background: rgba(10, 10, 12, 0.85) !important;
        border: none;
        border-radius: 0;
    }
    
    .rust-header {
        padding: 12px 15px;
    }
    
    .rust-title {
        font-size: 16px;
        letter-spacing: 2px;
    }
    
    .rust-close-hint {
        font-size: 9px;
    }
    
    .rust-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 5px;
    }
    
    .rust-tab {
        padding: 10px 14px;
        font-size: 10px;
        letter-spacing: 1px;
        white-space: nowrap;
    }
    
    #rust-content {
        padding: 12px 15px;
    }
    
    .rust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .rust-slot {
        height: 75px;
    }
    
    /* Skills Tab - Tablet: inherit touch sizes, no extra overrides needed */
}

@media screen and (max-width: 768px) and (pointer: coarse) {
    #rust-ui {
        width: 100vw;
        height: 100vh;
        top: 0;
        left: 0;
        transform: none;
        clip-path: none;
        border-radius: 0;
    }
    
    .rust-header {
        padding: 10px 12px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: #0a0a0a;
    }
    
    .rust-title {
        font-size: 14px;
    }
    
    .rust-tabs {
        position: sticky;
        top: 45px;
        z-index: 10;
        background: #0a0a0a;
    }
    
    .rust-tab {
        padding: 8px 12px;
        font-size: 9px;
    }
    
    #rust-content {
        padding: 10px 12px;
        padding-bottom: 80px;
    }
    
    .rust-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .rust-slot {
        height: 65px;
    }
    
    .rust-recipe {
        padding: 10px 12px;
        margin-bottom: 6px;
    }
    
    .recipe-btn {
        padding: 6px 12px;
        font-size: 10px;
    }
    
    /* Skills Tab Mobile - compact */
    .skills-header {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        margin-bottom: 8px;
        padding-bottom: 8px;
    }
    
    .skills-xp-badge {
        padding: 5px 10px;
    }
    
    .skills-xp-badge .xp-amount { font-size: 14px; }
    
    .skill-icon {
        width: 44px !important;
        min-width: 44px !important;
        font-size: 18px !important;
    }
    
    .skill-info { padding: 8px 10px !important; }
    .skill-name { font-size: 12px !important; }
    .skill-desc { font-size: 9px !important; }
    .skill-effect { font-size: 10px !important; }
    .skill-progress-container { height: 12px !important; }
    .skill-progress-text { font-size: 8px !important; }
    
    .skill-action {
        min-width: 70px !important;
        width: 70px !important;
        padding: 6px !important;
        gap: 4px !important;
    }
    
    .skill-cost { font-size: 11px !important; }
    .skill-btn { padding: 6px 8px !important; font-size: 9px !important; }
    .skill-maxed { font-size: 9px !important; }
}

/* Platform visibility utilities */
.mobile-only {
    display: none !important;
}

@media screen and (pointer: coarse) {
    .pc-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
}

/* Mobile close button */
.rust-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 0, 0, 0.4);
    border-radius: 4px;
    color: #ff4444;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.rust-close-btn:active {
    background: rgba(255, 0, 0, 0.4);
    transform: scale(0.95);
}

@media screen and (pointer: coarse) {
    .rust-close-btn {
        display: flex;
    }
}

@media screen and (max-width: 480px) and (pointer: coarse) {
    .rust-header {
        padding: 8px 10px;
    }
    
    .rust-title {
        font-size: 12px;
        letter-spacing: 1px;
    }
    
    .rust-close-hint {
        display: none !important;
    }
    
    .rust-close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    
    .rust-tab {
        padding: 6px 10px;
        font-size: 8px;
    }
    
    #rust-content {
        padding: 8px 10px;
    }
    
    .rust-grid {
        grid-template-columns: 1fr 1fr;
        gap: 5px;
    }
    
    .rust-slot {
        height: 55px;
        font-size: 12px;
    }
    
    .rust-recipe {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Skills - smallest screens */
    .skills-xp-badge .xp-amount { font-size: 13px; }
    .skills-xp-badge { padding: 4px 8px; gap: 5px; }
    .skills-subtitle { font-size: 8px; margin-bottom: 5px; }
    .skills-grid { gap: 5px !important; }
    .skill-icon { width: 36px !important; min-width: 36px !important; font-size: 16px !important; min-height: 40px !important; }
    .skill-info { padding: 5px 8px !important; gap: 2px !important; }
    .skill-name { font-size: 10px !important; }
    .skill-desc { font-size: 8px !important; }
    .skill-effect { font-size: 9px !important; }
    .skill-progress-container { height: 8px !important; margin-top: 2px !important; }
    .skill-progress-text { font-size: 7px !important; }
    .skill-action { min-width: 58px !important; width: 58px !important; padding: 5px !important; gap: 3px !important; }
    .skill-cost { font-size: 10px !important; }
    .skill-btn { font-size: 8px !important; padding: 5px 6px !important; }
    .skill-maxed { font-size: 8px !important; }
}

/* ============================================
   SETTINGS MENU & CONTROLS PANEL
   Madness Combat Style Redesign
   ============================================ */

/* Shared header styles */
.settings-menu-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 0;
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 10, 10, 0.15) 50%, transparent 100%);
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, transparent, #cc0000, transparent) 1;
}

.settings-menu-header::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 50, 50, 0.5), transparent);
    filter: blur(2px);
}

.settings-menu-title {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 
        0 0 10px rgba(255, 10, 10, 0.5),
        0 0 20px rgba(255, 10, 10, 0.3);
}

.settings-menu-close {
    display: none;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(255, 10, 10, 0.3) 0%, rgba(100, 0, 0, 0.4) 100%);
    border: 2px solid rgba(255, 10, 10, 0.6);
    color: #ff4444;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.15s ease;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    box-shadow: 
        0 0 15px rgba(255, 10, 10, 0.3),
        inset 0 0 20px rgba(255, 10, 10, 0.1);
}

.settings-menu-close:hover,
.settings-menu-close:active {
    background: linear-gradient(135deg, rgba(255, 30, 30, 0.5) 0%, rgba(150, 0, 0, 0.6) 100%);
    border-color: #ff5555;
    color: #fff;
    box-shadow: 
        0 0 25px rgba(255, 10, 10, 0.5),
        inset 0 0 30px rgba(255, 10, 10, 0.2);
    transform: translateY(-50%) scale(1.05);
}

/* Settings menu actions container */
.settings-menu-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.settings-menu-actions .settings-menu-close {
    position: static;
    transform: none;
}

/* ESC Fullscreen button */
.esc-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    border: 2px solid #555;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
    position: relative;
}

.esc-fullscreen-btn:hover {
    background: linear-gradient(135deg, #555 0%, #3a3a3a 100%);
    border-color: #777;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.esc-fullscreen-btn .fullscreen-icon {
    width: 18px;
    height: 18px;
}

.esc-fullscreen-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 6px 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    white-space: nowrap;
    border: 1px solid #555;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 100;
}

.esc-fullscreen-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Compact Settings Layout */
.settings-compact {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 10, 10, 0.1);
    margin-bottom: 10px;
}

.settings-compact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: rgba(20, 20, 20, 0.8);
    border-left: 2px solid rgba(255, 10, 10, 0.4);
}

.settings-compact-row span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    letter-spacing: 1px;
    min-width: 35px;
}

.settings-compact-row input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #2a2a2a;
    border-radius: 0;
    border: 1px solid #3a3a3a;
}

.settings-compact-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ff4040 0%, #cc0000 100%);
    border: 1px solid #ff5555;
    cursor: pointer;
}

.settings-compact-row #vol-value,
.settings-compact-row #sens-value {
    font-size: 12px;
    min-width: 36px;
    color: #ff5555;
    text-align: right;
}

.settings-compact-toggles {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.compact-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    letter-spacing: 0.5px;
}

.compact-toggle:hover {
    background: rgba(35, 25, 25, 0.95);
    border-color: #444;
}

.compact-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    -webkit-appearance: none;
    appearance: none;
    background: #1a1a1a;
    border: 1px solid #444;
    cursor: pointer;
    position: relative;
}

.compact-toggle input[type="checkbox"]:checked {
    background: linear-gradient(135deg, rgba(180, 0, 0, 0.6) 0%, rgba(100, 0, 0, 0.8) 100%);
    border-color: #cc0000;
}

.compact-toggle input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff5555;
    font-size: 10px;
    font-weight: bold;
}

.compact-toggle:has(input:checked) {
    color: #ff5555;
    border-color: rgba(255, 10, 10, 0.3);
}

.compact-color {
    display: flex;
    align-items: center;
    padding: 4px;
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid #333;
    cursor: pointer;
}

.compact-color input[type="color"] {
    width: 24px;
    height: 24px;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.compact-color input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.compact-color input[type="color"]::-webkit-color-swatch {
    border: 1px solid #555;
}

/* Connection Switcher (ESC menu) */
.settings-connection {
    position: relative;
    z-index: 1;
    padding: 8px 12px;
    margin-bottom: 8px;
    border-top: 1px solid rgba(255, 10, 10, 0.15);
}

.conn-switch-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: #555;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.conn-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.conn-switch-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.conn-switch-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.5px;
    min-width: 28px;
}

.conn-btn {
    padding: 3px 8px;
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid #333;
    color: #666;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.conn-btn:hover {
    background: rgba(35, 25, 25, 0.95);
    border-color: #444;
}

.conn-btn.active {
    background: linear-gradient(135deg, rgba(180, 0, 0, 0.4) 0%, rgba(100, 0, 0, 0.6) 100%);
    border-color: #cc0000;
    color: #ff5555;
    box-shadow: 0 0 6px rgba(255, 10, 10, 0.2);
}

.conn-apply-btn {
    padding: 3px 12px;
    background: linear-gradient(135deg, rgba(0, 100, 0, 0.4) 0%, rgba(0, 60, 0, 0.6) 100%);
    border: 1px solid #0a0;
    color: #0f0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.conn-apply-btn:hover {
    background: linear-gradient(135deg, rgba(0, 140, 0, 0.5) 0%, rgba(0, 80, 0, 0.7) 100%);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
}

/* Language Selector */
.settings-lang-row {
    position: relative;
    z-index: 1;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 10, 10, 0.15);
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
    min-width: 150px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444;
    color: #ccc;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.lang-toggle:hover {
    border-color: #c00;
    color: #fff;
}

.lang-toggle-flag { font-size: 16px; }
.lang-toggle-arrow { margin-left: auto; font-size: 11px; color: #666; transition: transform 0.2s; }
.lang-dropdown.open .lang-toggle-arrow { transform: rotate(180deg); }

.lang-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 2px;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid #444;
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    scrollbar-width: thin;
    scrollbar-color: #c00 #111;
}

.lang-dropdown.open .lang-list { display: block; }

/* In main menu, dropdown opens downward */
.menu-lang-row .lang-list {
    bottom: auto;
    top: 100%;
    margin-top: 2px;
    margin-bottom: 0;
}

.lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    color: #999;
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    white-space: nowrap;
}

.lang-item:hover {
    background: rgba(200, 0, 0, 0.15);
    color: #fff;
}

.lang-item.active {
    background: rgba(200, 0, 0, 0.25);
    color: #f55;
}

.lang-item-flag { font-size: 15px; }

/* Main menu language row */
.menu-lang-row {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.menu-lang-row .lang-dropdown {
    min-width: 180px;
}

.menu-lang-row .lang-toggle {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    font-size: 14px;
}

.menu-lang-row .lang-toggle:hover {
    border-color: #c00;
}

/* Settings section */
.settings-section {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Volume row spans full width */
.settings-section .settings-row:first-child {
    grid-column: 1 / -1;
}

/* Settings Row - Madness Combat Style */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.9) 0%, rgba(15, 15, 15, 0.95) 100%);
    border: 1px solid rgba(255, 10, 10, 0.15);
    border-left: 3px solid rgba(255, 10, 10, 0.4);
    position: relative;
    transition: all 0.15s ease;
    clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

.settings-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #cc0000 0%, #660000 100%);
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.settings-row:hover {
    background: linear-gradient(90deg, rgba(30, 15, 15, 0.95) 0%, rgba(20, 10, 10, 0.98) 100%);
    border-color: rgba(255, 10, 10, 0.3);
}

.settings-row:hover::before {
    opacity: 1;
}

.settings-row span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Custom Range Slider - Madness Style */
.settings-row input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    background: linear-gradient(90deg, #1a1a1a 0%, #252525 100%);
    border: 1px solid #333;
    border-radius: 0;
    outline: none;
    cursor: pointer;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.settings-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff3333 0%, #cc0000 50%, #990000 100%);
    border: 2px solid #ff4444;
    cursor: pointer;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.5);
    transition: all 0.1s ease;
}

.settings-row input[type="range"]::-webkit-slider-thumb:hover {
    background: linear-gradient(135deg, #ff5555 0%, #dd2222 50%, #aa0000 100%);
    box-shadow: 0 0 15px rgba(255, 10, 10, 0.7);
    transform: scale(1.1);
}

.settings-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff3333 0%, #cc0000 50%, #990000 100%);
    border: 2px solid #ff4444;
    cursor: pointer;
    border-radius: 0;
}

/* Volume Value Display */
.settings-row #vol-value {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 13px;
    color: #ff4444;
    min-width: 42px;
    text-align: right;
    text-shadow: 0 0 8px rgba(255, 10, 10, 0.5);
}

/* Custom Checkbox - Tactical Toggle */
.settings-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 24px;
    background: linear-gradient(90deg, #1a1a1a 0%, #252525 100%);
    border: 2px solid #333;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
}

.settings-row input[type="checkbox"]::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border: 1px solid #666;
    transition: all 0.2s ease;
    clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px);
}

.settings-row input[type="checkbox"]:checked {
    background: linear-gradient(90deg, rgba(200, 0, 0, 0.3) 0%, rgba(100, 0, 0, 0.4) 100%);
    border-color: #cc0000;
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.3);
}

.settings-row input[type="checkbox"]:checked::before {
    left: calc(100% - 20px);
    background: linear-gradient(135deg, #ff3333 0%, #cc0000 100%);
    border-color: #ff4444;
    box-shadow: 0 0 8px rgba(255, 10, 10, 0.6);
}

/* Custom Color Picker */
.settings-row input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 40px;
    height: 28px;
    padding: 0;
    border: 2px solid #444;
    background: #1a1a1a;
    cursor: pointer;
    clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    transition: all 0.15s ease;
}

.settings-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.settings-row input[type="color"]::-webkit-color-swatch {
    border: none;
    clip-path: polygon(2px 0, 100% 0, 100% calc(100% - 2px), calc(100% - 2px) 100%, 0 100%, 0 2px);
}

.settings-row input[type="color"]:hover {
    border-color: #cc0000;
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.3);
}

/* PC Controls inline (hidden on mobile) */
.settings-controls-pc {
    border-top: 2px solid;
    border-image: linear-gradient(90deg, transparent, rgba(255, 10, 10, 0.3), transparent) 1;
    margin-top: 14px;
    padding-top: 12px;
    position: relative;
    z-index: 1;
}

.settings-controls-pc .controls-title {
    font-family: 'Rajdhani', sans-serif;
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: none;
}

.controls-list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 11px;
    color: #fff;
}

.controls-list-inline span {
    padding: 3px 0;
    transition: color 0.15s ease;
}

.controls-list-inline span:hover {
    color: #ccc;
}

.controls-list-inline b {
    color: #fff;
    font-weight: 700;
    text-shadow: none;
}

/* Mobile-only elements */
.mobile-only {
    display: none;
}

@media screen and (pointer: coarse) {
    .mobile-only {
        display: block;
    }
    
    .settings-controls-pc {
        display: none;
    }
}

/* Settings buttons container */
.settings-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    position: relative;
    z-index: 1;
    border-top: 2px solid;
    border-image: linear-gradient(90deg, transparent, rgba(255, 10, 10, 0.2), transparent) 1;
}

.settings-buttons .menu-btn {
    width: 100%;
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 12px 20px;
    transition: all 0.15s ease;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.settings-buttons .menu-btn.primary {
    background: linear-gradient(135deg, rgba(139,0,0,0.3) 0%, #0a0a0a 100%);
    border: 2px solid #8b0000;
    color: #fff;
    box-shadow: 
        0 0 15px rgba(255, 10, 10, 0.2),
        inset 0 0 20px rgba(255, 10, 10, 0.05);
}

.settings-buttons .menu-btn.primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #ff0a0a;
    opacity: 0.3;
    animation: primary-pulse 2s ease-in-out infinite;
}

@keyframes primary-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

.settings-buttons .menu-btn.primary:hover {
    background: linear-gradient(135deg, rgba(255,10,10,0.3) 0%, rgba(139,0,0,0.3) 100%);
    border-color: #ff0a0a;
    box-shadow: 
        -5px 0 20px rgba(255, 10, 10, 0.4),
        inset 0 0 20px rgba(255, 10, 10, 0.1);
}

.settings-buttons .menu-btn.danger {
    background: linear-gradient(180deg, #5a1a1a 0%, #3d0d0d 100%);
    border: 2px solid #8a3030;
    color: #ff6666;
    box-shadow: 
        0 0 15px rgba(255, 10, 10, 0.15),
        inset 0 0 20px rgba(255, 10, 10, 0.05);
}

.settings-buttons .menu-btn.danger:hover {
    background: linear-gradient(180deg, #7a2a2a 0%, #5a1a1a 100%);
    border-color: #aa4040;
    color: #ff8888;
    box-shadow: 
        0 0 25px rgba(255, 10, 10, 0.3),
        inset 0 0 30px rgba(255, 10, 10, 0.1);
}

.settings-buttons .menu-btn:active {
    transform: scale(0.98);
}

/* Controls Panel */
#controls-panel {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    border: 2px solid #1a1a1a;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    padding: 15px;
    color: #fff;
    z-index: 2001;
    pointer-events: auto;
    font-family: 'Rajdhani', sans-serif;
}

.controls-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.control-item .key {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    border: 1px solid #444;
}

.control-item .desc {
    color: #aaa;
    font-size: 11px;
}

.controls-tip {
    color: #ff0;
    font-size: 10px;
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid #333;
    margin-top: 8px;
}

#controls-panel .menu-btn {
    width: 100%;
    margin-top: 8px;
}

/* ============================================
   MOBILE STYLES
   ============================================ */

@media screen and (pointer: coarse) {
    .settings-menu-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media screen and (max-width: 768px) and (pointer: coarse) {
    /* ESC Menu Mobile - Full Madness Combat Redesign */
    #settings-menu,
    #controls-panel {
        width: 92vw;
        max-width: 360px;
        padding: 16px;
        background: linear-gradient(180deg, #0c0c0c 0%, #080808 100%);
        border: 2px solid rgba(255, 10, 10, 0.3);
        box-shadow: 
            0 0 40px rgba(0, 0, 0, 0.95),
            0 0 80px rgba(255, 10, 10, 0.15),
            inset 0 0 60px rgba(0, 0, 0, 0.5);
        clip-path: polygon(
            0 0,
            calc(100% - 20px) 0,
            100% 20px,
            100% 100%,
            20px 100%,
            0 calc(100% - 20px)
        );
    }
    
    #settings-menu::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, transparent, #cc0000, transparent);
        opacity: 0.8;
    }
    
    .settings-menu-header {
        margin-bottom: 14px;
        padding: 10px 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255, 10, 10, 0.12) 50%, transparent 100%);
    }
    
    .settings-menu-title {
        font-size: 18px;
        letter-spacing: 3px;
    }
    
    .settings-menu-close {
        width: 44px;
        height: 44px;
        font-size: 18px;
        background: linear-gradient(135deg, rgba(255, 10, 10, 0.25) 0%, rgba(80, 0, 0, 0.35) 100%);
        border: 2px solid rgba(255, 10, 10, 0.5);
        box-shadow: 
            0 0 12px rgba(255, 10, 10, 0.25),
            inset 0 0 15px rgba(255, 10, 10, 0.1);
    }
    
    .settings-menu-close:active {
        transform: translateY(-50%) scale(0.95);
        background: linear-gradient(135deg, rgba(255, 30, 30, 0.4) 0%, rgba(120, 0, 0, 0.5) 100%);
    }
    
    .settings-section {
        gap: 8px;
    }
    
    /* Settings Rows - Mobile Optimized */
    #settings-menu .settings-row {
        padding: 14px 16px;
        min-height: 52px;
        background: linear-gradient(90deg, rgba(18, 18, 18, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
        border: 1px solid rgba(255, 10, 10, 0.12);
        border-left: 4px solid rgba(255, 10, 10, 0.5);
        clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
        gap: 12px;
    }
    
    #settings-menu .settings-row::before {
        width: 4px;
        background: linear-gradient(180deg, #dd0000 0%, #880000 100%);
    }
    
    #settings-menu .settings-row:active {
        background: linear-gradient(90deg, rgba(35, 15, 15, 0.98) 0%, rgba(25, 10, 10, 1) 100%);
        border-color: rgba(255, 10, 10, 0.25);
    }
    
    #settings-menu .settings-row span {
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 0.8px;
        color: #ddd;
    }
    
    /* Volume Slider - Mobile Touch Optimized */
    #settings-menu .settings-row input[type="range"] {
        height: 12px;
        flex: 1;
        min-width: 100px;
        background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%);
        border: 1px solid #3a3a3a;
    }
    
    #settings-menu .settings-row input[type="range"]::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
        background: linear-gradient(135deg, #ff4040 0%, #cc0000 50%, #990000 100%);
        border: 3px solid #ff5555;
        box-shadow: 
            0 0 15px rgba(255, 10, 10, 0.6),
            inset 0 0 8px rgba(255, 255, 255, 0.1);
    }
    
    #settings-menu .settings-row #vol-value {
        font-size: 15px;
        min-width: 48px;
        color: #ff5555;
        font-weight: 700;
    }
    
    /* Checkbox Toggle - Mobile Touch Optimized */
    #settings-menu .settings-row input[type="checkbox"] {
        width: 56px;
        height: 32px;
        min-width: 56px;
        background: linear-gradient(90deg, #1a1a1a 0%, #252525 100%);
        border: 2px solid #3a3a3a;
        clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
    }
    
    #settings-menu .settings-row input[type="checkbox"]::before {
        width: 22px;
        height: 22px;
        left: 3px;
        background: linear-gradient(135deg, #666 0%, #444 100%);
        border: 1px solid #777;
        clip-path: polygon(4px 0, 100% 0, 100% calc(100% - 4px), calc(100% - 4px) 100%, 0 100%, 0 4px);
    }
    
    #settings-menu .settings-row input[type="checkbox"]:checked {
        background: linear-gradient(90deg, rgba(180, 0, 0, 0.35) 0%, rgba(100, 0, 0, 0.45) 100%);
        border-color: #cc0000;
        box-shadow: 0 0 15px rgba(255, 10, 10, 0.35);
    }
    
    #settings-menu .settings-row input[type="checkbox"]:checked::before {
        left: calc(100% - 27px);
        background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
        border-color: #ff5555;
        box-shadow: 0 0 12px rgba(255, 10, 10, 0.7);
    }
    
    /* Color Picker - Mobile */
    #settings-menu .settings-row input[type="color"] {
        width: 48px;
        height: 36px;
        border: 2px solid #4a4a4a;
    }
    
    #settings-menu .settings-row input[type="color"]:active {
        border-color: #cc0000;
        box-shadow: 0 0 12px rgba(255, 10, 10, 0.4);
    }
    
    /* Disconnect Button - Mobile */
    .settings-buttons {
        margin-top: 14px;
        gap: 10px;
    }
    
    .settings-buttons .menu-btn {
        padding: 16px 20px;
        font-size: 15px;
        min-height: 52px;
        font-weight: 700;
        letter-spacing: 2px;
        clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    }
    
    .settings-buttons .menu-btn.danger {
        background: linear-gradient(180deg, #5a1a1a 0%, #3a0d0d 100%);
        border: 2px solid #8a3030;
        box-shadow: 
            0 0 20px rgba(255, 10, 10, 0.2),
            inset 0 0 30px rgba(255, 10, 10, 0.1);
    }
    
    .settings-buttons .menu-btn.danger:active {
        background: linear-gradient(180deg, #7a2a2a 0%, #4a1010 100%);
        transform: scale(0.98);
    }
    
    .controls-list {
        gap: 6px;
    }
    
    .control-item .key {
        font-size: 11px;
        min-width: 50px;
        padding: 4px 8px;
        background: rgba(255, 10, 10, 0.1);
        border: 1px solid rgba(255, 10, 10, 0.3);
    }
    
    .control-item .desc {
        font-size: 11px;
        color: #bbb;
    }
}

/* Landscape mobile - Madness Combat Style */
@media screen and (max-height: 450px) and (pointer: coarse) {
    #settings-menu,
    #controls-panel {
        width: 75vw;
        max-width: 480px;
        max-height: 92vh;
        padding: 12px 16px;
        overflow-y: auto;
        background: linear-gradient(180deg, #0c0c0c 0%, #080808 100%);
        border: 2px solid rgba(255, 10, 10, 0.25);
        box-shadow: 
            0 0 30px rgba(0, 0, 0, 0.9),
            0 0 60px rgba(255, 10, 10, 0.12);
    }
    
    .settings-menu-header {
        margin-bottom: 10px;
        padding: 8px 0;
    }
    
    .settings-menu-title {
        font-size: 15px;
        letter-spacing: 2px;
    }
    
    .settings-menu-close {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .settings-section {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
    }
    
    /* Compact settings rows for landscape */
    #settings-menu .settings-row {
        padding: 10px 12px;
        min-height: 40px;
        flex: 1 1 46%;
        min-width: 160px;
        background: linear-gradient(90deg, rgba(18, 18, 18, 0.9) 0%, rgba(12, 12, 12, 0.95) 100%);
        border-left: 3px solid rgba(255, 10, 10, 0.4);
        clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
    }
    
    #settings-menu .settings-row span {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
    
    #settings-menu .settings-row input[type="range"] {
        height: 10px;
        flex: 1;
    }
    
    #settings-menu .settings-row input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
    }
    
    #settings-menu .settings-row input[type="checkbox"] {
        width: 44px;
        height: 24px;
        min-width: 44px;
    }
    
    #settings-menu .settings-row input[type="checkbox"]::before {
        width: 16px;
        height: 16px;
    }
    
    #settings-menu .settings-row input[type="checkbox"]:checked::before {
        left: calc(100% - 20px);
    }
    
    #settings-menu .settings-row input[type="color"] {
        width: 36px;
        height: 28px;
    }
    
    #settings-menu .settings-row #vol-value {
        font-size: 12px;
        min-width: 38px;
    }
    
    .settings-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
    }
    
    .settings-buttons .menu-btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 14px;
        font-size: 12px;
        min-height: 38px;
        letter-spacing: 1px;
    }
    
    /* Controls panel landscape */
    .controls-list {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 4px;
    }
    
    .control-item {
        padding: 3px 0;
        gap: 6px;
    }
    
    .control-item .key {
        font-size: 10px;
        min-width: 42px;
        padding: 3px 6px;
        background: rgba(255, 10, 10, 0.08);
        border: 1px solid rgba(255, 10, 10, 0.2);
    }
    
    .control-item .desc {
        font-size: 10px;
        color: #aaa;
    }
    
    .controls-tip {
        font-size: 10px;
        padding: 6px 0;
        margin-top: 6px;
        color: #ff6;
    }
    
    #controls-panel .menu-btn {
        padding: 10px 14px;
        font-size: 12px;
        min-height: 36px;
        margin-top: 6px;
    }
}

/* ============================================
   NOTIFICATIONS MOBILE
   ============================================ */

@media screen and (max-width: 768px) and (pointer: coarse) {
    /* Notifications - Bottom Center, thin style */
    #hud-notifications {
        bottom: 60px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: 280px;
        max-height: 80px;
        overflow: hidden;
        flex-direction: column-reverse;
        align-items: center;
        gap: 2px;
    }
    
    .hud-notification {
        padding: 2px 8px 2px 6px;
        gap: 4px;
        min-width: auto;
        max-width: 200px;
        background: rgba(0, 0, 0, 0.25) !important;
        border: none !important;
        border-left: 3px solid !important;
        border-radius: 2px;
        font-size: 7px;
        box-shadow: none;
    }
    
    .hud-notification::before {
        display: none;
    }
    
    .notif-icon {
        font-size: 9px;
        min-width: 12px;
    }
    
    .notif-label {
        display: none;
    }
    
    .notif-text {
        font-size: 7px;
    }
    
    .notif-amount {
        font-size: 8px;
    }
}

@media screen and (max-width: 480px) and (pointer: coarse) {
    /* Notifications - Bottom Center, ultra compact */
    #hud-notifications {
        bottom: 50px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        max-width: 240px;
        max-height: 70px;
        overflow: hidden;
        flex-direction: column-reverse;
        align-items: center;
        gap: 2px;
    }
    
    .hud-notification {
        padding: 2px 6px 2px 4px;
        gap: 3px;
        min-width: auto;
        max-width: 180px;
        border: none !important;
        border-left: 2px solid !important;
        border-radius: 1px;
        margin-bottom: 0;
        background: rgba(0, 0, 0, 0.2) !important;
        box-shadow: none;
    }
    
    .hud-notification::before {
        display: none;
    }
    
    .notif-icon {
        font-size: 8px;
        min-width: 10px;
    }
    
    .notif-label {
        display: none;
    }
    
    .notif-text {
        font-size: 6px;
        line-height: 1.1;
    }
    
    .notif-amount {
        font-size: 7px;
    }
    
    .notif-content {
        gap: 0px;
    }
}

/* ============================================
   WEAPON SLOTS MOBILE CLICKABLE
   ============================================ */

@media screen and (pointer: coarse) {
    .weapon-slot {
        pointer-events: auto;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Ensure child elements don't intercept touches */
    .weapon-slot * {
        pointer-events: none;
    }
    
    .weapon-slot:active {
        transform: skew(-5deg) scale(0.95);
        opacity: 0.8;
    }
    
    .weapon-slot.active:active {
        transform: skew(-5deg) scale(1.05);
    }
}

/* ============================================
   MOBILE INTERACTION BUTTON AREA
   ============================================ */

#mobile-interact-btn {
    display: none;
}

@media screen and (pointer: coarse) {
    #mobile-interact-btn {
        display: none;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        padding: 15px 30px;
        background: rgba(0, 255, 0, 0.2);
        border: 2px solid #0f0;
        border-radius: 8px;
        color: #0f0;
        font-family: 'Orbitron', sans-serif;
        font-size: 14px;
        font-weight: 600;
        letter-spacing: 2px;
        text-transform: uppercase;
        pointer-events: auto;
        cursor: pointer;
        z-index: 100;
        animation: interact-pulse 1.5s ease-in-out infinite;
        -webkit-tap-highlight-color: transparent;
    }
    
    #mobile-interact-btn.visible {
        display: block;
    }
    
    #mobile-interact-btn:active {
        transform: translate(-50%, -50%) scale(0.95);
        background: rgba(0, 255, 0, 0.4);
    }
    
    @keyframes interact-pulse {
        0%, 100% {
            box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
        }
        50% {
            box-shadow: 0 0 25px rgba(0, 255, 0, 0.6);
        }
    }
    
    /* Hide PC revive hint on mobile */
    #revive-hint {
        display: none !important;
    }
}

/* ============================================
   SEAMLESS RECONNECT OVERLAY
   Madness Combat Style - matches ESC menu colors
   ============================================ */

#reconnect-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    backdrop-filter: blur(3px);
}

.reconnect-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 50px;
    background: linear-gradient(180deg, rgba(25, 15, 15, 0.98) 0%, rgba(15, 8, 8, 0.99) 100%);
    border: 2px solid #3a1515;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.9),
        0 0 60px rgba(200, 0, 0, 0.15),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.reconnect-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(200, 0, 0, 0.2);
    border-top-color: #cc0000;
    border-radius: 50%;
    animation: reconnect-spin 1s linear infinite;
    margin-bottom: 20px;
}

#reconnect-overlay.error .reconnect-spinner {
    border-top-color: #ff3333;
    animation: none;
    border-color: rgba(255, 50, 50, 0.3);
}

@keyframes reconnect-spin {
    to { transform: rotate(360deg); }
}

.reconnect-text {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ff3333;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-shadow: 
        0 0 10px rgba(255, 10, 10, 0.5),
        0 0 20px rgba(255, 10, 10, 0.3);
}

#reconnect-overlay.error .reconnect-text {
    color: #ff5555;
    text-shadow: 0 0 15px rgba(255, 50, 50, 0.6);
}

.reconnect-attempt {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

#reconnect-overlay.error .reconnect-attempt {
    color: #aaa;
}

/* Reload button - Madness Combat Style */
.reconnect-reload-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #ccc;
    background: linear-gradient(180deg, rgba(40, 20, 20, 0.9) 0%, rgba(25, 12, 12, 0.95) 100%);
    border: 1px solid #4a2020;
    padding: 10px 30px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.15s ease;
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.reconnect-reload-btn:hover {
    background: linear-gradient(180deg, rgba(80, 20, 20, 0.95) 0%, rgba(50, 15, 15, 0.98) 100%);
    border-color: #cc0000;
    color: #fff;
    box-shadow: 0 0 15px rgba(200, 0, 0, 0.3);
}

.reconnect-reload-btn:active {
    transform: scale(0.98);
    background: linear-gradient(180deg, rgba(100, 25, 25, 0.95) 0%, rgba(60, 18, 18, 0.98) 100%);
}

/* Pulse animation for the border */
#reconnect-overlay:not(.error) .reconnect-content {
    animation: reconnect-pulse 2s ease-in-out infinite;
}

@keyframes reconnect-pulse {
    0%, 100% {
        border-color: #3a1515;
        box-shadow: 
            0 0 30px rgba(0, 0, 0, 0.9),
            0 0 60px rgba(200, 0, 0, 0.15),
            inset 0 0 30px rgba(0, 0, 0, 0.5);
    }
    50% {
        border-color: #cc0000;
        box-shadow: 
            0 0 30px rgba(0, 0, 0, 0.9),
            0 0 80px rgba(200, 0, 0, 0.3),
            inset 0 0 30px rgba(0, 0, 0, 0.5);
    }
}

/* ============================================
   CASES TAB
   ============================================ */

/* Cases tab button glow */
.rust-tab[data-tab="cases"] {
    color: #d4af37;
    text-shadow: 0 0 6px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}
.rust-tab[data-tab="cases"]:hover {
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.08);
}
.rust-tab[data-tab="cases"].active {
    color: #ffd700;
    border-bottom-color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

/* Case card - madness combat style */
.case-card {
    position: relative;
    background: linear-gradient(180deg, #0a0a0a 0%, #111 40%, #0d0d0d 100%);
    border: 3px solid #ffd700;
    padding: 0;
    cursor: default;
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}
.case-card.selected {
    border-color: #ffd700;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.15);
}

/* Case showcase area - centered texture */
.case-card-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 18px;
    background: radial-gradient(ellipse at center bottom, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    position: relative;
    min-height: 130px;
}
.case-card-showcase::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.25), transparent);
}

/* Name banner - dark panel below texture */
.case-card-banner {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, #0e0e0e 0%, #080808 100%);
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}
.case-card-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}
.case-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.case-card-subtitle {
    font-size: 9px;
    color: #555;
    letter-spacing: 1px;
    font-family: 'Share Tech Mono', monospace;
    white-space: nowrap;
}

/* Cost bar */
.case-card-cost-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.4);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
}
.case-card-cost-label {
    font-size: 9px;
    color: #555;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.case-card-cost {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Open case button - aggressive madness style */
.case-open-btn {
    display: block;
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 14px 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #000;
    background: linear-gradient(180deg, #ffd700 0%, #d4af37 50%, #b8960f 100%);
    border: 3px solid #ffd700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    text-shadow: none;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.case-open-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}
.case-open-btn:hover::before {
    left: 150%;
}
@keyframes case-btn-shimmer {
    0% { background-position: 200% 0; }
    50% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
.case-open-btn:hover {
    background: linear-gradient(180deg, #ffe033 0%, #ffd700 50%, #d4af37 100%);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: #ffe033;
}
.case-open-btn:active {
    transform: scale(0.98);
    background: linear-gradient(180deg, #d4af37 0%, #b8960f 50%, #9a7d0a 100%);
}
.case-open-btn:disabled {
    background: linear-gradient(180deg, #222 0%, #1a1a1a 100%);
    color: #555;
    cursor: not-allowed;
    border-color: #333;
    text-shadow: none;
    box-shadow: none;
}

/* Rarity colors */
.rarity-covert     { color: #eb4b4b; }
.rarity-classified  { color: #d32ce6; }
.rarity-restricted  { color: #8847ff; }
.rarity-mil_spec    { color: #4b69ff; }
.rarity-consumer    { color: #b0c3d9; }

.rarity-border-covert     { border-color: #eb4b4b; }
.rarity-border-classified  { border-color: #d32ce6; }
.rarity-border-restricted  { border-color: #8847ff; }
.rarity-border-mil_spec    { border-color: #4b69ff; }
.rarity-border-consumer    { border-color: #b0c3d9; }

.rarity-bg-covert     { background: rgba(235, 75, 75, 0.12); }
.rarity-bg-classified  { background: rgba(211, 44, 230, 0.12); }
.rarity-bg-restricted  { background: rgba(136, 71, 255, 0.12); }
.rarity-bg-mil_spec    { background: rgba(75, 105, 255, 0.12); }
.rarity-bg-consumer    { background: rgba(176, 195, 217, 0.08); }

.rarity-glow-covert     { box-shadow: 0 0 12px rgba(235, 75, 75, 0.4), inset 0 0 12px rgba(235, 75, 75, 0.1); }
.rarity-glow-classified  { box-shadow: 0 0 12px rgba(211, 44, 230, 0.4), inset 0 0 12px rgba(211, 44, 230, 0.1); }
.rarity-glow-restricted  { box-shadow: 0 0 12px rgba(136, 71, 255, 0.4), inset 0 0 12px rgba(136, 71, 255, 0.1); }
.rarity-glow-mil_spec    { box-shadow: 0 0 10px rgba(75, 105, 255, 0.3), inset 0 0 10px rgba(75, 105, 255, 0.08); }
.rarity-glow-consumer    { box-shadow: 0 0 8px rgba(176, 195, 217, 0.2), inset 0 0 8px rgba(176, 195, 217, 0.05); }

/* Drop list */
.case-drop-list {
    margin-top: 15px;
}
.case-drop-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    color: #888;
    letter-spacing: 2px;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #222;
}
.case-drop-group {
    margin-bottom: 10px;
}
.case-drop-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    margin-top: 4px;
}
.case-drop-group-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    margin-bottom: 4px;
    display: inline-block;
}

/* Drop item card (CS:GO grid style) */
.case-drop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: rgba(20, 20, 20, 0.6);
    border-bottom: 3px solid var(--rarity-color, #333);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.case-drop-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.4s ease;
}
.case-drop-item:hover::before {
    left: 150%;
}
.case-drop-item:hover {
    background: rgba(30, 30, 30, 0.8);
    box-shadow: inset 0 -3px 12px -4px var(--rarity-color, #333);
    transform: translateY(-2px);
}

/* Rarity-specific hover effects */
.case-drop-item[data-rarity="covert"]:hover {
    background: rgba(235, 75, 75, 0.12);
    box-shadow: inset 0 -3px 18px -4px #eb4b4b, 0 0 12px rgba(235, 75, 75, 0.15);
}
.case-drop-item[data-rarity="covert"]::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(235, 75, 75, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.case-drop-item[data-rarity="covert"]:hover::after {
    opacity: 1;
    animation: covert-particles 1.5s ease-in-out infinite;
}
@keyframes covert-particles {
    0%, 100% { background: radial-gradient(circle at 15% 30%, rgba(235, 75, 75, 0.2) 0%, transparent 40%), radial-gradient(circle at 85% 70%, rgba(255, 100, 100, 0.15) 0%, transparent 35%); }
    33% { background: radial-gradient(circle at 25% 70%, rgba(235, 75, 75, 0.25) 0%, transparent 45%), radial-gradient(circle at 70% 20%, rgba(255, 120, 120, 0.12) 0%, transparent 30%); }
    66% { background: radial-gradient(circle at 50% 40%, rgba(255, 80, 80, 0.18) 0%, transparent 40%), radial-gradient(circle at 10% 60%, rgba(235, 75, 75, 0.15) 0%, transparent 35%); }
}

.case-drop-item[data-rarity="classified"]:hover {
    background: rgba(211, 44, 230, 0.1);
    box-shadow: inset 0 -3px 18px -4px #d32ce6, 0 0 10px rgba(211, 44, 230, 0.12);
}
.case-drop-item[data-rarity="classified"]::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(211, 44, 230, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.case-drop-item[data-rarity="classified"]:hover::after {
    opacity: 1;
    animation: classified-shimmer 2s ease-in-out infinite;
}
@keyframes classified-shimmer {
    0%, 100% { background: linear-gradient(90deg, rgba(211, 44, 230, 0.12) 0%, transparent 50%); }
    50% { background: linear-gradient(90deg, rgba(211, 44, 230, 0.06) 0%, rgba(211, 44, 230, 0.1) 30%, transparent 60%); }
}

.case-drop-item[data-rarity="restricted"]:hover {
    background: rgba(136, 71, 255, 0.08);
    box-shadow: inset 0 -3px 15px -4px #8847ff, 0 0 8px rgba(136, 71, 255, 0.1);
}

.case-drop-item[data-rarity="mil_spec"]:hover {
    background: rgba(75, 105, 255, 0.06);
    box-shadow: inset 0 -3px 12px -4px #4b69ff;
}

.case-drop-item[data-rarity="consumer"]:hover {
    background: rgba(176, 195, 217, 0.05);
    box-shadow: inset 0 -3px 10px -4px #b0c3d9;
}
.case-drop-item-icon {
    width: 56px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    border: 1px solid #222;
    flex-shrink: 0;
}
.case-drop-item-name {
    font-size: 10px;
    color: #ccc;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
}
.case-drop-item-rarity {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Case selection grid */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 5px 0;
}
.case-grid-card {
    position: relative;
    background: linear-gradient(145deg, #0d0d0d 0%, #1a1a1a 60%, #111 100%);
    border: 2px solid #333;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.case-grid-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.05), transparent);
    transition: left 0.5s ease;
}
.case-grid-card:hover::before {
    left: 140%;
}
.case-grid-card:hover {
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(212, 175, 55, 0.04);
    transform: translateY(-3px);
}
.case-grid-card:active {
    transform: translateY(0) scale(0.97);
}
.case-grid-card-icon {
    width: 100%;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    background: radial-gradient(ellipse at center bottom, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
}
.case-grid-card-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #ffd700;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
    margin-bottom: 4px;
}
.case-grid-card-cost {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}
.case-grid-card-items {
    font-size: 9px;
    color: #555;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Case detail back button */
.case-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #888;
    background: rgba(255,255,255,0.05);
    border: 1px solid #333;
    padding: 4px 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.case-back-btn:hover {
    color: #fff;
    border-color: #666;
    background: rgba(255,255,255,0.1);
}

/* Case texture (drawn via canvas) */
.case-texture-canvas {
    image-rendering: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.case-card-showcase .case-texture-canvas {
        left: 35%;
}
/* Cost item inline icon */
.cost-icon-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Share Tech Mono', monospace;
}
.cost-icon-inline canvas,
.cost-icon-inline img {
    vertical-align: middle;
}

/* Case item tooltip */
.case-item-tooltip {
    position: fixed;
    z-index: 4000;
    pointer-events: none;
    background: linear-gradient(180deg, #111 0%, #0a0a0a 100%);
    border: 1px solid #333;
    border-top: 2px solid var(--rarity-color, #888);
    padding: 10px 12px;
    max-width: 240px;
    min-width: 150px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.case-item-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.case-item-tooltip-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.case-item-tooltip-rarity {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    letter-spacing: 1.5px;
    opacity: 0.7;
    margin-bottom: 6px;
}
.case-item-tooltip-desc {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #999;
    line-height: 1.4;
    border-top: 1px solid #222;
    padding-top: 6px;
}
.case-item-tooltip-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: 5px;
}
.case-item-tooltip-stat {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: #c44;
    letter-spacing: 0.5px;
}
.case-item-tooltip-stat span {
    color: #fff;
}

/* Case error message */
.case-error-msg {
    color: #f44;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-align: center;
    padding: 6px 10px;
    margin-top: 8px;
    background: rgba(255, 68, 68, 0.08);
    border: 1px solid rgba(255, 68, 68, 0.2);
    animation: case-error-flash 0.5s ease;
}
@keyframes case-error-flash {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.5; }
    50% { opacity: 1; }
    75% { opacity: 0.5; }
}

/* ============================================
   CASE ROULETTE / SPINNER
   ============================================ */
.case-roulette-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    animation: roulette-fade-in 0.3s ease-out;
}
@keyframes roulette-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.case-roulette-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: #ffd700;
    letter-spacing: 4px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: roulette-title-pulse 2s ease-in-out infinite;
}
@keyframes roulette-title-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Spinner container */
.case-spinner-container {
    position: relative;
    width: 600px;
    max-width: 90vw;
    height: 120px;
    overflow: hidden;
    border: 2px solid #ffd700;
    background: #0a0a0a;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.2), inset 0 0 60px rgba(0, 0, 0, 0.8);
}

/* Center indicator line */
.case-spinner-indicator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: #ffd700;
    z-index: 10;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.4);
}
.case-spinner-indicator::before,
.case-spinner-indicator::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
}
.case-spinner-indicator::before {
    top: -8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #ffd700;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}
.case-spinner-indicator::after {
    bottom: -8px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid #ffd700;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.8));
}

/* Spinner strip (moves left) */
.case-spinner-strip {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    will-change: transform;
}

/* Individual spinner item */
.case-spinner-item {
    width: 120px;
    min-width: 120px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-right: 1px solid #222;
    padding: 8px;
    box-sizing: border-box;
    position: relative;
}
.case-spinner-item-icon {
    width: 55px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.case-spinner-item-name {
    font-size: 9px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Gradient fade on edges */
.case-spinner-container::before,
.case-spinner-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 80px;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}
.case-spinner-container::before {
    left: 0;
    background: linear-gradient(90deg, #0a0a0a 0%, transparent 100%);
}
.case-spinner-container::after {
    right: 0;
    background: linear-gradient(-90deg, #0a0a0a 0%, transparent 100%);
}

/* Win reveal */
.case-win-reveal {
    margin-top: 25px;
    text-align: center;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}
.case-win-reveal.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
.case-win-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 5px;
}
.case-win-rarity {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 2px;
    opacity: 0.8;
}
.case-win-close {
    margin-top: 20px;
    padding: 10px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #555;
    cursor: pointer;
    transition: all 0.2s ease;
}
.case-win-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #888;
}

/* ============================================
   CASES TAB MOBILE ADAPTATIONS
   ============================================ */
@media screen and (max-width: 768px) and (pointer: coarse) {
    .case-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }
    .case-grid-card {
        padding: 10px;
    }
    .case-grid-card-icon {
        height: 60px;
    }
    .case-grid-card-name {
        font-size: 10px;
    }
    .case-back-btn {
        font-size: 10px;
        padding: 3px 8px;
    }
    .case-card-name {
        font-size: 12px;
        letter-spacing: 1px;
    }
    .case-card-banner {
        padding: 8px 12px;
    }
    .case-card-cost-bar {
        padding: 6px 12px;
    }
    .case-open-btn {
        padding: 10px 16px;
        font-size: 11px;
        letter-spacing: 2px;
    }
    .case-drop-group-items {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 4px;
    }
    .case-drop-item {
        padding: 6px 4px;
    }
    .case-drop-item-icon {
        width: 46px;
        height: 34px;
    }
    .case-drop-item-name {
        font-size: 9px;
    }
    .case-spinner-container {
        height: 100px;
    }
    .case-spinner-item {
        width: 100px;
        min-width: 100px;
    }
    .case-spinner-item-icon {
        width: 45px;
        height: 35px;
    }
    .case-spinner-item-name {
        font-size: 8px;
    }
    .case-win-name {
        font-size: 18px;
    }
}

@media screen and (max-width: 480px) and (pointer: coarse) {
    .case-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
    }
    .case-grid-card {
        padding: 8px;
    }
    .case-grid-card-icon {
        height: 50px;
    }
    .case-grid-card-name {
        font-size: 9px;
        letter-spacing: 0.5px;
    }
    .case-grid-card-cost {
        font-size: 9px;
    }
    .case-card-name {
        font-size: 10px;
    }
    .case-card-banner {
        padding: 6px 10px;
        gap: 8px;
    }
    .case-card-cost-bar {
        padding: 5px 10px;
        font-size: 10px;
    }
    .case-open-btn {
        padding: 8px 12px;
        font-size: 10px;
    }
    .case-spinner-container {
        height: 85px;
    }
    .case-spinner-item {
        width: 80px;
        min-width: 80px;
    }
    .case-spinner-item-icon {
        width: 36px;
        height: 28px;
    }
    .case-spinner-item-name {
        font-size: 7px;
    }
    .case-win-name {
        font-size: 15px;
        letter-spacing: 1px;
    }
    .case-win-rarity {
        font-size: 10px;
    }
}
