/**
 * Card Games Gallery - Homepage Styles
 * Full-page game gallery for trycardgames.com
 *
 * Design: Deep indigo background, card-themed game tiles,
 * categorized sections, responsive grid layout
 */

/* ============================================
   GALLERY CONTAINER
   ============================================ */

.cg-gallery {
    min-height: 100vh;
    background: linear-gradient(180deg, #1a1b3a 0%, #12132a 50%, #0e0f22 100%);
    color: #e8e9f3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ============================================
   HEADER
   ============================================ */

.cg-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(26, 27, 58, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(93, 95, 170, 0.2);
}

.cg-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cg-logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.cg-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.cg-site-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
}

.cg-header-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.cg-header-link {
    color: rgba(232, 233, 243, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.cg-header-link:hover {
    color: #fff;
}

/* ============================================
   HERO SECTION
   ============================================ */

.cg-hero {
    padding: 3rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cg-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(86, 88, 168, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.cg-hero-inner {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.cg-hero-suits {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    line-height: 1;
}

.cg-suit {
    display: inline-block;
    animation: suitFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.cg-suit-heart { color: #e74c3c; animation-delay: 0s; }
.cg-suit-diamond { color: #f39c12; animation-delay: 0.4s; }
.cg-suit-spade { color: #3498db; animation-delay: 0.8s; }
.cg-suit-club { color: #2ecc71; animation-delay: 1.2s; }

@keyframes suitFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.cg-hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #c8c9e4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cg-hero-subtitle {
    font-size: 1.15rem;
    color: rgba(232, 233, 243, 0.65);
    margin: 0;
    font-weight: 400;
}

/* ============================================
   SECTION LAYOUT
   ============================================ */

.cg-section {
    padding: 1.5rem 1.5rem 2rem;
}

.cg-section-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.cg-section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
}

.cg-section-icon {
    font-size: 1.5rem;
    color: #3498db;
}

.cg-section-icon-puzzle {
    font-size: 1.2rem;
    color: #f39c12;
}

/* ============================================
   SECTION HEADER (title + carousel nav)
   ============================================ */

.cg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.cg-section-header .cg-section-title {
    margin: 0;
}

/* ============================================
   CAROUSEL
   ============================================ */

.cg-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 0.5rem;

    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

/* Carousel navigation buttons */
.cg-carousel-nav {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cg-carousel-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(93, 95, 170, 0.3);
    background: rgba(43, 45, 94, 0.6);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cg-carousel-btn:hover:not(:disabled) {
    background: rgba(61, 63, 122, 0.8);
    border-color: rgba(123, 125, 196, 0.5);
}

.cg-carousel-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

/* ============================================
   GAME CARDS
   ============================================ */

.cg-game-card {
    flex: 0 0 160px;
    scroll-snap-align: start;
    background: rgba(43, 45, 94, 0.5);
    border: 1px solid rgba(93, 95, 170, 0.2);
    border-radius: 14px;
    padding: 1rem;
    text-decoration: none;
    color: #e8e9f3;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.cg-game-card:hover {
    background: rgba(61, 63, 122, 0.6);
    border-color: rgba(123, 125, 196, 0.4);
    transform: translateY(-4px);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(123, 125, 196, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cg-game-card:active {
    transform: translateY(-2px);
}

/* Game thumbnail */
.cg-game-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cg-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badges */
.cg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    z-index: 2;
}

.cg-badge-popular {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.cg-badge-trending {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

/* Game name */
.cg-game-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: #fff;
    line-height: 1.2;
}

/* Game description */
.cg-game-desc {
    font-size: 0.78rem;
    color: rgba(232, 233, 243, 0.5);
    margin: 0;
    line-height: 1.3;
}

/* ============================================
   FEATURES BAR
   ============================================ */

.cg-features {
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(93, 95, 170, 0.15);
}

.cg-features-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
}

.cg-feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: rgba(232, 233, 243, 0.6);
    font-weight: 500;
}

.cg-feature i {
    color: #fbbf24;
    font-size: 0.85rem;
}

/* ============================================
   FOOTER
   ============================================ */

.cg-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(93, 95, 170, 0.1);
    text-align: center;
}

.cg-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.cg-footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
}

.cg-footer-links a {
    color: rgba(232, 233, 243, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.cg-footer-links a:hover {
    color: #fff;
}

.cg-footer-copy {
    font-size: 0.8rem;
    color: rgba(232, 233, 243, 0.3);
    margin: 0;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .cg-hero-title {
        font-size: 2rem;
    }

    .cg-hero-suits {
        font-size: 2rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    .cg-hero {
        padding: 2rem 1rem 1.5rem;
    }

    .cg-hero-title {
        font-size: 1.6rem;
    }

    .cg-hero-subtitle {
        font-size: 1rem;
    }

    .cg-hero-suits {
        font-size: 1.8rem;
        gap: 0.5rem;
    }

    .cg-section {
        padding: 1rem 1rem 1.5rem;
    }

    .cg-section-title {
        font-size: 1.2rem;
    }

    .cg-game-card {
        flex: 0 0 130px;
        padding: 0.75rem 0.5rem;
        border-radius: 12px;
    }

    .cg-game-thumb {
        width: 60px;
        height: 60px;
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }

    .cg-game-name {
        font-size: 0.8rem;
    }

    .cg-game-desc {
        font-size: 0.7rem;
    }

    .cg-badge {
        font-size: 0.5rem;
        padding: 0.1rem 0.3rem;
    }

    .cg-carousel-nav {
        display: none;
    }

    .cg-features-inner {
        gap: 1rem 1.5rem;
    }

    .cg-feature {
        font-size: 0.8rem;
    }

    .cg-header-inner {
        padding: 0.6rem 1rem;
    }

    .cg-logo {
        width: 32px;
        height: 32px;
    }

    .cg-site-name {
        font-size: 1.05rem;
    }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */

@media (max-width: 480px) {
    .cg-hero-title {
        font-size: 1.35rem;
    }

    .cg-hero-subtitle {
        font-size: 0.9rem;
    }

    .cg-hero-suits {
        font-size: 1.5rem;
    }

    .cg-game-card {
        flex: 0 0 115px;
    }

    .cg-game-thumb {
        width: 56px;
        height: 56px;
    }

    .cg-footer-links {
        gap: 1rem;
    }
}

/* ============================================
   WIDE DESKTOP
   ============================================ */

@media (min-width: 1400px) {
    .cg-game-card {
        flex: 0 0 180px;
    }

    .cg-game-thumb {
        width: 90px;
        height: 90px;
    }
}
