.game-play {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: var(--shadow-mid);
    overflow: hidden;
    background: var(--bg-card);
}

.game-play.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 9999;
    border-radius: 0;
}

/* Ẩn các elements khi game-play có class is-fullscreen */
html:has(.game-play.is-fullscreen) .site-header,
html:has(.game-play.is-fullscreen) .site-footer,
html:has(.game-play.is-fullscreen) .menu-list,
html:has(.game-play.is-fullscreen) .game-about,
html:has(.game-play.is-fullscreen) .similar-games-list {
    display: none;
}

/* Disable scroll và ẩn overflow khi fullscreen */
html:has(.game-play.is-fullscreen),
html:has(.game-play.is-fullscreen) body {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

.game-play-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

@media (width < 48rem) {
    .game-play-content {
        min-height: 0;
        flex: 1;
    }
}

.game-play-preview {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

.game-play-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

.game-play-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    /* backdrop-filter: blur(6px); */
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* justify-content: flex-end; */
    justify-content: center;
    padding-bottom: 3rem;
    gap: 0.5rem;
}

.game-preview-image {
    object-fit: cover;
    border-radius: var(--card-game-border-radius);
    box-shadow: var(--shadow-angle);
    aspect-ratio: 16 / 10;
}

.game-preview-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1rem 0;
    padding: 0 1rem;
    text-align: center;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-family);

}

.button-play-game {
    font-family: 'Nutino', sans-serif;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    cursor: pointer;
    align-items: center;
    display: inline-flex;
    justify-content: center;
    gap: 0.6rem;
    position: relative;
    border-radius: 999px;
    /* background: linear-gradient(to bottom, #fd763b 0%, #ff0f47 100%); */
    background: #6d5ff8;
    animation: breath 2s ease-in-out infinite;
    transform-origin: center center;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 1rem 3rem;
    font-size: 1.25rem;
    overflow: hidden;
    border: none;
}

.button-play-game::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}

.button-play-game:hover {
    transform: scale(1.08) translateY(-2px);
    animation: none;
    /* box-shadow: 0 8px 25px #ff0f47, inset 0 2px 0 rgba(255, 255, 255, 0.3); */
    /* border-color: rgba(255, 255, 255, 0.3); */
    filter: brightness(1.1);
}

.button-play-game:hover::before {
    left: 150%;
}

.button-play-game:active {
    transform: scale(0.97) translateY(2px);
    box-shadow: 0 2px 8px rgba(109, 95, 248, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.1);
}

.play-icon {
    flex-shrink: 0;
}

/* Hiệu ứng breath: phình to/thu nhỏ nhẹ nhàng */
@keyframes breath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }
}

/* --- Background image & video --- */
.game-bg-img,
.game-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-bg-img {
    z-index: 0;
}

.game-bg-video {
    z-index: 1;
    /* video covers the static image */
}

.game-play-overlay {
    z-index: 2;
    /* overlay covers both */
}

/* --- Scroll hint chevron --- */
.game-preview-scroll-hint {
    display: none;
    color: rgba(255, 255, 255, 0.5);
    animation: bounceDown 1.8s ease-in-out infinite;
    padding-bottom: 0.5rem;
}

@keyframes bounceDown {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}

/* ============================================================
   MOBILE-SPECIFIC OVERLAY REDESIGN
   ============================================================ */
@media (width < 48rem) {
    .game-play {
        border-radius: 0;
        box-shadow: none;
    }

    .game-play-overlay {
        padding: 14% 1.25rem 1.5rem;
        gap: 0.65rem;
        justify-content: flex-end;
        backdrop-filter: none;
        /* Tối dần xuống đúng màu nền trang để liền mạch với similar-games-list */
        background: linear-gradient(to top,
                var(--bg-body) 0%,
                rgba(14, 16, 32, 0.92) 14%,
                rgba(14, 16, 32, 0.55) 55%,
                rgba(14, 16, 32, 0.12) 100%);
    }

    .game-preview-image {
        width: 54%;
        max-width: 210px;
        height: auto;
        aspect-ratio: 16 / 10;
        border-radius: 14px;
        box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65), 0 3px 10px rgba(0, 0, 0, 0.4);
        align-self: center;
        margin-bottom: 0.4rem;
    }

    .game-preview-title {
        font-size: 1.5rem !important;
        margin: 0;
        text-align: center;
    }

    .button-play-game {
        width: 100%;
        max-width: 340px;
        padding: 1.05rem;
        font-size: 1.25rem;
        justify-content: center;
        align-self: center;
    }

    .game-preview-scroll-hint {
        display: flex;
        padding-top: 0.5rem;
    }
}

