/* ==========================================================================
   BONUS WIDGET V2 — коричнево-золотой стеклянный виджет
   Загружается после bonus_widget.css и перекрывает старую тяжёлую тему.
   ========================================================================== */

body .bonus-widget {
    --bw-gold: #f1d9a4;
    --bw-gold-bright: #f4dda8;
    --bw-text: #f3ecdf;
    --bw-text-dim: #b7a487;
    border: 1px solid rgba(216, 180, 106, 0.42);
    border-radius: 18px;
    background:
        radial-gradient(420px 190px at 8% 0%, rgba(216, 180, 106, 0.16), transparent 68%),
        linear-gradient(155deg, rgba(69, 46, 29, 0.94), rgba(19, 12, 7, 0.98));
    box-shadow:
        0 22px 55px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 230, 170, 0.08);
    color: var(--bw-text);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    -webkit-backdrop-filter: blur(14px) saturate(1.04);
    backdrop-filter: blur(14px) saturate(1.04);
}

body .bonus-widget::before {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(241, 217, 164, 0.8), transparent);
    opacity: 0.7;
}

body .bonus-widget::after {
    display: none;
}

body .bw-dismiss {
    top: 11px;
    right: 11px;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(216, 180, 106, 0.24);
    background: rgba(10, 6, 4, 0.42);
    color: var(--bw-text-dim);
    font-size: 16px;
    z-index: 6;
}

body .bw-dismiss:hover {
    border-color: rgba(241, 217, 164, 0.7);
    background: rgba(216, 180, 106, 0.14);
    color: var(--bw-gold-bright);
    transform: none;
    box-shadow: none;
}

body .bw-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 12px;
    border-bottom: 0;
}

body .bw-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(216, 180, 106, 0.42);
    border-radius: 12px;
    background:
        radial-gradient(circle at 50% 30%, rgba(216, 180, 106, 0.24), rgba(20, 13, 8, 0.7) 74%);
    font-size: 22px;
    filter: none;
    animation: bwIconPulse 3.4s ease-in-out infinite;
}

body .bw-heading {
    flex: 1;
    min-width: 0;
    padding-right: 26px;
}

body .bw-header h3 {
    margin: 0;
    color: var(--bw-gold);
    font-family: "Philosopher", Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-shadow: none;
}

body .bw-subtitle {
    margin: 4px 0 0;
    padding-left: 0;
    color: var(--bw-text-dim);
    font-size: 11.5px;
    font-style: normal;
    line-height: 1.45;
}

body .bw-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 0 18px 12px;
}

body .bw-perks span {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 4px 8px;
    border: 1px solid rgba(216, 180, 106, 0.16);
    border-radius: 999px;
    background: rgba(216, 180, 106, 0.06);
    color: var(--bw-text-dim);
    font-size: 9px;
    line-height: 1.2;
}

body .bw-perks b {
    color: var(--bw-gold);
    font-size: 10px;
    font-weight: 700;
}

body .bw-code-block {
    margin: 0 16px 12px;
    padding: 9px 10px;
    border: 1px solid rgba(216, 180, 106, 0.22);
    border-radius: 11px;
    background: rgba(9, 5, 3, 0.42);
}

body .bw-code-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
}

body .bw-code-label {
    color: var(--bw-text-dim);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

body .bw-code-value {
    flex: 1;
    min-width: 96px;
    padding: 4px 8px;
    border: 1px dashed rgba(216, 180, 106, 0.28);
    border-radius: 7px;
    background: rgba(216, 180, 106, 0.05);
    color: var(--bw-gold-bright);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

body .bw-code-copy {
    padding: 7px 11px;
    border: 1px solid rgba(216, 180, 106, 0.38);
    border-radius: 8px;
    background: rgba(216, 180, 106, 0.09);
    color: var(--bw-gold);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

body .bw-code-copy:hover {
    border-color: rgba(241, 217, 164, 0.7);
    background: rgba(216, 180, 106, 0.18);
}

body .bw-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    padding: 0 12px 10px;
    list-style: none;
}

body .bw-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 8px 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.015);
    border-bottom: 0;
    transition: background 0.18s ease, border-color 0.18s ease;
}

body .bw-item.bw-item-artifact,
body .bw-item.bw-item-link {
    padding: 8px 7px;
    border-bottom: 0;
}

body .bw-item-artifact__inner,
body .bw-item-link__inner {
    gap: 10px;
    padding: 0;
}

body .bw-item-artifact__img-wrap {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(216, 180, 106, 0.22);
    box-shadow: none;
}

body .bw-item:hover {
    border-color: rgba(216, 180, 106, 0.18);
    background: rgba(216, 180, 106, 0.06);
}

body .bw-item img {
    width: 42px;
    height: 42px;
    padding: 3px;
    border: 1px solid rgba(216, 180, 106, 0.2);
    border-radius: 9px;
    background: rgba(8, 5, 3, 0.5);
    box-shadow: none;
}

