/* ══════════════════════════════════════════════════════════
   Dark Grid Arcade – Desktop Sidebar
   Cyber-dark with cyan/indigo accents, sharp edges
   ══════════════════════════════════════════════════════════ */

.dga-layout-wrapper {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}
.dga-layout-wrapper > main,
.dga-layout-wrapper > .main-content { flex: 1; min-width: 0; }

/* Hide sidebar on game detail pages – give the player full width */
body.is-game-page .kz-sidebar.dga-sidebar { display: none; }
body.is-game-page .dga-layout-wrapper { max-width: 1200px; }

/* Game page inner layout: stack sidebar below content instead of beside it */
body.is-game-page .page-game .main-layout {
    flex-direction: column;
}
body.is-game-page .page-game .main-layout > .sidebar {
    width: 100%;
    display: flex;
    gap: var(--space-lg, 16px);
    flex-wrap: wrap;
}
body.is-game-page .page-game .main-layout > .sidebar > .sidebar-widget {
    flex: 1;
    min-width: 200px;
}

.kz-sidebar.dga-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    padding: 16px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,217,255,.15) transparent;
}
.kz-sidebar.dga-sidebar::-webkit-scrollbar { width: 4px; }
.kz-sidebar.dga-sidebar::-webkit-scrollbar-thumb { background: rgba(0,217,255,.2); border-radius: 4px; }

.dga-sidebar .sidebar-widget {
    background: rgba(20,20,40,.8);
    border: 1px solid rgba(0,217,255,.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}
.dga-sidebar .widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 700;
    color: #f0f4f8;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0,217,255,.08);
}
.dga-sidebar .widget-title i { color: #00d9ff; font-size: .85rem; }
.dga-sidebar .widget-empty {
    font-size: .8rem;
    color: #64748b;
    text-align: center;
    padding: 12px 0;
}

.dga-sidebar .widget-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #f0f4f8;
    transition: background .15s;
}
.dga-sidebar .widget-item:hover { background: rgba(0,217,255,.06); }
.dga-sidebar .widget-item img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.dga-sidebar .widget-item-title { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dga-sidebar .widget-item-meta { font-size: .72rem; color: #64748b; }

.dga-sidebar .random-game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00d9ff, #6366f1);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all .2s;
}
.dga-sidebar .random-game-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

.dga-sidebar .sidebar-ad-slot { margin-top: 12px; border-radius: 12px; overflow: hidden; min-height: 250px; }

.dga-sidebar .achievement-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; margin-bottom: 4px; }

/* ── Daily Challenges ─────────────────────────────────────── */
.dga-sidebar .widget-body { padding: 4px; }

.dga-sidebar .dc-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .75rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    padding: 8px 10px;
    background: rgba(0,217,255,.04);
    border: 1px solid rgba(0,217,255,.06);
    border-radius: 8px;
    margin-bottom: 10px;
}
.dga-sidebar .dc-countdown i { font-size: 11px; color: #00d9ff; }

/* Challenge Card */
.dga-sidebar .challenge-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: rgba(0,217,255,.03);
    border: 1px solid rgba(0,217,255,.06);
    transition: all .2s ease;
}
.dga-sidebar .challenge-item:last-child { margin-bottom: 0; }
.dga-sidebar .challenge-item:hover {
    background: rgba(0,217,255,.07);
    border-color: rgba(0,217,255,.15);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0,217,255,.08);
}

/* Header row: icon + info */
.dga-sidebar .dc-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}

.dga-sidebar .dc-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    background: rgba(0,217,255,.1);
    color: #00d9ff;
}
.dga-sidebar .challenge-item.dc-done .dc-icon {
    background: rgba(16,185,129,.12);
    color: #10b981;
}
.dga-sidebar .challenge-item.dc-claimed .dc-icon {
    background: rgba(100,116,139,.08);
    color: #64748b;
}

.dga-sidebar .dc-info { flex: 1; min-width: 0; }

.dga-sidebar .dc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.dga-sidebar .dc-title {
    font-size: .78rem;
    font-weight: 700;
    color: #f0f4f8;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dga-sidebar .dc-xp {
    font-size: .7rem;
    font-weight: 800;
    color: #00d9ff;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(0,217,255,.1);
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: -0.01em;
}
.dga-sidebar .challenge-item.dc-done .dc-xp {
    background: rgba(16,185,129,.12);
    color: #10b981;
}

.dga-sidebar .dc-desc {
    font-size: .72rem;
    color: #64748b;
    margin: 2px 0 0;
    line-height: 1.35;
}

