/* =============================================================================
   8bitedge.com — v2 /games/{console}/{game} feature styles

   The page shell is the shared `.hero-section` + `.container` used by /search
   and /browse (defined in features/search/main.css) — that supplies the dark
   cyan/green gradient background and the --console-* tokens, so this page sits
   on exactly the same surface as the rest of the desktop site. This file only
   adds the game-detail-specific pieces: the hero (cover + screenshot gallery),
   the Game Info / Market Price Guide panels (styled as the same translucent
   cyan-bordered cards as /browse), and the section headings.

   `.browse-page` is also applied to the section so the scanline ::before
   overlay + z-index handling are inherited verbatim from /browse.
   ========================================================================== */

/* ---- Section headings (match /search .search-browse-heading) ------------- */
.games-page .search-back-link { margin-top: 8px; }

.games-section-heading {
    font-family: 'Electrolize', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e8f6ff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
}

/* ---- Hero: gallery + title/description/CTA ------------------------------- */
.games-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
    margin: 6px 0 28px;
    /* Fixed height for the three second-row widgets (Game Info, trailer,
       Similar Games) so each keeps the same size regardless of its contents —
       a game with no similar games, no trailer, or more/less Game Info still
       lays out identically. Value = a full Similar Games card stack: 273px
       card strip (150px-wide cover at 3:4 = 200px art + ~73px info) + 37px
       heading. JS only aligns the widgets' tops to this line; it no longer
       sizes them (CSS owns the height now). */
    --games-widget-h: 340px;
}
/* Wraps the thumbnail gallery + Ratings box in one stacked left column. This
   is what carries the hero row's fixed-width flex-basis; .games-hero-media
   below just fills 100% of it and keeps its own tight border around the
   gallery only, so Ratings isn't clipped inside that frame. */