body .bw-item:hover img {
    border-color: rgba(216, 180, 106, 0.5);
    box-shadow: none;
    transform: none;
}

body .bw-item-body {
    flex: 1;
    min-width: 0;
}

body .bw-item-body strong {
    display: block;
    overflow: hidden;
    color: var(--bw-text);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .bw-item-body small {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--bw-text-dim);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body .bw-qty {
    min-width: 34px;
    height: 24px;
    padding: 0 8px;
    border: 1px solid rgba(241, 217, 164, 0.5);
    border-radius: 999px;
    background: rgba(216, 180, 106, 0.12);
    color: var(--bw-gold-bright);
    font-size: 10px;
    font-weight: 700;
    box-shadow: none;
}

body .bw-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 54px;
    margin: 4px 14px 14px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 230, 170, 0.56);
    border-radius: 12px;
    background: linear-gradient(180deg, #f4dda8 0%, #ddb56e 52%, #c4944e 100%);
    color: #211508;
    text-decoration: none;
    box-shadow:
        0 8px 20px rgba(160, 110, 50, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body .bw-cta:hover {
    background: linear-gradient(180deg, #f8e6bb 0%, #e7c27e 52%, #cfa05a 100%);
    color: #211508;
    transform: translateY(-1px);
    box-shadow:
        0 12px 26px rgba(160, 110, 50, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body .bw-cta__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

body .bw-cta__text b {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

body .bw-cta__text small {
    color: rgba(33, 21, 8, 0.68);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.25;
}

body .bw-cta__arrow {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
}

body .bonus-widget--big {
    width: 100%;
    max-width: none;
    margin: 0;
}

body .bonus-widget--big .bw-item img {
    width: 48px;
    height: 48px;
}

body .bonus-widget--big .bw-item-body strong {
    font-size: 13px;
}

body .bonus-widget--sticky {
    position: fixed;
    right: 18px;
    bottom: 92px;
    width: 328px;
    max-height: calc(100vh - 130px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 16px;
}

body .bonus-widget--sticky .bw-header {
    padding: 14px 14px 9px;
}

body .bonus-widget--sticky .bw-icon {
    width: 38px;
    height: 38px;
    font-size: 19px;
}

body .bonus-widget--sticky .bw-header h3 {
    font-size: 16px;
}

body .bonus-widget--sticky .bw-subtitle {
    font-size: 10.5px;
}

body .bonus-widget--sticky .bw-perks {
    padding: 0 14px 8px;
}

body .bonus-widget--sticky .bw-items {
    padding: 0 9px 8px;
}

body .bonus-widget--sticky .bw-item {
    padding: 6px 5px;
}

body .bonus-widget--sticky .bw-item img {
    width: 34px;
    height: 34px;
}

body .bonus-widget--sticky .bw-cta {
    min-height: 48px;
    margin: 2px 10px 10px;
    padding: 8px 12px;
}

body .bonus-widget--sticky .bw-cta__text b {
    font-size: 12px;
}

@media (max-width: 1200px) {
    body .bonus-widget--sticky {
        right: 12px;
        bottom: 28px;
        width: 300px;
        max-height: 58vh;
    }
}

@media (max-width: 768px) {
    body .bonus-widget--sticky {
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        max-height: 46vh;
        border-radius: 16px;
    }

    body .bonus-widget--sticky .bw-perks {
        display: none;
    }

    body .bonus-widget--sticky .bw-item:nth-child(n+4) {
        display: none;
    }
}

@media (max-width: 768px) {
    body .bw-mobile-trigger {
        width: 56px;
        height: 56px;
        border: 1px solid rgba(255, 230, 170, 0.7);
        background: linear-gradient(180deg, #f4dda8 0%, #ddb56e 52%, #c4944e 100%);
        color: #211508;
        font-size: 24px;
        box-shadow:
            0 10px 26px rgba(0, 0, 0, 0.4),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }

    body .bw-mobile-trigger::before {
        border-color: rgba(241, 217, 164, 0.5);
    }

    body .bonus-widget--sticky[data-auth-scope="guest"].bw-mobile-open {
        padding: 8px 8px 22px;
        background:
            radial-gradient(520px 240px at 50% 0%, rgba(216, 180, 106, 0.14), transparent 68%),
            linear-gradient(160deg, #24170e 0%, #100a06 100%);
    }

    body .bonus-widget--sticky[data-auth-scope="guest"].bw-mobile-open .bw-header {
        padding-top: 52px;
    }

    body .bonus-widget--sticky[data-auth-scope="guest"].bw-mobile-open .bw-perks {
        display: flex;
    }

    body .bonus-widget--sticky[data-auth-scope="guest"].bw-mobile-open .bw-item:nth-child(n+4) {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .bw-icon {
        animation: none;
    }
}
