/* ============================================================
   GAME PAGE — rules only /games/{slug} uses
   ============================================================
   Loaded after gaming-theme.css, and before the first paint only on
   that page (Helpers/PageStyles.cs). A rule belongs here while every
   class it needs is used by this page alone; once another page uses
   one, the rule moves to gaming-theme.css (PageStylesTests).
   ============================================================ */

.gn-score-lg {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.4rem;
    border-radius: var(--radius-lg);
}

/* --- Tag / Badge ------------------------------------------ */
.gn-tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;            /* 24px tap target (WCAG 2.5.8) for the linked chips */
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.7375rem;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

.gn-tag-genre {
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.gn-tag-theme {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.25);
}

.gn-tag-platform {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-bright);
    font-size: 0.7rem;
    letter-spacing: 0.03em;
}

.gn-tag-mode {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

/* ============================================================
   GAME DETAIL PAGE
   ============================================================ */

/* --- Backdrop hero ---------------------------------------- */
/* The backdrop is as tall as the title block needs, never shorter than the
   minimum. It used to be a fixed 340px with the content pinned to its bottom:
   a title block with a tagline, scores, a trending badge and the buttons is
   about 400px, and overflow: hidden cut its top (the breadcrumb, then the
   title) off right under the header. */
.gd-backdrop {
    position: relative;
    min-height: 340px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

@media (min-width: 1440px) {
    .gd-backdrop { min-height: 400px; }
}

.gd-backdrop-art {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    filter: blur(2px) brightness(0.45) saturate(1.2);
    transform: scale(1.05);
}

.gd-backdrop-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,  rgba(9,9,11,0.3) 0%, rgba(9,9,11,0.0) 30%, rgba(9,9,11,0.85) 80%, #09090b 100%),
        linear-gradient(to right,   rgba(9,9,11,0.8) 0%, transparent 60%);
}

.gd-backdrop-content {
    position: relative;             /* above the art and the gradient */
    width: 100%;
    padding: 2.5rem 2rem 2rem;      /* the top keeps the breadcrumb off the header when the block is tall */
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 2rem;
}

/* --- Cover art -------------------------------------------- */
.gd-cover-wrap {
    flex-shrink: 0;
    width: 160px;
    position: relative;
    z-index: 2;
}

.gd-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-bright);
    box-shadow: 0 24px 64px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.06);
    overflow: hidden;
    display: block;
}

.gd-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.04em;
}

/* --- Header info ------------------------------------------ */
.gd-header-info {
    flex: 1;
    padding-bottom: 0.5rem;
    min-width: 0;
}

