:root {
    /* DEFAULT (LIGHT MODE) */
    --ccl-bg-card: #ffffff;
    --ccl-bg-inner: #f5f7fa;
    --ccl-bg-sticky: #ffffff;
    --ccl-text-main: #333333;
    --ccl-text-sub: #555555;
    --ccl-text-white: #ffffff;
    --ccl-border: #e1e4e8;
    --ccl-border-card: #e1e4e8;
    --ccl-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --ccl-accent: #4d5cff;
    --ccl-accent-text: #ffffff;
    --ccl-bonus-bg: rgba(77, 92, 255, 0.05);
    --ccl-bonus-border: rgba(77, 92, 255, 0.1);
    --ccl-tooltip-bg: #ffffff;
    --ccl-tooltip-text: #333333;
    --ccl-tooltip-border: #e1e4e8;
    --ccl-details-panel-bg: #f9fafb;
    --ccl-details-item-text: #555555;
    --ccl-rank-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    --ccl-bar-bg: #e1e4e8;
    --ccl-sticky-border-top: #e1e4e8;
    --ccl-checkmark-bg: #dde0ff;
}

/* DARK MODE OVERRIDES */
body.dark-mode,
body.mercury-theme-dark,
body.dark,
body.custom-background-dark,
.cc-listing-row.mercury-dark-mode {
    --ccl-bg-card: #242a38;
    --ccl-bg-inner: #1f2533;
    --ccl-bg-sticky: #0f141e;
    --ccl-text-main: #ffffff;
    --ccl-text-sub: #cfd6e8;
    --ccl-text-white: #ffffff;
    --ccl-border: #2e3546;
    --ccl-border-card: #16233d;
    --ccl-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    --ccl-bonus-bg: rgba(255, 255, 255, 0.06);
    --ccl-bonus-border: rgba(255, 255, 255, 0.08);
    --ccl-tooltip-bg: #1b2232;
    --ccl-tooltip-text: #d7deee;
    --ccl-tooltip-border: #2e3546;
    --ccl-details-panel-bg: #1b2232;
    --ccl-details-item-text: #d7deee;
    --ccl-bar-bg: rgba(255, 255, 255, 0.15);
    --ccl-sticky-border-top: #2e3546;
    --ccl-checkmark-bg: #4d5cff;
}

/* ======================= LISTING ======================= */

.cc-card {
    position: relative;
    background: var(--ccl-bg-card);
    color: var(--ccl-text-main);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: none;
    margin: 24px auto 0;
    box-shadow: var(--ccl-shadow);
    font-size: 14px;
    flex-direction: column;

    /* ⭐ BORDER */
    border: 3px solid var(--ccl-border-card);
}

/* RANK */
.cc-rank {
    position: absolute;
    top: -12px;
    left: -12px;
    background: var(--ccl-accent);
    color: var(--ccl-accent-text);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    box-shadow: var(--ccl-rank-shadow);
}

.cc-row {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
}

/* COMMON */
.cc-card .cc-col {
    display: flex;
    flex-direction: column;
}

/* LEFT BOX */
.cc-left {
    min-width: 230px;
}

.cc-left-inner {
    background: var(--ccl-bg-inner);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cc-logo img {
    width: 85px;
    height: 85px;
    max-width: 85px;
    border-radius: 14px !important;
    object-fit: cover;
}

.cc-name {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--ccl-text-main);
}

.cc-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 1;
    color: var(--ccl-text-main);
}

.cc-rating-bar {
    width: 100px;
    height: 6px;
    background: var(--ccl-bar-bg);
    border-radius: 999px;
    overflow: hidden;
}

.cc-rating-bar span {
    white-space: nowrap;
}

.cc-rating-fill {
    width: 82%;
    height: 100%;
    background: #3ddc84;
}

/* GRID MIDDLE */
.cc-middle {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 90px 140px;
    align-items: center;
    gap: 22px;
}

/* BONUS */
.cc-bonus {
    text-align: center;
}

