/* games.css - Video game randomizer */
/* === GAMES PAGE === */

.games-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding-bottom: 60px;
    box-sizing: border-box;
}

/* === Filter bar === */
.games-filter {
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 24px 26px;
    margin-bottom: 28px;
    box-shadow: var(--surface-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.games-filter-head {
    text-align: center;
}

    .games-filter-head h2 {
        margin: 0;
        font-size: 1.4rem;
        font-weight: 600;
        color: #fff;
    }

    .games-filter-head p {
        margin: 4px 0 0;
        color: #888;
        font-size: 0.92rem;
    }

/* multi-select dropdowns - triggers + scrollable panels */
.games-multi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.games-multi {
    position: relative;
}

.games-multi-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    color: #ddd;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease;
    min-width: 160px;
}

    .games-multi-trigger:hover:not(:disabled) {
        border-color: var(--surface-border-hover);
        background: rgba(255, 255, 255, 0.06);
    }

    .games-multi-trigger.open {
        border-color: var(--accent);
        background: rgba(255, 255, 255, 0.06);
    }

    .games-multi-trigger:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.games-multi-label {
    color: #fff;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.games-multi-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: var(--accent);
    color: #fff;
    border-radius: 11px;
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.games-multi-chevron {
    color: #888;
    font-size: 0.85rem;
    transition: transform 180ms ease, color 180ms ease;
}

.games-multi-trigger.open .games-multi-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.games-multi-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: transparent;
}

.games-multi-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 260px;
    max-width: 320px;
    background: rgba(20, 20, 24, 0.96);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
}

.games-multi-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
}

.games-multi-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #ddd;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease;
}

    .games-multi-option:hover {
        background: rgba(255, 255, 255, 0.06);
        color: #fff;
    }

    .games-multi-option.active {
        background: color-mix(in srgb, var(--accent) 16%, transparent);
        color: #fff;
    }

    .games-multi-option i {
        color: #666;
        font-size: 1rem;
    }

    .games-multi-option.active i {
        color: var(--accent);
    }

.games-multi-foot {
    border-top: 1px solid var(--surface-border);
    padding: 6px;
}

.games-multi-clear {
    width: 100%;
    padding: 6px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
}

    .games-multi-clear:hover {
        background: rgba(255, 255, 255, 0.05);
        color: #fff;
    }

/* game modes - 3 visible chips (too few to warrant a dropdown) */
.games-modes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.games-mode {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    color: #ddd;
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

    .games-mode i {
        color: #888;
        transition: color 140ms ease;
    }

    .games-mode:hover:not(.active):not(:disabled) {
        background: rgba(255, 255, 255, 0.07);
        color: #fff;
    }

    .games-mode.active {
        background: color-mix(in srgb, var(--accent) 22%, transparent);
        border-color: var(--accent);
        color: #fff;
    }

        .games-mode.active i {
            color: var(--accent);
        }

    .games-mode:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

/* 3-column on wide, auto-stacks via minmax */
.games-controls-row {
    width: 100%;
    max-width: 920px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px 28px;
    align-items: start;
}

    .games-controls-row .games-year-range,
    .games-controls-row .games-slider {
        max-width: none;
    }

/* year range */
.games-year-range {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.games-year-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-year-input {
    width: 92px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    color: #ddd;
    font-size: 0.92rem;
    font-family: inherit;
    text-align: center;
}

    .games-year-input:focus {
        outline: none;
        border-color: var(--accent);
        background: rgba(255, 255, 255, 0.06);
    }

.games-year-sep {
    color: #666;
}

/* sliders */
.games-slider {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.games-slider-label {
    color: #aaa;
    font-size: 0.88rem;
}

    .games-slider-label strong {
        color: #fff;
        font-weight: 600;
        margin: 0 4px;
        font-variant-numeric: tabular-nums;
    }

.games-slider-suffix {
    color: #666;
    font-size: 0.82rem;
}

.games-slider input[type=range] {
    width: 100%;
    accent-color: var(--accent);
}

/* primary action */
.games-randomize {
    width: 100%;
    max-width: 380px;
    padding: 14px 24px;
    font-size: 1.05rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.games-spin {
    display: inline-block;
    animation: games-spin 1s linear infinite;
}

@keyframes games-spin {
    to { transform: rotate(360deg); }
}

/* pool count + error */
.games-pool {
    color: #aaa;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: center;
}

    .games-pool.tight {
        color: #f0c060;
    }

.games-error {
    width: 100%;
    max-width: 520px;
    padding: 12px 16px;
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.35);
    border-radius: 10px;
    color: #f5a5ad;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
}

/* === Result === */
/* hero + details share one bordered card so they read as a continuous unit */
.games-result {
    background: var(--surface-grad);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    box-shadow: var(--surface-shadow);
    overflow: hidden;
    /* sections inside don't invalidate parents */
    contain: layout style paint;
}

.games-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    min-height: 540px;
}

.games-hero-fade {
    position: absolute;
    inset: 0;
    /* opaque at the bottom so bright backdrops can't bleed through the title */
    background: linear-gradient(180deg,
        rgba(0,0,0,0.1) 0%,
        rgba(0,0,0,0.45) 40%,
        rgba(0,0,0,0.85) 75%,
        var(--surface-solid, rgba(20,20,24,1)) 100%
    );
    pointer-events: none;
}

.games-hero-inner {
    position: relative;
    display: flex;
    gap: 28px;
    padding: 36px 38px;
    align-items: flex-end;
    min-height: 540px;
}

.games-cover {
    width: 220px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65);
    flex-shrink: 0;
}

.games-hero-info {
    flex: 1;
    min-width: 0;
}

.games-franchise {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.games-title {
    margin: 0 0 10px;
    font-size: 2.6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.01em;
    /* hard close shadow + wide halo so the title reads on any backdrop */
    text-shadow:
        0 2px 4px rgba(0, 0, 0, 1),
        0 4px 28px rgba(0, 0, 0, 0.95);
}

/* live Steam player count badge */
.games-live-players {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    color: #ddd;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

    .games-live-players strong {
        color: #fff;
        font-variant-numeric: tabular-nums;
    }

.games-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4d;
    box-shadow: 0 0 8px rgba(255, 77, 77, 0.7);
    animation: games-live-pulse 1.6s ease-in-out infinite;
}

@keyframes games-live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.55; transform: scale(0.85); }
}

