/* === GAME PAGE === */

.page-game {
    min-height: calc(100vh - 140px);
    padding-bottom: 10px;
}

@media (max-width: 1200px) {
    .page-game {
        padding-bottom: 10px;
    }
}

.page-game .page-title {
    margin-top: 24px;
    margin-bottom: 12px;
    color: var(--text);
}

.game-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 8.33vw;
    border-radius: 0;
}

/* Game stage wrapper - full width gradient background */
.game-stage-wrapper {
    width: 100%;
    border-radius: 12px;
    padding: 20px;
    margin: 10px 0;
    box-sizing: border-box;
    background: #F9F9F9;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theme-dark .game-stage-wrapper {
    background: #031C4C;
}

/* Game stage - contains iframe with size constraints */
.game-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 320px;
    box-sizing: border-box;
}

.game-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Game layout */
.game-layout {
    display: flex;
    gap: 24px;
    margin-top: 40px;
}

.game-left {
    flex: 1;
    min-width: 0;
}

/* Game sidebar */
.game-right {
    width: 280px;
    flex-shrink: 0;
    overflow: auto;
}

.game-right h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--text);
}

.game-right ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (max-width: 768px) {
    .game-right ul {
        padding-top: 15px;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .game-right ul {
        margin-top: 20px;
    }
}

.game-right li {
    margin: 6px 0;
}

.game-right a {
    display: block;
    padding: 4px 6px;
    text-decoration: none;
    border-radius: 6px;
}

.game-right a:hover {
    background: var(--bg-2);
}

.game-right-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 16px;
}

.game-right-header span {
    font-family: 'Open Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--text);
    text-transform: uppercase;
}

.game-right-all {
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
}

.game-right-all:hover {
    text-decoration: underline;
}

/* Game cards in sidebar */
.game-right-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.game-right-cards li a {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-right-cards li a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-1);
}

.gr-thumb {
    width: 100%;
    height: 170px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-2);
}

.gr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gr-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--bg-2), var(--bg));
}

.gr-meta {
    margin-top: 8px;
}

.gr-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 140%;
    color: var(--text);
}

/* Game title under iframe */
.game-title-under {
    margin: 16px 0 12px;
    font-family: 'Open Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

@media (max-width: 768px) {
    .game-title-under {
        font-size: 20px;
    }
}

/* Game description */
.game-description {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 24px;
    color: var(--text);
    margin: 0 0 16px;
}

/* Balance block (from watch.css) */
.balance-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-block);
    border-radius: 8px;
    padding: 10px 30px;
    margin: 16px 0;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.balance-value {
    font-family: 'Open Sans', sans-serif;
    font-size: 34px;
    font-weight: 700;
    color: var(--text);
    position: relative;
}

.balance-value.disabled {
    color: var(--muted);
}

.pts_value {
    font-size: 34px;
    font-style: normal;
    font-weight: 700;
    line-height: 24px;
}

.pts_after_text {
    font-size: 18px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px;
}

.balance-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--muted);
}

.balance-redeem-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-transform: capitalize;
}

.balance-redeem-btn:hover {
    background: var(--primary-2);
}

/* Balance info popup */
.balance-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    background: var(--muted);
    color: var(--surface);
    border-radius: 50%;
    font-size: 12px;
    font-style: italic;
    font-family: Georgia, serif;
    cursor: pointer;
    vertical-align: middle;
}

.balance-info-icon:hover {
    background: var(--icon-muted);
}

.balance-info-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 70%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    width: 240px;
    padding: 16px;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    text-align: left;
}

.balance-info-popup.active {
    display: block;
}

.balance-info-popup p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.4;
}

/* Banner */
.bannerBg {
    margin-bottom: 20px;
}

.banner-main-728-90 {
    width: 100%;
    margin: 21px auto;
    text-align: center;
}

.banner-main-728-90 div {
    margin: 0 auto;
}

/* Connatix overrides */
#cnx-outer-container {
    padding-bottom: 5px !important;
}

#cnx-ad-banner {
    display: none;
}

#cnx-overlay[data-waiting-ad="true"] {
    opacity: 0 !important;
    pointer-events: none !important;
    height: 1px;
}

#cnx-skip {
    display: none !important;
}

/* === OTHER GAMES CAROUSEL === */
.other-games-section {
    margin-top: 0;
}

