/* Playable Modal Styles */

/* Ensure containers have relative positioning for absolute popup */
#playable-modal .phone-container,
.phone.playable {
    position: relative;
}

/* Phone frame overlay to cover gaps */
#playable-modal .phone-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 15px solid #1a1a1a;
    border-radius: 40px;
    pointer-events: none;
    z-index: 10001;
    box-sizing: border-box;
}

/* CTA Popup Overlay - Generic class for both modal and main page */
.cta-popup-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.cta-popup-overlay .cta-popup-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    max-width: 80%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.cta-popup-overlay .cta-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
}

.cta-popup-overlay .cta-popup-close:hover {
    color: #000;
}

.cta-popup-overlay h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.cta-popup-overlay p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Enable touch for iframe everywhere */
#playable-modal,
#playable-modal *,
#playable-modal .phone-screen,
#playable-modal .phone-screen iframe {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
}

#playable-modal .phone-container {
    touch-action: manipulation !important;
    cursor: pointer !important;
}

#playable-modal .phone-screen iframe {
    pointer-events: auto !important;
    touch-action: auto !important;
}

/* Tablet and small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
    .qr-section { 
        display: none !important; 
    }
    .phone-container {
        width: 80vw !important;
        height: calc(100vh - 80px) !important;
        max-width: 700px !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .qr-section { 
        display: none !important; 
    }
    .phone-container { 
        width: calc(100vw - 40px) !important; 
        height: calc(100vh - 80px) !important;
        max-width: 100% !important;
        /* Force z-index hierarchy - container on top */
        z-index: 1000002 !important;
    }
    .phone-screen {
        z-index: 1000001 !important;
    }
    .phone-screen iframe {
        z-index: 1000000 !important;
        pointer-events: auto !important;
        touch-action: auto !important;
        /* Chrome iPad specific fix */
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        /* Disable scrolling completely */
        overflow: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        /* Ensure clicks go through */
        position: absolute !important;
        isolation: isolate !important;
    }
    .modal-close {
        top: 10px !important;
        right: 10px !important;
        font-size: 35px !important;
    }
}
