/* ==========================================
   ONLINE GAMES SECTION - CoinLottery
   Netflix-style Category Rows Layout
   ========================================== */

.online-games-section {
    padding: 60px 0;
    background: linear-gradient(180deg, rgba(10, 14, 26, 0.95) 0%, rgba(13, 18, 32, 0.98) 100%);
    position: relative;
    overflow: hidden;
}

.online-games-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(6, 190, 222, 0.3), transparent);
}

.online-games-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.online-games-header {
    text-align: center;
    margin-bottom: 30px;
}

.online-games-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #06BEDE 0%, #4AABDF 50%, #06BEDE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.online-games-title i {
    -webkit-text-fill-color: #06BEDE;
}

.online-games-testing-badge {
    display: inline-block;
    background: linear-gradient(135deg, #06BEDE 0%, #4AABDF 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.online-games-count {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

/* Search */
.online-games-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.online-games-search-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.online-games-search {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border-radius: 50px;
    border: 1px solid rgba(6, 190, 222, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.online-games-search:focus {
    outline: none;
    border-color: #06BEDE;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(6, 190, 222, 0.15);
}

.online-games-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.online-games-search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(6, 190, 222, 0.6);
    font-size: 1.2rem;
}

/* Mode Toggle */
.online-games-mode-toggle {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: 25px;
    border-radius: 30px;
    border: 1px solid rgba(6, 190, 222, 0.3);
    padding: 5px;
    background: rgba(255, 255, 255, 0.03);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.online-games-mode-btn {
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.online-games-mode-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.online-games-mode-btn.active {
    background: linear-gradient(135deg, #06BEDE 0%, #4AABDF 50%, #06BEDE 100%);
    color: #0a0a1e;
    box-shadow: 0 4px 15px rgba(6, 190, 222, 0.4);
}

.online-games-mode-btn.active i {
    animation: pulse 2s infinite;
}

.online-games-mode-btn i {
    font-size: 1.3rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Hide old filter chips and results info */
.online-games-filters,
.online-games-clear-filters,
.online-games-results-info {
    display: none !important;
}

/* ==========================================
   CATEGORY ROWS LAYOUT
   ========================================== */

.online-games-rows-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Category Row */
.games-category-row {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.games-category-row.visible {
    opacity: 1;
    transform: translateY(0);
}

.games-category-row.hidden-by-search {
    display: none;
}

/* Row Header */
.row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 0 4px;
}

.row-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.row-category-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(6, 190, 222, 0.12);
    border: 1px solid rgba(6, 190, 222, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #06BEDE;
    flex-shrink: 0;
}

.row-category-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.row-category-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    margin-left: 4px;
}

.row-see-all {
    font-size: 0.85rem;
    color: rgba(6, 190, 222, 0.8);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 16px;
}

.row-see-all:hover {
    color: #4AABDF;
    background: rgba(6, 190, 222, 0.08);
}

/* Row Carousel */
.row-carousel {
    position: relative;
    overflow: clip;
}

/* Row Viewport */
.row-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    position: relative;
}

.row-viewport::-webkit-scrollbar {
    display: none;
}

/* Edge Fades */
.row-viewport::before,
.row-viewport::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.row-viewport::before {
    left: 0;
    background: linear-gradient(to right, rgba(10, 14, 26, 0.95), transparent);
}

.row-viewport::after {
    right: 0;
    background: linear-gradient(to left, rgba(10, 14, 26, 0.95), transparent);
}

.row-viewport.fade-left::before {
    opacity: 1;
}

.row-viewport.fade-right::after {
    opacity: 1;
}

/* Row Arrows */
.row-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(6, 190, 222, 0.5);
    background: rgba(10, 10, 30, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #06BEDE;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.row-arrow.visible {
    opacity: 1;
    pointer-events: auto;
}

.row-arrow:hover {
    background: rgba(6, 190, 222, 0.2);
    border-color: #06BEDE;
    box-shadow: 0 4px 20px rgba(6, 190, 222, 0.3);
}

.row-arrow-left {
    left: -18px;
}

.row-arrow-right {
    right: -18px;
}

/* Row Track (single horizontal row of cards) */
.row-track {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: 1fr;
    grid-auto-columns: clamp(156px, 14.5vw, 210px);
    gap: 14px;
    padding: 12px 0;
}

/* ==========================================
   GAME CARDS (preserved from original)
   ========================================== */

.online-game-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    scroll-snap-align: start;
    will-change: opacity, transform;
}

.online-game-card:hover {
    transform: scale(1.04);
    border-color: rgba(6, 190, 222, 0.4);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(6, 190, 222, 0.15);
}

.online-game-card:focus-visible {
    outline: 2px solid #06BEDE;
    outline-offset: 2px;
    transform: scale(1.04);
    border-color: rgba(6, 190, 222, 0.4);
}

.online-game-card-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: linear-gradient(135deg, rgba(30, 30, 50, 0.8) 0%, rgba(20, 20, 40, 0.9) 100%);
    overflow: hidden;
}

.online-game-card-thumbnail.loaded .fallback-icon {
    display: none;
}

.online-game-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.online-game-card:hover .online-game-card-thumbnail img {
    transform: scale(1.05);
}

.online-game-card-thumbnail.loaded img {
    opacity: 1;
}

.online-game-card-thumbnail.error .fallback-icon {
    display: block;
}

.online-game-card-thumbnail .fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: rgba(6, 190, 222, 0.5);
    display: none;
}

.online-game-card-thumbnail.has-error .fallback-icon {
    display: block;
}

/* Skeleton */
.online-game-card.skeleton .online-game-card-thumbnail {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.05) 25%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.online-game-card.skeleton .skeleton-text {
    background: rgba(255,255,255,0.1);
    height: 14px;
    border-radius: 4px;
    animation: skeleton-loading 1.5s infinite;
}

.online-game-card.skeleton .skeleton-text.short {
    width: 60%;
    height: 10px;
    margin-top: 6px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Maintenance */
.online-game-card.maintenance {
    opacity: 0.7;
}

.online-game-card.maintenance .online-game-card-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.maintenance-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Play Overlay */
.online-game-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.online-game-card:hover .online-game-card-overlay {
    opacity: 1;
}

.online-game-card-overlay .play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06BEDE, #4AABDF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1.3rem;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.online-game-card:hover .online-game-card-overlay .play-btn {
    transform: scale(1);
}

/* Card Info */
.online-game-card-info {
    padding: 12px;
}

.online-game-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-game-card-type {
    font-size: 0.75rem;
    color: rgba(6, 190, 222, 0.8);
    text-transform: capitalize;
}

/* Swipe Hint */
.online-games-swipe-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    margin: 0 auto 20px;
    background: rgba(6, 190, 222, 0.08);
    border: 1px solid rgba(6, 190, 222, 0.2);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82rem;
    width: fit-content;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.online-games-swipe-hint.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.online-games-swipe-hint i {
    color: #06BEDE;
    font-size: 1.1rem;
}

@keyframes hint-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

.online-games-swipe-hint .hint-arrow {
    animation: hint-nudge 1.2s ease-in-out 2;
}

/* Empty State */
.online-games-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.online-games-empty i {
    font-size: 4rem;
    color: rgba(6, 190, 222, 0.3);
    margin-bottom: 20px;
}

.online-games-empty p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.online-games-retry-btn {
    padding: 12px 25px;
    border-radius: 25px;
    border: 1px solid rgba(6, 190, 222, 0.5);
    background: rgba(6, 190, 222, 0.1);
    color: #06BEDE;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.online-games-retry-btn:hover {
    background: rgba(6, 190, 222, 0.2);
    border-color: #06BEDE;
}

/* No Games State */
.online-games-no-games {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(135deg, rgba(6, 190, 222, 0.06), rgba(74, 171, 223, 0.04));
    border-radius: 20px;
    border: 1px solid rgba(6, 190, 222, 0.2);
}

.online-games-no-games .no-games-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, rgba(6, 190, 222, 0.2), rgba(6, 190, 222, 0.06));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(6, 190, 222, 0.3);
}

