/* ============================================
   ADS STYLES - OldGames Monetization
   ============================================ */

/* ============================================
   AD CONTAINER BASE STYLES
   ============================================ */
.ad-container {
    display: none; /* Hidden by default - shown only when ad renders */
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 10px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(10, 10, 20, 0.98));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

/* Show ad container only when it has a rendered ad */
.ad-container:has(iframe),
.ad-container:has([data-adsbygoogle-status="done"]),
.ad-container.ad-loaded {
    display: flex !important;
}

.ad-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.ad-wrapper.og-ad-empty,
.ad-container.og-ad-empty,
.og-content-banner.og-ad-empty,
[data-ad-status="empty"] {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

/* Ad Label */
.ad-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    font-weight: 600;
    z-index: 5;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   HEADER BANNER AD
   ============================================ */
.ad-banner-top {
    width: 100%;
    max-width: 970px;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(180deg, 
        rgba(255, 0, 64, 0.1) 0%, 
        rgba(0, 0, 0, 0.9) 100%
    );
    border: 1px solid rgba(255, 0, 64, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default, shown by ads-manager when ad loads */
}

/* Show only when ad has actually rendered (has iframe from AdSense) */
.ad-banner-top.ad-loaded,
.ad-banner-top:has(iframe),
.ad-banner-top:has([data-adsbygoogle-status="done"]) {
    display: flex !important;
    min-height: 90px;
    margin-bottom: 20px;
}

.ad-banner-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--red, #ff0040), 
        transparent
    );
}

/* ============================================
   FOOTER BANNER AD
   ============================================ */
.ad-banner-bottom {
    width: 100%;
    max-width: 970px;
    min-height: 90px;
    margin: 20px auto 0;
    padding: 0;
    background: linear-gradient(0deg, 
        rgba(255, 0, 64, 0.1) 0%, 
        rgba(0, 0, 0, 0.9) 100%
    );
    border: 1px solid rgba(255, 0, 64, 0.2);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    /* Removed fixed positioning - was causing scroll issues */
    position: relative;
    z-index: 10;
    display: none; /* Hide footer ad for now to prevent issues */
}

.ad-banner-bottom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--red, #ff0040), 
        transparent
    );
}

/* Close button for sticky ads */
.ad-close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.ad-close-btn:hover {
    background: var(--red, #ff0040);
    transform: scale(1.1);
}

/* ============================================
   SIDEBAR AD
   ============================================ */
.ad-sidebar {
    width: 300px;
    min-height: 250px;
    margin: 20px 0;
    background: linear-gradient(135deg, 
        rgba(30, 30, 40, 0.95), 
        rgba(10, 10, 20, 0.98)
    );
    border: 1px solid rgba(255, 0, 64, 0.15);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ad-sidebar .ad-label {
    background: linear-gradient(90deg, var(--red, #ff0040), transparent);
    padding: 4px 12px;
    border-radius: 0 0 8px 0;
    top: 0;
    left: 0;
}

/* ============================================
   EMULATOR IN-GAME AD DOCK
   Non-blocking monetization while the game runs.
   ============================================ */
.emulator-ad-dock {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 8600;
    width: min(336px, calc(100vw - 28px));
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background:
        linear-gradient(160deg, rgba(14, 16, 24, 0.96), rgba(4, 5, 10, 0.98)),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.025), rgba(255,255,255,0.025) 1px, transparent 1px, transparent 5px);
    border: 1px solid rgba(255, 214, 80, 0.26);
    border-radius: 14px;
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.48),
        0 0 0 1px rgba(255, 45, 85, 0.1),
        0 0 28px rgba(255, 214, 80, 0.08);
    pointer-events: auto;
}

.emulator-ad-dock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 30px;
}

