/* =========================================================
   BUY MODAL
   ========================================================= */

.buy-modal {
    position: fixed;
    inset: 0;

    z-index: 2000;

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

    padding: 24px;

    visibility: hidden;
    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.buy-modal.is-open,
.buy-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;

    pointer-events: auto;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.buy-modal__overlay {
    position: absolute;
    inset: 0;

    background: rgba(17, 17, 17, 0.72);
}


/* =========================================================
   WINDOW
   ========================================================= */

.buy-modal__window {
    position: relative;

    z-index: 1;

    display: flex;
    flex-direction: column;

    width: min(100%, 620px);
    max-height: min(760px, calc(100vh - 48px));

    overflow-y: auto;
    overflow-x: hidden;

    background: #f5f4f0;

    border: 2px solid #111111;

    transform: translateY(12px);

    transition: transform 0.22s ease;
}

.buy-modal.is-open .buy-modal__window,
.buy-modal[aria-hidden="false"] .buy-modal__window {
    transform: translateY(0);
}


/* =========================================================
   CLOSE
   ========================================================= */

.buy-modal__close {
    position: absolute;

    top: 14px;
    right: 14px;

    z-index: 5;

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

    width: 38px;
    height: 38px;

    padding: 0;

    border: 1px solid #111111;

    background: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 26px;
    font-weight: 400;
    line-height: 1;

    color: #111111;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.buy-modal__close:hover {
    background: #111111;
    color: #ffffff;
}


/* =========================================================
   HEADER
   ========================================================= */

.buy-modal__header {
    padding: 32px 34px 26px;

    border-bottom: 1px solid #111111;
}

.buy-modal__eyebrow {
    margin-bottom: 8px;

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.14em;
    text-transform: uppercase;

    color: #315cff;
}

.buy-modal__title {
    margin: 0;

    padding-right: 50px;

    font-size: clamp(30px, 5vw, 44px);
    font-weight: 900;
    line-height: 0.92;

    letter-spacing: -0.055em;

    color: #111111;
}


/* =========================================================
   STEPPER
   ========================================================= */

.buy-modal__stepper {
    display: flex;
    align-items: center;

    margin-top: 28px;
}

.buy-modal__step {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-shrink: 0;

    color: #999999;
}

.buy-modal__step.is-active {
    color: #111111;
}

.buy-modal__step-num {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    border: 1px solid #999999;

    font-size: 11px;
    font-weight: 900;

    color: #999999;
}

.buy-modal__step.is-active .buy-modal__step-num {
    border-color: #111111;

    background: #111111;

    color: #ffffff;
}

.buy-modal__step-label {
    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.buy-modal__step-line {
    flex: 1;

    height: 1px;

    margin: 0 12px;

    background: #d2d1cd;
}


/* =========================================================
   STEP CONTENT
   ========================================================= */

.buy-modal__step-content {
    display: none;
    padding: 32px 34px 36px;
}

.buy-modal__step-content.is-active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}


/* =========================================================
   PRODUCT PREVIEW
   ========================================================= */

.buy-modal__product {
    display: grid;

    grid-template-columns: 110px 1fr;

    gap: 18px;
}

.buy-modal__product-image {
    width: 110px;
    height: 110px;

    overflow: hidden;

    background: #e6e5e1;

    border: 1px solid #111111;
}

.buy-modal__product-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.buy-modal__product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: #e5e4e0;

    font-size: 28px;
    font-weight: 900;

    color: #999999;
}

.buy-modal__product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.buy-modal__product-title {
    margin: 0 0 6px;

    font-size: 22px;
    font-weight: 900;
    line-height: 1;

    letter-spacing: -0.04em;

    color: #111111;
}

.buy-modal__product-category {
    margin-bottom: 8px;

    font-size: 9px;
    font-weight: 900;

    letter-spacing: 0.12em;
    text-transform: uppercase;

    color: #315cff;
}

.buy-modal__product-description {
    margin: 0;

    font-size: 13px;
    line-height: 1.45;

    color: #666666;
}


/* =========================================================
   INCLUDES
   ========================================================= */

.buy-modal__includes {
    padding: 14px 16px;
    background: #f7f7f4;
    border: 1px solid #e3e3df;
}

.buy-modal__includes-header {
    margin-bottom: 8px;
}

.buy-modal__includes-title {
    margin: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #777777;
}

.buy-modal__includes-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.buy-modal__includes-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #444444;
}

.buy-modal__includes-list li:last-child {
    margin-bottom: 0;
}

.buy-modal__includes-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.62em;
    width: 5px;
    height: 5px;
    background: #315cff;
    border-radius: 50%;
}


/* =========================================================
   DURATION
   ========================================================= */

.buy-modal__durations {
    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 0;
}

