/* === CrazyGames Homepage Custom Styles === */
.cg-wrap {
    width: 100%;
    margin: 0 auto;
    font-family: inherit;
    color: #1e293b;
}

/* --- Top Header Navigation Bar --- */
.cg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    position: sticky;
    top: 10px;
    z-index: 50;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}
.cg-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.cg-logo-link:hover {
    transform: scale(1.04);
}
.cg-logo-img {
    height: 40px;
    max-width: 150px;
    object-fit: contain;
}

/* Search Bar Trigger */
.cg-search-trigger {
    flex: 1;
    max-width: 580px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f5f9;
    border: 1.5px solid transparent;
    padding: 9px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #64748b;
}
.cg-search-trigger:hover {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    color: #0f172a;
}
.cg-search-icon {
    width: 20px;
    height: 20px;
    color: #64748b;
    flex-shrink: 0;
}
.cg-search-text {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.cg-search-kbd {
    background: #e2e8f0;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Topbar Actions */
.cg-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.cg-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}
.cg-action-btn-random {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(147, 51, 234, 0.25);
}
.cg-action-btn-random:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(147, 51, 234, 0.35);
}
.cg-action-btn-search-mobile {
    display: none;
    background: #f1f5f9;
    color: #334155;
    padding: 10px;
}

/* --- Category Filter Navigation Strip --- */
.cg-category-bar-wrapper {
    position: relative;
    margin-bottom: 24px;
}
.cg-category-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cg-category-bar::-webkit-scrollbar {
    display: none;
}
.cg-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
}
.cg-cat-pill:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}
.cg-cat-pill.active {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}
.cg-cat-pill .cg-cat-icon {
    font-size: 16px;
    line-height: 1;
}

/* Category Bar Scroll Chevrons */
.cg-cat-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: all 0.2s ease;
    color: #334155;
}
.cg-cat-nav-btn:hover {
    background: #0f172a;
    color: #ffffff;
}
.cg-cat-nav-prev { left: -14px; }
.cg-cat-nav-next { right: -14px; }

/* --- Hero Showcase Section --- */
.cg-hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 34px;
}
@media (max-width: 1024px) {
    .cg-hero-section {
        grid-template-columns: 1fr;
    }
    .cg-hero-side {
        display: none;
    }
}

/* Hero Slider Main */
.cg-hero-slider {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    background: #0f172a;
}
.cg-hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    background-size: cover;
    background-position: center;
}
.cg-hero-slide.active {
    opacity: 1;
    pointer-events: auto;
}
.cg-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.75) 50%, rgba(15, 23, 42, 0.2) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 36px 40px;
}
@media (max-width: 640px) {
    .cg-hero-slider {
        height: 320px;
    }
    .cg-hero-overlay {
        padding: 24px 20px;
        background: linear-gradient(0deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.6) 70%, rgba(15, 23, 42, 0.1) 100%);
    }
}
.cg-hero-badge-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.cg-hero-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}
.cg-hero-cat-tag {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #f1f5f9;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    text-transform: capitalize;
}
.cg-hero-title {
    color: #ffffff;
    font-size: 34px;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
@media (max-width: 640px) {
    .cg-hero-title {
        font-size: 24px;
    }
}
.cg-hero-desc {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.5;
    max-width: 500px;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cg-hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 28px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transition: all 0.25s ease;
    align-self: flex-start;
}
.cg-hero-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.55);
}

/* Slider Controls */
.cg-hero-arrows {
    position: absolute;
    bottom: 30px;
    right: 36px;
    display: flex;
    gap: 10px;
    z-index: 20;
}
@media (max-width: 640px) {
    .cg-hero-arrows {
        bottom: 20px;
        right: 20px;
    }
}
.cg-hero-arrow-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cg-hero-arrow-btn:hover {
    background: #ffffff;
    color: #0f172a;
    transform: scale(1.08);
}
.cg-hero-dots {
    position: absolute;
    bottom: 20px;
    left: 40px;
    display: flex;
    gap: 8px;
    z-index: 20;
}
@media (max-width: 640px) {
    .cg-hero-dots {
        display: none;
    }
}
.cg-hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.25s ease;
}
.cg-hero-dot.active {
    width: 28px;
    background: #3b82f6;
}

/* Hero Side Spotlight Cards (CrazyGames Right Column) */
.cg-hero-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cg-side-card {
    flex: 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    display: flex;
}
.cg-side-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}
.cg-side-card-overlay {
    width: 100%;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.45) 60%, rgba(15, 23, 42, 0.15) 100%);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.cg-side-card-badge {
    align-self: flex-start;
    background: #e11d48;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.cg-side-card-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 2px;
}
.cg-side-card-cat {
    color: #94a3b8;
    font-size: 12px;
    text-transform: capitalize;
}