.emulator-ad-dock-head span {
    min-width: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.emulator-ad-upgrade-btn {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(255, 214, 80, 0.45);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe47a, #a7f3d0);
    color: #11131c;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.emulator-ad-dock .ad-wrapper {
    min-height: 90px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.emulator-ad-dock .adsbygoogle {
    min-height: 50px;
}

body.controls-visible .emulator-ad-dock {
    bottom: calc(var(--mobile-controls-reserved, 0px) + max(10px, env(safe-area-inset-bottom)));
}

body.app-fullscreen-emu .emulator-ad-dock,
body.embedded-mode .emulator-ad-dock,
html.embedded-mode .emulator-ad-dock {
    display: none !important;
}

@media (max-width: 900px), (pointer: coarse) {
    .emulator-ad-dock {
        left: max(8px, env(safe-area-inset-left));
        right: max(8px, env(safe-area-inset-right));
        bottom: calc(var(--mobile-controls-reserved, 0px) + max(8px, env(safe-area-inset-bottom)));
        width: auto;
        max-height: 64px;
        padding: 6px;
        gap: 0;
        border-radius: 12px;
    }

    .emulator-ad-dock-head {
        position: absolute;
        top: -32px;
        right: 0;
        min-height: 28px;
        justify-content: flex-end;
        pointer-events: none;
    }

    .emulator-ad-dock-head span {
        display: none;
    }

    .emulator-ad-upgrade-btn {
        min-height: 28px;
        padding: 0 10px;
        font-size: 10px;
        pointer-events: auto;
    }

    .emulator-ad-dock .ad-wrapper {
        min-height: 50px;
        max-height: 50px;
        overflow: hidden;
    }

    .emulator-ad-dock .adsbygoogle {
        min-height: 50px;
        max-height: 50px;
    }

    .emulator-ad-dock .ad-label {
        display: none;
    }
}

/* ============================================
   IN-FEED AD (Between Game Cards)
   ============================================ */
.ad-in-feed,
.game-card-ad {
    width: 100%;
    max-width: 320px;
    min-height: 250px;
    margin: 15px;
    background: linear-gradient(135deg, 
        rgba(25, 25, 35, 0.95), 
        rgba(15, 15, 25, 0.98)
    );
    border: 2px solid rgba(255, 0, 64, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ad-in-feed:hover,
.game-card-ad:hover {
    border-color: rgba(255, 0, 64, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(255, 0, 64, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.ad-in-feed::before,
.game-card-ad::before {
    content: '📢';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
    opacity: 0.5;
}

/* ============================================
   PRE-GAME INTERSTITIAL AD
   ============================================ */
.pre-game-ad-overlay {
    position: fixed;
    inset: 0;
    padding: max(18px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 214, 80, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(4, 5, 12, 0.92), rgba(0, 0, 0, 0.98));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147482500;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pre-game-ad-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.pre-game-ad-container {
    width: 90%;
    max-width: 520px;
    background:
        linear-gradient(160deg, rgba(18, 20, 30, 0.98), rgba(5, 6, 12, 0.99)),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.025), rgba(255,255,255,0.025) 1px, transparent 1px, transparent 4px);
    border: 1px solid rgba(255, 225, 122, 0.28);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 
        0 24px 70px rgba(0, 0, 0, 0.62),
        0 0 0 1px rgba(255, 45, 85, 0.14),
        0 0 80px rgba(255, 45, 85, 0.12);
}

.pre-game-ad-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px 14px;
    background:
        linear-gradient(90deg, rgba(255, 45, 85, 0.16), rgba(255, 214, 80, 0.08) 46%, transparent),
        rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pre-game-ad-title-block {
    min-width: 0;
}

.pre-game-ad-title-block h2 {
    margin: 8px 0 4px;
    font-size: clamp(1.08rem, 3.8vw, 1.55rem);
    line-height: 1.05;
    color: #fff;
    font-family: 'Russo One', 'Inter', sans-serif;
    font-weight: 800;
    letter-spacing: 0;
}

.pre-game-ad-title-block p {
    margin: 0;
    max-width: 390px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.84rem;
    line-height: 1.35;
}

.pre-game-ad-header .ad-label {
    position: static;
    display: inline-flex;
    background: rgba(255, 214, 80, 0.12);
    border: 1px solid rgba(255, 214, 80, 0.28);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    color: #ffe47a;
}

.skip-timer {
    flex: 0 0 auto;
    min-width: 104px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pre-game-ad-content {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 55%),
        rgba(0, 0, 0, 0.26);
    position: relative;
}

.pre-game-ad-placeholder {
    position: absolute;
    inset: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.46);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.68rem;
    pointer-events: none;
}

.pre-game-ad-placeholder strong {
    color: rgba(255, 225, 122, 0.86);
    font-size: 1rem;
}

.pre-game-ad-content .ad-wrapper {
    z-index: 2;
    min-height: 250px;
    max-width: 336px;
    background: rgba(0, 0, 0, 0.22);
}

.pre-game-ad-content .ad-wrapper[data-ad-status] {
    display: flex !important;
}

.pre-game-ad-content .adsbygoogle {
    position: relative;
    z-index: 2;
}

.pre-game-premium-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, rgba(255, 214, 80, 0.1), rgba(255, 45, 85, 0.08));
    border-top: 1px solid rgba(255, 214, 80, 0.13);
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
}

.pre-game-premium-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 214, 80, 0.42);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe47a, #a7f3d0);
    color: #11131c;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(255, 214, 80, 0.18);
}

.pre-game-ad-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pre-game-ad-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.pre-game-ad-footer strong {
    color: #ffe47a;
}

.skip-btn {
    min-height: 44px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
}

.skip-btn:disabled {
    opacity: 0.5;
}

.skip-btn.ready,
.skip-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--red, #ff0040), #ff7a18);
    border-color: transparent;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 0, 64, 0.4);
}

