/**
 * Comet Ad System Styles
 * Dramatic comet impact advertisement display
 */

/* Comet impact shake animation */
@keyframes cometScreenShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    5% { transform: translate(-20px, -18px) rotate(-1deg); }
    10% { transform: translate(18px, 20px) rotate(1deg); }
    15% { transform: translate(-18px, 18px) rotate(-0.8deg); }
    20% { transform: translate(20px, -20px) rotate(0.8deg); }
    25% { transform: translate(-16px, -16px) rotate(-0.6deg); }
    30% { transform: translate(16px, 16px) rotate(0.6deg); }
    35% { transform: translate(-14px, 14px) rotate(-0.5deg); }
    40% { transform: translate(14px, -14px) rotate(0.5deg); }
    45% { transform: translate(-12px, -12px) rotate(-0.4deg); }
    50% { transform: translate(12px, 12px) rotate(0.4deg); }
    60% { transform: translate(-8px, 8px) rotate(-0.2deg); }
    70% { transform: translate(6px, -6px) rotate(0.2deg); }
    80% { transform: translate(-4px, 4px) rotate(-0.1deg); }
    90% { transform: translate(2px, -2px) rotate(0.05deg); }
}

body.comet-impact-shake {
    animation: cometScreenShake 1.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
    overflow: hidden !important; /* Prevent scrolling during explosion */
    position: fixed !important; /* Lock body position */
    width: 100% !important;
    height: 100% !important;
}

/* Also lock HTML element during explosion */
html.comet-playing {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
}

/* Warning notification */
.comet-warning {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 10px 25px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    transition: top 0.4s ease;
    color: rgba(255, 100, 100, 0.9);
    white-space: nowrap;
    pointer-events: none;
}

.comet-warning.show {
    top: 20px;
}

/* Big text in center screen */
.comet-big-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 3rem;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow:
        0 0 20px rgba(255, 255, 255, 1),
        0 0 40px rgba(255, 200, 100, 0.8),
        0 0 60px rgba(255, 150, 50, 0.6),
        0 0 80px rgba(255, 100, 0, 0.4);
    z-index: 10001;
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.comet-big-text.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: bigTextPulse 0.5s ease-in-out infinite;
}

@keyframes bigTextPulse {
    0%, 100% {
        text-shadow:
            0 0 20px rgba(255, 255, 255, 1),
            0 0 40px rgba(255, 200, 100, 0.8),
            0 0 60px rgba(255, 150, 50, 0.6),
            0 0 80px rgba(255, 100, 0, 0.4);
    }
    50% {
        text-shadow:
            0 0 30px rgba(255, 255, 255, 1),
            0 0 60px rgba(255, 200, 100, 1),
            0 0 90px rgba(255, 150, 50, 0.8),
            0 0 120px rgba(255, 100, 0, 0.6);
    }
}

/* Responsive big text */
@media (max-width: 480px) {
    .comet-big-text {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .comet-big-text {
        font-size: 2.4rem;
        letter-spacing: 6px;
    }
}

.comet-warning::before {
    content: '▲';
    margin-right: 12px;
    color: rgba(255, 50, 50, 0.9);
    font-size: 0.7rem;
}

.comet-warning-text {
    display: inline-block;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.comet-warning-text.fade-out {
    opacity: 0;
}

.comet-warning-text.blink {
    animation: dangerBlink 0.3s ease-in-out infinite;
}

@keyframes dangerBlink {
    0%, 100% {
        opacity: 1;
        color: rgba(255, 50, 50, 1);
    }
    50% {
        opacity: 0.3;
        color: rgba(255, 100, 100, 0.6);
    }
}

/* Red alert overlay */
.comet-red-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 0, 0, 0);
    pointer-events: none;
    z-index: 9998;
    transition: background 0.3s ease;
}

.comet-red-alert-overlay.active {
    animation: redAlertPulse 0.5s ease-in-out infinite;
}

@keyframes redAlertPulse {
    0%, 100% {
        background: rgba(255, 0, 0, 0.15);
    }
    50% {
        background: rgba(255, 0, 0, 0.3);
    }
}

/* Comet */
.comet {
    position: absolute;
    width: 35px;
    height: 35px;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
}

