/* ============================================
   Landing — showcase (Cosmic Arcade, 2026-09-23)
   ============================================
   Galleries/carousels, Hot This Week bento, genre switcher carousel, top creators.
   Loaded after landing-sections.css; mobile.css still loads last.
   ============================================ */

/* ============================================
   Galleries
   ============================================ */
.gallery {
    position: relative;
}

.gallery__head {
    margin-bottom: var(--space-3);
}

/* Emoji stand-in for sections without an SVG icon (Hot This Week) */
/* Legacy header (mobile/landing-mobile.html still renders .game-header) */
.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 var(--space-3);
    min-height: 40px;
}

.game-header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.game-header__title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: #fff;
}

.game-header__link {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--line-1);
    background: var(--surface-1);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.game-header__link:hover {
    color: #fff;
    background: var(--accent-soft);
    border-color: var(--line-accent);
}

/* Carousel */
.carousel-wrapper {
    position: relative;
}

.game-carousel {
    display: flex;
    gap: 18px;
    margin: -10px -10px 0;
    padding: 10px 10px 26px; /* room for hover lift + stat counts */
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}

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

.game-carousel .social-card--extended {
    width: 256px;
    min-width: 256px;
    max-width: 256px;
}

/* Arrows: glass discs on the edges. landing.js drives opacity/pointer-events inline
   (start/end of scroll); visibility here only reveals them while the section is hovered. */
.carousel-nav {
    position: absolute;
    top: 128px; /* centered on the 256px square thumbnail */
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line-2);
    background: rgba(24, 22, 48, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.8);
    visibility: hidden;
    transition: visibility 0s linear 0.2s, background var(--duration-fast) ease, border-color var(--duration-fast) ease, transform var(--duration-fast) ease, opacity 0.2s ease;
}

.gallery:hover .carousel-nav {
    visibility: visible;
    transition-delay: 0s;
}

.carousel-nav:hover {
    background: var(--accent-600);
    border-color: var(--accent-400);
    transform: translateY(-50%) scale(1.06);
}

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

.carousel-nav--left {
    left: -14px;
}

.carousel-nav--right {
    right: -14px;
}

.carousel-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Show More card (end of every carousel) */
.show-more-card {
    flex-shrink: 0;
    width: 180px;
    height: 256px; /* matches the square thumbnail */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--surface-1);
    border: 1px dashed var(--line-2);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color var(--duration-normal) ease, background var(--duration-normal) ease, transform var(--duration-normal) var(--ease-out);
}

.show-more-card:hover {
    border-color: var(--line-accent);
    border-style: solid;
    background: var(--surface-2);
    transform: translateY(-3px);
}

.show-more-card__icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    transition: transform var(--duration-normal) var(--ease-spring);
}

.show-more-card:hover .show-more-card__icon {
    transform: translateX(4px);
}

.show-more-card__text {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Empty state (desktop adds ui-empty from ui.css; mobile landing has no ui.css) */
.empty-state {
    flex: 1;
    width: 100%;
    text-align: center;
}

.game-carousel .empty-state {
    padding: 32px 24px;
}

.mobile-view .empty-state {
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.mobile-view .empty-state .ui-empty__icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.mobile-view .empty-state .ui-empty__title {
    font-size: 16px;
    color: var(--text-secondary);
}

.mobile-view .empty-state .ui-btn {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 18px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

/* ============================================
   Bento — Hot This Week (1 hero card + up to 4 tiles)
   ============================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 18px;
}

.bento .social-card--extended.bento__item {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.bento .bento__item--hero {
    grid-column: span 2;
    grid-row: span 2;
}

.bento .bento__item--hero .social-card__thumbnail {
    border-radius: 20px;
    box-shadow: 0 0 0 1px var(--line-2), 0 26px 60px -24px rgba(0, 0, 0, 0.9);
}

.bento .bento__item--hero .social-card__meta {
    font-size: 16px;
}

/* Sparse weeks (1–2 games): regular-size cards + a wide CTA tile instead of a giant hero */
.bento[data-count="1"],
.bento[data-count="2"] {
    grid-template-columns: repeat(auto-fill, minmax(240px, 300px));
}

.bento[data-count="1"] .bento__item--hero,
.bento[data-count="2"] .bento__item--hero {
    grid-column: auto;
    grid-row: auto;
}

.bento[data-count="1"] .bento__item--hero .social-card__thumbnail,
.bento[data-count="2"] .bento__item--hero .social-card__thumbnail {
    box-shadow: none;
}

.bento[data-count="1"] .bento__cta,
.bento[data-count="2"] .bento__cta {
    grid-column: span 2;
}

.bento[data-count="3"] .bento__cta {
    grid-column: span 2;
}

/* "Your game could be here" — fills the free bento slots */
.bento__cta {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: 240px;
    padding: 22px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px dashed var(--line-2);
    background: var(--surface-solid);
    color: #fff;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--duration-fast) ease, transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) ease;
}

.bento__cta-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    transition: opacity var(--duration-normal) ease, transform 0.6s var(--ease-out);
}

.bento__cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 11, 34, 0.1) 0%, rgba(13, 11, 34, 0.92) 85%);
}

