/* =========================================================
   BOOKMAKER AFFILIATE CTA
   Desktop: left action-bar safe zone.
   Mobile: footer slot.
   Global, all-tournament CTA.
========================================================= */

/* ---------------------------------------------------------
   DESKTOP ACTION BAR SLOT
   Safe zone:
   - left edge lives after burger/nav area
   - right edge stops before centered cockpit controls
   - does not disturb centered RUN controls
--------------------------------------------------------- */

.affiliate-action-slot {
    position: absolute;
    top: 0;
    bottom: 0;

    /*
       Left-side placement.
       Keep this independent from #action-bar ownership.
       If absolute anchoring ever gets weird, put `position: relative`
       on #action-bar in app-shell.css, not here.
    */
    left: clamp(90px, 14vw, 305px);

    /*
       Right safe boundary.
       This is the important part: the slot ends before the centered
       gear/mode/RUN/share cockpit, so it cannot overlay the gear icon.
    */
    right: calc(50% + 155px);

    display: flex;
    align-items: center;
    justify-content: flex-start;

    z-index: 22000;
    pointer-events: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);

    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0.22s ease;
}

.affiliate-action-slot.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/*
   If the safe zone becomes too small, switch to icon-only before mobile.
   At true mobile width, use the footer version instead.
*/
@media (max-width: 768px) {
    .affiliate-action-slot {
        display: none !important;
    }
}

/* ---------------------------------------------------------
   MOBILE / FOOTER SLOT
--------------------------------------------------------- */

.affiliate-footer-slot {
    display: none;
    justify-content: center;
    width: 100%;

    height: 0;
    margin: 0;
    overflow: hidden;

    opacity: 0;
    transform: translateY(6px);

    transition:
        height 0.24s ease,
        margin 0.24s ease,
        opacity 0.22s ease,
        transform 0.22s ease;
}

.affiliate-footer-slot.active {
    height: 40px;
    margin: 10px 0 0 0;
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .affiliate-footer-slot {
        display: flex;
    }
}

/* ---------------------------------------------------------
   SHARED PILL
--------------------------------------------------------- */

.bookmaker-affiliate-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    min-width: 34px;
    max-width: 100%;

    border-radius: 999px;
    border: 1px solid rgba(245, 158, 11, 0.32);
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;

    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;

    cursor: pointer;
    pointer-events: auto;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.bookmaker-affiliate-link:hover {
    text-decoration: none;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.48);
    color: rgba(255, 255, 255, 0.92);
}

.bookmaker-affiliate-link:active {
    transform: scale(0.98);
}

.bookmaker-affiliate-icon,
.bookmaker-affiliate-external {
    flex: 0 0 auto;
    line-height: 1;
}

.bookmaker-affiliate-external {
    font-size: 9px;
    opacity: 0.7;
}

.bookmaker-affiliate-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bookmaker-affiliate-copy-short {
    display: none;
}

.bookmaker-affiliate-disclaimer {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 700;
    opacity: 0.72;
}

/* ---------------------------------------------------------
   DESKTOP ACTION-BAR VERSION
--------------------------------------------------------- */

.bookmaker-affiliate-link-action {
    width: min(100%, 355px);
    height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

/* Wide desktop: full copy */
.bookmaker-affiliate-link-action .bookmaker-affiliate-copy-full {
    display: inline;
}

.bookmaker-affiliate-link-action .bookmaker-affiliate-copy-short {
    display: none;
}

/* Medium desktop: short copy */
@media (max-width: 1500px) {
    .bookmaker-affiliate-link-action .bookmaker-affiliate-copy-full {
        display: none;
    }

    .bookmaker-affiliate-link-action .bookmaker-affiliate-copy-short {
        display: inline;
    }
}

/* Narrow desktop: remove disclaimer before collision risk */
@media (max-width: 1250px) {
    .bookmaker-affiliate-link-action .bookmaker-affiliate-disclaimer {
        display: none;
    }
}

/* Very narrow desktop/tablet: icon-only, like a collapsed pill */
@media (max-width: 1030px) {
    .bookmaker-affiliate-link-action {
        width: 34px;
        max-width: 34px;
        padding: 0;
        gap: 0;
    }

    .bookmaker-affiliate-link-action .bookmaker-affiliate-copy,
    .bookmaker-affiliate-link-action .bookmaker-affiliate-disclaimer,
    .bookmaker-affiliate-link-action .bookmaker-affiliate-external {
        display: none;
    }
}

/* ---------------------------------------------------------
   FOOTER / MOBILE VERSION
--------------------------------------------------------- */

.bookmaker-affiliate-link-footer {
    max-width: min(92vw, 420px);
    min-height: 34px;
    padding: 9px 14px;
    font-size: 12px;
}

/* Footer/mobile: use compact copy */
.bookmaker-affiliate-link-footer .bookmaker-affiliate-copy-full {
    display: none;
}

.bookmaker-affiliate-link-footer .bookmaker-affiliate-copy-short {
    display: inline;
}

/* ---------------------------------------------------------
   MODAL SPECIALS
--------------------------------------------------------- */

.bookmaker-modal-card {
    max-width: 420px;
}

.bookmaker-modal-body {
    text-align: center;
}

.bookmaker-modal-lead {
    margin: 4px 0 18px 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 14px;
    line-height: 1.45;
}

.bookmaker-primary-btn,
.bookmaker-secondary-btn {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.bookmaker-primary-btn {
    background: #fbbf24;
    color: #111827;
}

.bookmaker-primary-btn-wide {
    width: 100%;
    min-height: 42px;
    margin-top: 4px;
    font-size: 13px;
}

.bookmaker-primary-btn:disabled,
.bookmaker-primary-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.62;
}

.bookmaker-secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
}


.bookmaker-legal-note {
    margin: 18px 0 0 0;
    color: rgba(255, 255, 255, 0.44);
    font-size: 10.5px;
    line-height: 1.45;
    text-align: left;
}

.bookmaker-help-details {
    margin-top: 12px;
    text-align: left;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
}

.bookmaker-help-details summary {
    cursor: pointer;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.62);
}

.bookmaker-help-details[open] summary {
    margin-bottom: 8px;
}

.bookmaker-help-links {
    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 10px 12px;
    border-radius: 10px;

    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.bookmaker-help-links a {
    color: #3dd1dc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 520px) {
    .bookmaker-modal-card {
        max-width: calc(100vw - 28px);
    }

    .bookmaker-primary-btn-wide {
        width: 100%;
    }
}