/* ============================================================
   Sidebar - Clean icon-rail (collapsed) / full panel (expanded)
   ============================================================ */

/* ── body offset ─────────────────────────────────────────── */
body.has-sidebar {
    padding-left: 52px;
    transition: padding-left 0.25s cubic-bezier(0.4,0,0.2,1);
}
body.has-sidebar.sidebar-expanded { padding-left: 260px; }
@media (max-width: 900px) {
    body.has-sidebar,
    body.has-sidebar.sidebar-expanded { padding-left: 0 !important; }
}

/* ── sidebar shell ───────────────────────────────────────── */
.nav-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 52px;
    background: #08080A;
    border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 200; overflow: hidden;
    display: flex; flex-direction: column;
    transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
}
.nav-sidebar.expanded { width: 260px; }
.nav-sidebar .sb-scroll { overflow-y: hidden; }
.nav-sidebar.expanded .sb-scroll { overflow-y: auto; }
.nav-sidebar .sb-scroll::-webkit-scrollbar { width: 3px; }
.nav-sidebar .sb-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.nav-sidebar.expanded .sb-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); }
.nav-sidebar.expanded .sb-scroll:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }

@media (max-width: 900px) {
    .nav-sidebar {
        width: 280px; transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        overflow-y: auto;
    }
    .nav-sidebar.open { transform: translateX(0); }
    .nav-sidebar.expanded { width: 280px; }
}
.nav-sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 199;
    opacity: 0; visibility: hidden; transition: all 0.3s; pointer-events: none;
    backdrop-filter: blur(4px);
}
.nav-sidebar-backdrop.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── sections ────────────────────────────────────────────── */
.sb-section { padding: 4px 0; position: relative; z-index: 1; }
.nav-sidebar.expanded .sb-section { padding: 8px 0; }
.sb-section + .sb-section { border-top: 1px solid rgba(255,255,255,0.04); }

/* Hide tournaments when collapsed; streamers section stays visible for live indicators */
.nav-sidebar:not(.expanded) .sb-section--tournaments { display: none; }

/* When collapsed, hide offline streamers and the section label/title */
.nav-sidebar:not(.expanded) .sb-section--streamers .sb-section-title { display: none !important; }
.nav-sidebar:not(.expanded) .streamer-item.offline { display: none; }
.nav-sidebar:not(.expanded) .streamer-section-label { display: none; }

/* Collapsed live streamer: centered avatar column with tiny viewer count */
.nav-sidebar:not(.expanded) .streamer-item {
    flex-direction: column; gap: 2px; padding: 6px 0;
    justify-content: center; align-items: center;
}
.nav-sidebar:not(.expanded) .streamer-item .streamer-live-dot { display: none; }
.nav-sidebar:not(.expanded) .streamer-item .streamer-info { display: none; }
.nav-sidebar:not(.expanded) .streamer-item img.streamer-avatar {
    width: 28px; height: 28px; min-width: 28px; min-height: 28px;
}
/* Show compact viewer count under avatar when collapsed */
.streamer-item .sb-collapsed-viewers { display: none; }
.nav-sidebar:not(.expanded) .streamer-item .sb-collapsed-viewers {
    display: block; font-size: 8px; font-weight: 700; color: #F87171;
    text-align: center; line-height: 1;
    text-shadow: 0 0 6px rgba(248,113,113,0.5);
}

.sb-section-title {
    font-size: 9px; font-weight: 800; color: rgba(200,180,240,0.65);
    text-transform: uppercase; letter-spacing: 2px;
    margin-bottom: 8px; display: none; align-items: center; gap: 8px;
    text-shadow: 0 0 6px rgba(157,135,200,0.3);
}
.nav-sidebar.expanded .sb-section-title { display: flex; padding: 0 14px; }
.sb-section-title .count {
    background: rgba(157,135,200,0.10); color: #A893D4;
    font-size: 9px; padding: 2px 6px; border-radius: 10px;
    font-weight: 700; min-width: 18px; text-align: center;
}

/* ── nav links ───────────────────────────────────────────── */
.sb-links { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }
.nav-sidebar.expanded .sb-links { padding: 0 8px; }

