/**
 * CanvasClashes - Unified Video Ad & Interstitial Engine Stylesheet
 * Responsive, Cyberpunk dark glassmorphism for 5-second prerolls & 3-minute midrolls
 */

.game-ad-overlay {
    position: absolute;
    inset: 0;
    z-index: 999999;
    background: rgba(3, 7, 18, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    animation: adFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.game-ad-overlay * {
    box-sizing: border-box;
}

.game-ad-overlay.fixed-fullscreen {
    position: fixed !important;
    inset: 0 !important;
}

.game-ad-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.97);
}

@keyframes adFadeIn {
    from {
        opacity: 0;
        transform: scale(1.02);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.game-ad-card {
    width: 100%;
    max-width: 660px;
    max-height: 92vh;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-ad-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: rgba(10, 15, 30, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.game-ad-badge {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.game-ad-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: adPulse 1.8s infinite ease-in-out;
}

.game-ad-dot.midroll-dot {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

@keyframes adPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.game-ad-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #cbd5e1;
    text-transform: uppercase;
}

.game-ad-timer-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    font-weight: 600;
}

.game-ad-timer-txt {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.game-ad-timer-txt strong {
    color: #38bdf8;
    font-weight: 800;
    font-size: 1rem;
}

.btn-game-ad-skip {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-game-ad-skip:hover:not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
}

.btn-game-ad-skip.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
}

.game-ad-media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 55vh;
    background: #020617;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-ad-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.game-ad-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-game-ad-sound {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.btn-game-ad-sound:hover {
    background: rgba(15, 23, 42, 0.98);
    border-color: #38bdf8;
    transform: scale(1.08);
}

.btn-game-ad-sound.unmuted {
    border-color: #10b981;
    color: #10b981;
}

.game-ad-info-link {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 0.4rem 0.7rem;
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.game-ad-info-link:hover {
    color: #fff;
    border-color: #38bdf8;
}

.game-ad-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 12;
}

.game-ad-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 50%, #10b981 100%);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
    transition: width 0.1s linear;
}

.game-ad-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(10, 15, 30, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-ad-upgrade-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fde68a;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.game-ad-upgrade-cta:hover {
    background: rgba(245, 158, 11, 0.22);
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

@media (max-width: 640px) {
    .game-ad-card {
        max-width: 100%;
        border-radius: 12px;
    }
    .game-ad-header {
        padding: 0.6rem 0.9rem;
    }
    .game-ad-label {
        font-size: 0.68rem;
    }
    .game-ad-upgrade-cta {
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
    }
}