.other-games-carousel-wrapper {
    position: relative;
}

/* Other Games navigation buttons (hidden by default, shown on tablet) */
.other-games-prev,
.other-games-next {
    display: none;
    position: absolute;
    top: 5px;
    width: 100px;
    height: 200px;
    background: var(--carousel-button-bg);
    backdrop-filter: blur(5px);
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    overflow: hidden;
}

.other-games-prev {
    left: 0;
    transform-origin: left center;
}

.other-games-next {
    right: 0;
    transform-origin: right center;
}

.other-games-prev:hover,
.other-games-next:hover {
    transform: scale(1.1);
}

.other-games-prev:hover img,
.other-games-next:hover img {
    transform: scale(1.3);
}

.other-games-prev img,
.other-games-next img {
    transition: transform 0.2s;
}

/* Light theme arrows */
.other-games-prev img {
    content: url('/assets/img/left-arrow.png');
}

.other-games-next img {
    content: url('/assets/img/right-arrow.png');
}

/* Dark theme arrows */
.theme-dark .other-games-prev img {
    content: url('/assets/img/left-arrow-dark.png');
}

.theme-dark .other-games-next img {
    content: url('/assets/img/right-arrow-dark.png');
}

.other-games-prev:disabled,
.other-games-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* === RESPONSIVE === */
@media (max-width: 1400px) {
    .game-container {
        padding: 0 5.71vw;
    }
}

@media (max-width: 1200px) {
    .game-container {
        padding: 0 3.33vw;
    }

    .game-layout {
        flex-direction: column;
    }

    .game-right {
        width: 100%;
        max-width: none;
        flex-shrink: 1;
        border-left: 0;
        padding-left: 0;
        padding-top: 20px;
        overflow-x: hidden;
    }

    /* === OTHER GAMES HORIZONTAL CAROUSEL FOR TABLET (769-1200px) === */
    .other-games-section {
        margin-left: -3.33vw;
        margin-right: -3.33vw;
        padding: 0 0 30px 0;
    }

    .game-right-header {
        padding-left: 3.33vw;
    }

    .game-right-header span {
        font-size: 18px;
    }

    .game-right-header span::after {
        content: '';
        display: block;
        width: 30px;
        height: 4px;
        background: var(--primary);
        margin-top: 12px;
    }

    .other-games-carousel-wrapper {
        position: relative;
        overflow: visible;
    }

    .game-right-cards {
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 20px 0;
        margin: -20px 0;
        list-style: none;
    }

    .game-right-cards::-webkit-scrollbar {
        display: none;
    }

    .other-game-card {
        flex: 0 0 auto;
        width: 270px;
        transition: transform 0.3s ease;
    }

    .other-game-card:hover {
        transform: scale(1.05);
        z-index: 10;
    }

    .gr-thumb {
        width: 270px;
        height: 160px;
        border-radius: 12px;
        transition: all 0.3s;
    }

    .other-game-card:hover .gr-thumb {
        border: 2px solid var(--video-card-hover-border);
        border-radius: 0;
    }

    .gr-title {
        font-size: 14px;
        font-weight: 600;
        color: var(--text);
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: color 0.2s ease;
        max-height: 2.8em;
        white-space: normal;
        margin-bottom: 4px;
    }

    .other-game-card:hover .gr-title {
        color: var(--primary);
    }

    /* Show navigation buttons - same style as Featured Video */
    .other-games-prev,
    .other-games-next {
        display: flex;
        position: absolute;
        top: 5px;
        width: 100px;
        height: 200px;
        background: var(--carousel-button-bg);
        backdrop-filter: blur(5px);
        border: none;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 20;
        transition: all 0.2s;
        overflow: hidden;
    }

    .other-games-prev {
        left: 0;
        transform-origin: left center;
    }

    .other-games-next {
        right: 0;
        transform-origin: right center;
    }
}

