/* Styles extracted from games.html and game-player.html */

.games-section {
    min-height: 100vh;
    background: url('../images/krasivoe-goluboe-nebo-i-belye-oblaka 1.png') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 90px 1rem 15vh;
    --active-card-1: #d40000;
    --active-card-2: #b40000;
}

.games-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
}

.games-watermark {
    position: absolute;
    inset: 32px 0 auto 0;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    text-align: center;
    top: 200px;
    transform: translateY(40px);
}

.games-watermark__line {
    margin: 0;
    font-family: 'Dela Gothic One', sans-serif;
    font-size: clamp(2.4rem, 7vw, 5.5rem);
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.42);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 0.95;
    white-space: nowrap;
}

.games-carousel-wrap {
    position: relative;
    z-index: 1;
    width: min(1260px, 96vw);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
}

.games-arrow {
    width: 68px;
    height: 68px;
    border: 2px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    cursor: pointer;
    transition: all 180ms ease;
}

.games-arrow:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.18);
}

.games-carousel-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    transform: translateY(-16px);
    --active-card-1: #d10000;
    --active-card-2: #b30000;
    --badge-1: #f04040;
    --badge-2: #d91d1d;
    --active-img-scale: 1.50;
    --active-img-y: 0px;
}

.games-carousel-viewport {
    overflow: hidden;
    width: 100%;
    /* no lateral padding so the next card is clipped and not visible */
    padding: 8px 0;
    box-sizing: border-box;
}

.games-carousel-track {
    display: flex;
    align-items: end;
    transition: transform 320ms ease;
    will-change: transform;
    gap: 6px;
}

.game-card {
    flex: 0 0 20%;
    padding: 8px;
    cursor: pointer;
    transition: transform 200ms ease, opacity 150ms ease;
    position: relative;
}

.game-card__inner {
    height: 250px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.16);
    overflow: hidden;
    position: relative;
    transition: height 360ms cubic-bezier(.22,.9,.12,1), border-color 360ms ease, transform 360ms ease;
    display: flex;
    align-items: end;
    justify-content: center;
}

.game-card__inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--active-card-1) 0%, var(--active-card-2) 100%);
    opacity: 0;
    transition: opacity 360ms ease;
    border-radius: inherit;
    z-index: 0;
}

.game-card.is-active .game-card__inner {
    height: 440px;
    border-color: transparent;
    transform: translateY(10px);
}

.game-card.is-active .game-card__inner::before {
    opacity: 1;
}

.game-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 360ms cubic-bezier(.22,.9,.12,1);
    padding: 8px;
    transform-origin: center bottom;
}

.game-card.is-active .game-card__img {
    transform: translateY(var(--active-img-y)) scale(var(--active-img-scale));
}

.games-power-badge {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(180deg, var(--badge-1) 0%, var(--badge-2) 100%);
    color: #fff;
    font-family: 'Dela Gothic One', sans-serif;
    text-transform: uppercase;
    font-size: 1.1rem;
    border-radius: 999px;
    padding: 0.6rem 1.4rem;
    transition: background 360ms ease, opacity 220ms ease, transform 260ms cubic-bezier(.22,.9,.12,1);
    opacity: 1;
}

.games-deco {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    animation: gamesFloat 6s ease-in-out infinite;
    will-change: transform, opacity;
    transition: opacity 160ms ease, transform 220ms cubic-bezier(.2,.9,.2,1);
    opacity: 1;
}

.games-deco--1 { animation-delay: 0s; }
.games-deco--2 { animation-delay: 0.6s; }
.games-deco--3 { animation-delay: 1.1s; }
.games-deco--4 { animation-delay: 1.7s; }

@keyframes gamesFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

@media (max-width: 991px) {
    .games-watermark { inset: 58px 0 auto 0; top: 200px; transform: translateY(20px); }
    .games-arrow { width: 54px; height: 54px; font-size: 1.6rem; }
    .game-card { flex-basis: 33.3333%; }
    .game-card__inner, .game-card.is-active .game-card__inner { height: 300px; transform: none; }
    .games-power-badge { font-size: 0.95rem; }
    .games-carousel-stage { transform: translateY(-10px); padding-bottom: 62px; }
}

@media (max-width: 640px) {
    .games-section { padding-top: 98px; }
    .games-carousel-wrap { grid-template-columns: 1fr; gap: 0; }
    .games-arrow { display: none; }
    .games-carousel-track { flex-direction: column; align-items: stretch; gap: 0; }
    .games-carousel-viewport {
        padding: 0;
        height: 500px;
        overflow-y: scroll;
        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        scrollbar-width: none;
    }
    .games-carousel-viewport::-webkit-scrollbar { display: none; }
    .game-card { flex: 0 0 500px !important; width: 100%; padding: 6px 6px 74px; scroll-snap-align: start; }
    .game-card > .games-power-badge { top: auto; bottom: 6px; left: 50%; transform: translateX(-50%); z-index: 10; white-space: nowrap; }
    .game-card__inner { height: 420px; }
    .game-card.is-active .game-card__inner { height: 420px; transform: none; }
    .game-card.is-active .game-card__img { transform: none; }
    .games-carousel-stage { transform: none; padding-bottom: 56px; }
    .games-deco { opacity: 0.9; }
}

/* game-player styles */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

.player-wrap {
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.player-iframe {
    flex: 1;
    border: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.btn-back {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 9999;
    color: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(6px);
}

.btn-back:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 44px rgba(2, 6, 23, 0.45);
}

.game-title {
    display: none;
}

main {
    background: linear-gradient(180deg, #bfefff, #dff7ff);
}