.online-games-no-games .no-games-icon i {
    font-size: 3rem;
    color: #06BEDE;
}

.online-games-no-games h3 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 15px;
    font-weight: 600;
}

.online-games-no-games p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Loading Modal */
.online-games-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.online-games-loading-modal.active {
    display: flex;
}

.online-games-loading-content {
    text-align: center;
    padding: 40px;
}

.online-games-loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(6, 190, 222, 0.2);
    border-top-color: #06BEDE;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.online-games-loading-text {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.online-games-loading-game-name {
    color: #06BEDE;
    font-size: 1rem;
    font-weight: 600;
}

.online-games-loading-cancel {
    margin-top: 20px;
    padding: 10px 25px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.online-games-loading-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 900px) {
    .online-games-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .online-games-section {
        padding: 40px 0;
    }

    .online-games-rows-container {
        gap: 24px;
    }

    .row-track {
        grid-auto-columns: clamp(124px, 33vw, 168px);
        gap: 10px;
    }

    .online-games-title {
        font-size: 1.6rem;
    }

    .online-games-mode-toggle {
        padding: 4px;
        margin-bottom: 20px;
    }

    .online-games-mode-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        gap: 8px;
    }

    .online-games-mode-btn i {
        font-size: 1.1rem;
    }

    .row-arrow {
        display: none;
    }

    .row-header {
        margin-bottom: 10px;
    }

    .row-category-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        font-size: 0.95rem;
    }

    .row-category-name {
        font-size: 1.05rem;
    }

    .row-category-count {
        font-size: 0.78rem;
    }

    .row-see-all {
        font-size: 0.78rem;
    }

    .online-game-card-info {
        padding: 10px;
    }

    .online-game-card-name {
        font-size: 0.8rem;
    }

    .online-game-card-type {
        font-size: 0.7rem;
    }

    .online-game-card-overlay .play-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .online-games-container {
        padding: 0 12px;
    }

    .online-games-search {
        padding: 12px 15px 12px 45px;
        font-size: 0.9rem;
    }

    .row-track {
        grid-auto-columns: clamp(112px, 39vw, 148px);
    }

    .row-header-left {
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .games-category-row {
        transition: none;
    }
    .online-game-card {
        transition: none !important;
    }
    .online-games-swipe-hint .hint-arrow {
        animation: none;
    }
}

