/* ============================================
   SpicyGames 🌶️ — Hot & Spicy Theme
   ============================================ */

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #161616;
    --bg-card: #1e1e1e;
    --bg-sidebar: #111111;
    --bg-header: #0a0a0a;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #e63946;
    --accent-hover: #c62828;
    --accent-light: #ff6b6b;
    --accent-orange: #ff8c00;
    --accent-yellow: #ffd60a;
    --warm-subtle: #2a1a1a;
    --gradient-hot: linear-gradient(135deg, #e63946, #ff8c00);
    --gradient-fire: linear-gradient(135deg, #ff4500, #ff8c00, #ffd60a);
    --border-color: #2a2a2a;
    --card-radius: 12px;
    --sidebar-width: 240px;
    --header-height: 90px;
    --transition: 0.2s ease;
    --glow-red: 0 0 20px rgba(230, 57, 70, 0.2);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body.cg-layout {
    margin: 0;
    padding: 0;
    background: var(--bg-primary) !important;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    overflow-x: hidden;
    min-height: 100vh;
}

body.cg-layout a {
    color: inherit;
    text-decoration: none;
}

/* ---- HEADER ---- */
.cg-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    gap: 16px;
}

.cg-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-hot);
}

.cg-header__logo {
    display: flex;
    align-items: center;
    width: var(--sidebar-width-expanded);
    flex-shrink: 0;
    padding-left: 4px;
    transition: width 0.3s ease-out;
}

body.sidebar-collapsed .cg-header__left {
    width: var(--sidebar-width-collapsed);
}

.cg-header__logo a {
    display: flex;
    align-items: center;
}

.cg-header__logo img {
    height: 80px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
}

.cg-header__search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.cg-header__search input {
    width: 100%;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 16px 0 40px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition);
}

.cg-header__search input::placeholder {
    color: var(--text-muted);
}

.cg-header__search input:focus {
    border-color: var(--accent);
    box-shadow: var(--glow-red);
}

.cg-header__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Search Results Dropdown */
.cg-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    z-index: 1001;
    display: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.cg-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    transition: background 0.15s;
}

.cg-search-item:hover {
    background: var(--warm-subtle);
}

.cg-search-item img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.cg-search-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.cg-search-item-plays {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.cg-search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.cg-search-more {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--accent-light);
    border-top: 1px solid var(--border-color);
}

.cg-header__nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.cg-header__nav-link {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition);
    white-space: nowrap;
    color: var(--text-secondary);
}

.cg-header__nav-link:hover {
    background: var(--warm-subtle);
    color: var(--accent-light);
}

/* Private Zone link with reward badge */
.cg-header__nav-link--pz {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cg-header__reward-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #22c55e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
    animation: reward-badge-pulse 2s infinite;
}

@keyframes reward-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.cg-header__login-btn {
    background: var(--gradient-hot);
    color: #fff;
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cg-header__login-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--glow-red);
}

.cg-header__user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background var(--transition);
    position: relative;
}

.cg-header__user:hover {
    background: var(--bg-secondary);
}

.cg-header__user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
}

.cg-header__user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .cg-header__user-name {
        display: none;
    }
}

.cg-header__user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0;
    padding-top: 8px;
    background: transparent;
    z-index: 100;
}

.cg-header__user-dropdown::before {
    content: '';
    display: block;
}

.cg-header__user-dropdown-inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 160px;
    overflow: hidden;
}

.cg-header__user:hover .cg-header__user-dropdown {
    display: block;
}

.cg-header__user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    transition: background var(--transition);
}

.cg-header__user-dropdown a:hover {
    background: var(--warm-subtle);
}

/* ============================================
   PROFILE SIDE PANEL (SpicyGames Style)
   ============================================ */

/* Dark overlay behind panel */
.sg-profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.sg-profile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* The slide-in panel */
.sg-profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-left: 1px solid var(--border-color);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sg-profile-panel.open {
    transform: translateX(0);
}

/* Close button */
.sg-profile-panel__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-profile-panel__close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: rotate(90deg);
}

/* User info section */
.sg-profile-panel__user {
    text-align: center;
    padding: 40px 24px 24px;
    background: linear-gradient(180deg, rgba(230, 57, 70, 0.1) 0%, transparent 100%);
}

.sg-profile-panel__avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s;
}

.sg-profile-panel__avatar:hover {
    transform: scale(1.08);
}