.buy-modal__duration {
    min-height: 48px;

    border: 1px solid #c9c8c4;
    border-right: 0;

    background: #ffffff;

    font: inherit;
    font-size: 11px;
    font-weight: 900;

    color: #555555;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.buy-modal__duration:last-child {
    border-right: 1px solid #c9c8c4;
}

.buy-modal__duration:hover {
    background: #ecebe7;
    color: #111111;
}

.buy-modal__duration.is-active {
    border-color: #111111;
    background: #111111;

    color: #ffffff;
}


/* =========================================================
   FORM
   ========================================================= */

.buy-modal__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.buy-modal__field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.buy-modal__field + .buy-modal__field {
    margin-top: 0;
}

.buy-modal__label {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555555;
}

.buy-modal__input,
.buy-modal__select {
    width: 100%;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 13px;
    border: 1px solid #bdbcb8;
    border-radius: 0;
    background: #ffffff;
    font: inherit;
    font-size: 13px;
    color: #111111;
    outline: none;
}

.buy-modal__input:focus,
.buy-modal__select:focus {
    border-color: #315cff;
}

.buy-modal__hint {
    margin-top: -2px;
    font-size: 10px;
    line-height: 1.4;
    color: #999999;
}


/* =========================================================
   INPUT
   ========================================================= */

.buy-modal__input {
    width: 100%;
    min-height: 48px;

    padding: 0 14px;

    border: 1px solid #aaa9a5;

    outline: none;

    border-radius: 0;

    background: #ffffff;

    font: inherit;
    font-size: 14px;

    color: #111111;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.buy-modal__input::placeholder {
    color: #aaa9a5;
}

.buy-modal__input:hover {
    border-color: #555555;
}

.buy-modal__input:focus {
    border-color: #315cff;

    box-shadow: inset 3px 0 0 #315cff;
}


/* =========================================================
   HINT
   ========================================================= */

.buy-modal__hint {
    font-size: 10px;
    line-height: 1.4;

    color: #999999;
}


/* =========================================================
   PLAYER INFO
   ========================================================= */

.player-info__content {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding: 18px;
    border: 1px solid #d4d3cf;
    background: #f5f4f0;
}

.player-info__avatar {
    width: 72px;
    height: 72px;
    overflow: hidden;
    flex-shrink: 0;
    border: 0;
}

.player-info__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    image-rendering: pixelated;
}

.player-info__details {
    min-width: 0;
}

.player-info__nickname {
    margin: 0;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.035em;
    color: #111111;
}

.player-info__subtitle {
    margin-top: 5px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #999999;
}

.player-info__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 13px;
    font-size: 11px;
    font-weight: 800;
}

.player-info__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #999999;
}

.player-info__status--online {
    color: #111111;
}

.player-info__status--online::before {
    background: #315cff;
}

.player-info__status--offline {
    color: #888888;
}

.player-info__meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px 14px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #d4d3cf;
}

.player-info__meta-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #999999;
}

.player-info__meta-value {
    font-size: 10px;
    font-weight: 700;
    color: #444444;
    text-align: right;
}

@media (max-width: 480px) {
    .player-info__content {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 13px;
        padding: 14px;
    }

    .player-info__avatar {
        width: 58px;
        height: 58px;
    }

    .player-info__nickname {
        font-size: 17px;
    }
}


/* =========================================================
   PROMO
   ========================================================= */

.buy-modal__promo {
    display: grid;

    grid-template-columns: 1fr auto;

    gap: 0;
}

.buy-modal__promo .buy-modal__input {
    border-right: 0;
}

.buy-modal__promo-button {
    min-width: 105px;

    padding: 0 14px;

    border: 1px solid #111111;

    background: #111111;

    font: inherit;
    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.05em;
    text-transform: uppercase;

    color: #ffffff;

    cursor: pointer;

    transition: background 0.15s ease;
}

.buy-modal__promo-button:hover {
    background: #315cff;
}

.buy-modal__promo-message {
    min-height: 16px;

    padding-top: 5px;

    font-size: 11px;
}

.buy-modal__promo-message.is-success {
    font-weight: 700;

    color: #315cff;
}

.buy-modal__promo-message.is-error {
    font-weight: 700;

    color: #d60000;
}


/* =========================================================
   CHECKBOX
   ========================================================= */

.buy-modal__checkbox-label {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    cursor: pointer;
}

.buy-modal__checkbox-label input {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin: 1px 0 0;

    accent-color: #315cff;

    cursor: pointer;
}

.buy-modal__checkbox-text {
    font-size: 11px;
    line-height: 1.5;

    color: #666666;
}