.skip-btn.ready:hover,
.skip-btn:not(:disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 0, 64, 0.6);
}

/* ============================================
   AD BLOCKER MESSAGE
   ============================================ */
.ad-blocker-message {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    padding: 18px;
    background: linear-gradient(135deg, 
        rgba(255, 200, 50, 0.08), 
        rgba(8, 12, 24, 0.94)
    );
    border: 1px solid rgba(255, 200, 50, 0.28);
    border-radius: 12px;
    text-align: center;
    position: relative;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.adblocker-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.adblocker-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 0.75rem;
    color: #101014;
    background: linear-gradient(135deg, #fff2a8, #ffc832);
    box-shadow: 0 0 24px rgba(255, 200, 50, 0.28);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.adblocker-content h3 {
    color: #ffc832;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.adblocker-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

.adblocker-buttons {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.btn-refresh,
.btn-premium {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.adblocker-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 1rem;
}

.adblocker-close:hover {
    background: rgba(255, 200, 50, 0.18);
    color: #fff;
}

.btn-refresh {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-premium {
    background: linear-gradient(135deg, #ffc832, #ff8c00);
    border: none;
    color: #000;
}

.btn-premium:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 200, 50, 0.4);
}

/* ============================================
   FALLBACK ADS
   ============================================ */
.fallback-ad {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.fallback-ad-card {
    min-height: 90px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(0, 214, 160, 0.18), rgba(255, 45, 85, 0.08)),
        radial-gradient(circle at 85% 15%, rgba(255, 215, 0, 0.22), transparent 36%),
        rgba(12, 14, 24, 0.94);
}

.fallback-ad-card:hover {
    filter: brightness(1.06);
}

.fallback-ad-kicker {
    color: #7dffcf;
    font-size: 0.68rem;
    font-family: 'Russo One', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.fallback-ad-card strong {
    font-family: 'Russo One', sans-serif;
    font-size: 1.05rem;
}

.fallback-ad-card span:last-child {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    line-height: 1.35;
}

/* ============================================
   NATIVE AD STYLE
   ============================================ */
.native-ad {
    background: linear-gradient(135deg, 
        rgba(40, 40, 50, 0.95), 
        rgba(20, 20, 30, 0.98)
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.native-ad:hover {
    border-color: rgba(255, 0, 64, 0.3);
    transform: translateY(-2px);
}

.native-ad-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.native-ad-content {
    flex: 1;
}

.native-ad-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.native-ad-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.native-ad-cta {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--red, #ff0040), #ff4080);
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.native-ad-cta:hover {
    transform: scale(1.05);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
    .ad-banner-top,
    .ad-banner-bottom {
        max-width: 100%;
        min-height: 50px;
        padding: 5px;
    }
    
    .ad-sidebar {
        width: 100%;
        max-width: 320px;
    }
    
    .pre-game-ad-container {
        width: min(100%, 356px);
        max-width: none;
        border-radius: 16px;
    }

    .pre-game-ad-header {
        padding: 14px 14px 12px;
        gap: 10px;
    }

    .pre-game-ad-title-block h2 {
        font-size: 1.05rem;
    }

    .pre-game-ad-title-block p {
        display: none;
    }

    .skip-timer {
        min-width: 92px;
        padding: 8px 9px;
        font-size: 10px;
    }
    
    .pre-game-ad-content {
        min-height: 274px;
        padding: 12px;
    }

    .pre-game-ad-placeholder {
        inset: 12px;
    }

    .pre-game-ad-content .ad-wrapper {
        min-height: 250px;
        max-width: 320px;
    }

    .pre-game-premium-strip {
        padding: 10px 14px;
        align-items: stretch;
    }

    .pre-game-premium-strip span {
        display: none;
    }

    .pre-game-premium-btn {
        width: 100%;
    }

    .pre-game-ad-footer {
        padding: 12px 14px;
        gap: 10px;
    }

    .pre-game-ad-footer p {
        min-width: 0;
        font-size: 12px;
        line-height: 1.2;
    }

    .skip-btn {
        min-width: 126px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .adblocker-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-refresh,
    .btn-premium {
        width: 100%;
    }
    
    .native-ad {
        flex-direction: column;
        text-align: center;
    }
    
    .native-ad-image {
        width: 100%;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .ad-in-feed,
    .game-card-ad {
        max-width: 100%;
        margin: 10px 0;
    }
    
    .ad-label {
        font-size: 8px;
        padding: 2px 4px;
    }
}

/* ============================================
   LOADING STATE - Hidden until ad actually loads
   ============================================ */
.ad-wrapper[data-ad-status="loading"] {
    display: none; /* Don't show loading state - hide until ad renders */
}

/* Show wrapper only when ad has rendered */
.ad-wrapper:has(iframe),
.ad-wrapper:has([data-adsbygoogle-status="done"]) {
    display: flex !important;
    background: rgba(0, 0, 0, 0.3);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   VIDEO AD STYLES
   ============================================ */
.video-ad-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    max-width: 640px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-ad-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-ad-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-ad-progress {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 15px;
    overflow: hidden;
}

.video-ad-progress-bar {
    height: 100%;
    background: var(--red, #ff0040);
    transition: width 0.1s linear;
}

.video-ad-skip {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-ad-skip:hover:not(:disabled) {
    background: var(--red, #ff0040);
    border-color: transparent;
}

.video-ad-skip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   PREMIUM UPSELL IN ADS
   ============================================ */
.ad-premium-upsell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 15px;
    background: linear-gradient(90deg, 
        rgba(255, 200, 50, 0.1), 
        transparent
    );
    border-top: 1px solid rgba(255, 200, 50, 0.2);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.ad-premium-upsell a {
    color: #ffc832;
    text-decoration: none;
    font-weight: 600;
}

.ad-premium-upsell a:hover {
    text-decoration: underline;
}

/* ============================================
   HIDE ADS FOR PREMIUM USERS
   ============================================ */
body.premium-user .ad-container,
body.premium-user .ad-wrapper,
body.premium-user .adsbygoogle,
body.premium-user [data-ad-slot],
body.premium-user .ad-blocker-message,
body.premium-user .pre-game-ad-overlay {
    display: none !important;
}


/* ============================================================
   Hide the legacy "Power Up" emulator ad dock everywhere.
   The button has been removed from ads-manager.js, but pages
   that were already cached or referenced it still need this
   safety net so the dock never shows up while the user plays.
   The HilltopAds Video Slider replaces it.
   ============================================================ */
.emulator-ad-dock,
#emulatorAdDock,
.emulator-ad-upgrade-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ============================================================
   IN-GAME EMULATOR AD (closeable, re-shows after 30s)
   Injected by ads-manager.js installEmulatorAdDock() on
   emulator.html for free users only. Hidden in fullscreen
   (body.app-fullscreen-emu rules already target .og-ingame-ad)
   and never created for premium/admin users.
   ============================================================ */
.og-ingame-ad {
    position: fixed;
    z-index: 4200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(12, 14, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
    padding: 6px;
    overflow: hidden;
    animation: ogInGameAdIn 0.28s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Desktop / wide: tucked into the bottom-right corner, clear of
   the game canvas and on-screen controls (avoids accidental clicks). */
@media (min-width: 921px) {
    .og-ingame-ad {
        right: 16px;
        bottom: 16px;
        width: 312px;
        min-height: 90px;
        max-height: 280px;
    }
    .og-ingame-ad .adsbygoogle {
        width: 300px;
        min-height: 90px;
    }
}

/* Mobile / narrow: a slim banner pinned to the very top-center so it
   never overlaps the bottom virtual gamepad. */
@media (max-width: 920px) {
    .og-ingame-ad {
        top: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: min(340px, 96vw);
        min-height: 54px;
        max-height: 120px;
        padding: 4px;
        border-radius: 10px;
    }
    .og-ingame-ad .adsbygoogle {
        width: 320px;
        height: 50px;
    }
}

.og-ingame-ad .ad-wrapper {
    width: 100%;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.og-ingame-ad .ad-label {
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 2px;
}

.og-ingame-ad-close {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s ease, transform 0.2s ease;
}

.og-ingame-ad-close:hover {
    background: var(--red, #ff315a);
    transform: scale(1.08);
}

.og-ingame-ad--closing {
    animation: ogInGameAdOut 0.2s ease forwards;
}

@keyframes ogInGameAdIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Mobile keeps the translateX centering while fading. */
@media (max-width: 920px) {
    @keyframes ogInGameAdIn {
        from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
        to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    @keyframes ogInGameAdOut {
        from { opacity: 1; transform: translateX(-50%) translateY(0); }
        to { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    }
}

@keyframes ogInGameAdOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(8px); }
}

/* Premium users never see it even if a stale timer fires. */
body.premium-no-ads .og-ingame-ad,
body.premium-user .og-ingame-ad {
    display: none !important;
}