.sg-profile-panel__avatar:hover img {
    box-shadow: 0 0 25px rgba(230, 57, 70, 0.6);
}

.sg-profile-panel__avatar img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.4);
    object-fit: cover;
    transition: box-shadow 0.2s;
}

.sg-profile-panel__level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 32px;
    height: 32px;
    background: var(--gradient-hot);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--bg-secondary);
}

.sg-profile-panel__name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.sg-profile-panel__email {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Level & XP Section */
.sg-profile-panel__level-section {
    margin: 0 24px 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1) 0%, rgba(230, 57, 70, 0.1) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 0, 0.2);
}

.sg-profile-panel__level-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sg-profile-panel__level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--gradient-hot);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.sg-profile-panel__level-badge i {
    font-size: 10px;
}

.sg-profile-panel__xp-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sg-profile-panel__xp-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.sg-profile-panel__xp-fill {
    height: 100%;
    background: var(--gradient-hot);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Spicy Coins Display */
.sg-profile-panel__coins {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 24px 16px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #2a1a00 0%, #1a1200 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 200, 0, 0.3);
}

.sg-profile-panel__coins-icon {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.5));
}

.sg-profile-panel__coins-amount {
    font-size: 24px;
    font-weight: 800;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.sg-profile-panel__coins-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main profile button */
.sg-profile-panel__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 24px 20px;
    padding: 14px 24px;
    background: var(--gradient-hot);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

.sg-profile-panel__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(230, 57, 70, 0.5);
    color: #fff;
}

/* Progress section */
.sg-profile-panel__progress {
    margin: 0 24px 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.sg-profile-panel__progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sg-profile-panel__progress-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.sg-profile-panel__progress-title i {
    color: var(--accent);
    margin-right: 6px;
}

.sg-profile-panel__progress-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
}

.sg-profile-panel__progress-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.sg-profile-panel__progress-fill {
    height: 100%;
    background: var(--gradient-hot);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.sg-profile-panel__progress-cta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-light);
    text-decoration: none;
}

.sg-profile-panel__progress-cta:hover {
    color: var(--accent);
}

.sg-profile-panel__progress-cta i {
    transition: transform 0.2s ease;
}

.sg-profile-panel__progress-cta:hover i {
    transform: translateX(4px);
}

/* Stats grid */
.sg-profile-panel__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 0 24px 20px;
}

.sg-profile-panel__stat {
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.sg-profile-panel__stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 4px;
}

.sg-profile-panel__stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.sg-profile-panel__stat-label i {
    margin-right: 4px;
    color: var(--accent);
}

/* Navigation links */
.sg-profile-panel__nav {
    padding: 0 24px;
}

.sg-profile-panel__nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: transparent;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sg-profile-panel__nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sg-profile-panel__nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    color: var(--accent);
}

.sg-profile-panel__nav-item--logout {
    color: var(--text-muted);
}

.sg-profile-panel__nav-item--logout:hover {
    background: rgba(230, 57, 70, 0.1);
    color: var(--accent);
}

.sg-profile-panel__divider {
    height: 1px;
    background: var(--border-color);
    margin: 12px 24px;
}

/* Make user clickable */
#profileTrigger {
    cursor: pointer;
}

.cg-header__profile-progress-fill {
    height: 100%;
    background: var(--gradient-hot);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.cg-header__dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

/* ---- SIDEBAR ---- */
:root {
    --sidebar-width-expanded: 200px;
    --sidebar-width-collapsed: 56px;
}

.cg-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width-expanded);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 900;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease-out;
}

/* Collapsed state */
.cg-sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