.cc-bonus-box {
    background: var(--ccl-bonus-bg);
    border: 1px solid var(--ccl-bonus-border);
    padding: 10px 16px;
    border-radius: 12px;
    display: inline-block;
}

.cc-bonus-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--ccl-text-main);
}

.cc-bonus-sub {
    font-size: 13px;
    opacity: 0.8;
    color: var(--ccl-text-sub);
}

.cc-bonus-tnc {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 6px;
    text-decoration: underline;
    cursor: help;
    position: relative;
    display: inline-block;
    color: var(--ccl-text-sub);
}

.cc-tooltip {
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background-color: var(--ccl-tooltip-bg);
    color: var(--ccl-tooltip-text);
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ccl-tooltip-border);
    transition: opacity 0.2s;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    pointer-events: none;
}

.cc-tooltip ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.cc-tooltip p {
    margin: 0 0 8px;
    font-size: 13px;
}

.cc-tooltip p:last-child {
    margin-bottom: 0;
}

.cc-bonus-tnc:hover .cc-tooltip {
    visibility: visible;
    opacity: 1;
}

.cc-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--ccl-tooltip-bg) transparent transparent transparent;
}

/* PAYOUT */
.cc-payout {
    text-align: center;
    font-size: 12px;
}

.cc-meta-label {
    text-transform: uppercase;
    font-size: 11px;
    opacity: 0.7;
    line-height: 1;
    color: var(--ccl-text-sub);
}

.cc-meta-value {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 15px;
    color: var(--ccl-text-main);
}

/* DEPOSIT METHODS */
.cc-deposits {
    font-size: 12px;
}

.cc-deposit-label {
    text-transform: uppercase;
    font-size: 11px;
    line-height: 1;
    opacity: 0.7;
    margin-bottom: 8px;
    color: var(--ccl-text-sub);
}

.cc-deposit-icons {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 6px;
}

.cc-deposit-item {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

.cc-deposit-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 0;
}

.cc-deposit-more {
    background: #eef2ff;
    border: 1px solid #4d5cff;
    color: #4d5cff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* CTA */
.cc-cta {
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
}

.cc-btn {
    background: #4d5cff;
    color: #ffffff !important;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    width: max-content;
}

.cc-review-link {
    font-size: 11px;
    opacity: 0.85;
    color: var(--ccl-text-sub) !important;
    text-decoration: none;
    line-height: 1.3;
}

/* ======================= КНОПКА MORE DETAILS ======================= */

.cc-more-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

.cc-more-btn {
    background: var(--ccl-bg-inner);
    color: var(--ccl-text-sub);
    border: 1px solid var(--ccl-border);
    border-radius: 10px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.cc-more-icon {
    font-size: 10px;
    opacity: 0.9;
}

/* ======================= ПАНЕЛЬ ДЕТАЛЕЙ ======================= */

.cc-details-panel {
    max-width: none;
    margin: 6px auto 24px;
    /* мінімальний відступ зверху */
    padding: 18px;
    background: var(--ccl-details-panel-bg);
    border-radius: 14px;
    display: none;
    gap: 16px;
}

.cc-details-panel.open {
    display: flex;
}

.cc-details-card {
    flex: 1;
    background: var(--ccl-bg-card);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    color: var(--ccl-details-item-text);
}

.cc-details-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--ccl-text-main);
}

.cc-details-list {
    margin: 0 !important;
    padding: 0;
    list-style: none;
}

.cc-details-list li {
    display: flex;
    gap: 8px;
    color: var(--ccl-details-item-text);
    padding: 0 !important;
    line-height: 1.2;
    margin-bottom: 15px;
}

.cc-details-check {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--ccl-checkmark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    min-width: 16px;
    min-height: 16px;
    color: #ffffff;
}

@media (max-width: 1250px) {
    .cc-sticky-btn {
        margin-right: 60px;
    }
}