.games-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

    .games-meta span:not(:last-child)::after {
        content: " · ";
        color: #777;
        margin-left: 8px;
    }

.games-genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.games-genre-pill {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: #ddd;
    font-size: 0.78rem;
}

.games-summary {
    color: #ddd;
    font-size: 0.94rem;
    line-height: 1.55;
    max-width: 720px;
    margin: 0 0 4px;
}

    /* clip long descriptions to 4 lines until expanded (keeps them off half the screen) */
    .games-summary.clamped {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

.games-summary-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 14px;
    color: var(--accent-text);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

    .games-summary-toggle:hover { text-decoration: underline; }

/* hero CTAs - primary reroll + secondary IGDB */
.games-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.games-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    color: #fff;
    font-size: 0.94rem;
    font-weight: 500;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

    .games-cta:hover:not(:disabled) {
        background: rgba(255, 255, 255, 0.18);
        transform: translateY(-1px);
    }

    .games-cta:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.games-cta-primary {
    background: var(--accent);
    border-color: var(--accent);
}

    .games-cta-primary:hover:not(:disabled) {
        background: var(--accent);
        filter: brightness(1.1);
    }

/* card chrome lives on .games-result; this is just the inner flow */
.games-details {
    background: transparent;
}

.games-section-inline {
    padding: 26px 30px;
    border-bottom: 1px solid var(--surface-border);
}

    .games-section-inline:last-child {
        border-bottom: none;
    }

.games-section-title {
    margin: 0 0 16px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ratings */
.games-ratings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.games-rating {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-left: 4px solid var(--rating-color, #888);
    border-radius: 10px;
    padding: 14px 16px;
}

.games-rating-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--rating-color, #888);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.games-rating-score {
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

    .games-rating-score small {
        color: #777;
        font-size: 0.9rem;
        font-weight: 400;
        margin-left: 2px;
    }

.games-rating-votes {
    color: #888;
    font-size: 0.8rem;
    margin-top: 6px;
}

/* "Very Positive" / "Mixed" / etc tag */
.games-rating-tag {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    background: color-mix(in srgb, var(--rating-color) 18%, transparent);
    color: var(--rating-color);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* stores - prominent CTA-style buttons with brand color hint */
.games-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.games-store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

    .games-store:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-1px);
    }

    .games-store i {
        font-size: 1.1rem;
    }

.games-store-steam       { border-color: rgba(102, 192, 244, 0.45); }
.games-store-steam:hover { background: rgba(102, 192, 244, 0.12); }

.games-store-playstation       { border-color: rgba(0, 112, 209, 0.45); }
.games-store-playstation:hover { background: rgba(0, 112, 209, 0.14); }

.games-store-xbox       { border-color: rgba(16, 124, 16, 0.45); }
.games-store-xbox:hover { background: rgba(16, 124, 16, 0.14); }

.games-store-nintendo       { border-color: rgba(229, 9, 20, 0.45); }
.games-store-nintendo:hover { background: rgba(229, 9, 20, 0.14); }

.games-store-epic       { border-color: rgba(255, 255, 255, 0.35); }
.games-store-epic:hover { background: rgba(255, 255, 255, 0.14); }

.games-store-gog       { border-color: rgba(140, 76, 220, 0.45); }
.games-store-gog:hover { background: rgba(140, 76, 220, 0.14); }

.games-store-itch       { border-color: rgba(250, 80, 99, 0.45); }
.games-store-itch:hover { background: rgba(250, 80, 99, 0.14); }

/* fallback stores are muted to telegraph they're search URLs */
.games-store.search {
    opacity: 0.85;
}

.games-store-search-icon {
    margin-left: 4px;
    font-size: 0.78rem;
    color: #888;
}

/* click-to-play YouTube thumbnail (saves loading the embed until clicked) */
.games-trailer {
    position: relative;
    width: 100%;
    max-width: 760px;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    border: none;
    padding: 0;
    cursor: pointer;
    background-size: cover;
    background-position: center;
}

    .games-trailer iframe {
        width: 100%;
        height: 100%;
        border: 0;
    }

.games-trailer-thumb {
    transition: transform 200ms ease;
}

    .games-trailer-thumb::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.45) 100%);
        pointer-events: none;
    }

    .games-trailer-thumb:hover {
        transform: scale(1.005);
    }