/* Hover expand when collapsed (desktop only) */
@media (min-width: 1025px) {
    .cg-sidebar.collapsed:hover {
        width: var(--sidebar-width-expanded);
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__item-text {
        opacity: 1;
        width: auto;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__title {
        opacity: 1;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__footer {
        padding: 12px 16px;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__contact-btn {
        visibility: visible;
        width: 100%;
        height: auto;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__links {
        display: flex;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__social {
        justify-content: flex-start;
    }
    
    .cg-sidebar.collapsed:hover .cg-sidebar__item {
        justify-content: flex-start;
        padding: 8px 16px;
    }
}

/* Toggle Button - Fixed at top left (never moves) */
.cg-sidebar__toggle {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 910;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.cg-sidebar__toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cg-sidebar__toggle-arrow {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

/* Arrow direction: left when open, right when collapsed */
.cg-sidebar.collapsed .cg-sidebar__toggle-arrow {
    transform: rotate(180deg);
}

.cg-sidebar::-webkit-scrollbar {
    width: 4px;
}

.cg-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.cg-sidebar__section {
    flex: 1;
    overflow-y: auto;
    padding-top: 50px; /* Space for toggle button */
}

/* Item text - hidden when collapsed */
.cg-sidebar__item-text {
    transition: opacity 0.3s ease, transform 0.3s ease;
    white-space: nowrap;
}

.cg-sidebar.collapsed .cg-sidebar__item-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    /* No transform - keep Y position stable */
}

/* Titles hidden when collapsed - keep height */
.cg-sidebar__title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    padding: 12px 16px 6px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    min-height: 30px; /* Fixed height to prevent jumping */
}

.cg-sidebar.collapsed .cg-sidebar__title {
    opacity: 0;
    /* Keep height and padding - just hide visually */
    pointer-events: none;
}

/* Footer stays visible when collapsed - just compact */
.cg-sidebar.collapsed .cg-sidebar__footer {
    padding: 12px 16px;
}

.cg-sidebar.collapsed .cg-sidebar__contact-btn {
    visibility: hidden; /* Hidden but keeps space */
    height: 40px;
}

.cg-sidebar.collapsed .cg-sidebar__links {
    display: none;
}

.cg-sidebar.collapsed .cg-sidebar__social {
    justify-content: flex-start;
    margin-top: 8px;
}

.cg-sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    cursor: pointer;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
}

/* Center icons when collapsed - keep same Y position */
.cg-sidebar.collapsed .cg-sidebar__item {
    justify-content: flex-start; /* Keep aligned to left, not center */
    padding: 8px 16px; /* Same padding as open state */
}

.cg-sidebar__item:hover {
    background: var(--warm-subtle);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.cg-sidebar__item.active {
    background: var(--warm-subtle);
    color: var(--accent-light);
    border-left-color: var(--accent);
}

.cg-sidebar__item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.3s ease-out;
}

.cg-sidebar__item-icon img {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    transition: all 0.3s ease-out;
}

.cg-sidebar__item-icon i {
    font-size: 14px;
    color: var(--accent-light);
    transition: all 0.3s ease-out;
}

/* Hover animations for sidebar items */
.cg-sidebar__item:hover .cg-sidebar__item-icon {
    transform: scale(1.2) rotate(-5deg);
}

.cg-sidebar__item:hover .cg-sidebar__item-icon img {
    filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.6));
}

.cg-sidebar__item:hover .cg-sidebar__item-icon i {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(230, 57, 70, 0.8);
    transform: scale(1.1);
}

/* Active state keeps the glow */
.cg-sidebar__item.active .cg-sidebar__item-icon {
    transform: scale(1.1);
}

.cg-sidebar__item.active .cg-sidebar__item-icon img {
    filter: drop-shadow(0 0 6px rgba(230, 57, 70, 0.5));
}

.cg-sidebar__item.active .cg-sidebar__item-icon i {
    text-shadow: 0 0 8px rgba(230, 57, 70, 0.6);
}

/* Broken/Missing icon indicator */
.cg-sidebar__item-icon img.broken-icon,
.cg-sidebar__item-icon img.missing-icon[src*="undefined"],
.cg-sidebar__item-icon img.missing-icon:not([src]) {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #444 0%, #333 100%);
    border: 1px dashed #666;
    border-radius: 4px;
    object-fit: contain;
}

/* Error state styling - shows broken image icon */
.cg-sidebar__item-icon img.broken-icon::before,
.cg-sidebar__item-icon img[onerror].broken-icon::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
}

.cg-sidebar__divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 16px;
}

/* Sidebar Footer */
.cg-sidebar__footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    margin-top: auto;
    background: var(--bg-sidebar);
}

.cg-sidebar__contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    background: var(--gradient-hot);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.cg-sidebar__contact-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
    color: #fff;
}

.cg-sidebar__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 12px;
    padding: 0;
    list-style: none;
}