@media (max-width: 900px) {
    .other-games-prev,
    .other-games-next {
        width: 60px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .game-container {
        padding: 0 16px;
    }

    .game-layout {
        margin-top: 20px;
        gap: 5px;
    }

    .game-right {
        padding-top: 10px;
        margin-top: 16px;
        margin-left: -5px;
    }

    /* === OTHER GAMES CAROUSEL ON MOBILE === */
    .other-games-section {
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        padding: 0;
    }

    .game-right-header {
        padding: 0;
        margin-bottom: 20px;
    }

    .game-right-header span::after {
        width: 60px;
        background: var(--accent);
    }

    .game-right-cards {
        scroll-snap-type: x mandatory;
        scroll-padding-left: 10px;
        scroll-behavior: auto;
        padding: 0 0 10px 10px;
        margin: 0;
    }

    .game-right-cards::-webkit-scrollbar {
        display: none;
    }

    .other-game-card {
        flex: 0 0 auto;
        width: 270px;
        scroll-snap-align: start;
    }

    .gr-thumb {
        width: 270px;
        height: 160px;
        border-radius: 12px;
        margin-bottom: 10px;
    }

    .gr-title {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.3;
        white-space: normal;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        margin-bottom: 4px;
    }

    /* Hide navigation buttons on mobile - swipe only */
    .other-games-prev,
    .other-games-next {
        display: none !important;
    }

    /* Hide banner on mobile */
    .game-right .bannerBg {
        display: none;
    }

    .balance-block {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .balance-redeem-btn {
        width: 100%;
    }

    .game-stage-wrapper {
        border-radius: 10px;
        padding: 15px;
    }

    .balance-value {
        font-size: 28px;
    }

    .pts_value {
        font-size: 34px;
    }

    .pts_after_text {
        font-size: 18px;
    }
}

@media (max-width: 520px) {
    /* Cards stay 270x160 like on watch.css */
}

/* Aspect ratio fallback */
@supports not (aspect-ratio: 16 / 9) {
    .game-stage {
        height: auto;
    }

    .game-stage::before {
        content: "";
        display: block;
        padding-top: 56.25%; /* 9/16 */
    }

    .game-stage > iframe {
        position: absolute;
        inset: 0;
    }
}

@media (max-width: 520px) {
    .game-stage-wrapper {
        padding: 10px;
        border-radius: 8px;
    }
}

/* === Featured Video Section === */
.pp-featured-video-section {
    padding: 30px 0;
}

.pp-featured-video-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.pp-featured-video-container .pp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8.33vw;
    margin-bottom: 20px;
}

.pp-featured-video-container .pp-section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pp-featured-video-container .pp-section-header h2::after {
    content: '';
    display: block;
    width: 30px;
    height: 4px;
    background: var(--primary);
    margin-top: 12px;
}

.pp-view-more {
    font-size: 20px;
    font-weight: 400;
    color: var(--accent);
    text-decoration: none;
}

.pp-view-more:hover {
    opacity: 0.8;
}

.pp-featured-video-carousel-wrapper {
    position: relative;
    overflow: visible;
}

.pp-featured-video-carousel {
    overflow: hidden;
    padding: 20px 0;
    margin: -20px 0;
}

.pp-featured-video-track {
    display: flex;
    gap: 10px;
    transition: transform 0.4s ease;
}

.pp-featured-video-item {
    flex: 0 0 auto;
    min-width: 0;
    width: 270px;
    transition: transform 0.3s ease;
}

.pp-featured-video-item:hover {
    transform: scale(1.05);
    z-index: 10;
}

.pp-featured-video-item .videoItem {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.pp-featured-video-item .videoItem .image {
    width: 270px;
    height: 160px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.pp-featured-video-item:hover .videoItem .image {
    border: 2px solid var(--video-card-hover-border);
    border-radius: 0;
}

.pp-featured-video-item .videoItem .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(29, 29, 29, 0.00) 0%, rgba(1, 15, 41, 0.72) 80.79%);
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.pp-featured-video-item .videoItem .image:hover .overlay {
    opacity: 1;
}

/* Play button with SVG icon */
.pp-featured-video-item .videoItem .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pp-featured-video-item .videoItem .play-button::after {
    content: '';
    width: 40px;
    height: 40px;
    background-image: url('/assets/img/icons/play-arrow-video.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.pp-featured-video-item .videoItem .image:hover .play-button {
    opacity: 1;
}

.pp-featured-video-item .videoItem .duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}

.pp-featured-video-item .videoItem .details {
    padding: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pp-featured-video-item .videoItem .videoname_linkdiv {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
    max-height: 2.8em;
}

.pp-featured-video-item .videoItem .videoname_linkdiv:hover {
    color: var(--primary);
}

.pp-featured-video-item .videoItem .video-meta {
    font-size: 14px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center;
}

.pp-featured-video-item .videoItem .video-meta .meta-separator {
    color: var(--muted);
}

/* Navigation buttons */
.pp-featured-video-prev,
.pp-featured-video-next {
    position: absolute;
    top: 15px;
    width: 100px;
    height: 270px;
    background: var(--carousel-button-bg);
    backdrop-filter: blur(5px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
}

.pp-featured-video-prev:hover,
.pp-featured-video-next:hover {
    transform: scale(1.1);
}

.pp-featured-video-prev {
    left: 0;
}

.pp-featured-video-next {
    right: 0;
}

/* Light theme arrows */
.pp-featured-video-prev img {
    content: url('/assets/img/left-arrow.png');
}

.pp-featured-video-next img {
    content: url('/assets/img/right-arrow.png');
}

/* Dark theme arrows */
.theme-dark .pp-featured-video-prev img {
    content: url('/assets/img/left-arrow-dark.png');
}

.theme-dark .pp-featured-video-next img {
    content: url('/assets/img/right-arrow-dark.png');
}

.pp-featured-video-prev:disabled,
.pp-featured-video-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Featured Video Responsive */
@media (max-width: 1400px) {
    .pp-featured-video-container .pp-section-header {
        padding: 0 5.71vw;
    }
}

@media (max-width: 1200px) {
    .pp-featured-video-container .pp-section-header {
        padding: 0 3.33vw;
    }

    .pp-featured-video-container .pp-section-header h2 {
        font-size: 18px;
    }

    .pp-view-more {
        font-size: 18px;
    }
}

@media (max-width: 900px) {
    .pp-featured-video-container .pp-section-header {
        padding: 0 20px;
    }

    .pp-featured-video-prev,
    .pp-featured-video-next {
        width: 60px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .pp-featured-video-container .pp-section-header {
        padding: 0 16px;
    }

    /* Hide carousel buttons on mobile - use swipe instead */
    .pp-featured-video-prev,
    .pp-featured-video-next {
        display: none !important;
    }

    /* Featured Video carousel padding for mobile */
    .pp-featured-video-carousel-wrapper {
        padding-left: 10px;
    }

    .pp-featured-video-carousel {
        padding: 20px 0;
        margin: -20px 0;
    }
}

@media (max-width: 600px) {
    .pp-featured-video-section {
        padding: 20px 0;
    }

    .pp-featured-video-container .pp-section-header {
        padding-left: 10px;
    }

    .pp-featured-video-container .pp-section-header h2 {
        font-size: 18px;
    }

    .pp-view-more {
        font-size: 18px;
    }

    .pp-featured-video-carousel-wrapper {
        padding-left: 10px;
    }

    /* Hide carousel buttons on mobile */
    .pp-featured-video-prev,
    .pp-featured-video-next {
        display: none !important;
    }
}

/* === DISABLE HOVER ON TOUCH DEVICES === */
@media (hover: none), (pointer: coarse) {
    /* Featured Video carousel navigation */
    .pp-featured-video-prev:hover,
    .pp-featured-video-next:hover {
        transform: none;
    }

    .pp-featured-video-prev:hover img,
    .pp-featured-video-next:hover img {
        transform: none;
    }

    /* Featured Video card hover effects */
    .pp-featured-video-item:hover {
        transform: none;
        z-index: auto;
    }

    .pp-featured-video-item:hover .videoItem .image {
        border: none;
        border-radius: 12px;
    }

    .pp-featured-video-item .videoItem .image:hover .overlay {
        opacity: 0;
    }

    .pp-featured-video-item .videoItem .image:hover .play-button {
        opacity: 0;
    }

    .pp-featured-video-item .videoItem .videoname_linkdiv:hover {
        color: var(--text);
    }

    /* Other Games carousel hover effects */
    .other-games-prev:hover,
    .other-games-next:hover {
        transform: none;
    }

    .other-games-prev:hover img,
    .other-games-next:hover img {
        transform: none;
    }

    .other-game-card:hover {
        transform: none;
    }

    .other-game-card:hover .gr-thumb {
        border: none;
    }

    .other-game-card:hover .gr-title {
        color: var(--text);
    }
}