/* The game catalogue has its own artwork and layout; game-play screens keep
   their existing games.css styles. */
.sg-games-gallery-body .sg-games-background-scene {
    opacity: .32;
}

.sg-games-gallery-body .sg-games-shell {
    width: min(1420px, calc(100% - 48px));
    padding-top: 30px;
}

.sg-games-gallery-body .sg-games-hero {
    position: relative;
    display: flex;
    min-height: 360px;
    margin-bottom: 32px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(169, 206, 255, .25);
    border-radius: 30px;
    background: #102a51;
    box-shadow: 0 26px 70px rgba(2, 13, 32, .24);
}

.sg-games-gallery-body .sg-games-hero::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(90deg, rgba(9, 29, 60, .4), transparent 65%);
    content: "";
    pointer-events: none;
}

.sg-games-gallery-body .sg-games-hero__copy {
    position: relative;
    z-index: 1;
    width: min(58%, 760px);
    padding: clamp(30px, 4vw, 60px);
}

.sg-games-gallery-body .sg-games-hero__art {
    position: absolute;
    inset: 0 0 0 43%;
    z-index: -2;
    background: url("../assets/games/hub/library-hero.jpg") right center / cover no-repeat;
}

.sg-games-gallery-body .sg-games-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    color: #9ef2da;
    font-size: .78rem;
    letter-spacing: .12em;
}

.sg-games-gallery-body .sg-games-kicker::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #53dcb9;
    box-shadow: 0 0 0 5px rgba(83, 220, 185, .12);
    content: "";
}

.sg-games-gallery-body .sg-games-hero h1 {
    max-width: 11ch;
    margin-bottom: 15px;
    color: #fff;
    font-size: clamp(2.5rem, 4.1vw, 4.2rem);
    line-height: 1.12;
    letter-spacing: -.035em;
}

.sg-games-gallery-body .sg-games-hero p:not(.sg-games-kicker) {
    max-width: 48ch;
    color: #e1edff;
    font-size: 1.05rem;
    line-height: 1.65;
}

.sg-games-gallery-body .sg-games-hero .sg-games-grade-note {
    display: inline-block;
    max-width: 53ch;
    margin-top: 22px;
    padding: 10px 14px;
    border-color: rgba(255, 224, 155, .48);
    border-radius: 12px;
    background: rgba(8, 23, 46, .66);
    color: #ffe8b0;
    font-size: .86rem;
    line-height: 1.5;
}

.sg-games-gallery-body .sg-games-layout {
    grid-template-columns: minmax(215px, 248px) minmax(0, 1fr);
    gap: 24px;
}

.sg-games-gallery-body .sg-games-sidebar {
    padding: 20px 16px;
    border-radius: 20px;
}

.sg-games-gallery-body .sg-games-toolbar {
    margin-bottom: 17px;
}

.sg-games-gallery-body .sg-games-search input {
    min-height: 50px;
    border-radius: 14px;
}

.sg-games-gallery-body .sg-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.sg-games-gallery-body .sg-game-card {
    border-radius: 20px;
}

.sg-games-gallery-body .sg-game-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.sg-games-gallery-body .sg-game-card__media::after {
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background: linear-gradient(transparent, rgba(3, 17, 36, .45));
    content: "";
    pointer-events: none;
}

.sg-games-gallery-body .sg-game-card__img {
    transition: transform .35s ease;
}

.sg-games-gallery-body .sg-game-card:hover .sg-game-card__img {
    transform: scale(1.035);
}

.sg-games-gallery-body .sg-game-card__plan,
.sg-games-gallery-body .sg-game-card__ribbon {
    z-index: 1;
}

.sg-games-gallery-body .sg-game-card__body {
    gap: 9px;
    padding: 18px;
}

.sg-games-gallery-body .sg-game-card__title {
    font-size: 1.2rem;
}

.sg-games-gallery-body .sg-game-card__desc {
    line-height: 1.5;
}

.sg-games-gallery-body .sg-game-card__learning {
    display: block;
    margin-top: 3px;
}

.sg-games-gallery-body .sg-game-card__learning div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border: 0;
    border-top: 1px solid var(--sgg-line);
    border-radius: 0;
    background: transparent;
}

.sg-games-gallery-body .sg-game-card__learning dt {
    flex: 0 0 auto;
    font-size: .7rem;
    line-height: 1.45;
}

.sg-games-gallery-body .sg-game-card__learning dd {
    margin: 0;
    font-size: .76rem;
    line-height: 1.4;
    text-align: right;
}

.sg-games-gallery-body .sg-game-card__action {
    min-height: 44px;
    align-content: center;
}

/* The gallery hero is intentionally navy in both themes so its illustration
   keeps the same color and every line of overlaid text stays readable. */
html[lang][data-index-v2-theme] body.sg-games-gallery-body[data-v2-mode-theme="light"] .sg-games-hero h1 {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

html[lang][data-index-v2-theme] body.sg-games-gallery-body[data-v2-mode-theme="light"] .sg-games-hero p:not(.sg-games-kicker, .sg-games-grade-note) {
    color: #e1edff !important;
    -webkit-text-fill-color: #e1edff !important;
}

html[lang][data-index-v2-theme] body.sg-games-gallery-body[data-v2-mode-theme="light"] .sg-games-hero .sg-games-grade-note {
    border-color: rgba(255, 224, 155, .48);
    background: rgba(8, 23, 46, .66);
    color: #ffe8b0 !important;
    -webkit-text-fill-color: #ffe8b0 !important;
}

html[lang][data-index-v2-theme] body.sg-games-gallery-body[data-v2-mode-theme="light"] .sg-games-hero .sg-games-kicker {
    color: #9ef2da !important;
    -webkit-text-fill-color: #9ef2da !important;
}

@media (max-width: 900px) {
    .sg-games-gallery-body .sg-games-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .sg-games-gallery-body .sg-games-hero__copy {
        width: 67%;
    }

    .sg-games-gallery-body .sg-games-filter-toggle {
        display: inline-flex;
        min-height: 46px;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .sg-games-gallery-body .sg-games-shell {
        width: calc(100% - 28px);
        padding-top: 16px;
    }

    .sg-games-gallery-body .sg-games-hero {
        display: block;
        min-height: 0;
        margin-bottom: 20px;
        border-radius: 24px;
    }

    .sg-games-gallery-body .sg-games-hero::after {
        display: none;
    }

    .sg-games-gallery-body .sg-games-hero__copy {
        width: 100%;
        padding: 26px 23px 12px;
    }

    .sg-games-gallery-body .sg-games-hero__art {
        position: relative;
        inset: auto;
        width: 100%;
        height: 180px;
        background-size: cover;
        background-position: right 58%;
    }

    .sg-games-gallery-body .sg-games-hero h1 {
        max-width: none;
        font-size: clamp(2rem, 8vw, 2.65rem);
    }

    .sg-games-gallery-body .sg-games-hero p:not(.sg-games-kicker) {
        font-size: .96rem;
    }

    .sg-games-gallery-body .sg-games-hero .sg-games-grade-note {
        margin-top: 16px;
        font-size: .82rem;
    }

    .sg-games-gallery-body .sg-games-filter-toggle {
        width: 100%;
        justify-content: center;
    }

    .sg-games-gallery-body .sg-games-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .sg-games-gallery-body .sg-game-card__body {
        padding: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sg-games-gallery-body .sg-game-card__img {
        transition: none;
    }
}