.gd-breadcrumb {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.gd-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.gd-breadcrumb a:hover { color: var(--text-secondary); }

.gd-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    line-height: 1.05;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.gd-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.gd-meta-sep { color: var(--text-muted); }

.gd-meta-developer { color: var(--accent-cyan); font-weight: 500; }

/* --- Score group ------------------------------------------ */
.gd-scores {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.gd-score-block {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.gd-score-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

.gd-score-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.gd-score-sep {
    width: 1px;
    height: 2.5rem;
    background: var(--border-bright);
}

/* --- Content layout --------------------------------------- */
.gd-body {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    /* Wrap long words / URLs inside descriptions, storylines, meta rows
       so text never pushes the grid or flex parent wider than its track. */
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Tab nav and tab content both align with the body edge — no indent.
   Cover protrusion (16px) is cleared vertically by .gd-tabs-offset. */
.gd-offset {
    padding-left: 0;
}

/* --- Tab navigation --------------------------------------- */
.gd-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}

.gd-tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    margin-bottom: -1px;
}

.gd-tab:hover { color: var(--text-secondary); }
a.gd-tab { text-decoration: none; display: inline-block; }

/* Game page sections: all five are in the HTML (crawlers and deep links see
   everything), one is shown. Before the circuit connects the URL fragment picks
   it (:target); once interactive (.gd-interactive) the server-set .active class
   alone decides, because Blazor's pushState navigation does not refresh :target. */
.gd-panel { display: none; scroll-margin-top: 4.5rem; }
.gd-panel.active { display: block; }
.gd-body:not(.gd-interactive) .gd-panel:target { display: block; }
.gd-body:not(.gd-interactive):has(.gd-panel:target) .gd-panel.active:not(:target) { display: none; }
.gd-body:not(.gd-interactive):has(.gd-panel:target) .gd-tab.active { color: var(--text-muted); border-bottom-color: transparent; }
.gd-body:not(.gd-interactive):has(#overview:target) .gd-tab[href$="#overview"],
.gd-body:not(.gd-interactive):has(#media:target)    .gd-tab[href$="#media"],
.gd-body:not(.gd-interactive):has(#releases:target) .gd-tab[href$="#releases"],
.gd-body:not(.gd-interactive):has(#ratings:target)  .gd-tab[href$="#ratings"] {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.gd-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

/* The overview is one flow (GamePage.razor): the sidebar floats on the right, the
   rest wraps beside it and widens to the full width where the sidebar ends. Blocks
   that are their own formatting context (the answers, tables, grids, scrolling rows)
   narrow beside the float instead of running under it. */
.gd-flow { display: flow-root; }
.gd-aside { float: right; width: 300px; margin: 0 0 1.5rem 2.5rem; }
.gd-aside > .gd-sidebar-card:last-child { margin-bottom: 0; }
.gd-flow > .ga, .gd-flow > .ge { display: flow-root; }
/* Wide enough for a fourth column once the sidebar has ended. */
.gd-flow > .gd-screenshots { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }

/* The reference cards (release dates, languages, credits, links), always full width,
   in as many columns as fit. The browser balances the columns, so no card leaves a
   tall gap beside it; one column on a phone. */
.gd-details { clear: both; padding-top: 3rem; columns: 3 17.5rem; column-gap: 1.5rem; }
.gd-details > .gd-sidebar-card { break-inside: avoid; margin-bottom: 1.5rem; }
/* One or two cards do not leave a third, empty column. */
.gd-details:has(> .gd-sidebar-card:first-child:last-child) { columns: 1; max-width: 34rem; }
.gd-details:has(> .gd-sidebar-card:nth-child(2):last-child) { columns: 2 17.5rem; max-width: 60rem; }
.gd-details:not(:has(.gd-sidebar-card)) { display: none; }
.gd-attribution--wide { clear: both; margin-top: 1rem; }
.gd-attribution--wide .gd-igdb-link { width: auto; min-width: 16rem; }

/* --- Summary / description -------------------------------- */
/* Facts-in-prose paragraph under the summary (release, platforms, price, length, players). */
.gd-facts {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin: -0.5rem 0 1.5rem;
    overflow-wrap: break-word;
}

.gd-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.8;
    overflow-wrap: break-word;
    word-break: break-word;
}

.gd-description p { margin: 0 0 1rem; }

.gd-read-more {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

/* --- Screenshots ------------------------------------------ */
.gd-screenshots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.gd-screenshot {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.gd-screenshot:hover { border-color: var(--border-bright); transform: scale(1.02); }

.gd-screenshot-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gd-screenshot:hover .gd-screenshot-overlay { opacity: 1; }

/* --- Credits --------------------------------------------- */








/* --- Related games (horizontal scroll) -------------------- */
.gd-related-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
    margin-top: 1.5rem;
}

.gd-related-scroll::-webkit-scrollbar { height: 4px; }
.gd-related-scroll::-webkit-scrollbar-track { background: transparent; }
.gd-related-scroll::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.gd-related-card {
    flex: 0 0 155px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.gd-related-card:hover {
    border-color: var(--border-bright);
    transform: translateY(-3px);
}

.gd-related-cover {
    aspect-ratio: 3 / 4;
    position: relative;
}

.gd-related-body {
    padding: 0.625rem;
}

.gd-related-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gd-related-year {
    font-size: 0.7375rem;
    color: var(--text-muted);
}

/* --- Sidebar cards ---------------------------------------- */
.gd-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.gd-attribution {
    margin: 0.75rem 0 0;
    padding: 0.5rem 0.25rem 0;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}
.gd-igdb-link { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
.gd-attribution-line { margin: 0; }

.gd-attribution a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--border-bright);
    transition: color 0.15s ease;
}

.gd-attribution a:hover { color: var(--accent-cyan); }

.gd-sidebar-title,
h2.gd-sidebar-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 0.875rem;
}

.gd-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8375rem;
}

.gd-detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.gd-detail-row:first-child { padding-top: 0; }

.gd-detail-key { color: var(--text-muted); flex-shrink: 0; }
.gd-detail-val { color: var(--text-primary); text-align: right; font-weight: 500; }

/* --- Platform releases ------------------------------------ */
.gd-platform-release {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8375rem;
}

.gd-platform-release:last-child { border-bottom: none; padding-bottom: 0; }
.gd-platform-release:first-child { padding-top: 0; }

.gd-platform-name { font-weight: 500; color: var(--text-primary); }
.gd-platform-date { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; flex: none; color: var(--text-muted); font-size: 0.8rem; text-align: right; }
.gd-platform-date > span, .gd-platform-first > span:first-child { white-space: nowrap; }
.gd-platform-first { display: flex; flex-direction: column; align-items: flex-end; gap: 0.2rem; }
.gd-platform-release > div:first-child { min-width: 0; padding-right: 0.75rem; }
.gd-platform-status { padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--accent-cyan-glow); color: var(--accent-cyan); font-size: 0.68rem; font-weight: 600; white-space: nowrap; }
.gd-platform-full { color: var(--text-secondary); white-space: nowrap; }
.gd-company:hover .gd-company-name { color: var(--accent-cyan); }

.gd-company-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    border: 1px solid var(--border-bright);
    color: #fff;
}

.gd-company-name { font-size: 0.875rem; font-weight: 500; }
.gd-company-role { font-size: 0.75rem; color: var(--text-muted); }

/* --- External link ---------------------------------------- */
.gd-ext-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.gd-ext-link:hover {
    border-color: var(--border-bright);
    color: var(--text-primary);
    background: var(--bg-card);
}

.gd-ext-icon { display: flex; align-items: center; flex-shrink: 0; opacity: 0.85; transition: opacity var(--transition); }
.gd-ext-text  { flex: 1; }
.gd-ext-link:hover .gd-ext-icon { opacity: 1; }

/* Brand accent colours on the icon */
.gd-ext-link--steam      .gd-ext-icon { color: #1b9bcc; }
.gd-ext-link--epicgames  .gd-ext-icon { color: #2eff7a; }
.gd-ext-link--gog        .gd-ext-icon { color: #86328a; }
.gd-ext-link--youtube    .gd-ext-icon { color: #ff0000; }
.gd-ext-link--twitch     .gd-ext-icon { color: #9146ff; }
.gd-ext-link--twitter    .gd-ext-icon { color: #e7e9ea; }
.gd-ext-link--facebook   .gd-ext-icon { color: #1877f2; }
.gd-ext-link--instagram  .gd-ext-icon { color: #e1306c; }
.gd-ext-link--reddit     .gd-ext-icon { color: #ff4500; }
.gd-ext-link--discord    .gd-ext-icon { color: #5865f2; }
.gd-ext-link--itch       .gd-ext-icon { color: #fa5c5c; }
.gd-ext-link--official   .gd-ext-icon { color: var(--accent); }
.gd-ext-link--playstation .gd-ext-icon { color: #2d7cf6; }
.gd-ext-link--xbox        .gd-ext-icon { color: #52b043; }
.gd-ext-link--nintendo    .gd-ext-icon { color: #ff3c3c; }
.gd-ext-link--apple       .gd-ext-icon { color: #e7e9ea; }
.gd-ext-link--googleplay  .gd-ext-icon { color: #34d399; }
.gd-ext-link--humble      .gd-ext-icon { color: #ff5d5d; }
.gd-ext-link--kickstarter .gd-ext-icon { color: #05ce78; }
.gd-ext-link--patreon     .gd-ext-icon { color: #ff424d; }
.gd-ext-link--tiktok      .gd-ext-icon { color: #e7e9ea; }
.gd-ext-link--amazon      .gd-ext-icon { color: #ff9900; }
.gd-ext-link--wiki        .gd-ext-icon { color: var(--text-secondary); }
.gd-ext-link--bluesky     .gd-ext-icon { color: #1185fe; }
.gd-ext-link--wikipedia   .gd-ext-icon { color: #e7e9ea; }
.gd-ext-link--wikia       .gd-ext-icon { color: #fa005a; }
.gd-store-link { display: inline-flex; align-items: center; gap: 0.4rem; }
.gd-store-icon svg { width: 14px; height: 14px; }

/* --- Rating badge ----------------------------------------- */
.gd-rating-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-bright);
    border-radius: var(--radius-md);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

.gd-rating-badge .rating-system { font-size: 0.55rem; letter-spacing: 0.05em; color: var(--text-muted); }
.gd-rating-badge .rating-value  { font-size: 1.1rem; line-height: 1; }

/* Game Detail — tab area top offset (controls cover-overlap padding) */
.gd-tabs-offset { padding-top: 1.75rem; }

/* Game Detail — release row grid */
.gd-release-row {
    display: grid;
    grid-template-columns: 1fr 120px 110px 80px;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.8375rem;
}

@media (max-width: 900px) {
    /* The overview flow becomes one column: the summary and the answers, then the
       sidebar (price first), then everything else. */
    .gd-flow { display: flex; flex-direction: column; }
    .gd-flow > * { order: 3; min-width: 0; }
    .gd-flow > .gd-summary, .gd-flow > .gd-facts, .gd-flow > .ga { order: 1; }
    .gd-flow > .gd-aside { order: 2; float: none; width: auto; margin: 0 0 1.5rem; }
    .gd-details { padding-top: 2rem; }

    /* Backdrop cover a little smaller */
    .gd-cover-wrap { width: 140px; }
    .gd-backdrop   { min-height: 300px; }
    .gd-offset     { padding-left: 0; }
    .gd-tabs-offset { padding-top: 1.5rem; }

    /* Screenshots/Artwork grids — reduce artwork columns for tablet */
    .gd-screenshots { grid-template-columns: repeat(3, 1fr) !important; }
    .gd-body { padding: 0 1.25rem 3rem; }
    .gd-related-card { flex: 0 0 140px; }
}

@media (max-width: 640px) {

    /* ===================================================== */
    /* GAME DETAIL PAGE                                       */
    /* ===================================================== */

    /* The blurred art + gradient (inset: 0) fill the whole backdrop. */
    .gd-backdrop { min-height: 200px; }

    /* Stronger gradient on mobile so text is readable across the whole stack. */
    .gd-backdrop-gradient {
        background:
            linear-gradient(to bottom,
                rgba(9,9,11,0.45) 0%,
                rgba(9,9,11,0.75) 55%,
                #09090b 100%);
    }

    /* Cover above the title block, in one column. */
    .gd-backdrop-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem 1rem 1.25rem;
    }

    /* Cover sits at the top of the stack, no vertical shift */
    .gd-cover-wrap {
        width: 110px;
        transform: none;
    }

    /* Header info takes the full column width */
    .gd-header-info {
        width: 100%;
        padding-bottom: 0;
    }

    /* Title & meta adapt to narrow space */
    .gd-title    { font-size: clamp(1.4rem, 6vw, 1.9rem); margin-bottom: 0.4rem; }
    .gd-breadcrumb { margin-bottom: 0.375rem; font-size: 0.7rem; }
    .gd-meta-row { font-size: 0.75rem; gap: 0.25rem 0.5rem; margin-bottom: 0.75rem; }
    .gd-scores   { gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
    .gn-score-lg { width: 2.75rem; height: 2.75rem; font-size: 1.1rem; }
    .gd-score-sep { display: none; }

    /* Action buttons go full-width and stack nicely */
    .gd-header-info > div:last-child {
        width: 100%;
    }
    .gd-header-info > div:last-child .gn-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    /* Body: full-width, tight padding */
    .gd-body   { padding: 1rem 1rem 3rem; }
    /* Drop the left offset on mobile — content uses the full viewport width. */
    .gd-offset { padding-left: 0; }
    .gd-tabs-offset { padding-top: 0; }

    /* Tabs: scrollable row, no wrap, hide scrollbar but keep swipe */
    .gd-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        gap: 0;
        scrollbar-width: none;
        margin-bottom: 1.5rem;
    }
    .gd-tabs::-webkit-scrollbar { display: none; }
    .gd-tab  { padding: 0.75rem 0.875rem; font-size: 0.8125rem; white-space: nowrap; flex-shrink: 0; }

    /* Screenshots/Artwork: 2 columns regardless of inline style */
    .gd-screenshots { grid-template-columns: repeat(2, 1fr) !important; gap: 0.5rem; }
    .gd-description { font-size: 0.9rem; line-height: 1.7; }

    /* Related scroll: smaller cards */
    .gd-related-card { flex: 0 0 130px; }

    /* Sidebar cards full-width + readable padding */
    .gd-sidebar-card { margin-bottom: 0.875rem; padding: 1rem; }
    .gd-sidebar-title { margin-bottom: 0.75rem; }

    /* Credits: tighter layout */

    /* Release row: stack into 2-column grid on mobile */
    .gd-release-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 1rem;
    }
    .gd-release-row > :nth-child(3),
    .gd-release-row > :nth-child(4) {
        font-size: 0.775rem;
        color: var(--text-muted);
    }

    /* Section titles inside tabs */
    .gd-body .gn-section-title { font-size: 1.1rem; }
}

/* ── Lightbox ──────────────────────────────────────────────────────────────── */
.gd-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    animation: lb-fade-in 0.15s ease;
}

.gd-lightbox-backdrop {
    position: absolute;
    inset: 0;
    cursor: zoom-out;
}

.gd-lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: min(90vw, 1400px);
    max-height: 90vh;
    pointer-events: none;
}

.gd-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
    cursor: zoom-in;
    animation: lb-zoom-in 0.18s ease;
}

/* Full-size view: the content box becomes a scrollable viewport the size of
   the screen and the image keeps its natural pixels. Touch scrolls it; the
   browser's own pinch zoom still works on top. */
.gd-lightbox-zoomed {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    pointer-events: auto;
    cursor: zoom-out;
}
.gd-lightbox-zoomed .gd-lightbox-img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 0;
    box-shadow: none;
    cursor: zoom-out;
    animation: none;
}

.gd-lightbox-counter {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.04em;
    pointer-events: auto;
}

.gd-lightbox-close {
    position: fixed;
    top: 1.1rem;
    right: 1.1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}
.gd-lightbox-close:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

.gd-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}
.gd-lightbox-nav:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.gd-lightbox-nav:disabled { opacity: 0.2; cursor: default; }
.gd-lightbox-prev { left: 1.1rem; }
.gd-lightbox-next { right: 1.1rem; }

/* ── "In Library" / "On Wishlist" active button states ────────────────────── */
.gn-btn-active {
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.45);
}
.gn-btn-active:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.45);
}
/* Swap label to "Remove from Library" on hover */
.gn-btn-active:hover > span::after {
    content: " — remove";
    color: inherit;
    opacity: 0.7;
    font-weight: 500;
}

.gn-btn-active-wishlist {
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
    border-color: rgba(124, 58, 237, 0.55);
}
.gn-btn-active-wishlist:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.55);
}
.gn-btn-active-wishlist:hover > span::after {
    content: " — remove";
    opacity: 0.7;
    font-weight: 500;
}

/* ── Reviews tab ──────────────────────────────────────────────────────────── */
.rv-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.rv-card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 1.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}
.rv-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.04;
    pointer-events: none;
}
.rv-card-great::before { background: var(--score-great); }
.rv-card-good::before  { background: var(--score-good);  }
.rv-card-mixed::before { background: var(--score-mixed); }
.rv-card-poor::before  { background: var(--score-poor);  }
.rv-card-bad::before   { background: var(--score-bad);   }

.rv-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.rv-ring-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    flex-shrink: 0;
}
.rv-ring-wrap svg {
    transform: rotate(-90deg);
}
.rv-ring-num {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.rv-ring-score {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}
.rv-ring-denom {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}
.rv-verdict {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.rv-verdict-great { color: var(--score-great); }
.rv-verdict-good  { color: var(--score-good);  }
.rv-verdict-mixed { color: var(--score-mixed); }
.rv-verdict-poor  { color: var(--score-poor);  }
.rv-verdict-bad   { color: var(--score-bad);   }

.rv-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.rv-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 22ch;
}

/* comparison bars */
.rv-compare {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
}
.rv-compare-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.rv-bar-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 2.5rem;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}
.rv-bar-row:last-child { margin-bottom: 0; }
.rv-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
}
.rv-bar-track {
    background: var(--surface-2);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.rv-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.rv-bar-val {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* score guide */
.rv-guide {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
}
.rv-guide-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}
.rv-guide-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 0.625rem;
}
.rv-guide-row:last-child { margin-bottom: 0; }
.rv-guide-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rv-guide-range {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 3rem;
}
.rv-guide-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.rv-guide-active {
    background: var(--bg-elevated);
    border-radius: 6px;
    margin: -0.25rem -0.5rem;
    padding: 0.25rem 0.5rem;
}

@media (max-width: 600px) {
    .rv-hero { grid-template-columns: 1fr; }
    .rv-bar-row { grid-template-columns: 4rem 1fr 2rem; gap: 0.625rem; }
}

@media (max-width: 900px) {
    .gd-screenshots { grid-template-columns: repeat(3, 1fr); }
}


/* ── Game detail: IGDB extras (price card, store links, videos, languages, related rows) ── */
.gd-price-card { border: 1px solid rgba(34,197,94,.35); background: linear-gradient(160deg, rgba(34,197,94,.10), rgba(34,197,94,.02)); }
.gd-price-best { display:flex; align-items:baseline; gap:.5rem; margin:.25rem 0 .35rem; }
.gd-price-now  { font-size:1.6rem; font-weight:700; color:var(--score-great); line-height:1; }
.gd-price-was  { font-size:.8rem; color:var(--text-muted); text-decoration:line-through; }
.gd-price-cut  { font-size:.72rem; font-weight:600; padding:.15rem .45rem; border-radius:999px; background:rgba(34,197,94,.18); color:var(--score-great); }
.gd-price-row  { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding:.45rem 0; border-top:1px solid var(--border); font-size:.8rem; text-decoration:none; color:var(--text-secondary); }
.gd-price-row:hover { color:var(--text-primary); }
.gd-price-row strong { color:var(--text-primary); font-variant-numeric:tabular-nums; }

/* ── Game detail: the "at a glance" card (GameGlance.razor) ──
   One row per fact: the icon says where the fact comes from (and takes that source's
   colour), the figure is set in the display face, the line under it gives the detail.
   Two things move the eye: the bar under Steam's verdict, whose fill is the share of
   positive reviews, and the dot beside the Twitch figure, the only thing that animates. */
.gg-list { list-style:none; margin:0; padding:0; }
.gg-row  { --gg-tone: var(--text-secondary); display:grid; grid-template-columns:2rem minmax(0,1fr); column-gap:.75rem; align-items:start; padding:.65rem 0; border-top:1px solid var(--border); }
.gg-row:first-child { border-top:0; padding-top:.1rem; }
/* A row that is only its figure sits level with its icon. */
.gg-row:not(:has(.gg-note, .gg-bar)) { align-items:center; }
.gg-row--price  { --gg-tone: var(--score-great); }
.gg-row--steam  { --gg-tone: #66c0f4; }
.gg-row--twitch { --gg-tone: #a970ff; }
.gg-row--time   { --gg-tone: var(--accent-cyan); }
.gg-row--lists  { --gg-tone: #a78bfa; }
.gg-icon { width:2rem; height:2rem; border-radius:var(--radius-md); display:grid; place-items:center; color:var(--gg-tone); background:color-mix(in srgb, var(--gg-tone) 13%, transparent); }
.gg-icon svg { width:1rem; height:1rem; display:block; }
.gg-body { min-width:0; }
.gg-value { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:.4rem; row-gap:.1rem; font-family:'Rajdhani', sans-serif; font-size:1.35rem; font-weight:700; line-height:1.15; letter-spacing:.005em; color:var(--text-primary); font-variant-numeric:tabular-nums; }
.gg-value a { color:inherit; text-decoration:none; border-bottom:1px solid color-mix(in srgb, var(--gg-tone) 55%, transparent); transition:border-color .15s, color .15s; }
.gg-value a:hover { color:var(--gg-tone); border-bottom-color:var(--gg-tone); }
.gg-unit { font-family:'Inter', 'Inter Fallback', 'Inter Fallback Roboto', system-ui, sans-serif; font-size:.8rem; font-weight:500; letter-spacing:0; color:var(--text-secondary); }
.gg-note { margin-top:.2rem; font-size:.76rem; line-height:1.45; color:var(--text-muted); overflow-wrap:anywhere; }
.gg-note a { color:var(--text-secondary); text-decoration:underline; text-decoration-color:var(--border-bright); text-underline-offset:2px; }
.gg-note a:hover { color:var(--gg-tone); text-decoration-color:currentColor; }
.gg-value a:focus-visible, .gg-note a:focus-visible { outline:2px solid var(--accent-cyan); outline-offset:2px; border-radius:2px; }
.gg-flag { color:var(--score-great); font-weight:600; }
.gg-bar { display:block; height:5px; margin:.45rem 0 .1rem; border-radius:999px; background:rgba(255,255,255,.09); overflow:hidden; }
.gg-bar > span { display:block; height:100%; border-radius:inherit; background:var(--gg-fill); }
.gg-bar--good  { --gg-fill: var(--score-great); }
.gg-bar--mixed { --gg-fill: var(--score-mixed); }
.gg-bar--bad   { --gg-fill: var(--score-bad); }
/* Twitch: the live mark sits on the icon, so it never wraps away from the figure. */
.gg-icon--live { position:relative; }
.gg-icon--live::after { content:""; position:absolute; top:-.2rem; right:-.2rem; width:.6rem; height:.6rem; border-radius:50%; background:#ef4444; border:2px solid var(--bg-card); }
@media (prefers-reduced-motion: no-preference) {
    .gg-icon--live::after { animation: gg-pulse 2s ease-out infinite; }
}
/* Its most watched channels: name left, viewers right, the whole line one link. */
.gg-channels { list-style:none; margin:.45rem 0 0; padding:0; }
.gg-channels a { display:flex; align-items:baseline; justify-content:space-between; gap:.75rem; padding:.28rem .5rem; margin:0 -.5rem; border-radius:6px; font-size:.8rem; line-height:1.35; color:var(--text-secondary); text-decoration:none; transition:background-color .15s, color .15s; }
.gg-channels a:hover { background:color-mix(in srgb, var(--gg-tone) 12%, transparent); color:var(--text-primary); }
.gg-channels a:focus-visible { outline:2px solid var(--accent-cyan); outline-offset:-2px; }
.gg-channel-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:500; }
.gg-channel-viewers { flex-shrink:0; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.gg-channels a:hover .gg-channel-viewers { color:var(--gg-tone); }
/* A finger needs more room than a pointer. */
@media (hover: none) { .gg-channels a { padding-top:.5rem; padding-bottom:.5rem; }
}
/* Players over the last month, and the change on a week ago. */
.gg-spark { display:block; width:100%; height:1.6rem; margin:.4rem 0 .1rem; overflow:visible; }
.gg-spark polyline { fill:none; stroke:var(--gg-tone); stroke-width:1.6; stroke-linejoin:round; stroke-linecap:round; vector-effect:non-scaling-stroke; }
.gg-up   { color:var(--score-great); font-weight:600; }
.gg-down { color:#fca5a5; font-weight:600; }
.gg-sources { margin:.85rem 0 0; padding-top:.7rem; border-top:1px solid var(--border); font-size:.7rem; line-height:1.5; color:var(--text-muted); }
.gg-sources a { color:var(--text-secondary); text-decoration:underline; text-decoration-color:var(--border-bright); text-underline-offset:2px; white-space:nowrap; }
.gg-sources a:hover { color:var(--text-primary); }


/* ── Game detail: quick answers (GameAnswers.razor) ──
   The question a person types, then its answer. Two columns where there is room,
   the answer under its question on a phone. */
.ga { margin:1.75rem 0; }
.ga-list { margin:.75rem 0 0; border-top:1px solid var(--border); }
.ga-item { display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); column-gap:1.5rem; padding:.8rem 0; border-bottom:1px solid var(--border); }
.ga-item dt { font-family:'Rajdhani', sans-serif; font-size:1.05rem; font-weight:600; line-height:1.3; color:var(--text-primary); }
.ga-item dd { margin:0; font-size:.9rem; line-height:1.6; color:var(--text-secondary); max-width:62ch; }
@media (max-width: 640px) {
    .ga-item { grid-template-columns:1fr; row-gap:.25rem; }
}

/* ── Game detail: versions and today's prices (GameEditions.razor) ── */
.ge { margin:1.75rem 0; }
.ge-table { width:100%; margin-top:.75rem; border-collapse:collapse; font-size:.875rem; }
.ge-table thead th { padding:0 0 .5rem; text-align:left; font-size:.72rem; font-weight:500; color:var(--text-muted); border-bottom:1px solid var(--border); }
.ge-table tbody th, .ge-table tbody td { padding:.7rem 0; border-bottom:1px solid var(--border); text-align:left; font-weight:400; color:var(--text-secondary); vertical-align:baseline; }
.ge-table tbody td { padding-left:1rem; font-variant-numeric:tabular-nums; white-space:nowrap; }
.ge-table .ge-num { text-align:right; }
.ge-name { display:block; font-weight:600; color:var(--text-primary); text-decoration:none; }
a.ge-name:hover { color:var(--accent-cyan); }
a.ge-name:focus-visible { outline:2px solid var(--accent-cyan); outline-offset:2px; border-radius:2px; }
.ge-kind { display:block; margin-top:.1rem; font-size:.75rem; color:var(--text-muted); }
.ge-price { font-family:'Rajdhani', sans-serif; font-size:1.15rem; font-weight:700; color:var(--text-primary); }
.ge-store { margin-left:.3rem; font-size:.75rem; color:var(--text-muted); }
.ge-flag { display:block; margin-top:.1rem; font-size:.72rem; font-weight:600; color:var(--score-great); }
.ge-cheapest .ge-price { color:var(--score-great); }
.ge-note { margin:.6rem 0 0; font-size:.72rem; color:var(--text-muted); }
@media (max-width: 640px) {
    /* Each version becomes a block: its name, then year and price on one line. */
    .ge-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
    .ge-table tbody tr { display:grid; grid-template-columns:1fr auto; column-gap:1rem; padding:.7rem 0; border-bottom:1px solid var(--border); }
    .ge-table tbody th, .ge-table tbody td { padding:0; border:0; }
    .ge-table tbody th { grid-column:1 / -1; margin-bottom:.25rem; }
    .ge-table tbody td { white-space:normal; }
}

/* ── Game detail: the release email button, and the link to the series page ── */
.gn-btn-active-alert { border-color:var(--accent-cyan); color:var(--accent-cyan); background:var(--accent-cyan-glow); }
/* On a phone the two list buttons keep their row; the release email gets its own, full width. */
@media (max-width: 640px) { .gd-alert-btn { flex:1 0 100%; justify-content:center; }
}
.gd-series-link { font-size:.7rem; text-decoration:none; background:rgba(6,182,212,.12); color:var(--accent-cyan); border-color:rgba(6,182,212,.3); }
.gd-series-link:hover { background:rgba(6,182,212,.22); color:var(--text-primary); }

/* "Show all N" sits in the tag cloud and looks like a tag, but is a button */
.gd-tags-toggle { font-size:0.72rem; color:var(--accent-cyan); background:transparent; border:1px dashed var(--border-bright); padding:0.2rem 0.55rem; border-radius:4px; cursor:pointer; }
.gd-tags-toggle:hover { color:var(--text-primary); border-color:var(--accent); }

.gd-store-links { display:flex; flex-wrap:wrap; gap:.4rem; }
.gd-store-link  { font-size:.74rem; padding:.3rem .6rem; border-radius:6px; border:1px solid var(--border); background:var(--surface-2); color:var(--text-secondary); text-decoration:none; transition:color .15s, border-color .15s; }
.gd-store-link:hover { color:var(--text-primary); border-color:var(--accent-dim); }
.gd-ttb { display:grid; grid-template-columns:repeat(3,1fr); gap:.4rem; margin-top:.35rem; }
.gd-ttb-cell { text-align:center; padding:.5rem .25rem; border-radius:6px; background:var(--surface-2); border:1px solid var(--border); }
.gd-ttb-val { font-size:1rem; font-weight:600; color:var(--text-primary); }
.gd-ttb-key { font-size:.66rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.04em; margin-top:.15rem; }
.gd-videos { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.gd-video  { position:relative; aspect-ratio:16/9; border-radius:8px; overflow:hidden; cursor:pointer; background:#000; border:1px solid var(--border); }
.gd-video img { width:100%; height:100%; object-fit:cover; opacity:.85; transition:opacity .15s, transform .2s; }
.gd-video:hover img { opacity:1; transform:scale(1.03); }
.gd-video-play { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.gd-video-play span { width:3.25rem; height:3.25rem; border-radius:50%; background:rgba(0,0,0,.6); border:1px solid rgba(255,255,255,.35); display:flex; align-items:center; justify-content:center; }
.gd-video-name { position:absolute; left:0; right:0; bottom:0; padding:.5rem .6rem; font-size:.74rem; color:#fff; background:linear-gradient(transparent, rgba(0,0,0,.75)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* The lightbox content box has pointer-events: none so the backdrop's click-to-
   close shows through; the video frame must take clicks itself or the play
   button is unreachable and the cursor stays the backdrop's magnifier. */
.gd-video-frame { position:relative; width:min(960px, 92vw); aspect-ratio:16/9; background:#000; border-radius:10px; overflow:hidden; pointer-events:auto; cursor:default; }
.gd-video-frame iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.gd-lang-table { width:100%; border-collapse:collapse; font-size:.76rem; }
.gd-lang-table th { text-align:center; font-weight:500; color:var(--text-muted); font-size:.66rem; text-transform:uppercase; letter-spacing:.04em; padding:.25rem 0; }
.gd-lang-table th:first-child, .gd-lang-table td:first-child { text-align:left; }
.gd-lang-table td { padding:.3rem 0; border-top:1px solid var(--border); color:var(--text-secondary); text-align:center; }
.gd-lang-yes { color:var(--score-great); font-weight:600; }
.gd-lang-no  { color:var(--text-muted); opacity:.5; }
.gd-mp-grid { display:flex; flex-wrap:wrap; gap:.3rem; justify-content:flex-end; }
@media (max-width: 720px) { .gd-videos { grid-template-columns:repeat(2,1fr); } .gd-ttb { grid-template-columns:repeat(3,1fr); }
}

@keyframes lb-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lb-zoom-in {
    from { transform: scale(0.94); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}
