/* ====================================
   GOOGLE ADSENSE MONETIZATION STYLING
   ==================================== */

/* Ad Container Base Styles */
.simple-ad,
.adsense-normalized-ad,
.adsense-normalized-wrap,
.ad-container {
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    padding: 0 12px;
    text-align: center;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}

.ad-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-container.ads {
    font-size: 12px;
    color: #999;
    padding: 5px;
}

/* ====================================
   AD SIZE CONTAINERS
   ==================================== */

/* 970x250 Billboard (Above Fold) */
.ad-970x250 {
    min-width: 970px;
    min-height: 250px;
}

/* 728x90 Leaderboard */
.ad-728x90 {
    min-width: 728px;
    min-height: 90px;
}

/* 336x280 Rectangle */
.ad-336x280 {
    min-width: 336px;
    min-height: 280px;
}

/* 300x250 Medium Rectangle (Most Flexible) */
.ad-300x250 {
    min-width: 300px;
    min-height: 250px;
}

/* ====================================
   STICKY SIDEBAR AD (Desktop)
   ==================================== */

.sticky-ad-container {
    position: sticky;
    top: 80px;
    height: fit-content;
    width: 320px;
    margin-left: 20px;
}

.sticky-ad-wrapper {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* ====================================
   ANCHOR AD (Fixed Footer)
   ==================================== */

.anchor-ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    border-top: 0;
    padding: 0;
    z-index: 999;
    box-shadow: none;
    pointer-events: none;
}

.anchor-ad-wrapper {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    position: relative;
    pointer-events: auto;
}

.anchor-ad-close {
    position: absolute;
    top: -28px;
    right: 0;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #777;
    padding: 0;
    width: 28px;
    height: 28px;
    line-height: 28px;
    border-radius: 3px;
}

.anchor-ad-close:hover {
    color: #333;
}

/* ====================================
   MULTIPLEX NATIVE AD STYLING
   ==================================== */

.multiplex-container {
    margin: 30px 0;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    min-height: 0;
    max-height: none;
    overflow: visible;
    box-shadow: none !important;
}

.multiplex-header {
    display: none !important;
}

/* ====================================
   HOMEPAGE MOBILE-FIRST NATIVE ADS
   ==================================== */

.homepage-native-ad {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 15px;
}

.homepage-native-ad--hero {
    margin-top: 24px;
    margin-bottom: 34px;
}

.native-ad-shell {
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    padding: 0;
    min-height: 0;
    overflow: hidden;
    box-shadow: none !important;
}

.homepage-fluid-ad {
    min-height: 0;
    padding: 0;
}

.ad-container .adsbygoogle,
.native-ad-shell .adsbygoogle,
.multiplex-container .adsbygoogle,
.simple-ad .adsbygoogle,
.adsense-normalized-ad .adsbygoogle {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 120px;
    text-align: center;
}

.simple-ad .adsbygoogle[data-ad-format="fluid"],
.adsense-normalized-ad .adsbygoogle[data-ad-format="fluid"] {
    min-height: 160px;
}

/* ====================================
   MOBILE RESPONSIVE ADJUSTMENTS
   ==================================== */

@media (max-width: 1024px) {
    /* Hide desktop-only ads */
    .sticky-ad-container {
        display: none !important;
    }

    .ad-970x250 {
        min-width: 0;
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    /* Mobile ad container adjustments */
    .simple-ad,
    .adsense-normalized-ad,
    .ad-container {
        margin: 15px 0;
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Mobile sizes */
    .ad-728x90 {
        min-width: 0;
        min-height: 90px;
    }

    .ad-336x280 {
        min-width: 300px;
        min-height: 250px;
    }

    .ad-300x250 {
        min-width: 300px;
        min-height: 250px;
    }

    /* Anchor ad mobile */
    .anchor-ad-container {
        padding: 0;
    }

    .anchor-ad-wrapper {
        width: 320px;
        max-width: 100%;
        padding: 0;
        box-sizing: border-box;
    }

    .anchor-ad-wrapper .adsbygoogle {
        width: 320px !important;
        max-width: 100% !important;
        height: 50px !important;
    }

    .homepage-native-ad {
        margin: 24px auto;
        padding: 0 12px;
    }

    .homepage-native-ad--hero {
        margin-top: 18px;
    }

    .native-ad-shell,
    .multiplex-container {
        border-radius: 8px;
        padding: 0;
        min-height: 0;
        max-height: none;
        box-shadow: none;
    }

    .homepage-fluid-ad {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    /* Very small mobile */
    .ad-container {
        margin: 10px 0;
    }

    .ad-728x90,
    .ad-336x280,
    .ad-300x250 {
        min-width: 0;
    }

    .native-ad-shell,
    .multiplex-container {
        min-height: 0;
        max-height: none;
    }
}

/* ====================================
   AD DENSITY & SPACING RULES
   ==================================== */

/* Minimum spacing between ads: 600px */
.ad-container + .ad-container {
    margin-top: 600px;
}

/* CLS Prevention - Reserve space before ads load */
.ad-placeholder {
    background: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* ====================================
   AD POLICY COMPLIANCE
   ==================================== */

/* Clear ad labeling */
.ad-label {
    display: none !important;
    font-size: 11px;
    color: #999;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Safe spacing from clickable elements */
.game-item + .ad-container {
    margin-top: 200px;
}

/* ====================================
   LAZY LOADING VISIBILITY
   ==================================== */

.ad-container[data-lazy] {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.ad-container[data-lazy].visible {
    opacity: 1;
}

/* ====================================
   MAIN LAYOUT WITH SIDEBAR
   ==================================== */

.main-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .main-with-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ====================================
   AD QUALITY INDICATORS
   ==================================== */

/* High-performing placements */
.ad-above-fold {
    margin-bottom: 20px;
}

.ad-in-content {
    margin: 30px 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

/* ====================================
   ANCHOR AD CUSTOMIZATION
   ==================================== */

.anchor-ad-container.collapsed {
    bottom: -100px;
    transition: bottom 0.3s ease-out;
}

.anchor-ad-container.visible {
    bottom: 0;
    transition: bottom 0.3s ease-out;
}

/* ====================================
   POLICY-SAFE GAME TRANSITION
   ==================================== */

.game-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(4, 3, 20, 0.72);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    z-index: 10000;
    padding: 20px;
    transition: opacity 180ms ease, visibility 180ms ease;
}

.game-transition-overlay.active {
    opacity: 1;
    visibility: visible;
}

.game-transition-card {
    width: min(92vw, 360px);
    display: grid;
    grid-template-columns: 58px 1fr 26px;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    color: #151226;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.game-transition-thumb {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
}

.game-transition-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-transition-copy strong {
    font-size: 15px;
    line-height: 1.2;
}

.game-transition-copy span {
    font-size: 13px;
    line-height: 1.25;
    color: #5b566f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-transition-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(88, 75, 255, 0.2);
    border-top-color: #584bff;
    border-radius: 50%;
    animation: game-transition-spin 800ms linear infinite;
}

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

/* ====================================
   PRINT MEDIA - HIDE ADS
   ==================================== */

@media print {
    .ad-container,
    .sticky-ad-container,
    .anchor-ad-container,
    .game-transition-overlay {
        display: none !important;
    }
}
