/* ============================================
   Explore Page — desktop layout (Cosmic Arcade)
   ============================================
   Loaded only by desktop/explorer.html, after explorer.css.
   Cosmic hero (data-mode search / filter / genre, set by explorer.js), chip controls,
   result count, fluid grid with neon hover rim.
   ============================================ */

.explore-page .search-section {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-width: none;
    margin: var(--space-2) 0 var(--space-6);
    padding: 0;
}

/* ---------- Cosmic hero: search / filter / genre (data-mode set by explorer.js) ---------- */
.explore-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 220px;
    padding: 34px 38px;
    display: flex;
    align-items: center;
    border-radius: 28px;
    border: 1px solid var(--line-2);
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
    box-shadow: var(--shadow-card);
}

/* star dust */
.explore-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        radial-gradient(1px 1px at 12% 28%, rgba(255, 255, 255, 0.8), transparent 60%),
        radial-gradient(1px 1px at 58% 18%, rgba(255, 255, 255, 0.7), transparent 60%),
        radial-gradient(1px 1px at 90% 30%, rgba(255, 255, 255, 0.7), transparent 60%);
    opacity: 0.35;
}

/* genre art occupies the right ~60%, fading in from the text column */
.explore-hero__art {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 40%;
    z-index: -1;
    background-size: cover;
    background-position: center 35%;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 0.5s var(--ease-out), transform 0.8s var(--ease-out);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%);
    mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.6) 22%, #000 45%);
}

.explore-hero__body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 660px;
}

.explore-hero .explore-head {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.explore-hero .explore-head__icon {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 32px;
    line-height: 1;
}

.explore-hero .explore-head__icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.explore-hero .explore-head__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.explore-hero .explore-head__eyebrow {
    width: fit-content;
    font-family: var(--font-display);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-400);
}

.explore-hero .explore-head__title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(30px, 2.8vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: #fff;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.explore-hero__desc {
    margin: 0;
    max-width: 480px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.explore-hero__row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.explore-hero__make[hidden] {
    display: none;
}

.explore-hero__make {
    height: 50px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    font-size: 15px;
}

/* Search field (all modes) — standard focus ring */
.explore-page .search-container {
    flex: 1 1 auto;
    width: auto;
    max-width: 520px;
    height: 50px;
    background: rgba(8, 6, 24, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.explore-page .search-container:focus-within {
    background: rgba(8, 6, 24, 0.72);
    border-color: var(--line-accent);
    box-shadow: var(--focus-ring);
}

.explore-page .search-container:focus-within .search-container__icon {
    color: var(--accent-300);
}

/* Search mode (plain /explore): centered, search-first */
.explore-hero[data-mode="search"] {
    min-height: 260px;
    justify-content: center;
    text-align: center;
}

.explore-hero[data-mode="search"] .explore-hero__body {
    align-items: center;
    max-width: 720px;
}

.explore-hero[data-mode="search"] .explore-head {
    flex-direction: column;
    gap: 12px;
}

.explore-hero[data-mode="search"] .explore-head__text {
    align-items: center;
}

.explore-hero[data-mode="search"] .explore-head__title {
    font-size: clamp(34px, 3.4vw, 48px);
}

.explore-hero[data-mode="search"] .explore-hero__row {
    width: 100%;
    justify-content: center;
}

.explore-hero[data-mode="search"] .search-container {
    max-width: 640px;
    height: 58px;
    border-color: var(--line-2);
    box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8);
}

.explore-hero[data-mode="search"] .search-input {
    font-size: 16px;
}

/* Genre mode: the maker genre art fills the right side */
.explore-hero[data-mode="genre"] {
    min-height: 280px;
}

.explore-hero[data-mode="genre"] .explore-hero__art {
    opacity: 1;
    transform: none;
}

.explore-hero[data-mode="genre"] .explore-head__title {
    font-size: clamp(36px, 3.6vw, 52px);
}

/* Filter mode: one subtle wash tinted per filter */
.explore-hero[data-key="weekly"] {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(249, 115, 22, 0.18) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
}

.explore-hero[data-key="favorites"] {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(244, 63, 94, 0.16) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
}

.explore-hero[data-key="recent"] {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(34, 211, 238, 0.14) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
}

.explore-hero[data-key="new"] {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(250, 204, 21, 0.13) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
}

.explore-hero[data-key="featured"],
.explore-hero[data-key="toppicks"] {
    background:
        radial-gradient(60% 120% at 0% 0%, rgba(192, 38, 211, 0.16) 0%, transparent 60%),
        linear-gradient(135deg, #17132f 0%, #110d26 100%);
}

/* ---------- Controls: genre chip rail, category segmented, count + sort ---------- */
.explore-page .explore-controls {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    margin-top: 20px;
}

/* labels stay in the DOM (explorer.js reads them for the hero eyebrow) but not on screen */
.explore-page .explore-controls .filter-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.explore-page .explore-controls .filter-control {
    height: auto;
    min-width: 0;
}

.explore-page .filter-control--genre {
    display: block;
}

.explore-chip.is-active .ui-chip__icon {
    filter: drop-shadow(0 0 6px rgba(196, 181, 253, 0.8));
}

.explore-controls__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
}

.explore-seg {
    height: 32px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--duration-fast) ease, background var(--duration-fast) ease;
}

.explore-seg:hover {
    color: #fff;
    background: var(--surface-2);
}

.explore-seg.is-active {
    color: #fff;
    background: var(--gradient-primary);
    box-shadow: 0 6px 18px -8px rgba(124, 58, 237, 0.9);
}

.explore-controls__right {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.explore-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px 0 12px;
    border-radius: var(--radius-full);
    background: var(--surface-1);
    border: 1px solid var(--line-1);
    color: var(--text-tertiary);
    font-size: 13px;
}

.explore-count[hidden] {
    display: none;
}

.explore-count svg {
    width: 17px;
    height: 17px;
    color: var(--accent-cyan);
}

.explore-count strong {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.explore-page .sort-control {
    height: 38px;
}

/* ---------- Grid: fluid columns, neutral lift on hover ---------- */
.explore-page .game-grid-section {
    max-width: none;
    padding: 0;
}

.explore-page .game-grid {
    grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
    gap: 30px 22px;
    max-width: none;
}

.explore-page .game-grid .social-card--extended {
    width: auto;
    max-width: none;
    min-width: 0;
}

.explore-page .game-grid .social-card--extended:hover .social-card__thumbnail {
    box-shadow:
        0 0 0 1.5px rgba(255, 255, 255, 0.22),
        0 18px 40px -16px rgba(0, 0, 0, 0.85);
}

.explore-page .empty-state {
    border-color: var(--line-2);
    background: radial-gradient(50% 90% at 50% 0%, rgba(124, 58, 237, 0.1), transparent 70%);
}

.explore-page .empty-cta-button {
    background: var(--gradient-cta);
    border-radius: var(--radius-full);
    box-shadow: 0 10px 26px -12px rgba(124, 58, 237, 0.7);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .explore-hero {
        padding: 28px 26px;
    }

    .explore-hero__row {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .explore-hero .explore-head__title {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .explore-hero__art {
        transition: none;
    }
}