/* --- Section Containers --- */
.cg-section {
    margin-bottom: 38px;
}
.cg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.cg-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cg-section-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.cg-icon-trending {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border: 1px solid #fdba74;
}
.cg-icon-new {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
}
.cg-icon-category {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border: 1px solid #7dd3fc;
}
.cg-icon-grid {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 1px solid #d8b4fe;
}

.cg-section-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}
.cg-section-subtitle {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    margin: 2px 0 0;
}
@media (max-width: 640px) {
    .cg-section-title {
        font-size: 18px;
    }
    .cg-section-subtitle {
        display: none;
    }
}
.cg-section-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cg-view-all-link {
    font-size: 13px;
    font-weight: 700;
    color: #3b82f6;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eff6ff;
    transition: all 0.2s ease;
}
.cg-view-all-link:hover {
    background: #3b82f6;
    color: #ffffff;
}
.cg-arrow-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}
.cg-arrow-btn:hover {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* --- Carousel Track (Horizontal Scroll) --- */
.cg-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 2px 14px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cg-carousel::-webkit-scrollbar {
    display: none;
}

/* --- Game Card (CrazyGames Style) --- */
.cg-game-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f1f5f9;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.cg-carousel .cg-game-card {
    width: 175px;
}
@media (max-width: 640px) {
    .cg-carousel .cg-game-card {
        width: 135px;
    }
}
.cg-game-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e1;
}

.cg-card-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f1f5f9;
}
.cg-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.cg-game-card:hover .cg-card-thumb {
    transform: scale(1.1);
}

/* Card Hover Play Icon Overlay */
.cg-card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.cg-game-card:hover .cg-card-play-overlay {
    opacity: 1;
}
.cg-card-play-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #3b82f6;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cg-game-card:hover .cg-card-play-icon {
    transform: scale(1);
}

/* Card Badges */
.cg-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.cg-card-badge-hot {
    background: #ef4444;
    color: #ffffff;
}
.cg-card-badge-new {
    background: #10b981;
    color: #ffffff;
}
.cg-card-badge-feat {
    background: #f59e0b;
    color: #ffffff;
}

/* Card Info Body */
.cg-card-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
}
.cg-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.cg-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}
.cg-card-cat-name {
    text-transform: capitalize;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cg-card-plays {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    font-weight: 600;
    font-size: 11px;
    flex-shrink: 0;
}

/* --- Full Games Catalog Grid - Exactly 3 Rows on Every Screen --- */
.cg-games-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 16px;
}
@media (min-width: 1441px) {
    .cg-games-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    .cg-games-grid > .cg-game-card:nth-child(n+25) {
        display: none !important;
    }
}
@media (min-width: 1201px) and (max-width: 1440px) {
    .cg-games-grid {
        grid-template-columns: repeat(7, 1fr);
    }
    .cg-games-grid > .cg-game-card:nth-child(n+22) {
        display: none !important;
    }
}
@media (min-width: 993px) and (max-width: 1200px) {
    .cg-games-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .cg-games-grid > .cg-game-card:nth-child(n+19) {
        display: none !important;
    }
}
@media (min-width: 769px) and (max-width: 992px) {
    .cg-games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    .cg-games-grid > .cg-game-card:nth-child(n+16) {
        display: none !important;
    }
}
@media (min-width: 521px) and (max-width: 768px) {
    .cg-games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .cg-games-grid > .cg-game-card:nth-child(n+13) {
        display: none !important;
    }
}
@media (max-width: 520px) {
    .cg-games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .cg-games-grid > .cg-game-card:nth-child(n+10) {
        display: none !important;
    }
}
.cg-games-grid .cg-game-card {
    width: 100%;
}

/* --- Ad Container --- */
.cg-ad-box {
    margin: 30px auto;
    max-width: 970px;
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    border: 1px dashed #cbd5e1;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}
.cg-ad-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* --- About Site Card --- */
.cg-about-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 36px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    margin-top: 40px;
    margin-bottom: 20px;
}
.cg-about-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.cg-about-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3b82f6;
}
.cg-about-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #475569;
    margin: 0;
}
.cg-about-content {
    color: #334155;
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .cg-search-trigger {
        display: none;
    }
    .cg-action-btn-search-mobile {
        display: inline-flex;
    }
    .cg-action-btn-random span {
        display: none;
    }
    .cg-topbar {
        padding: 10px 14px;
    }
}