/* DEAD BY PIXEL - Lobby Sidebar UI */

#char-select-screen {
    display: none;
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 30;
    font-family: 'Share Tech Mono', monospace;
    pointer-events: none;
}

#char-select-screen .cs-sidebar,
#char-select-screen .cs-panel {
    pointer-events: auto;
}

.cs-sidebar {
    position: absolute;
    top: 70px; left: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-sidebar-icon {
    width: 42px; height: 42px;
    background: rgba(10,8,4,0.92);
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.15s;
}
.cs-sidebar-icon:hover { border-color: #888; background: rgba(25,18,8,0.95); }
.cs-sidebar-icon.active { border-color: #cc4444; background: rgba(30,8,4,0.95); }

.cs-panel {
    display: none;
    position: absolute;
    top: 70px; left: 65px;
    width: 340px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: rgba(8,6,3,0.96);
    border: 2px solid #2a2010;
    padding: 14px;
}
.cs-panel.open { display: block; }
.cs-panel::-webkit-scrollbar { width: 4px; }
.cs-panel::-webkit-scrollbar-thumb { background: #444; }

.cs-panel h3 {
    color: #ccc;
    font-size: 0.85em;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #2a2010;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cs-char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.cs-char-card {
    background: #0a0a06;
    border: 2px solid #2a2010;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2px 2px 3px;
}
.cs-char-card:hover { border-color: #777; }
.cs-char-card.selected { border-color: #ffaa00; box-shadow: 0 0 8px #ffaa0033; }
.cs-char-card.locked { opacity: 0.2; cursor: default; }
.cs-char-card.locked:hover { border-color: #2a2010; }
.cs-char-card canvas { width: 100%; image-rendering: pixelated; }
.cs-card-name { font-size: 0.5em; color: #999; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }

.cs-loadout-row { display: flex; gap: 10px; margin-bottom: 4px; align-items: center; }

/* PERK SLOTS - Diamond shape (rotated 45deg) like DBD */
.cs-loadout-slot {
    width: 48px; height: 48px;
    background: #141008;
    border: 2px solid #332a18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.cs-loadout-slot:hover { border-color: #776633; }
.cs-loadout-slot.filled { border-color: #aa8833; background: #1f1808; }

/* Perk diamond shape */
.cs-loadout-slot.perk {
    width: 50px; height: 50px;
    transform: rotate(45deg);
    border: 3px solid #6633aa;
    background: linear-gradient(135deg, #1a0a2a, #0a0510, #1a0828);
    box-shadow: inset 0 0 12px rgba(120,50,200,0.2), 0 0 6px rgba(100,30,180,0.15);
}
.cs-loadout-slot.perk > * {
    transform: rotate(-45deg);
}
.cs-loadout-slot.perk:hover {
    border-color: #9944ff;
    box-shadow: inset 0 0 16px rgba(150,60,255,0.3), 0 0 10px rgba(130,40,220,0.25);
}
.cs-loadout-slot.perk.filled {
    border-color: #aa55ff;
    background: linear-gradient(135deg, #2a1040, #150820, #2a0840);
    box-shadow: inset 0 0 15px rgba(150,80,255,0.3), 0 0 8px rgba(130,50,220,0.3);
}

/* Item slot - Hexagonal shape like DBD */
.cs-loadout-slot.item-slot {
    width: 48px; height: 48px;
    background: #0a1518;
    border: 3px solid #2a4a4a;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
    position: relative;
}
.cs-loadout-slot.item-slot::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(180deg, #1a3a3a, #0a1818);
    z-index: -1;
}
.cs-loadout-slot.item-slot::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 3px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(180deg, #0a2028, #051010);
    z-index: -1;
}
.cs-loadout-slot.item-slot:hover {
    filter: brightness(1.3);
}
.cs-loadout-slot.item-slot.filled::after {
    background: linear-gradient(180deg, #0f2a30, #081818);
}

/* PERK PICKER GRID - Diamond shaped items */
.cs-picker-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding: 4px;
}

.cs-picker-item {
    width: 42px; height: 42px;
    margin: 6px auto;
    background: linear-gradient(135deg, #1a0a2a, #0a0510);
    border: 2px solid #4a2a6a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.12s;
    transform: rotate(45deg);
    position: relative;
}
.cs-picker-item > * {
    transform: rotate(-45deg);
}
.cs-picker-item::before {
    content: '';
    position: absolute;
    top: 2px; left: 2px; right: 2px; bottom: 2px;
    background: linear-gradient(135deg, rgba(100,40,160,0.15), transparent, rgba(80,20,140,0.1));
    pointer-events: none;
}
.cs-picker-item:hover { 
    border-color: #9955ff;
    transform: rotate(45deg) scale(1.1);
    box-shadow: 0 0 10px rgba(130,50,220,0.3);
}
.cs-picker-item.equipped { 
    border-color: #ffaa00; 
    background: linear-gradient(135deg, #2a1a00, #1a1000);
    box-shadow: 0 0 8px rgba(255,170,0,0.3);
}
.cs-picker-item.equipped::before {
    background: linear-gradient(135deg, rgba(255,170,0,0.15), transparent, rgba(200,120,0,0.1));
}

@media (max-width: 600px) {
    .cs-panel { width: calc(100% - 80px); left: 58px; }
    .cs-char-grid { grid-template-columns: repeat(3, 1fr); }
}


/* Customize panel preview */
#cs-preview-canvas {
    background: #020202;
    border: 1px solid #333;
}

/* Character level badge on char cards */
.cs-char-card .cs-card-name + div {
    margin-top: 1px;
}
