/* GAMES: accordion. Hover (desktop) or tap (mobile) a game to open it.
   Mobile rows version is in responsive.css. */

.games-acc {
    display: flex;
    gap: var(--gap);
    height: clamp(360px, 46vw, 500px); /* height of the game row */
}
.games-acc > li {
    flex: 1;
    min-width: 0;
    transition: flex var(--t-slow) var(--ease), height var(--t-slow) var(--ease);
}
.games-acc > li.is-active {
    flex: 4.5; /* open game is 4.5x wider than closed ones */
}
.game {
    position: relative;
    display: block;
    height: 100%;
    overflow: hidden;
    border-radius: var(--pill);
    background: var(--hl);
    color: #fff;
    text-decoration: none;
    isolation: isolate;
    transition: border-radius var(--t-slow) var(--ease);
}
.games-acc > li.is-active .game {
    border-radius: var(--r-lg);
}
.game img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 0.8s var(--ease);
}
.games-acc > li.is-active .game img {
    transform: scale(1.05);
}
/* dark gradient so text is readable */
.game::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.1) 60%);
}
.game .icon-svg {
    filter: brightness(0) invert(1);
}
/* vertical name, shown while closed */
.game-v {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) rotate(180deg);
    writing-mode: vertical-rl;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
    transition: opacity var(--t-short) var(--ease);
}
.games-acc > li.is-active .game-v {
    opacity: 0;
}
/* caption + download link, shown while open */
.game-cap {
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: 24px;
    display: grid;
    gap: 6px;
    justify-items: start;
    text-align: left;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--t-short) var(--ease), transform var(--t-long) var(--ease);
}
.games-acc > li.is-active .game-cap {
    opacity: 1;
    transform: none;
    transition-delay: var(--t-short);
}
.game-cap h3 {
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
}