.games-trailer-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    background: rgba(255, 0, 0, 0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.4rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    z-index: 2;
    transition: transform 180ms ease, background 180ms ease;
}

.games-trailer-thumb:hover .games-trailer-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(255, 0, 0, 1);
}

/* up to 3 most-helpful Steam reviews */
.games-reviews {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.games-review {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .games-review.rec      { border-left: 3px solid #66c0f4; }
    .games-review.not-rec  { border-left: 3px solid #c44; }

.games-review-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

    .games-review.rec .games-review-head i { color: #66c0f4; }
    .games-review.not-rec .games-review-head i { color: #c44; }

.games-review-verdict {
    color: #fff;
    font-weight: 600;
}

.games-review-playtime {
    color: #888;
    margin-left: auto;
    font-size: 0.78rem;
}

.games-review-text {
    margin: 0;
    color: #ccc;
    font-size: 0.88rem;
    line-height: 1.5;
    /* clamp so cards stay the same height */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.games-review-helpful {
    color: #888;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* similar games - row of small cover cards */
.games-similar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

.games-similar-card {
    text-decoration: none;
    color: #fff;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border);
    transition: transform 180ms ease, border-color 180ms ease;
}

    .games-similar-card:hover {
        transform: translateY(-3px);
        border-color: var(--accent);
    }

    .games-similar-card img {
        width: 100%;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        display: block;
    }

.games-similar-cover-empty {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    color: #444;
    font-size: 2rem;
}

.games-similar-meta {
    padding: 8px 10px;
}

.games-similar-name {
    font-size: 0.82rem;
    line-height: 1.25;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.games-similar-year {
    color: #888;
    font-size: 0.74rem;
    margin-top: 2px;
}

/* time to beat */
.games-ttb {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.games-ttb-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

    .games-ttb-tile i {
        color: var(--accent);
        font-size: 1.4rem;
        margin-bottom: 8px;
        display: block;
    }

.games-ttb-label {
    color: #888;
    font-size: 0.82rem;
    margin-bottom: 4px;
}

.games-ttb-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* details grid */
.games-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.games-detail-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    border-radius: 10px;
    padding: 12px 14px;
}

.games-detail-label {
    color: #888;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.games-detail-value {
    color: #fff;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* gallery */
.games-gallery-large {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #000;
}

    .games-gallery-large img {
        width: 100%;
        height: auto;
        display: block;
    }

.games-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.games-gallery-thumb {
    padding: 0;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 140ms ease, transform 140ms ease;
}

    .games-gallery-thumb:hover,
    .games-gallery-thumb.active {
        border-color: var(--accent);
    }

    .games-gallery-thumb img {
        width: 100%;
        height: 64px;
        object-fit: cover;
        display: block;
    }

/* empty state */
.games-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

    .games-empty i {
        font-size: 3rem;
        display: block;
        margin-bottom: 12px;
        color: #444;
    }

    .games-empty p {
        margin: 0;
        font-size: 0.95rem;
    }

/* responsive */
@media (max-width: 720px) {
    .games-hero,
    .games-hero-inner {
        min-height: 0;
    }

    .games-hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px 22px;
    }

    .games-cover {
        width: 160px;
    }

    .games-title {
        font-size: 1.7rem;
    }

    .games-meta,
    .games-genre-pills,
    .games-cta-row {
        justify-content: center;
    }

    .games-section-inline {
        padding: 22px 20px;
    }

    .games-trailer-play {
        width: 60px;
        height: 60px;
        font-size: 1.9rem;
    }
}