.bento__cta-copy,
.bento__cta-go {
    position: relative;
    z-index: 1;
}

.bento__cta-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 360px;
}

.bento__cta-copy strong {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.bento__cta-copy span {
    font-size: 13px;
    color: var(--text-secondary);
}

.bento__cta-go {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--gradient-primary);
    transition: transform var(--duration-normal) var(--ease-spring);
}

.bento__cta-go svg {
    width: 18px;
    height: 18px;
}

.bento__cta:hover {
    border-style: solid;
    border-color: var(--line-accent);
    transform: translateY(-3px);
    box-shadow: 0 22px 44px -20px rgba(0, 0, 0, 0.9);
}

.bento__cta:hover .bento__cta-art {
    opacity: 0.75;
    transform: scale(1.05);
}

.bento__cta:hover .bento__cta-go {
    transform: translateX(4px);
}

/* ============================================
   Genre showcase — one carousel switched by chips
   ============================================ */
.genre-showcase__chips {
    margin: -4px 0 14px;
}

.game-carousel.is-loading {
    opacity: 0.45;
    transition: opacity var(--duration-fast) ease;
}

.genre-empty {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 150px;
    padding: 16px 22px 16px 16px;
    border-radius: var(--radius-2xl);
    border: 1px dashed var(--line-2);
    background: var(--surface-1);
}

.genre-empty__art {
    width: 180px;
    aspect-ratio: 3 / 2;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 16px 34px -18px rgba(0, 0, 0, 0.9);
}

.genre-empty__copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.genre-empty__copy strong {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.genre-empty__copy span {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ============================================
   Top creators strip
   ============================================ */
.creators__rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 2px 8px;
}

.creators__rail::-webkit-scrollbar {
    display: none;
}

.creator-chip {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
    padding: 12px 16px 12px 12px;
    border-radius: var(--radius-2xl);
    background: var(--surface-1);
    border: 1px solid var(--line-1);
    color: inherit;
    text-decoration: none;
    transition: transform var(--duration-fast) ease, border-color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.creator-chip:hover {
    transform: translateY(-2px);
    background: var(--surface-2);
    border-color: var(--line-accent);
}

.creator-chip__rank {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-tertiary);
}

.creator-chip--rank-1 .creator-chip__rank { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2604; }
.creator-chip--rank-2 .creator-chip__rank { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #1e293b; }
.creator-chip--rank-3 .creator-chip__rank { background: linear-gradient(135deg, #fdba74, #c2410c); color: #3b1504; }

.creator-chip__avatar {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    overflow: hidden;
    background: var(--gradient-primary);
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 3px var(--line-2);
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.creator-chip__avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.creator-chip__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.creator-chip__name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.creator-chip__meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ============================================
   Responsive (showcase)
   ============================================ */
@media (max-width: 1280px) {
    .bento {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bento .bento__item:nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 1024px) {
    .carousel-nav {
        display: none; /* touch swipe only */
    }
}

@media (max-width: 768px) {
    .game-carousel .social-card--extended {
        width: 220px;
        min-width: 220px;
        max-width: 220px;
    }

    .show-more-card {
        width: 160px;
        height: 220px;
    }

    .bento {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bento .bento__item--hero {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .genre-empty {
        flex-direction: column;
        text-align: center;
    }
}