.buy-modal__checkbox-text a {
    color: #111111;

    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.buy-modal__checkbox-text a:hover {
    color: #315cff;
}

.buy-modal__checkbox-error {
    margin-top: 6px;

    font-size: 11px;
    font-weight: 700;

    color: #d60000;
}


/* =========================================================
   SUMMARY
   ========================================================= */

.buy-modal__summary {
    padding: 18px;

    background: #e9e8e4;

    border-top: 1px solid #111111;
    border-bottom: 1px solid #111111;
}

.buy-modal__summary--step2 {
    margin-top: 4px;
}

.buy-modal__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    gap: 20px;

    padding: 6px 0;

    font-size: 12px;

    color: #666666;
}

.buy-modal__summary-row strong {
    color: #111111;
}

.buy-modal__summary-discount {
    color: #315cff;
}

.buy-modal__summary-discount strong {
    color: #315cff;
}

.buy-modal__summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;

    gap: 20px;
}

.buy-modal__summary-total span {
    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    color: #555555;
}

.buy-modal__summary-total strong {
    font-size: 26px;
    font-weight: 900;

    letter-spacing: -0.04em;

    color: #111111;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.buy-modal__buttons {
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
}

.buy-modal__submit {
    min-height: 50px;

    padding: 0 18px;

    border: 1px solid #111111;

    font: inherit;
    font-size: 10px;
    font-weight: 900;

    letter-spacing: 0.08em;
    text-transform: uppercase;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.buy-modal__submit--back {
    background: #ffffff;

    color: #111111;
}

.buy-modal__submit--back:hover {
    background: #111111;
    color: #ffffff;
}

.buy-modal__submit--pay,
.buy-modal__submit--next {
    background: #315cff;
    width: 100%;
    color: #ffffff;
}

.buy-modal__submit--pay:hover,
.buy-modal__submit--next:hover {
    background: #111111;
}

.buy-modal__submit:disabled {
    opacity: 0.45;

    cursor: not-allowed;
}

.buy-modal__submit:focus-visible,
.buy-modal__promo-button:focus-visible,
.buy-modal__close:focus-visible {
    outline: 2px solid #315cff;
    outline-offset: 2px;
}


/* =========================================================
   CURRENCY MODAL SPECIFIC
   ========================================================= */

#currencyBuyModal .buy-modal__summary {
    margin-top: 20px;
}

#currencyBuyModal .buy-modal__step-content {
    padding-top: 30px;
}

.buy-modal__step-content form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* =========================================================
   BODY LOCK
   ========================================================= */

body.buy-modal-open {
    overflow: hidden;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

.buy-modal__window {
    scrollbar-width: thin;
    scrollbar-color: #111111 transparent;
}

.buy-modal__window::-webkit-scrollbar {
    width: 6px;
}

.buy-modal__window::-webkit-scrollbar-track {
    background: transparent;
}

.buy-modal__window::-webkit-scrollbar-thumb {
    background: #111111;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 700px) {
    .buy-modal {
        align-items: flex-end;

        padding: 0;
    }

    .buy-modal__window {
        width: 100%;
        max-height: 94vh;

        border-width: 2px 0 0;

        box-shadow: none;

        transform: translateY(100%);
    }

    .buy-modal.is-open .buy-modal__window,
    .buy-modal[aria-hidden="false"] .buy-modal__window {
        transform: translateY(0);
    }

    .buy-modal__header {
        padding: 26px 22px 22px;
    }

    .buy-modal__step-content {
        padding: 24px 22px 28px;
    }

    .buy-modal__product {
        grid-template-columns: 82px 1fr;

        gap: 14px;
    }

    .buy-modal__product-image {
        width: 82px;
        height: 82px;
    }

    .buy-modal__product-title {
        font-size: 19px;
    }
}

@media (max-width: 480px) {
    .buy-modal__close {
        top: 10px;
        right: 10px;

        width: 34px;
        height: 34px;

        font-size: 23px;
    }

    .buy-modal__header {
        padding: 22px 18px 20px;
    }

    .buy-modal__step-content {
        padding: 20px 18px 24px;
    }

    .buy-modal__title {
        font-size: 32px;
    }

    .buy-modal__step-label {
        display: none;
    }

    .buy-modal__product {
        grid-template-columns: 72px 1fr;
    }

    .buy-modal__product-image {
        width: 72px;
        height: 72px;
    }

    .buy-modal__durations {
        grid-template-columns: 1fr;
    }

    .buy-modal__duration {
        border-right: 1px solid #c9c8c4;
        border-bottom: 0;
    }

    .buy-modal__duration:last-child {
        border-bottom: 1px solid #c9c8c4;
    }

    .buy-modal__promo {
        grid-template-columns: 1fr;
    }

    .buy-modal__promo .buy-modal__input {
        border-right: 1px solid #aaa9a5;
    }

    .buy-modal__promo-button {
        min-height: 44px;
    }

    .buy-modal__summary-total strong {
        font-size: 22px;
    }
}