.cg-sidebar__links a {
    font-size: 11px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.cg-sidebar__links a:hover {
    color: var(--accent-light);
}

.cg-sidebar__social {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.cg-sidebar__social a {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    transition: all 0.2s;
}

.cg-sidebar__social a:hover {
    background: var(--accent);
    color: #fff;
}

.cg-sidebar__copyright {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 12px;
    text-align: center;
}

/* ---- MAIN CONTENT ---- */
.cg-main {
    margin-left: var(--sidebar-width-expanded);
    margin-top: var(--header-height);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease-out;
}

/* Main content adjusts when sidebar collapsed */
body.sidebar-collapsed .cg-main {
    margin-left: var(--sidebar-width-collapsed);
}

/* But expands back on sidebar hover */
@media (min-width: 1025px) {
    body.sidebar-collapsed .cg-sidebar:hover ~ .cg-main,
    body.sidebar-collapsed .cg-sidebar:hover + .cg-sidebar-overlay + .cg-main {
        margin-left: var(--sidebar-width-expanded);
    }
}

/* ---- HERO / FEATURED SLIDER ---- */
.cg-hero {
    margin-bottom: 32px;
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.cg-hero__slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cg-hero__slides::-webkit-scrollbar {
    display: none;
}

.cg-hero__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    aspect-ratio: 21/7;
    background: var(--bg-card);
}

.cg-hero__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cg-hero__slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.cg-hero__slide-title {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
    background: var(--gradient-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cg-hero__slide-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.cg-hero__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.cg-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}

.cg-hero__dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.5);
}

/* ---- SECTION HEADER ---- */
.cg-section {
    margin-bottom: 32px;
}

/* Spicy Originals Section - Special styling */
.cg-section--spicy {
    background: linear-gradient(135deg, rgba(230, 57, 70, 0.1) 0%, rgba(255, 107, 53, 0.05) 100%);
    border: 1px solid rgba(230, 57, 70, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
}

.cg-section--spicy .cg-section__title {
    color: #e63946;
}

.cg-game-grid--spicy {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
}

.cg-game-grid--spicy .cg-game-card {
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.cg-game-grid--spicy .cg-game-card:hover {
    border-color: rgba(230, 57, 70, 0.5);
}

.cg-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cg-section__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cg-section__title i {
    color: var(--accent);
}

.cg-section__more {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cg-section__more:hover {
    color: var(--accent-orange);
    gap: 8px;
}

/* ---- GAME GRID (Bento Style) ---- */
.cg-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
}

/* Bento Grid - Fixed columns for featured sections */
.cg-game-grid--bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: minmax(120px, 1fr);
    gap: 14px;
}

@media (max-width: 1200px) {
    .cg-game-grid--bento {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 992px) {
    .cg-game-grid--bento {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .cg-game-grid--bento {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .cg-game-grid--bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- GAME CARD ---- */
.cg-game-card {
    position: relative;
    border-radius: var(--card-radius);
    overflow: hidden;
    aspect-ratio: 3/4;
    background: var(--bg-card);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: block;
}

/* Medium Card - 2 columns wide, 1 row tall */
.cg-game-card--medium {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16/9;
}

/* Large Card - 2 columns wide, 2 rows tall */
.cg-game-card--large {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1/1;
}

/* Featured badge for large cards */
.cg-game-card--large::before,
.cg-game-card--medium::before {
    content: '⭐ FEATURED';
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.cg-game-card--large::before {
    content: '🔥 TOP GAME';
    font-size: 11px;
    padding: 5px 10px;
}

/* Larger text for big cards */
.cg-game-card--large .cg-game-card__name {
    font-size: 18px;
}

.cg-game-card--large .cg-game-card__plays {
    font-size: 14px;
}

.cg-game-card--medium .cg-game-card__name {
    font-size: 15px;
}

.cg-game-card--medium .cg-game-card__plays {
    font-size: 12px;
}

/* Mobile: reduce large cards to fit better */
@media (max-width: 768px) {
    .cg-game-card--large {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .cg-game-card--medium {
        grid-column: span 2;
        grid-row: span 1;
    }
}

@media (max-width: 480px) {
    .cg-game-card--large {
        grid-column: span 2;
        grid-row: span 2;
    }
    
    .cg-game-card--medium {
        grid-column: span 2;
        grid-row: span 1;
    }
    
    .cg-game-card--large .cg-game-card__name,
    .cg-game-card--medium .cg-game-card__name {
        font-size: 14px;
    }
}

.cg-game-card:hover {
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(230, 57, 70, 0.2), 0 0 0 2px var(--accent);
    z-index: 10;
}

.cg-game-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease;
    display: block;
}

.cg-game-card__gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.cg-game-card:hover .cg-game-card__gif {
    opacity: 1;
}

.cg-game-card:hover .cg-game-card__image {
    opacity: 0;
}

.cg-game-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 10px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    opacity: 0;
    transition: opacity var(--transition);
}

.cg-game-card:hover .cg-game-card__overlay {
    opacity: 1;
}

.cg-game-card__name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    color: #fff;
}

.cg-game-card__plays {
    font-size: 11px;
    color: var(--accent-orange);
    margin: 2px 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Hot badge */
.cg-game-card__hot-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--gradient-hot);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Spicy Original badge */
.cg-game-card__spicy-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #e63946 0%, #ff6b35 100%);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(230, 57, 70, 0.5);
    animation: spicy-pulse 2s ease-in-out infinite;
}

.cg-game-card__spicy-badge img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

@keyframes spicy-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(230, 57, 70, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(230, 57, 70, 0.7);
    }
}

/* Multiplayer badge (top-right, opposite the spicy badge) */
.cg-game-card__mp-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(20, 20, 28, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 13px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

/* Spicy Sidebar Animations */
@keyframes pepperWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

@keyframes flameGlow {
    0%, 100% {
        filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.8));
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Collapsed sidebar icon glow animation */
.cg-sidebar.collapsed .cg-sidebar__item-icon {
    animation: flameGlow 2s ease-in-out infinite;
}

.cg-sidebar.collapsed .cg-sidebar__item-icon img,
.cg-sidebar.collapsed .cg-sidebar__item-icon i {
    transition: all 0.3s ease-out;
}

.cg-sidebar.collapsed .cg-sidebar__item:hover .cg-sidebar__item-icon {
    transform: scale(1.3) rotate(-10deg);
    animation: none;
    filter: drop-shadow(0 0 15px rgba(230, 57, 70, 0.9));
}

/* Stagger animation when expanding */
.cg-sidebar.collapsed:hover .cg-sidebar__item-text {
    animation: slideInLeft 0.3s ease forwards;
}

.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(1) .cg-sidebar__item-text { animation-delay: 0.02s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(2) .cg-sidebar__item-text { animation-delay: 0.04s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(3) .cg-sidebar__item-text { animation-delay: 0.06s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(4) .cg-sidebar__item-text { animation-delay: 0.08s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(5) .cg-sidebar__item-text { animation-delay: 0.1s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(6) .cg-sidebar__item-text { animation-delay: 0.12s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(7) .cg-sidebar__item-text { animation-delay: 0.14s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(8) .cg-sidebar__item-text { animation-delay: 0.16s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(9) .cg-sidebar__item-text { animation-delay: 0.18s; }
.cg-sidebar.collapsed:hover .cg-sidebar__item:nth-child(10) .cg-sidebar__item-text { animation-delay: 0.2s; }

/* New badge */
.cg-game-card__new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
}

/* Rating badge */
.cg-game-card__rating-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f77f00 0%, #d62828 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 5;
}

/* ---- FAQ SECTION ---- */
.cg-faq {
    margin-top: 48px;
    margin-bottom: 48px;
}

.cg-faq__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px;
    text-align: center;
}

.cg-faq__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 16px;
}

.cg-faq__item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 20px;
    transition: all var(--transition);
}

.cg-faq__item:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-red);
}

.cg-faq__question {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--accent-light);
}

.cg-faq__answer {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ---- FOOTER ---- */
.cg-footer {
    margin-left: var(--sidebar-width-expanded);
    background: var(--bg-header);
    border-top: 1px solid var(--border-color);
    padding: 0;
    position: relative;
    transition: margin-left 0.3s ease-out;
}

body.sidebar-collapsed .cg-footer {
    margin-left: var(--sidebar-width-collapsed);
}

.cg-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-hot);
}

.cg-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr;
    gap: 32px;
    padding: 40px 32px 32px;
}

.cg-footer__logo {
    height: 44px;
    width: auto;
    margin-bottom: 12px;
    display: block;
}

.cg-footer__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0 0 12px;
}

.cg-footer__learn-more {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}

.cg-footer__learn-more:hover {
    gap: 10px;
    color: var(--accent-orange);
}

.cg-footer__col-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.cg-footer__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cg-footer__cat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
    white-space: nowrap;
}