.games-hero-left {
    flex: 0 0 220px;
    /* A flex item's default min-width is `auto` (its content's min-content
       width) — without pinning it to 0 the column expands to fit the whole
       row of gallery tiles and squeezes .games-hero-info off-screen. */
    min-width: 0;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.games-hero-media {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--console-border);
    background: #0a0e27;
}
.games-media-scroll {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    /* One image per view: each tile is the full column width and snaps into
       place, so a single arrow-click / swipe advances exactly one image. */
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.games-media-scroll::-webkit-scrollbar { display: none; }
.games-media-img {
    flex: 0 0 100%;
    width: 100%;
    height: 220px;
    /* cover so the image fills the whole 220x220 tile (keeping its aspect
       ratio, cropping the overflow) rather than leaving letterbox bars. */
    object-fit: cover;
    scroll-snap-align: start;
    background: #0a0e27;
}
.games-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px;
    color: #e8f6ff;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.games-media-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--console-border);
    background: rgba(10, 10, 20, 0.85);
    color: var(--console-cyan);
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.games-media-arrow.visible { opacity: 1; pointer-events: auto; }
.games-media-arrow:hover { box-shadow: 0 0 12px rgba(0, 217, 255, 0.4); }
.games-media-arrow-left { left: 6px; }
.games-media-arrow-right { right: 6px; }

/* flex-grow 0 so the info column sizes to its text and doesn't push the price
   guide to the far right — the guide then sits one flex `gap` (28px) after the
   text, matching the gap between the thumbnail and the text. */
/* flex-basis 0 + grow 1 so the text column takes only the row's *leftover*
   width (after the fixed thumbnail/price-guide and content-sized Game Info),
   growing from zero and wrapping its text within — rather than contributing
   its full one-line (max-content) width, which would blow the row out and
   force the boxes to wrap onto the next line. min-width 0 lets it shrink. */
.games-hero-info { flex: 1 1 0; min-width: 0; padding-top: 2px; }

/* Reserves the same vertical space Game Info's fixed top offset takes in the
   left column (220px gallery + 1px top/bottom border + 16px gap = 238px), so
   the trailer directly below starts at that same line for most games — no
   description, a one-line summary, and a full 5-line summary should all still
   put the trailer roughly at 238px. The JS top-align (below) only has to nudge
   Game Info *down* for the rare game whose header content runs taller than
   that, since margin-top can't safely pull Game Info up into the gallery. */
.games-hero-info-head { min-height: 238px; box-sizing: border-box; }

/* Rightmost hero column: a vertical stack of the two info cards (side by side)
   with the Similar Games strip beneath. Content-sized (flex:0 1 auto) off its
   widest child — the card row — and top-aligns with the thumbnail. */
.games-hero-cards {
    flex: 0 1 auto;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
/* The two info cards side by side; align-items:stretch keeps them equal height.
   This row is what sets the column's (and therefore the Similar strip's) width. */
.games-hero-cards-top {
    display: flex;
    gap: 28px;
    align-items: stretch;
}
.games-price-guide {
    flex: 0 0 330px;
    max-width: 330px;
    margin-bottom: 0;
}
/* Content-sized: takes only the width its rating rows need, never stretching
   to a set width. */
.games-ratings-box {
    flex: 0 1 auto;
    min-width: 220px;
    margin-bottom: 0;
}
.games-price-guide .games-section-heading,
.games-ratings-box .games-section-heading { margin-bottom: 14px; }
.games-price-guide .games-prices { max-width: none; }

@media (max-width: 900px) {
    .games-hero-cards { width: 100%; }
    .games-hero-cards-top {
        flex-direction: column;
        align-items: stretch;
    }
    .games-price-guide { flex-basis: auto; max-width: 100%; }
    .games-price-guide .games-prices { max-width: 380px; }
    /* Columns stack full-width here, so the fixed widget height no longer buys
       side-by-side alignment — let each size to its content (the trailer keeps a
       16:9 box since it has no intrinsic height of its own). */
    .games-hero { --games-widget-h: auto; }
    .games-hero-video { aspect-ratio: 16 / 9; }
    .games-info-box { overflow-y: visible; }
    .games-similar-scroller { min-height: 0; }
}

/* ---- Badge row + Notifications dropdown ---------------------------------- */
/* Console badge + Notifications trigger share one row above the title. */
.games-badge-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.games-notify-dropdown { position: relative; }
.games-notify-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-green);
    border: 1px solid rgba(0, 255, 65, 0.4);
    border-radius: 4px;
    background: rgba(0, 255, 65, 0.07);
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}
.games-notify-badge:hover { box-shadow: 0 0 8px rgba(0, 255, 65, 0.3); }
.games-notify-caret { font-size: 0.6rem; }
.games-notify-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    min-width: 220px;
    max-width: 300px;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    background: #0f0f1e;
    border: 1px solid rgba(0, 255, 65, 0.4);
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}
.games-notify-panel[hidden] { display: none; }
.games-notify-option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    color: var(--console-text);
    text-decoration: none;
    cursor: pointer;
}
.games-notify-option:hover { background: rgba(0, 255, 65, 0.1); }
.games-notify-option-new {
    color: var(--console-green);
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    margin-bottom: 4px;
    padding-bottom: 10px;
}

/* ---- Toast (Notifications add confirmation) ------------------------------ */
.games-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%) translateY(12px);
    z-index: 2147483600;
    max-width: calc(100vw - 32px);
    padding: 11px 18px;
    background: #0f0f1e;
    border: 1px solid rgba(0, 255, 65, 0.5);
    border-radius: 6px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.85rem;
    color: var(--console-text);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.games-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.games-toast-error { border-color: rgba(255, 82, 82, 0.5); }

.games-console-badge {
    display: inline-block;
    padding: 4px 10px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-cyan);
    border: 1px solid rgba(0, 217, 255, 0.4);
    border-radius: 4px;
    background: rgba(0, 217, 255, 0.07);
    text-decoration: none;
    transition: box-shadow 0.15s ease;
}
.games-console-badge:hover { box-shadow: 0 0 8px rgba(0, 217, 255, 0.3); }