@media (max-width: 985px) {
    .cc-listing-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .cc-listing-row>div {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    .cc-card {
        flex: 1;
        height: 100%;
        width: 100%;
    }

    /* Reset main row to simple block/flex column context */
    .cc-row {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Use display: contents to unwrap cc-middle children so they sit directly in cc-row flex container */
    .cc-middle {
        display: contents;
    }

    /* 1. Header: Logo + Name */
    .cc-left {
        order: 1;
        width: 100%;
        margin-bottom: 20px;
        min-width: 0;
    }

    .cc-left-inner {
        flex-direction: row;
        align-items: center;
        text-align: left;
        background: transparent;
        padding: 0;
        justify-content: flex-start;
        gap: 15px;
    }

    .cc-logo img {
        width: 60px;
        height: 60px;
        max-width: 60px;
    }

    .cc-name {
        font-size: 16px;
    }

    /* 2. Bonus Content */
    .cc-bonus {
        order: 2;
        margin-bottom: 20px;
        padding: 0 5px;
    }

    .cc-bonus-box {
        background: transparent;
        border: none;
        padding: 0;
    }

    .cc-bonus-main {
        font-size: 18px;
        line-height: 1.4;
    }

    /* 3. CTA Buttons */
    .cc-cta {
        order: 3;
        width: 100%;
        margin-bottom: 25px;
        min-width: 0;
    }

    .cc-btn {
        width: 70%;
        padding: 15px;
        font-size: 16px;
        box-sizing: border-box;
        display: block;
    }

    /* 4. Payout / RTP Stats with horizontal rules */
    .cc-payout {
        order: 4;
        width: 100%;
        display: flex;
        /* Override desktop column/block */
        flex-direction: row !important;
        justify-content: space-around;
        align-items: flex-start;
        padding: 15px 0;
        border-top: 1px solid var(--ccl-border);
        border-bottom: 1px solid var(--ccl-border);
        margin-bottom: 20px;
    }

    .cc-payout-item {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cc-meta-value {
        font-size: 18px;
        /* Larger on mobile as per screen */
        margin-bottom: 0;
    }

    /* 5. Deposit Methods */
    .cc-deposits {
        order: 5;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cc-deposit-icons {
        grid-template-columns: repeat(6, 40px);
        gap: 5px;
    }

    .cc-details-panel {
        flex-direction: column;
    }

    /* Padding adjustments */
    .cc-card {
        padding: 15px;
    }
}

@media (max-width: 665px) {
    .cc-listing-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .cc-card {
        width: 100%;
        max-width: 450px;
    }
}

/* ======================= STICKY FOOTER ======================= */
.cc-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--ccl-bg-sticky);
    border-top: 1px solid var(--ccl-sticky-border-top);
    z-index: 9999;
    padding: 10px 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    /* Lighter shadow for light mode */
    transform: translateY(110%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    visibility: hidden;
    /* Hide initially to prevent interaction */
}

.cc-sticky-footer.visible {
    transform: translateY(0);
    visibility: visible;
}

.cc-sticky-inner {
    width: 100%;
    max-width: 1150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cc-sticky-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cc-sticky-logo img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.cc-sticky-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cc-sticky-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ccl-text-main);
    line-height: 1.2;
}

.cc-sticky-rating-wrap {
    margin-top: 4px;
    font-size: 13px !important;
    color: var(--ccl-text-main);
}

.cc-sticky-rating-wrap .cc-rating-bar {
    width: 80px !important;
    height: 5px !important;
}

.cc-sticky-right {
    display: flex;
    align-items: center;
}

/* Adjust button for sticky */
.cc-sticky-btn {
    padding: 10px 30px;
    font-size: 16px;
    white-space: nowrap;
    width: max-content;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .cc-sticky-footer {
        padding: 8px 12px;
    }

    .cc-sticky-inner {
        gap: 10px;
    }

    .cc-sticky-logo img {
        width: 40px;
        height: 40px;
    }

    .cc-sticky-name {
        font-size: 14px;
    }

    .cc-sticky-rating {
        font-size: 11px;
    }

    .cc-sticky-btn {
        padding: 8px 16px;
        font-size: 13px;
        margin-right: 60px;
    }
}