.cg-footer__cat-item i {
    font-size: 11px;
    color: var(--accent-light);
}

.cg-footer__cat-item:hover {
    border-color: var(--accent);
    color: var(--text-primary);
    background: var(--warm-subtle);
}

.cg-footer__link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cg-footer__link-list li {
    margin-bottom: 10px;
}

.cg-footer__link-list a {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.cg-footer__link-list a:hover {
    color: var(--accent-light);
}

.cg-footer__contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-hot);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.cg-footer__contact-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--glow-red);
    color: #fff;
}

.cg-footer__social {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cg-footer__social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.cg-footer__social a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: var(--glow-red);
}

.cg-footer__bottom {
    border-top: 1px solid var(--border-color);
    padding: 16px 32px;
    text-align: center;
}

.cg-footer__copy {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* ---- HAMBURGER (mobile) ---- */
.cg-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--accent-light);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

/* ---- SIDEBAR OVERLAY (mobile) ---- */
.cg-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 899;
}

/* ---- LEVEL UP TOAST ---- */
.lvl-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #1a0a0a, #2e1010);
    border: 2px solid #e63946;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.35);
    animation: toastSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), toastFadeOut 0.4s ease 6s forwards;
    min-width: 280px;
}

.lvl-toast__badge img {
    width: 52px;
    height: auto;
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.5));
}

