/* --- Zirvestream Style Ads --- */

/* Page Background Ad (Refinement) */
.page-bg-link {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Above body but below content */
    cursor: pointer;
}

.page-bg {
    position: fixed;
    top: 100px;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind the link */
    background-position: top center;
    background-repeat: no-repeat;

    background-size: 100% auto !important;
    /* Scale width to fit viewport */
}

/* Ensure content sits well above the background link */
/* KEY FIX: Allow clicks to pass through full-width wrappers */
/* Ensure content sits well above the background link */
/* KEY FIX: Allow clicks to pass through full-width wrappers */
.as-header {
    position: relative;
    z-index: 30;
    /* Higher than main to let menu float over */
    pointer-events: none;
}

.as-main,
.as-footer {
    position: relative;
    z-index: 20;
    /* High z-index to ensure visible on top */
    pointer-events: none;
    /* Let clicks pass through empty spaces */
}

/* Restore clicks for ACTUAL content containers */
.as-header-container,
.as-hero-container,
.as-container,
.as-footer-container,
.as-match-content-wrapper,
.as-side-banner,
.as-search-overlay,
.as-splash-overlay,
.as-match-page,
.as-player-sidebar-container,
.as-match-details-section,
.as-chat-wrapper {
    pointer-events: auto;
    /* Re-enable clicks for content */
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    .page-bg-link,
    .page-bg {
        display: none;
    }
}

a[aria-label="Reklam"] {
    display: block;
    text-decoration: none;
}

/* Header Grid Banners (2x2) */
.as-ads-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.as-ads-grid a {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.as-ads-grid a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.as-ads-grid img {
    width: 100%;
    height: auto;
    display: block;
}

/* Player Contextual Ads (Yellow Bar) */
.as-ad-player-context {
    background: #ffc107;
    color: #000;
    font-weight: 800;
    text-align: center;
    padding: 12px;
    display: block;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-size: 15px;
    text-decoration: none;
    border-radius: 6px;
    animation: as-pulse 2s infinite;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    /* Ensure clickable */
}

.as-ad-player-context:hover {
    background: #ffca2c;
    color: #000;
}

.as-ad-player-bottom {
    margin-top: 12px;
    margin-bottom: 0;
}

@keyframes as-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        opacity: 1;
    }
}

/* Splash Popup */
.as-splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}

.as-splash-overlay.active {
    opacity: 1;
    visibility: visible;
}

.as-splash-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    animation: as-popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.as-splash-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s;
}

.as-splash-close:hover {
    transform: rotate(90deg);
}

.as-splash-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@keyframes as-popIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .as-ads-grid {
        grid-template-columns: 1fr;
    }

    .as-ad-player-context {
        font-size: 13px;
        padding: 10px;
    }

    .as-splash-close {
        top: -35px;
        right: 0;
    }
}