.comet-core {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 248, 220, 0.95) 15%,
        rgba(255, 235, 200, 0.9) 30%,
        rgba(255, 200, 150, 0.7) 50%,
        rgba(255, 150, 100, 0.4) 70%,
        rgba(200, 100, 50, 0.1) 90%,
        transparent 100%);
    filter: blur(8px);
    box-shadow:
        0 0 60px rgba(255, 255, 255, 1),
        0 0 120px rgba(255, 235, 200, 0.9),
        0 0 180px rgba(255, 200, 150, 0.6),
        0 0 240px rgba(255, 150, 100, 0.3);
    animation: cometPulse 0.15s ease-in-out infinite;
}

@keyframes cometPulse {
    0%, 100% {
        filter: blur(8px) brightness(1);
        transform: scale(1);
    }
    50% {
        filter: blur(10px) brightness(1.2);
        transform: scale(1.05);
    }
}

/* Explosion flash */
.comet-explosion-flash {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 245, 230, 1) 5%,
        rgba(255, 220, 180, 0.95) 12%,
        rgba(255, 180, 120, 0.85) 20%,
        rgba(255, 140, 80, 0.7) 30%,
        rgba(255, 100, 50, 0.5) 45%,
        rgba(200, 80, 120, 0.3) 60%,
        rgba(138, 43, 226, 0.15) 75%,
        transparent 100%);
    opacity: 0;
    z-index: 10001;
    pointer-events: none;
    mix-blend-mode: screen;
}

/* Energy waves */
.comet-energy-wave {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 6px solid rgba(138, 43, 226, 0.9);
    border-radius: 50%;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
    box-shadow:
        0 0 40px rgba(138, 43, 226, 0.8),
        inset 0 0 40px rgba(138, 43, 226, 0.5);
    background: radial-gradient(circle,
        rgba(138, 43, 226, 0.3) 0%,
        transparent 70%);
}

/* Shockwaves */
.comet-shockwave {
    position: absolute;
    width: 60px;
    height: 60px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 5px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    opacity: 0;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.9);
}

/* Debris container - PREVENT PAGE EXPANSION */
#comet-debris-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden !important; /* CRITICAL: Prevent debris from expanding page */
    pointer-events: none;
    z-index: 9999;
    visibility: hidden;
    max-width: 100vw !important;
    max-height: 100vh !important;
}

#comet-debris-container:not(:empty) {
    visibility: visible;
}

/* Star particles */
.comet-debris-particle {
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
    z-index: 1;
    will-change: transform, opacity;
    pointer-events: none; /* Prevent debris from blocking clicks */
}

.comet-white-fragment {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0.9) 40%,
        rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 8px rgba(255, 255, 255, 1),
        0 0 15px rgba(255, 255, 255, 0.6);
}