/* ==========================================
   GAME IFRAME FULLSCREEN MODAL
   ========================================== */

#gameIframeModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2147483000;
    background: #000;
    display: none;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 200ms ease, transform 200ms ease;
}

#gameIframeModal.active {
    display: flex;
}

#gameIframeModal.visible {
    opacity: 1;
    transform: scale(1);
}

.game-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: max(env(safe-area-inset-top, 0px), 8px) 16px 8px;
    background: linear-gradient(180deg, rgba(18, 18, 38, 0.98) 0%, rgba(12, 12, 28, 0.96) 100%);
    border-bottom: 2px solid rgba(6, 190, 222, 0.5);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 3;
}

.game-modal-title {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

.game-modal-favorite-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 2px solid rgba(6, 190, 222, 0.5);
    background: rgba(6, 190, 222, 0.1);
    color: #06BEDE;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.game-modal-favorite-btn:hover {
    border-color: #06BEDE;
    background: rgba(6, 190, 222, 0.2);
    color: #06BEDE;
}

.game-modal-favorite-btn:active {
    transform: scale(0.85);
}

.game-modal-favorite-btn.favorited {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.game-modal-favorite-btn.favorited:hover {
    border-color: #f87171;
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

@keyframes heartPop {
    0% { transform: scale(1); }
    30% { transform: scale(1.35); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.game-modal-favorite-btn.heart-animate {
    animation: heartPop 0.4s ease;
}

.game-modal-favorite-btn .fav-toast {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.game-modal-favorite-btn .fav-toast.show {
    opacity: 1;
}

.game-modal-favorite-btn.favorited .fav-toast {
    color: #ef4444;
}

.game-modal-favorite-btn:not(.favorited) .fav-toast {
    color: #4ade80;
}

.game-modal-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.game-modal-close-btn:hover {
    border-color: #06BEDE;
    color: #06BEDE;
    background: rgba(6, 190, 222, 0.15);
}

.game-modal-close-btn:active {
    transform: scale(0.92);
    background: rgba(6, 190, 222, 0.25);
}

.game-modal-iframe-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

.game-modal-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.game-modal-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.game-modal-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.game-modal-loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(6, 190, 222, 0.2);
    border-top-color: #06BEDE;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.game-modal-loading-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 6px;
}

.game-modal-loading-name {
    color: #06BEDE;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.game-modal-loading-cancel {
    padding: 10px 24px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-modal-loading-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.game-modal-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.game-modal-fallback.visible {
    display: flex;
}

.game-modal-fallback-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    text-align: center;
}

.game-modal-fallback-btn {
    padding: 12px 28px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #06BEDE 0%, #4AABDF 50%, #06BEDE 100%);
    color: #0a0a1e;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.game-modal-fallback-btn:hover {
    box-shadow: 0 4px 15px rgba(6, 190, 222, 0.4);
    transform: translateY(-1px);
}

.game-modal-confirm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 20px;
    opacity: 0;
    transition: opacity 200ms ease;
}

.game-modal-confirm-overlay.active {
    display: flex;
}

.game-modal-confirm-overlay.visible {
    opacity: 1;
}

.game-modal-confirm-card {
    background: rgba(20, 20, 45, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(6, 190, 222, 0.4);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    transform: translateY(8px);
    transition: transform 200ms ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-modal-confirm-overlay.visible .game-modal-confirm-card {
    transform: translateY(0);
}

.game-modal-confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.game-modal-confirm-text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
    line-height: 1.5;
}

.game-modal-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.game-modal-confirm-stay {
    padding: 14px 24px;
    border-radius: 30px;
    border: none;
    background: linear-gradient(135deg, #06BEDE 0%, #4AABDF 50%, #06BEDE 100%);
    color: #0a0a1e;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-modal-confirm-stay:hover {
    box-shadow: 0 4px 20px rgba(6, 190, 222, 0.5);
    transform: translateY(-1px);
}

.game-modal-confirm-exit {
    padding: 12px 24px;
    border-radius: 30px;
    border: 1.5px solid rgba(6, 190, 222, 0.5);
    background: transparent;
    color: #06BEDE;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-modal-confirm-exit:hover {
    background: rgba(6, 190, 222, 0.1);
    border-color: #06BEDE;
}

@media (max-width: 768px) {
    .game-modal-header {
        min-height: calc(48px + env(safe-area-inset-top, 0px));
        padding: max(env(safe-area-inset-top, 0px), 6px) max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
        gap: 10px;
    }

    .game-modal-title {
        font-size: 1rem;
    }

    .game-modal-favorite-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }

    .game-modal-close-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        font-size: 1.3rem;
    }

    .game-modal-iframe-container {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .game-modal-confirm-card {
        padding: 24px 20px;
        margin: 0 12px;
    }

    .game-modal-confirm-title {
        font-size: 1.1rem;
    }

    .game-modal-confirm-text {
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #gameIframeModal {
        transition: none;
    }

    .game-modal-confirm-overlay {
        transition: none;
    }

    .game-modal-confirm-card {
        transition: none;
    }
}

body.game-modal-open .contact-float-container,
body.game-modal-open .floating-tickets-btn,
body.game-modal-open .keno-float-button,
body.game-modal-open .floating-island-nav {
    display: none !important;
}