/* Progress bar */
.dga-sidebar .challenge-progress {
    height: 4px;
    background: rgba(0,217,255,.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.dga-sidebar .challenge-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #00d9ff, #6366f1);
    border-radius: 2px;
    transition: width .4s ease;
}
.dga-sidebar .challenge-item.dc-done .challenge-progress-bar {
    background: linear-gradient(90deg, #10b981, #6ee7b7);
}

/* Footer row */
.dga-sidebar .dc-footer { margin-top: 8px; }

.dga-sidebar .dc-counter {
    font-size: .7rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.dga-sidebar .dc-status { font-size: .7rem; font-weight: 600; }
.dga-sidebar .dc-status-claimed { color: #10b981; }
.dga-sidebar .dc-status-claimed i { font-size: 10px; }
.dga-sidebar .dc-status-pending { color: #64748b; font-style: italic; }

/* Claim button */
.dga-sidebar .dc-claim-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #00d9ff, #6366f1);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    box-shadow: 0 2px 8px rgba(0,217,255,.2);
}
.dga-sidebar .dc-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,217,255,.3);
    filter: brightness(1.1);
}

.dga-sidebar .challenge-item.dc-claimed { opacity: .5; }

.dga-sidebar .friend-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; text-decoration: none; color: #f0f4f8; transition: background .15s; }
.dga-sidebar .friend-item:hover { background: rgba(0,217,255,.06); }
.dga-sidebar .friend-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.dga-sidebar .friend-status { width: 8px; height: 8px; background: #10b981; border-radius: 50%; flex-shrink: 0; }

/* ── Sidebar Achievements Widget ─────────────────────────── */
.dga-sidebar .sidebar-ach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(0,217,255,.03);
    border: 1px solid rgba(0,217,255,.06);
    transition: all .15s;
    opacity: .55;
}
.dga-sidebar .sidebar-ach-item:last-of-type { margin-bottom: 8px; }
.dga-sidebar .sidebar-ach-item:hover {
    background: rgba(0,217,255,.07);
    border-color: rgba(0,217,255,.15);
}
.dga-sidebar .sidebar-ach-item.unlocked {
    opacity: 1;
    border-color: rgba(0,217,255,.2);
    background: rgba(0,217,255,.06);
}
.dga-sidebar .sidebar-ach-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(0,217,255,.08);
    border-radius: 8px;
    flex-shrink: 0;
}
.dga-sidebar .sidebar-ach-item.unlocked .sidebar-ach-icon {
    background: rgba(0,217,255,.15);
}
.dga-sidebar .sidebar-ach-info {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.dga-sidebar .sidebar-ach-name {
    font-size: .78rem;
    font-weight: 600;
    color: #f0f4f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dga-sidebar .sidebar-ach-item:not(.unlocked) .sidebar-ach-name {
    color: #94a3b8;
}
.dga-sidebar .sidebar-ach-xp {
    font-size: .68rem;
    font-weight: 700;
    color: #00d9ff;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(0,217,255,.1);
    padding: 2px 7px;
    border-radius: 6px;
}
.dga-sidebar .sidebar-link-all {
    display: block;
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    color: #00d9ff;
    text-decoration: none;
    padding: 8px 0 0;
    transition: color .15s;
}
.dga-sidebar .sidebar-link-all:hover {
    color: #6366f1;
}

@media (max-width: 1200px) {
    .kz-sidebar.dga-sidebar { display: none; }
    .dga-layout-wrapper { padding: 0 16px; }
}





/* ── Shared Sidebar Widget Styles (sidebar.js classes) ── */

/* Game Items (Recently Played / Favorites list) */
.sidebar-game-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.sidebar-game-item:hover { background: rgba(128,128,128,.08); }

.sidebar-game-thumb {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.sidebar-game-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-game-title {
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-game-cat {
    font-size: .72rem;
    opacity: .6;
}

/* Achievements */
.sidebar-ach-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    background: rgba(128,128,128,.04);
    border: 1px solid rgba(128,128,128,.08);
    transition: all .15s;
    opacity: .55;
}
.sidebar-ach-item:last-of-type { margin-bottom: 8px; }
.sidebar-ach-item:hover {
    background: rgba(128,128,128,.08);
    border-color: rgba(128,128,128,.15);
}
.sidebar-ach-item.unlocked {
    opacity: 1;
    border-color: rgba(37,99,235,.2);
    background: rgba(37,99,235,.04);
}

.sidebar-ach-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: rgba(128,128,128,.08);
    border-radius: 8px;
    flex-shrink: 0;
}
.sidebar-ach-item.unlocked .sidebar-ach-icon {
    background: rgba(37,99,235,.1);
}

.sidebar-ach-info {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.sidebar-ach-name {
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-ach-xp {
    font-size: .68rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(37,99,235,.1);
    color: #2563eb;
    padding: 2px 7px;
    border-radius: 6px;
}

.sidebar-link-all {
    display: block;
    text-align: center;
    font-size: .78rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 8px 0 0;
    transition: color .15s;
}
.sidebar-link-all:hover { opacity: .7; }

/* Friends */
.sidebar-friend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
}
.sidebar-friend:hover { background: rgba(128,128,128,.08); }

.friend-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.friend-name {
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-status {
    font-size: .68rem;
    opacity: .6;
}


/* ── Favorites Grid (2 per row, equal size) ── */
.sidebar-fav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.sidebar-fav-item {
    display: block;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    transition: all .15s;
    background: rgba(0,212,255,.03);
    border: 1px solid rgba(0,212,255,.06);
}

.sidebar-fav-item:hover {
    border-color: rgba(0,212,255,.15);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,212,255,.1);
}

.sidebar-fav-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 75%;
    overflow: hidden;
}

.sidebar-fav-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-fav-title {
    display: block;
    font-size: .72rem;
    font-weight: 600;
    color: inherit;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 6px 6px 8px;
}