.lvl-toast__badge-num {
    font-size: 28px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

.lvl-toast__info {
    display: flex;
    flex-direction: column;
}

.lvl-toast__title {
    font-size: 16px;
    font-weight: 800;
    background: linear-gradient(90deg, #ff8c00, #e63946);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.lvl-toast__level {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.lvl-toast__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
    position: absolute;
    top: 8px;
    right: 10px;
}

.lvl-toast__close:hover {
    color: var(--accent-light);
}

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(120%); }
}

/* ---- LEVEL UP TOAST ---- */
.cg-toast-levelup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(230, 57, 70, 0.3);
    animation: toastSlideIn 0.4s ease, toastFadeOut 0.4s ease 5s forwards;
    max-width: 320px;
}

.cg-toast-levelup__icon img {
    width: 48px;
    height: auto;
}

.cg-toast-levelup__text {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cg-toast-levelup__text strong {
    font-size: 14px;
    color: var(--accent-orange);
}

.cg-toast-levelup__text span {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.cg-toast-levelup__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    margin-left: auto;
}

@keyframes toastSlideIn {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(120%); }
}

/* ---- EMAIL VERIFIED TOAST ---- */
.cg-toast-verified {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #1a332a 0%, #162e26 100%);
    border: 2px solid #34d399;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(52, 211, 153, 0.25);
    animation: toastSlideIn 0.4s ease, toastFadeOut 0.4s ease 6s forwards;
    max-width: 360px;
}

.cg-toast-verified__icon {
    width: 48px;
    height: 48px;
    background: rgba(52, 211, 153, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cg-toast-verified__icon i {
    font-size: 24px;
    color: #34d399;
}

.cg-toast-verified__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cg-toast-verified__text strong {
    font-size: 15px;
    color: #34d399;
}

.cg-toast-verified__text span {
    font-size: 13px;
    color: var(--text-secondary);
}

.cg-toast-verified__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    margin-left: auto;
    transition: color 0.2s;
}

.cg-toast-verified__close:hover {
    color: #34d399;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ---- GAME PAGE OVERRIDES ---- */
/* When old style.css is loaded alongside, make sure our layout still works */
body.cg-layout .cg-main .game_wrapper,
body.cg-layout .cg-main .blue_box,
body.cg-layout .cg-main .categorised_games,
body.cg-layout .cg-main .all_category {
    margin-left: 0;
    margin-right: 0;
}

body.cg-layout .cg-main .all_category {
    display: none; /* Hide old category bar on game page — sidebar handles it */
}

body.cg-layout .cg-main .blue_box {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
}

body.cg-layout .cg-main .game_wrapper {
    background: transparent;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .cg-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .cg-hamburger {
        display: block;
    }

    /* Hide toggle button on mobile */
    .cg-sidebar__toggle {
        display: none;
    }

    .cg-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: var(--sidebar-width-expanded) !important;
    }

    .cg-sidebar.collapsed {
        width: var(--sidebar-width-expanded) !important;
    }
    
    .cg-sidebar.collapsed .cg-sidebar__item-text,
    .cg-sidebar.collapsed .cg-sidebar__title,
    .cg-sidebar.collapsed .cg-sidebar__footer {
        opacity: 1 !important;
        transform: none !important;
        height: auto !important;
        padding: initial !important;
    }

    .cg-sidebar.open {
        transform: translateX(0);
    }

    .cg-sidebar-overlay.open {
        display: block;
    }

    .cg-main,
    .cg-footer {
        margin-left: 0 !important;
    }

    .cg-header__left {
        width: auto !important;
    }

    .cg-footer__top {
        grid-template-columns: 1fr 1fr;
    }

    .cg-header__logo {
        width: auto;
    }

    .cg-header__search {
        max-width: none;
    }

    .cg-hero__slide {
        aspect-ratio: 16/7;
    }

    .cg-hero__slide-title {
        font-size: 20px;
    }

    .cg-game-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }

    .cg-game-card {
        border-radius: 8px;
    }

    .cg-game-card__overlay {
        opacity: 1;
        padding: 20px 6px 6px;
    }

    .cg-game-card__name {
        font-size: 11px;
    }

    .cg-faq__grid {
        grid-template-columns: 1fr;
    }

    .cg-footer__inner {
        flex-direction: column;
        text-align: center;
    }

    .cg-footer__links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .cg-footer__top {
        grid-template-columns: 1fr;
        padding: 24px 16px;
        gap: 24px;
    }

    .cg-header__nav-link {
        display: none;
    }
}

