.cda-hidden {
    display: none !important;
}

.cda-rail {
    position: fixed;
    top: 50%;
    z-index: 99980;
    width: 160px;
    max-width: 16vw;
    transform: translateY(-50%);
    font-family: Arial, sans-serif;
}

.cda-rail-left {
    left: 12px;
}

.cda-rail-right {
    right: 12px;
}

.cda-ad {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    text-decoration: none;
}

.cda-ad img {
    display: block;
    width: 100%;
    height: auto;
}

.cda-legal {
    padding: 6px 7px;
    color: #fff;
    background: rgba(0, 0, 0, 0.82);
    font-size: 10px;
    line-height: 1.25;
    text-align: center;
}

.cda-close {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 2;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    font-size: 17px;
    line-height: 24px;
}

.cda-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.62);
    font-family: Arial, sans-serif;
}

.cda-popup {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(430px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.cda-popup img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(56vh, 520px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    background: #111827;
}

.cda-popup-banner {
    width: min(300px, calc(100vw - 32px));
    max-height: none;
    overflow: visible;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.cda-popup-banner .cda-popup-ad {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    line-height: 0;
}

.cda-popup-banner img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    margin: 0;
    object-fit: contain;
    background: transparent;
}

.cda-popup-banner .cda-close {
    top: -13px;
    right: -13px;
    width: 28px;
    height: 28px;
    font-size: 20px;
    line-height: 28px;
}

.cda-popup-body {
    flex: 0 0 auto;
    padding: 18px;
    text-align: center;
}

.cda-popup-title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 22px;
    line-height: 1.2;
}

.cda-popup-text {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
}

.cda-popup-button {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 8px;
    color: #fff;
    background: #16a34a;
    font-weight: 700;
    text-decoration: none;
}

.cda-bottom {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 99980;
    display: none;
    overflow: hidden;
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.30);
    font-family: Arial, sans-serif;
    transform: translateZ(0);
}

.cda-bottom .cda-ad {
    display: flex;
    align-items: center;
}

.cda-bottom img {
    width: 128px;
    max-width: 34%;
}

.cda-bottom .cda-legal {
    flex: 1;
    padding: 10px 34px 10px 10px;
    font-size: 12px;
}

@media (max-width: 1240px) {
    .cda-rail {
        width: 130px;
    }
}

@media (max-width: 1024px) {
    .cda-rail {
        display: none !important;
    }

    .cda-bottom.cda-mobile-bottom {
        display: block;
    }
}

@media (max-width: 640px) {
    .cda-popup-backdrop {
        align-items: flex-end;
        padding: 10px;
    }

    .cda-popup-backdrop-banner {
        align-items: center;
        padding: 16px;
    }

    .cda-popup {
        width: 100%;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        border-radius: 10px 10px 8px 8px;
    }

    .cda-popup img {
        max-height: 42vh;
    }

    .cda-popup-banner {
        width: min(300px, calc(100vw - 32px));
        max-height: none;
        overflow: visible;
    }

    .cda-popup-banner img {
        max-height: none;
    }

    .cda-popup-body {
        padding: 14px;
    }

    .cda-popup-title {
        font-size: 18px;
    }

    .cda-popup-text {
        font-size: 13px;
    }

    .cda-bottom {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        left: 8px;
    }

    .cda-bottom img {
        width: 120px;
        max-width: 38%;
    }

    .cda-bottom .cda-legal {
        padding: 9px 34px 9px 9px;
        font-size: 11px;
    }

    .cda-close {
        top: 6px;
        right: 6px;
        width: 28px;
        height: 28px;
        line-height: 28px;
    }
}

@media (max-width: 380px) {
    .cda-bottom img {
        width: 104px;
    }

    .cda-bottom .cda-legal {
        font-size: 10px;
    }
}