/* .game-play.is-mobile:not(.is-fullscreen) {
    border-radius: var(--card-game-border-radius);
} */


.game-iframe {
    display: none;
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.game-play-footer {
    height: 64px;
    width: 100%;
    /* background: var(--bg-card); */
    background: radial-gradient(circle at top left, rgba(255, 79, 94, 0.18), transparent 24%), radial-gradient(circle at top right, rgba(74, 162, 232, 0.18), transparent 26%), radial-gradient(circle at 50% 0%, rgba(113, 203, 70, 0.12), transparent 28%), linear-gradient(180deg, #101827 0%, #0d1420 100%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.5rem;
    box-sizing: border-box;

    @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
        height: 45px;
    }
}

.game-play-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

/* Ảnh game cạnh title trong footer */
.game-footer-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-angle);

    @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
        width: 36px;
        height: 36px;
    }
}

.game-play-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    font-family: 'Nutino', sans-serif;
}

/* Rating dưới title */
.game-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-warning);
    line-height: 1;
}

.game-rating svg {
    color: var(--text-warning);
}

/* Strip game gợi ý — chỉ hiện khi fullscreen */
.game-play-suggested {
    display: none;
}

.game-play-suggested-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;

    @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
        gap: 0.3rem;
    }
}

.game-play-suggested-list::-webkit-scrollbar {
    display: none;
}

.game-play-suggested-list li {
    flex: 0 0 auto;
}

.game-play-suggested-item {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-angle);
    transition: transform 0.15s ease;

    @media (orientation: landscape) and (hover: none) and (pointer: coarse) {
        width: 36px;
        height: 36px;
    }
}

.game-play-suggested-item:hover {
    transform: scale(1.04);
}

.game-play-suggested-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-company {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: -0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-play-actions {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
}

.btn-fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-fullscreen:hover {
    transform: scale(1.1);
}

.similar-games-list li {
    border-radius: var(--card-game-border-radius);
    aspect-ratio: 1;
    position: relative;
}

.is-mobile .btn-fullscreen {
    display: none;
}

.game-play.is-mobile:not(.is-fullscreen) .game-play-footer {
    display: none;
}

.icon-expand {
    display: block;
}

.icon-compress {
    display: none;
}

.is-fullscreen .icon-expand {
    display: none;
}

.is-fullscreen .icon-compress {
    display: block;
}

/* Fullscreen: ẩn title + rating, nhường chỗ cho strip game gợi ý.
   Ảnh game vẫn giữ lại. */
.is-fullscreen .game-play-meta {
    display: none;
}

.is-fullscreen .game-play-info {
    flex: 0 0 auto;
}

.is-fullscreen .game-play-suggested {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

.rotate-screen-warning {
    position: absolute;
    display: none;
    padding: 1rem;
    padding-right: 0;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    border-radius: 1rem;
    border-width: 2px;
    border-color: #ffffff;
    width: 100%;
    top: 10%;
    max-width: 250px;
    background: rgba(149, 149, 149, 0.2);
    overflow: hidden;
}

.rotate-screen-warning span {
    flex: 1 1 0%;
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: #fff;
}

.rotate-screen-warning button {
    position: absolute;
    background: transparent;
    color: #fff;
    border: none;
    height: 100%;
    right: 0;
    padding: 0 0.5rem;
    background: rgba(149, 149, 149, 0.2);
}

.animate-rotate-90 {
    animation: rotate-90 2s infinite;
}

@keyframes rotate-90 {
    0% {
        transform: rotate(0deg);
    }

    70% {
        transform: rotate(135deg);
    }

    100% {
        transform: rotate(135deg);
    }
}