.games-title {
    font-family: 'Electrolize', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #e8f6ff;
    text-shadow: 0 0 14px rgba(0, 217, 255, 0.25);
    margin: 12px 0;
    line-height: 1.15;
}
.games-description {
    font-family: 'Electrolize', sans-serif;
    color: var(--console-muted);
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0 0 6px;
    /* Clamp to 5 lines; the JS-toggled "Read more" link reveals the rest in a
       modal. */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.games-readmore {
    display: inline-block;
    margin: 0 0 18px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-cyan);
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.games-readmore:hover { color: var(--console-green); text-shadow: 0 0 10px rgba(0, 255, 65, 0.35); }
.games-readmore[hidden] { display: none; }

/* Trailer under the text: full width of the text column. JS sets an explicit
   height (matching Similar Games); width just fills the column. */
.games-hero-video {
    width: 100%;
    /* Fixed height (shared with Game Info + Similar Games) so the trailer is
       always the same size and never collapses to the iframe's tiny intrinsic
       size when there's nothing beside it to match. */
    height: var(--games-widget-h);
    border: 1px solid var(--console-border);
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 0 24px rgba(0, 217, 255, 0.12);
}
.games-hero-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
/* No-trailer placeholder: same fixed .games-hero-video box, softer card
   background (not the embed's black), centred message. */
.games-hero-video-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    background: var(--console-card);
    box-shadow: none;
}
.games-hero-video-empty-text {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.9rem;
    color: var(--console-muted);
}

/* Game Info: stacked under the thumbnail gallery in .games-hero-left, so it's
   the same (220px) width as the gallery rather than filling a row. Background/
   border/padding come from the shared .games-panel class already on it. */
.games-info-box {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 0;
    /* Fixed height (shared with the trailer + Similar Games) so the panel is
       the same size whether a game has a lot or a little metadata; content
       past that scrolls rather than stretching the panel. */
    height: var(--games-widget-h);
    overflow-y: auto;
}
.games-ratings-list { display: flex; flex-direction: column; gap: 12px; }
.games-rating { display: flex; align-items: center; gap: 10px; }
.games-rating-score {
    font-family: 'Electrolize', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--console-green);
    text-shadow: 0 0 12px rgba(0, 255, 65, 0.35);
    white-space: nowrap;
}
.games-rating-score span {
    font-size: 0.7rem;
    color: var(--console-muted);
    text-shadow: none;
    margin-left: 2px;
}
.games-rating-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.games-rating-label {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-cyan);
}
.games-rating-count {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.62rem;
    color: var(--console-muted);
}

/* ---- Description modal --------------------------------------------------- */
.games-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.games-modal[hidden] { display: none; }
.games-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 16, 0.82);
    backdrop-filter: blur(2px);
}
.games-modal-box {
    position: relative;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #0f0f1e;
    border: 1px solid var(--console-cyan);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.25), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.games-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}
.games-modal-title {
    font-family: 'Electrolize', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #e8f6ff;
    margin: 0;
}
.games-modal-close {
    flex-shrink: 0;
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--console-muted);
    transition: color 0.15s ease;
}
.games-modal-close:hover { color: var(--console-cyan); }
.games-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--console-text);
}
.games-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #04122a;
    background: var(--console-cyan);
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 0 16px rgba(0, 217, 255, 0.35);
    transition: box-shadow 0.15s ease;
}
.games-cta:hover { box-shadow: 0 0 22px rgba(0, 217, 255, 0.55); }

/* ---- Panels (match the /browse .browse-card translucent surface) --------- */
.games-panel {
    background: var(--console-card);
    border: 1px solid var(--console-border);
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 0px;
}

/* ---- Game Info grid ------------------------------------------------------ */
/* Single content-sized column: the Game Info box is only as wide as its
   widest stat, and the stats stack vertically. */