@media (max-width: 480px) {
    .cg-game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .cg-main {
        padding: 16px 12px;
    }

    .cg-section__title {
        font-size: 16px;
    }
}


/* ---- EMAIL VERIFICATION BANNER ---- */
.cg-verify-banner {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid var(--accent);
    padding: 12px 20px;
    z-index: 999;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cg-verify-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cg-verify-banner__icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-hot);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);
    }
}

.cg-verify-banner__icon i {
    font-size: 20px;
    color: #fff;
}

.cg-verify-banner__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cg-verify-banner__content strong {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.cg-verify-banner__content span {
    font-size: 13px;
    color: var(--text-secondary);
}

.cg-verify-banner__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--gradient-hot);
    color: #fff !important;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.cg-verify-banner__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
    color: #fff !important;
    text-decoration: none;
}

.cg-verify-banner__close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.cg-verify-banner__close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Adjust main content when banner is visible */
body.has-verify-banner .cg-sidebar {
    top: calc(var(--header-height) + 64px);
}

body.has-verify-banner .cg-main {
    padding-top: 64px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cg-verify-banner {
        padding: 10px 12px;
    }
    
    .cg-verify-banner__inner {
        gap: 10px;
    }
    
    .cg-verify-banner__icon {
        width: 36px;
        height: 36px;
    }
    
    .cg-verify-banner__icon i {
        font-size: 16px;
    }
    
    .cg-verify-banner__content strong {
        font-size: 13px;
    }
    
    .cg-verify-banner__content span {
        display: none;
    }
    
    .cg-verify-banner__btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .cg-verify-banner__icon {
        display: none;
    }
    
    .cg-verify-banner__btn {
        padding: 8px 12px;
    }
    
    .cg-verify-banner__btn i {
        display: none;
    }
}


/* ============================================
   MOBILE OPTIMIZATIONS - SpicyGames
   ============================================ */

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    /* Header adjustments */
    .cg-header {
        height: 60px;
        padding: 0 12px;
    }
    
    .cg-header__logo img {
        height: 50px;
    }
    
    .cg-header__search {
        flex: 1;
        margin: 0 8px;
    }
    
    .cg-header__search input {
        height: 36px;
        font-size: 14px;
        padding-left: 36px;
    }
    
    .cg-header__login-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* Main content with mobile header */
    .cg-main {
        margin-top: 60px;
        padding: 12px;
    }
    
    /* Game page fullscreen optimization */
    .cg-game-container {
        margin: -12px;
        border-radius: 0;
    }
    
    /* Section titles */
    .cg-section__header {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .cg-section__title {
        font-size: 16px;
    }
    
    .cg-section__more {
        font-size: 12px;
    }
    
    /* Better touch area for game cards */
    .cg-game-card {
        min-height: 120px;
    }
    
    .cg-game-card__overlay {
        opacity: 1;
        background: linear-gradient(transparent 30%, rgba(0,0,0,0.9));
    }
    
    /* Footer simplification */
    .cg-footer {
        margin-left: 0;
    }
    
    /* Hamburger menu button */
    .cg-hamburger {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: 24px;
        cursor: pointer;
        flex-shrink: 0;
    }
    
    /* Sidebar overlay */
    .cg-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 899;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .cg-sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }
    
    /* Sidebar mobile */
    .cg-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 950;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 60px;
    }
    
    .cg-sidebar.open {
        transform: translateX(0);
    }
    
    /* User profile trigger area - larger touch target */
    .cg-header__user {
        padding: 8px;
    }
    
    .cg-header__user img {
        width: 36px;
        height: 36px;
    }
}