.comet-fire-fragment {
    width: 7px;
    height: 7px;
    background: radial-gradient(circle,
        rgba(255, 255, 230, 1) 0%,
        rgba(255, 200, 100, 0.9) 35%,
        rgba(255, 120, 50, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(255, 200, 100, 1),
        0 0 18px rgba(255, 150, 80, 0.7);
}

.comet-purple-fragment {
    width: 5px;
    height: 5px;
    background: radial-gradient(circle,
        rgba(200, 150, 255, 1) 0%,
        rgba(138, 43, 226, 0.9) 40%,
        rgba(100, 20, 180, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 9px rgba(138, 43, 226, 1),
        0 0 16px rgba(138, 43, 226, 0.6);
}

.comet-blue-fragment {
    width: 6px;
    height: 6px;
    background: radial-gradient(circle,
        rgba(180, 220, 255, 1) 0%,
        rgba(100, 180, 255, 0.9) 40%,
        rgba(50, 120, 220, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 8px rgba(100, 180, 255, 1),
        0 0 14px rgba(100, 180, 255, 0.7);
}

.comet-cosmic-dust {
    width: 4px;
    height: 4px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(200, 200, 255, 0.7) 50%,
        rgba(150, 150, 200, 0) 100%);
    border-radius: 50%;
    box-shadow:
        0 0 6px rgba(200, 200, 255, 0.9),
        0 0 12px rgba(200, 200, 255, 0.5);
}

/* Ad display modal - MOBILE FIRST - REAL DEVICE OPTIMIZED */
.comet-ad-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, rgba(5, 10, 25, 0.95), rgba(15, 20, 40, 0.95));
    border: 2px solid rgba(74, 158, 255, 0.4);
    border-radius: 20px;
    padding: 30px 25px;
    max-width: min(90vw, 400px);
    width: auto;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow:
        0 15px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 40px rgba(0, 100, 200, 0.1);
    z-index: 999999; /* Much higher z-index for real mobile devices */
    opacity: 0;
    text-align: center;
    box-sizing: border-box;
    pointer-events: none;
    display: none;
    visibility: hidden;
    /* Real mobile optimizations */
    -webkit-transform: translate(-50%, -50%) scale(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* Reduce backdrop-filter on mobile as it can cause rendering issues */
@media (min-width: 769px) {
    .comet-ad-display {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
}

.comet-ad-display.show {
    pointer-events: auto !important;
    display: block !important;
    visibility: visible !important;
    z-index: 999999 !important;
}

/* Animated starfield inside popup */
.comet-ad-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 15% 90%, white, transparent),
        radial-gradient(2px 2px at 70% 20%, white, transparent);
    background-size: 200% 200%;
    background-position: 0% 0%;
    opacity: 0.3;
    animation: stars-float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes stars-float {
    0%, 100% {
        background-position: 0% 0%;
        opacity: 0.2;
    }
    25% {
        background-position: 100% 50%;
        opacity: 0.4;
    }
    50% {
        background-position: 50% 100%;
        opacity: 0.3;
    }
    75% {
        background-position: 100% 100%;
        opacity: 0.5;
    }
}

/* Additional twinkling stars */
.comet-ad-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 40% 40%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 25% 75%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 85% 85%, rgba(255, 255, 255, 0.6), transparent);
    background-size: 100% 100%;
    animation: stars-twinkle 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes stars-twinkle {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.comet-ad-display.show {
    animation: adRise 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    -webkit-animation: adRise 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Desktop animation with transform */
@media (min-width: 769px) {
    @keyframes adRise {
        0% {
            transform: translate(-50%, -50%) scale(0);
            -webkit-transform: translate(-50%, -50%) scale(0);
            opacity: 0;
            visibility: visible;
        }
        70% {
            transform: translate(-50%, -50%) scale(1.05);
            -webkit-transform: translate(-50%, -50%) scale(1.05);
            opacity: 1;
            visibility: visible;
        }
        100% {
            transform: translate(-50%, -50%) scale(1);
            -webkit-transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            visibility: visible;
        }
    }

    @-webkit-keyframes adRise {
        0% {
            -webkit-transform: translate(-50%, -50%) scale(0);
            opacity: 0;
            visibility: visible;
        }
        70% {
            -webkit-transform: translate(-50%, -50%) scale(1.05);
            opacity: 1;
            visibility: visible;
        }
        100% {
            -webkit-transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            visibility: visible;
        }
    }
}

/* Mobile animation WITHOUT transform (uses opacity only) */
@media (max-width: 768px) {
    @keyframes adRise {
        0% {
            opacity: 0;
            visibility: visible;
        }
        100% {
            opacity: 1;
            visibility: visible;
        }
    }

    @-webkit-keyframes adRise {
        0% {
            opacity: 0;
            visibility: visible;
        }
        100% {
            opacity: 1;
            visibility: visible;
        }
    }
}

.comet-ad-badge {
    display: inline-block;
    background: rgba(138, 43, 226, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.5);
    padding: 6px 16px;
    border-radius: 2px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    font-weight: 400;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(200, 150, 255, 0.9);
    position: relative;
    z-index: 1;
}

.comet-ad-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    display: block;
    object-fit: contain;
}

.comet-ad-title {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.comet-ad-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

.comet-ad-cta {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 12px 32px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
}

.comet-ad-cta:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.1);
}

.comet-ad-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 2px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    z-index: 1;
}

.comet-ad-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Responsive - Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    /* Reduce intensity of explosion flash on mobile */
    .comet-explosion-flash {
        background: radial-gradient(circle at center,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 245, 230, 0.8) 5%,
            rgba(255, 220, 180, 0.7) 12%,
            rgba(255, 180, 120, 0.6) 20%,
            rgba(255, 140, 80, 0.5) 30%,
            rgba(255, 100, 50, 0.3) 45%,
            rgba(200, 80, 120, 0.2) 60%,
            rgba(138, 43, 226, 0.1) 75%,
            transparent 100%);
    }

    /* Reduce shockwave size on mobile */
    .comet-shockwave {
        width: 40px;
        height: 40px;
        border: 3px solid rgba(255, 255, 255, 0.95);
    }

    /* Reduce energy wave size on mobile */
    .comet-energy-wave {
        width: 60px;
        height: 60px;
        border: 4px solid rgba(138, 43, 226, 0.9);
    }

    /* CRITICAL: Make ad display work on REAL MOBILE DEVICES - SIMPLE APPROACH */
    .comet-ad-display {
        padding: 20px 15px !important;
        width: 90vw !important;
        max-width: 90vw !important;
        min-height: 300px !important;
        max-height: 80vh !important;
        border-radius: 15px !important;
        position: fixed !important;
        top: 10vh !important;
        left: 5vw !important;
        right: 5vw !important;
        bottom: auto !important;
        margin: 0 !important;
        z-index: 999999 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    .comet-ad-display.show {
        transform: none !important;
        -webkit-transform: none !important;
        opacity: 1 !important;
    }

    .comet-ad-display.show {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 999999 !important;
        opacity: 1 !important;
    }

    .comet-ad-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
        word-wrap: break-word;
    }

    .comet-ad-description {
        font-size: 0.8rem;
        line-height: 1.5;
        margin-bottom: 18px;
        word-wrap: break-word;
    }

    .comet-ad-badge {
        font-size: 0.65rem;
        padding: 4px 12px;
        margin-bottom: 15px;
    }

    .comet-ad-cta {
        font-size: 0.8rem;
        padding: 10px 24px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .comet-ad-image {
        margin-bottom: 15px;
        max-height: 200px;
    }

    .comet-ad-close {
        width: 28px;
        height: 28px;
        top: 10px;
        right: 10px;
        font-size: 1rem;
    }
}

/* Responsive - Medium Mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Reduce intensity of explosion flash on medium mobile */
    .comet-explosion-flash {
        background: radial-gradient(circle at center,
            rgba(255, 255, 255, 0.9) 0%,
            rgba(255, 245, 230, 0.9) 5%,
            rgba(255, 220, 180, 0.8) 12%,
            rgba(255, 180, 120, 0.7) 20%,
            rgba(255, 140, 80, 0.6) 30%,
            rgba(255, 100, 50, 0.4) 45%,
            rgba(200, 80, 120, 0.25) 60%,
            rgba(138, 43, 226, 0.12) 75%,
            transparent 100%);
    }

    /* Reduce shockwave size on medium mobile */
    .comet-shockwave {
        width: 50px;
        height: 50px;
        border: 4px solid rgba(255, 255, 255, 0.95);
    }

    /* Reduce energy wave size on medium mobile */
    .comet-energy-wave {
        width: 70px;
        height: 70px;
        border: 5px solid rgba(138, 43, 226, 0.9);
    }

    /* CRITICAL: Make ad display work on REAL MEDIUM MOBILE DEVICES - SIMPLE APPROACH */
    .comet-ad-display {
        padding: 25px 20px !important;
        width: 90vw !important;
        max-width: 90vw !important;
        min-height: 300px !important;
        max-height: 80vh !important;
        position: fixed !important;
        top: 10vh !important;
        left: 5vw !important;
        right: 5vw !important;
        bottom: auto !important;
        margin: 0 !important;
        z-index: 999999 !important;
        transform: none !important;
        -webkit-transform: none !important;
    }

    .comet-ad-display.show {
        transform: none !important;
        -webkit-transform: none !important;
        opacity: 1 !important;
    }

    .comet-ad-display.show {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        z-index: 999999 !important;
        opacity: 1 !important;
    }

    .comet-ad-title {
        font-size: 1.4rem;
        word-wrap: break-word;
    }

    .comet-ad-description {
        font-size: 0.85rem;
        word-wrap: break-word;
    }

    .comet-ad-badge {
        font-size: 0.7rem;
        padding: 5px 14px;
    }

    .comet-ad-cta {
        font-size: 0.85rem;
        padding: 11px 28px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .comet-ad-image {
        max-height: 250px;
    }
}

/* Responsive - Tablet (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .comet-ad-display {
        padding: 35px 30px;
        max-width: min(85vw, 500px);
        width: auto;
        max-height: 85vh;
    }

    .comet-ad-title {
        font-size: 1.6rem;
        word-wrap: break-word;
    }

    .comet-ad-description {
        font-size: 0.9rem;
        word-wrap: break-word;
    }

    .comet-ad-image {
        max-height: 300px;
    }
}

/* Responsive - Desktop (1025px+) */
@media (min-width: 1025px) {
    .comet-ad-display {
        padding: 40px;
        max-width: 550px;
        width: auto;
    }

    .comet-ad-title {
        font-size: 1.8rem;
        word-wrap: break-word;
    }

    .comet-ad-description {
        font-size: 0.95rem;
        word-wrap: break-word;
    }

    .comet-ad-image {
        max-height: 350px;
    }
}