.games-stats-grid {
    display: grid;
    grid-template-columns: auto;
    gap: 14px;
}
.games-stat { display: flex; flex-direction: column; gap: 5px; }
.games-stat-label {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-muted);
}
.games-stat-val {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.95rem;
    color: var(--console-text);
}
.games-stat-rarity { display: flex; }

/* ---- Market Price Guide --------------------------------------------------
   .prices-container/.price-row/.price-label/.price-value/.rarity-box are
   defined in features/pricing/main.css — reused as-is. */
.games-prices { max-width: 380px; }
.games-pricing-note {
    font-family: 'Electrolize', sans-serif;
    margin: 14px 0 0;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    color: var(--console-muted);
}

/* ---- Similar Games -------------------------------------------------------
   Sits under the price-guide/game-info row inside .games-hero-cards, spanning
   that row's full (combined) width and left-aligned to the price guide. A
   horizontal cover strip that scrolls once the cards overflow that width.

   width:0 + min-width:100% is the key: width:0 keeps this block from
   contributing its (wide) card row to the column's intrinsic width — so the
   column stays sized to the card row above — while min-width:100% then renders
   it at the full resolved column width. The strip's overflow-x scrolls the
   cards within that. */
.games-similar {
    width: 0;
    min-width: 100%;
    box-sizing: border-box;
    /* Fixed height (shared with the trailer + Game Info) and a column layout so
       the heading stays put and the card strip / empty-state message fill the
       rest — the section keeps its size even with no similar games. */
    height: var(--games-widget-h);
    display: flex;
    flex-direction: column;
}
.games-similar .games-section-heading { flex: 0 0 auto; }
.games-similar-empty {
    flex: 1 1 auto;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    color: var(--console-muted);
    border: 1px dashed var(--console-border);
    border-radius: 8px;
}
/* position:relative anchors the reused .games-media-arrow buttons; the native
   scrollbar is hidden since scrolling is driven by those arrows (JS). Fills the
   height left under the heading so cards sit in a stable-size row. */
.games-similar-scroller { position: relative; flex: 1 1 auto; min-height: 0; }
.games-similar-strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.games-similar-strip::-webkit-scrollbar { display: none; }
.games-similar-card {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    background: var(--console-card);
    border: 1px solid var(--console-border);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.games-similar-card:hover {
    border-color: var(--console-cyan);
    background: rgba(0, 255, 255, 0.05);
    transform: translateY(-2px);
}
.games-similar-art {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #0a0e27;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.games-similar-art img { width: 100%; height: 100%; object-fit: cover; }
.games-similar-noart {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    color: var(--console-muted);
    padding: 8px;
    line-height: 1.3;
}
.games-similar-info { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; }
.games-similar-name {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--console-text);
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.games-similar-card:hover .games-similar-name { color: #fff; }
.games-similar-console {
    font-family: 'Electrolize', sans-serif;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--console-cyan);
}

/* ---- Latest Listings -----------------------------------------------------
   .results-list, .console-listing and .listing-notify are defined in
   features/search/main.css — reused as-is via _listings.blade.php. */
.games-listings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.games-listings-head .games-section-heading { margin: 0; }
.games-listings-head .games-cta { flex-shrink: 0; }
/* This page wires up no pricing-popover JS (unlike /search), so hide the
   "Pricing data" peek button here only — scoped so _listings.blade.php and
   /search stay untouched. */
.games-results-list .listing-price-peek { display: none; }
/* The per-listing Notifications dropdown only renders on /search (the games
   controller doesn't pass $notificationListsByConsole), and this page has its
   own hero Notifications dropdown — hide any listing-level one here as a
   safeguard, leaving _listings.blade.php and /search untouched. */
.games-results-list .listing-notify-dropdown { display: none; }
.games-viewall {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-family: 'Electrolize', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--console-cyan);
    text-decoration: none;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.games-viewall:hover { color: #00ff41; text-shadow: 0 0 10px rgba(0, 255, 65, 0.35); }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
    .games-hero { flex-direction: column; }
    .games-title { font-size: 1.5rem; }
}