/* Small phones optimization */
@media (max-width: 480px) {
    :root {
        --header-height: 56px;
    }
    
    .cg-header {
        height: 56px;
        padding: 0 8px;
        gap: 8px;
    }
    
    .cg-header__logo img {
        height: 40px;
    }
    
    .cg-header__search input {
        height: 34px;
        font-size: 13px;
    }
    
    .cg-main {
        margin-top: 56px;
        padding: 8px;
    }
    
    /* 3-column grid for small phones */
    .cg-game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .cg-game-card {
        border-radius: 8px;
        min-height: 100px;
    }
    
    .cg-game-card__name {
        font-size: 10px;
    }
    
    .cg-game-card__plays {
        font-size: 9px;
    }
    
    /* Hide less important UI elements */
    .cg-game-card__hot-badge,
    .cg-game-card__new-badge {
        padding: 2px 5px;
        font-size: 8px;
    }
    
    /* Section spacing */
    .cg-section {
        margin-bottom: 20px;
    }
    
    .cg-section__title {
        font-size: 14px;
    }
    
    /* Hero slider */
    .cg-hero__slide {
        aspect-ratio: 16/9;
    }
    
    .cg-hero__slide-title {
        font-size: 16px;
    }
    
    .cg-hero__slide-desc {
        font-size: 12px;
        display: none;
    }
}

/* Landscape phone optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .cg-header {
        height: 48px;
    }
    
    .cg-main {
        margin-top: 48px;
        padding: 8px;
    }
    
    /* Full width game container in landscape */
    .cg-game-container {
        margin: -8px;
        height: calc(100vh - 48px);
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Always show overlay on touch devices */
    .cg-game-card__overlay {
        opacity: 1;
    }
    
    /* Remove hover transforms on touch */
    .cg-game-card:hover {
        transform: none;
    }
    
    /* Active state instead of hover */
    .cg-game-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Larger tap targets */
    .cg-sidebar__item {
        padding: 12px 16px;
        min-height: 48px;
    }
    
    .cg-header__nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* PWA / Fullscreen game mode */
@media (display-mode: standalone) {
    .cg-header {
        padding-top: env(safe-area-inset-top);
    }
    
    .cg-main {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
    .cg-header {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .cg-main {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
    
    .cg-sidebar {
        padding-left: env(safe-area-inset-left);
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .cg-game-card__overlay {
        background: rgba(0, 0, 0, 0.95);
    }
    
    .cg-game-card__name {
        font-weight: 700;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .cg-game-card:hover {
        transform: none;
    }
}

/* ===== Header notification bell ===== */
.cg-notif {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cg-notif__bell {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition);
}

.cg-notif__bell:hover {
    background: var(--warm-subtle);
    color: var(--accent-light);
}

.cg-notif__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--accent, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
    animation: reward-badge-pulse 2s infinite; /* reuse existing keyframes */
}

.cg-notif__dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background: var(--surface, #1b1b1f);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.cg-notif__dropdown.is-open {
    display: block;
}

.cg-notif__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.1));
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.cg-notif__markall {
    background: transparent;
    border: none;
    color: var(--accent-light, #ff8a65);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.cg-notif__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}

.cg-notif__item {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer;
    transition: background var(--transition);
}

.cg-notif__item:hover {
    background: rgba(255,255,255,0.04);
}

.cg-notif__item.is-unread {
    background: rgba(239, 68, 68, 0.08);
}

.cg-notif__item-icon {
    flex: 0 0 auto;
    font-size: 16px;
    color: var(--accent-light, #ff8a65);
}

.cg-notif__item.is-read .cg-notif__item-icon {
    color: var(--text-muted, #888);
}

.cg-notif__item-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.cg-notif__item-title {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.cg-notif__item-msg {
    font-size: 12px;
    color: var(--text-secondary, #bbb);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cg-notif__item-time {
    font-size: 10px;
    color: var(--text-muted, #888);
}