.sb-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 0;
    border-radius: 8px; color: #8B8698;
    text-decoration: none; font-size: 12px; font-weight: 600;
    transition: all 0.15s; justify-content: center;
    white-space: nowrap; overflow: hidden; position: relative;
}
.nav-sidebar.expanded .sb-link { padding: 8px 12px; justify-content: flex-start; }
.sb-link:hover {
    background: rgba(157,135,200,0.05); color: #C0B8D0;
}
/* Active: text glow only, no background highlight */
.sb-link.active {
    color: #E0D4F7; background: transparent;
    text-shadow: 0 0 8px rgba(200,176,240,0.7), 0 0 20px rgba(157,135,200,0.4);
}
.sb-link.active::before {
    content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background: linear-gradient(180deg, #C8B0F0, #9B5CF6);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 12px rgba(157,135,200,0.6), 0 0 4px rgba(157,135,200,0.8);
}
.nav-sidebar:not(.expanded) .sb-link.active::before {
    left: -6px;
}
.sb-link .link-icon {
    font-size: 16px; width: 20px; text-align: center; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.7; transition: all 0.15s;
    color: #9B92AB;
}
.sb-link:hover .link-icon { opacity: 1; color: #C0B8D0; }
.sb-link.active .link-icon {
    opacity: 1; color: #E0D4F7;
    filter: drop-shadow(0 0 6px rgba(200,176,240,0.7));
}
.sb-link-text { display: none; }
.nav-sidebar.expanded .sb-link-text { display: inline; }

/* ── Tooltip on collapsed hover ──────────────────────────── */
.nav-sidebar:not(.expanded) .sb-link[title] { position: relative; }
.nav-sidebar:not(.expanded) .sb-link[title]::after {
    content: attr(title); position: absolute; left: calc(100% + 10px); top: 50%;
    transform: translateY(-50%); background: #2A2A2E; color: #ddd;
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
    white-space: nowrap; pointer-events: none; opacity: 0; z-index: 999;
    transition: opacity 0.15s; box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.nav-sidebar:not(.expanded) .sb-link[title]:hover::after { opacity: 1; }

/* ── nav group / submenu ─────────────────────────────────── */
.sb-nav-group { position: relative; }
.sb-group-toggle { cursor: pointer; background: none; border: none; width: 100%; }
.sb-group-arrow {
    display: none; margin-left: auto; font-size: 10px;
    color: rgba(255,255,255,0.14); transition: transform 0.2s;
}
.nav-sidebar.expanded .sb-group-arrow { display: inline; }
.sb-nav-group.open .sb-group-arrow { transform: rotate(90deg); color: rgba(176,124,255,0.6); }

.sb-sub-links {
    display: none; flex-direction: column; gap: 0;
    overflow: hidden; transition: all 0.2s;
    margin-left: 14px; padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.05);
}
.sb-nav-group.open .sb-sub-links { display: flex; }
.nav-sidebar:not(.expanded) .sb-sub-links { display: none !important; }

.sb-sub-link {
    font-size: 11px; padding: 5px 10px !important;
    color: var(--text-muted); border-radius: 6px;
}
.sb-sub-link:hover { color: var(--text-secondary); background: rgba(157,135,200,0.04); }
.sb-sub-link.active { color: #E0D4F7; text-shadow: 0 0 8px rgba(200,176,240,0.6); }
.sb-sub-link .link-icon { width: 16px; }
.sb-sub-link .link-icon svg { width: 13px; height: 13px; }

/* ── Per-item accent colors ──────────────────────────────── */
/* Ego-Match items: crimson red */
.sb-link[data-id=\"ego-match\"].active,
.sb-group-toggle[data-id=\"ego-match\"].active { color: #F87171; text-shadow: 0 0 10px rgba(239,68,68,0.6), 0 0 24px rgba(239,68,68,0.25); }
.sb-link[data-id=\"ego-match\"].active .link-icon,
.sb-group-toggle[data-id=\"ego-match\"].active .link-icon { color: #F87171; filter: drop-shadow(0 0 6px rgba(239,68,68,0.6)); }
.sb-link[data-id=\"ego-match\"].active::before { background: linear-gradient(180deg, #FCA5A5, #EF4444); box-shadow: 0 0 10px rgba(239,68,68,0.6); }
.sb-sub-link[data-id=\"ego-match\"].active { color: #F87171; text-shadow: 0 0 8px rgba(239,68,68,0.6); }
.sb-sub-link[data-id=\"ego-leaderboard\"].active { color: #F87171; text-shadow: 0 0 8px rgba(239,68,68,0.6); }

/* Wager / money-match: USD green */
.sb-sub-link[data-id=\"wager\"].active { color: #4ADE80; text-shadow: 0 0 8px rgba(74,222,128,0.6); }

/* Tournaments: gold */
.sb-link[data-id=\"tournaments\"].active { color: #FCD34D; text-shadow: 0 0 10px rgba(252,211,77,0.5), 0 0 24px rgba(245,158,11,0.2); }
.sb-link[data-id=\"tournaments\"].active .link-icon { color: #FCD34D; filter: drop-shadow(0 0 6px rgba(252,211,77,0.5)); }
.sb-link[data-id=\"tournaments\"].active::before { background: linear-gradient(180deg, #FDE68A, #F59E0B); box-shadow: 0 0 10px rgba(245,158,11,0.5); }

/* Leaderboard: emerald */
.sb-link[data-id=\"leaderboard\"].active { color: #6EE7B7; text-shadow: 0 0 10px rgba(110,231,183,0.5), 0 0 24px rgba(16,185,129,0.2); }
.sb-link[data-id=\"leaderboard\"].active .link-icon { color: #6EE7B7; filter: drop-shadow(0 0 6px rgba(110,231,183,0.5)); }
.sb-link[data-id=\"leaderboard\"].active::before { background: linear-gradient(180deg, #A7F3D0, #10B981); box-shadow: 0 0 10px rgba(16,185,129,0.5); }

/* Discord: blurple */
.sb-link[data-id=\"discord\"].active { color: #818CF8; text-shadow: 0 0 10px rgba(129,140,248,0.5); }
.sb-link[data-id=\"discord\"].active .link-icon { color: #818CF8; filter: drop-shadow(0 0 6px rgba(129,140,248,0.5)); }
.sb-link[data-id=\"discord\"].active::before { background: linear-gradient(180deg, #A5B4FC, #6366F1); box-shadow: 0 0 10px rgba(99,102,241,0.5); }

/* Players: sky blue */
.sb-link[data-id=\"players\"].active { color: #7DD3FC; text-shadow: 0 0 10px rgba(125,211,252,0.5); }
.sb-link[data-id=\"players\"].active .link-icon { color: #7DD3FC; filter: drop-shadow(0 0 6px rgba(125,211,252,0.5)); }
.sb-link[data-id=\"players\"].active::before { background: linear-gradient(180deg, #BAE6FD, #0EA5E9); box-shadow: 0 0 10px rgba(14,165,233,0.5); }

/* Teams: teal */
.sb-link[data-id=\"teams\"].active { color: #5EEAD4; text-shadow: 0 0 10px rgba(94,234,212,0.5); }
.sb-link[data-id=\"teams\"].active .link-icon { color: #5EEAD4; filter: drop-shadow(0 0 6px rgba(94,234,212,0.5)); }
.sb-link[data-id=\"teams\"].active::before { background: linear-gradient(180deg, #99F6E4, #14B8A6); box-shadow: 0 0 10px rgba(20,184,166,0.5); }

/* ── tournament items ────────────────────────────────────── */
.sb-t-item {
    display: flex; align-items: center; gap: 10px; padding: 7px 12px;
    border-radius: 8px; cursor: pointer; transition: all 0.15s;
    margin-bottom: 1px;
}
.sb-t-item:hover { background: rgba(157,135,200,0.06); }

.sb-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sb-dot.live {
    background: #F87171; box-shadow: 0 0 8px rgba(248,113,113,0.5);
    animation: sb-pulse 2s infinite;
}
.sb-dot.checkin { background: #FBBF24; box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.sb-dot.open { background: #34D399; }
.sb-dot.completed { background: var(--text-muted); opacity: 0.5; }
@keyframes sb-pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.sb-t-info { flex: 1; min-width: 0; }
.sb-t-name {
    font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.85);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-t-meta { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

.sb-t-status {
    font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    flex-shrink: 0; padding: 2px 6px; border-radius: 4px;
}
.sb-t-status.live { color: #F87171; background: rgba(248,113,113,0.12); }
.sb-t-status.checkin { color: #FBBF24; background: rgba(251,191,36,0.10); }
.sb-t-status.open { color: #34D399; background: rgba(52,211,153,0.10); }
.sb-t-status.completed { color: var(--text-muted); background: rgba(255,255,255,0.04); }

/* ── empty / loading ─────────────────────────────────────── */
.sb-empty {
    color: var(--text-muted); font-size: 11px; padding: 8px 14px;
    text-align: left; opacity: 0.6;
}
