.game-library { width: 100%; gap: 1.25rem; }
.library-intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .35rem 0 .25rem; }
.library-intro h1 { color: var(--ig-heading-color); font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -.035em; margin: 0 0 .35rem; }
.library-intro p { margin: 0; color: var(--ig-text-muted); font-size: .92rem; }
.library-body { min-width: 0; }
.library-filters { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.15rem; }
.library-search { flex: 0 1 25rem; min-width: 0; }
.library-game-type { flex: 0 1 13rem; min-width: 0; }
.library-filters .ig-form-field { margin: 0 !important; }
.library-game-open { color: inherit; text-decoration: none; }
.library-result-count { margin: 0 0 0 auto; color: var(--ig-text-muted); font-size: .8rem; }
.library-game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.library-catalogue { display: grid; gap: 2rem; }
.library-catalogue-section { min-width: 0; }
.library-catalogue-heading { margin: 0 0 .85rem; color: var(--ig-heading-color); font-family: var(--ig-font-label); font-size: 1.15rem; font-weight: 700; }
.library-catalogue-section .library-game-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.library-game.ig-layout-card { padding: 0; gap: 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--ig-surface-raised); border: 1px solid var(--ig-border-strong); border-radius: var(--ig-radius-md); transition: border-color 140ms ease, box-shadow 140ms ease; }
.library-game:hover, .library-game:focus-within { border-color: color-mix(in srgb, var(--ig-accent) 45%, var(--ig-border-strong)); box-shadow: var(--ig-card-shadow-hover); }
.game-capsule { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ig-surface-subtle); }
.game-capsule img { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-capsule .game-identity-mark { width: 4rem; height: 4rem; font-size: 2rem; }
.library-game-content { display: flex; flex: 1; flex-direction: column; gap: .55rem; padding: 1rem; }
.library-game-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; }
.library-game h2 { font-size: 1.3rem; font-weight: 700; color: var(--ig-heading-color); line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.library-game-metadata { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .3rem; }
.library-game-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.library-game-tag { display: inline-flex; align-items: center; padding: .13rem .52rem; border: 1px solid color-mix(in srgb, var(--ig-border-color) 55%, transparent); border-radius: 999px; color: var(--ig-text-muted); background: color-mix(in srgb, var(--ig-surface-strong) 65%, var(--ig-surface-raised)); font-family: var(--ig-font-sans); font-size: .75rem; font-weight: 500; line-height: 1.35; }
.library-game-description { margin: 0; color: var(--ig-text-muted); font-size: .84rem; line-height: 1.55; }
.library-game .library-game-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.library-status { display: block; font-size: .78rem; font-weight: 600; }
.library-game .library-status { color: var(--ig-text-muted); font-size: .73rem; font-weight: 400; }
.library-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.library-footnote { color: var(--ig-text-muted); font-size: .82rem; margin: 1.15rem 0 0; }
.library-empty { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; border: 1px dashed var(--ig-border-strong); border-radius: var(--ig-radius-md); }
.library-empty h2 { font-size: 1.2rem; }
.library-empty p { color: var(--ig-text-muted); margin-bottom: 0; }
.library-plans > .btn, .library-game-detail > .btn { margin-bottom: 1.5rem; }
.library-game-overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); gap: 2rem; align-items: center; }
.library-game-overview:not(.has-gallery) { align-items: start; }
.library-game-overview .game-capsule { border-radius: var(--ig-radius-md); }
.library-game-summary { display: grid; gap: 1rem; min-width: 0; }
.library-game-summary h1 { color: var(--ig-heading-color); font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.1; margin: 0; padding: 0; border: 0; }
.library-game-summary > p { margin: 0; }
.library-game-options { margin-top: 2rem; border-block: 1px solid var(--ig-border-color); padding: 1.1rem 0; font-size: .9rem; }
.library-game-options summary { font-weight: 600; color: var(--ig-heading-color); cursor: pointer; }
.library-game-options p { margin: 1rem 0; color: var(--ig-text-muted); }
.library-game-options .btn { margin: 0 .5rem .5rem 0; }
.library-account h2, .library-plans h2 { color: var(--ig-heading-color); font-size: 1.35rem; margin: 0 0 .5rem; }
.library-account h3, .library-plans h3 { font-size: 1.05rem; }
.library-plans > p, .library-account > p { font-size: .9rem; }
.library-plan { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding: 1.4rem; margin: 1.5rem 0 1rem; background: var(--ig-surface-raised); border: 1px solid var(--ig-border-color); border-radius: var(--ig-radius-md); }
.library-plan > div:first-child { flex: 1 1 20rem; }
.library-plan p { margin: 0; color: var(--ig-text-muted); font-size: .85rem; }
.library-plan .library-plan-price { margin-top: .65rem; color: var(--ig-heading-color); font-size: .9rem; font-weight: 600; }
.library-plans > h3 { margin-top: 2rem; }
.library-subscription { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: 1rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--ig-border-color); font-size: .88rem; }
.library-pending { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem; border: 1px solid var(--ig-border-strong); border-radius: var(--ig-radius-sm); }
.library-pending span { flex: 1; }
.library-form { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; padding: 1.25rem 0; }
.library-form h3 { width: 100%; margin: 0; font-size: 1.1rem; }
.library-form input, .library-form select { max-width: 360px; }
.library-account details { padding: 1.2rem 0; margin-bottom: 1rem; border-block: 1px solid var(--ig-border-color); }
.library-account summary { font-weight: 600; }
.library-account > .library-actions { margin-bottom: 1rem; }
.library-message:empty { display: none; }
.library-message:not(:empty) { position: fixed; right: 1rem; bottom: 1rem; z-index: 1040; width: min(28rem, calc(100vw - 2rem)); margin: 0; padding: .8rem 1rem; background: var(--ig-surface-raised); border: 1px solid var(--ig-border-color); border-left: 3px solid var(--ig-accent); border-radius: var(--ig-radius-sm); box-shadow: var(--ig-card-shadow-hover); overflow-wrap: anywhere; pointer-events: none; font-size: .9rem; }
.game-catalogue-admin > .text-body-secondary { margin: 0; }
.game-order-list { display: grid; gap: .5rem; max-width: 52rem; margin: 0; padding: 0; list-style: none; }
.game-order-row { display: flex; align-items: center; gap: .8rem; min-width: 0; padding: .7rem; border: 1px solid var(--ig-border-color); border-radius: var(--ig-radius-sm); background: var(--ig-surface-raised); }
.game-order-row[draggable="true"] { cursor: grab; }
.game-order-row.is-dragging { opacity: .5; }
.game-order-row[data-drop="before"] { border-top: 3px solid var(--ig-accent); }
.game-order-row[data-drop="after"] { border-bottom: 3px solid var(--ig-accent); }
.game-order-number { display: grid; place-items: center; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ig-surface-subtle); font-weight: 700; }
.game-order-description { display: grid; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.game-order-description small { color: var(--ig-text-muted); }
.game-order-row-actions { display: flex; gap: .3rem; }
.game-order-row .btn { min-height: 2.5rem; }
.game-order-actions { margin-top: .25rem; }
@media (max-width: 700px) {
    .library-search { width: 100%; }
    .library-game-content { padding: 1rem; }
    .library-game-overview { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
    .library-form input, .library-form select { max-width: none; }
    .game-order-row { flex-wrap: wrap; }
    .game-order-description { flex-basis: calc(100% - 3rem); }
    .game-order-row-actions { margin-left: 2.8rem; }
}

.account-field { display: grid; gap: .3rem; min-width: 0; flex: 1 1 12rem; }
.account-field[hidden] { display: none; }
.account-field input, .account-field select { min-width: 0; width: 100%; max-width: none; }
@media (max-width: 700px) {
    .account-field { width: 100%; flex-basis: 100%; }
}
.launcher-download { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2rem; padding-block: .5rem; }
.launcher-download-copy { flex: 1 1 16rem; min-width: 0; }
.launcher-download h2 { font-size: 1.35rem; font-weight: 650; margin: 0 0 .65rem; color: var(--ig-heading-color); }
.launcher-description { max-width: 38ch; font-size: .9rem; color: var(--ig-text-muted); margin-bottom: 1.1rem; }
.launcher-platform, .launcher-version { font-size: .75rem; color: var(--ig-text-muted); }
.launcher-platform { margin-bottom: .55rem; }
.launcher-version { margin: .55rem 0 0; }
.launcher-install-help { font-size: .8rem; margin-top: 1.2rem; }
.launcher-install-help summary { color: var(--ig-text-muted); cursor: pointer; }
.launcher-install-help ol { padding-left: 1.2rem; margin: .75rem 0 0; line-height: 1.65; }
.launcher-preview { flex: 1.5 1 22rem; min-width: 0; margin: 0; }
.launcher-preview img { display: block; width: 100%; height: auto; border: 1px solid var(--ig-border-color); border-radius: var(--ig-radius-sm); }
.launcher-preview figcaption { margin-top: .45rem; color: var(--ig-text-muted); font-size: .68rem; }
.library-platforms { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; margin: 0; padding: 0; list-style: none; color: var(--ig-text-muted); }
.library-platform { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; line-height: 1; }
.library-platform svg { flex: 0 0 auto; width: 1.1rem; height: 1.1rem; }
.library-platform[data-platform="browser"] { color: var(--ig-accent); }
.library-game-heading .library-platforms { flex-wrap: nowrap; margin-left: auto; }
.library-game-summary .library-platform { padding: .3rem .65rem; border: 1px solid var(--ig-border-color); border-radius: 999px; background: var(--ig-surface-subtle); }

/* Store page: gallery, full-window viewer, copy and facts (GameStorePage via the Library API). */
/* Screenshots and video sit on a fixed dark stage in every theme. */
:root { --game-library-media-backdrop: #06080c; --game-library-media-ink: #fff; --game-library-media-missing: #c9d1dc; --game-library-lightbox-backdrop: #111; --game-library-lightbox-caption: #d6dbe3; }
.library-game-detail { width: 100%; }
.library-game-overview.has-gallery { align-items: start; }
.store-gallery { display: grid; gap: .55rem; min-width: 0; }
.store-gallery-stage { position: relative; width: 100%; overflow: hidden; border-radius: var(--ig-radius-md); background: var(--game-library-media-backdrop); touch-action: pan-y; }
.store-gallery-item { position: absolute; inset: 0; }
.store-gallery-item img, .store-gallery-item video, .store-lightbox-media img, .store-lightbox-media video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.store-gallery-view { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.store-gallery-view:focus-visible { outline: 2px solid var(--ig-accent); outline-offset: -3px; }
.store-gallery-step { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0 0 .2rem; border: 0; border-radius: 999px; color: var(--game-library-media-ink); background: rgb(0 0 0 / .55); font-size: 1.7rem; line-height: 1; opacity: .85; transition: opacity 120ms ease, background-color 120ms ease; }
.store-gallery-previous { left: .6rem; }
.store-gallery-next { right: .6rem; }
.store-gallery-step:hover, .store-gallery-step:focus-visible { opacity: 1; background: rgb(0 0 0 / .8); }
.store-gallery-step:focus-visible, .store-gallery-thumb:focus-visible { outline: 2px solid var(--ig-accent); outline-offset: 2px; }
.store-gallery-caption { margin: 0; min-height: 1.35em; color: var(--ig-text-muted); font-size: .82rem; line-height: 1.4; }
.store-gallery-thumbs { position: relative; display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px .35rem; scrollbar-width: thin; }
.store-gallery-thumb { position: relative; flex: 0 1 7.5rem; min-width: 5.75rem; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: var(--ig-radius-sm); background: var(--game-library-media-backdrop); opacity: .72; transition: opacity 120ms ease, border-color 120ms ease; }
.store-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.store-gallery-thumb:hover, .store-gallery-thumb:focus-visible { opacity: 1; }
.store-gallery-thumb[aria-current="true"] { opacity: 1; border-color: var(--ig-accent-fill); }
ig-button[data-type="video"] .store-gallery-thumb::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--game-library-media-ink); font-size: 1.1rem; text-shadow: 0 1px 4px rgb(0 0 0 / .85); }
.store-gallery-item.is-missing img, .store-lightbox-media.is-missing img, .store-gallery-thumb.is-missing img { visibility: hidden; }
.store-gallery-item.is-missing::after, .store-lightbox-media.is-missing::after { content: "This screenshot could not be loaded."; position: absolute; inset: 0; display: grid; place-items: center; color: var(--game-library-media-missing); font-size: .9rem; }
.store-lightbox { position:relative; height:calc(100dvh - 8rem); padding:0 4.25rem; display:grid; grid-template-rows:minmax(0,1fr) auto; gap:.75rem; background:var(--game-library-lightbox-backdrop); color:var(--game-library-media-ink); }
.store-lightbox-media { position: relative; min-height: 0; }
.store-lightbox-caption { margin: 0; color: var(--game-library-lightbox-caption); font-size: .9rem; text-align: center; }
.store-lightbox .store-gallery-previous { left: .7rem; }
.store-lightbox .store-gallery-next { right: .7rem; }
.library-store { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); gap: 2rem 2.5rem; align-items: start; margin-top: 2.25rem; }
.library-store-main, .library-store-aside { display: grid; gap: 1.25rem; min-width: 0; }
.library-store-main { gap: 2.25rem; }
.library-store-aside:only-child { grid-column: 1 / -1; max-width: 40rem; }
.library-store-section h2 { margin: 0 0 .8rem; color: var(--ig-heading-color); font-family: var(--ig-font-label); font-size: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.library-store-main .library-store-section > p { max-width: 72ch; margin: 0 0 .85rem; line-height: 1.7; }
.library-store-main .library-store-section > p:last-child { margin-bottom: 0; }
.library-store-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: .85rem; margin: 0; padding: 0; list-style: none; }
.library-store-features li { padding: 1rem 1.1rem; background: var(--ig-surface-raised); border: 1px solid var(--ig-border-color); border-radius: var(--ig-radius-md); }
.library-store-features h3 { margin: 0 0 .35rem; color: var(--ig-heading-color); font-size: 1rem; font-weight: 700; line-height: 1.3; }
.library-store-features p { margin: 0; color: var(--ig-text-muted); font-size: .88rem; line-height: 1.55; }
.library-store-aside .library-store-section { padding: 1.1rem 1.2rem; background: var(--ig-surface-raised); border: 1px solid var(--ig-border-color); border-radius: var(--ig-radius-md); }
.library-store-facts { display: grid; gap: .6rem; margin: 0; font-size: .86rem; line-height: 1.45; }
.library-store-facts > div { display: grid; grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr); gap: .75rem; }
.library-store-facts dt { color: var(--ig-text-muted); font-weight: 400; }
.library-store-facts dd { margin: 0; color: var(--ig-text-color); overflow-wrap: anywhere; }
.library-store-link { font-size: .88rem; }
@media (max-width: 900px) {
    .library-game-overview.has-gallery, .library-store { grid-template-columns: minmax(0, 1fr); }
    .library-game-overview.has-gallery .library-game-summary > .game-capsule { display: none; }
}
@media (max-width: 700px) {
    .store-gallery-thumb { flex-basis: 7rem; min-width: 5.5rem; }
    .store-gallery-step { width: 2.4rem; height: 2.4rem; font-size: 1.5rem; }
    .store-lightbox { padding: 3.5rem .35rem 4.25rem; }
    .store-lightbox .store-gallery-step { top: auto; bottom: .6rem; translate: none; }
    .store-lightbox .store-gallery-previous { left: calc(50% - 3.4rem); }
    .store-lightbox .store-gallery-next { right: calc(50% - 3.4rem); }
}
