:root { --bf-footer-h: clamp(40px, 5vh, 42px); }
.card-error-bf {
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    font-weight: 600;
    color: #ff6b6b;
    padding-top: 0.5vh;
    margin: auto;
    text-align: center;
    display: none;
}

.card-footer.hidden {
    display: none;
}

.card-error-bf.active {
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding-top: 0.5vh;
    margin: auto;
    z-index: 9999 !important;
    position: relative !important;
    min-height: var(--bf-footer-h);
}

@media (hover: hover) and (pointer: fine) {
    .card:hover {
        transform: scale(1.02) translateZ(0);
        z-index: 3;
    }
}

.card:focus-visible {
    outline: 2px solid rgba(255,255,255,.9);
    outline-offset: 2px;
    transform: scale(1.02);
    z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
    }
}
.card {
    font-family: var(--main-font);
    position: relative;
    border-radius: 20px;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;

    transition: transform 150ms ease, box-shadow 150ms ease, z-index 0s;
    will-change: transform;
    transform-origin: center;
}
.card::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: -8px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(90deg, rgba(147, 154, 187, 0.00) 0%, #939ABB 47.5%, rgba(147, 154, 187, 0.00) 97.81%);
    box-shadow: 0 6px 12px rgba(0,0,0,0.35);
    z-index: -1;
}

.card--ultra::after {
    content: "";
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: -8px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(
            90deg,
            rgba(249, 218, 83, 0) 0%,
            rgb(246, 123, 255) 47.5%,
            rgba(249, 218, 83, 0) 97.81%
    );
    box-shadow: 0 6px 12px rgba(249, 218, 83, 0.5);
    z-index: -1;
}

.card-image img {
    image-rendering: smooth;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.card-title {
    font-size: var(--card-title);
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    text-transform: uppercase;
}
.title {
    text-transform: uppercase;
}

.card-description {
    font-size: var(--card-description);
    color: white;
    margin: 0;
    font-weight: 500;
}

.card-footer {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.card-price {
    font-weight: 700;
    color: #ffffff;
}
.card-check {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.card-check.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(100%);
    cursor: not-allowed;
    transform: none !important;
    transition: all 0.2s ease;
}

.card-check:hover:not(.disabled) {
    transform: scale(1.05);
    filter: brightness(1.1);
    cursor: pointer;
}

.scroll-arrow,
.pagination-bf {
    display: none;
}

@media (orientation: landscape) {
    html, body {
        overflow-y: hidden;
        height: 100dvh;
        max-height: 100dvh;
    }
    .scroll {
        overflow-x: visible;
    }

    .scroll-arrow {
        display: none !important;
    }

    .pagination-bf {
        display: none !important;
    }

    .scroll-track {
        display: none !important;
    }
    .scroll-thumb {
        display: none !important;
    }
    .title {
        font-size: clamp(11px, calc(1.7vw + 1vh), 32px);;
    }

    #featurebuy-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;

        align-items: start;
        justify-items: center;
        padding: clamp(1.5%, 2vh, 3%);
        box-sizing: border-box;
        overflow: hidden;
        opacity: 1;
        transition: opacity 0.3s ease;
        z-index: 1000;
        row-gap: clamp(0.8vh, 1.5vh, 2vh);

        display: grid;
        grid-template-rows: auto 1fr auto;
        grid-template-columns: 1fr;
        grid-template-areas:
      "title"
      "scroll"
      "bet";
    }

    .title-container {
        grid-area: title;
        align-self: start;
        justify-self: center;
        flex: 1;
        text-align: center;

        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        /*padding: 0.8rem 0;*/
    }

    .scroll-container {
        grid-area: scroll;
        align-self: start;

        width: 100%;
        max-height: 100%;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        transform-origin: top center;
        max-width: clamp(900px, 95vw, 1200px);
        margin: 0 auto;
    }

    .bet-control-wrapper-bf {
        grid-area: bet;
        align-self: end;
        justify-self: center;

        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }
    .balance-bf {
        position: unset !important;
        margin-top: 0;
        /*margin-bottom: 2vh;*/
        /*font-size: clamp(0.7rem, calc(1.5vw + 0.8vh), 1.1rem) !important;*/
    }
    .bet-control-wrapper-bf {
        position: unset !important;
    }

    #block-wrapper {
        display: flex;
        align-items: stretch;

        max-height: 100%;
        flex-direction: row;
        gap: clamp(1.2vw, 2vw, 30px);
        justify-content: center;
        /*overflow-x: auto;*/
        box-sizing: border-box;
        margin: 0 auto;
        padding-top: clamp(1vh, calc(1vw + 1vh), 2vh);
        scrollbar-width: none;
        scroll-padding-inline: clamp(24px, 5vw, 40px);

        /*overflow-y: hidden;*/
    }

    #block-wrapper::-webkit-scrollbar {
        display: none;
    }

    .card {
        flex: 0 0 clamp(17rem, 30vw, 22rem);
        margin-bottom: clamp(0.3vh, 0.8vh, 1vh);

        scroll-snap-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        border-radius: 20px;
        box-shadow: 0px 1.57514px 1.57514px rgba(0, 0, 0, 0.8);
        box-sizing: border-box;
    }

    .card--ultra {
        max-height: calc(100dvh - clamp(22vh, 27vh, 33vh));
        z-index: 1;
        border-radius: 20px;
        background-color: hsla(240, 15%, 9%, 1);
        background-image: radial-gradient(
                at 88% 40%,
                hsla(240, 15%, 9%, 1) 0px,
                transparent 85%
        ),
        radial-gradient(at 49% 30%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
        radial-gradient(at 14% 26%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
        radial-gradient(at 0% 64%, hsla(263, 93%, 56%, 1) 0px, transparent 85%),
        radial-gradient(at 41% 94%, hsla(284, 100%, 84%, 1) 0px, transparent 85%),
        radial-gradient(at 100% 99%, hsla(306, 100%, 57%, 1) 0px, transparent 85%);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);

        border: 2px solid #b51cfd;
    }
    .card--ultra .card-badge {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 4px 0;
        z-index: 3;
        font-family: var(--main-font);
        text-transform: uppercase;
    }

    .card--regular {
        background-color: hsl(233, 22%, 38%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);

        border: 1px solid hsla(232, 22%, 100%, 0.1);
        border-radius: 20px;
        z-index: 1;
    }

    .card-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5vh;
        text-align: justify;
        justify-content: space-between;
        flex-grow: 1;
        height: auto;
        width: 100%;
    }

    .card-main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.8vh;
        /*justify-content: space-between;*/
        width: 100%;
        height: auto;
        padding-inline: clamp(0.5vw, 1vw, 1.5vw);
    }

    .card-title {
        font-size: clamp(13px, calc(1.2vw + 1vh), 20px);
        text-align: center;
        line-height: 1.1;
        display: flex;
        justify-content: center;
        margin: 0 0 4px clamp(20px, 3vw, 40px);
        padding-right: clamp(20px, 3vw, 40px);
        min-height: clamp(2em, 2.2em, 2.5em);
        align-items: flex-start;
    }

    .card-icon {
        position: absolute;
        top: clamp(8px, 1vh, 10px);
        left: clamp(8px, 1vh, 10px);
        width: clamp(18px, 3.2vw, 40px);
        height: clamp(18px, 3.2vw, 40px);
        transition: transform 0.2s ease, filter 0.2s ease;
        z-index: 5;
    }

    .card-description {
        font-size: clamp(14px, 1.8vw, 18px);
        text-align: justify;
        padding: 0 2%;
        margin-top: 1%;
        line-height: 1.3;
        flex-grow: 1;
        justify-content: center;
        align-items: flex-start;

        display: block;
    }

    .card-image {
        max-height: clamp(10vh, 18vh, 25vh);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
    }

    .card-image img {
        image-rendering: smooth;
        height: clamp(10vh, 15vh, 17vh);
        object-fit: contain;
    }

    .card-footer {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 1vh;
        flex-wrap: nowrap;
        margin-top: auto;
    }

    .card-price {
        font-size: clamp(14px, 2.5vw, 22px);
    }

    .card-check img {
        image-rendering: smooth;
        width: auto;
        height: clamp(2rem, 5vw, 4rem);
    }

    .scroll {
        width: 100%;
        height: auto;
        scrollbar-width: none;
    }


    .scroll::-webkit-scrollbar {
        display: none;
    }

    .scroll-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        z-index: 10;

        width: clamp(20px, 4vw, 32px);
        height: clamp(32px, 6vh, 48px);
        padding: 0;

        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

    .scroll-arrow.left {
        left: 0;
    }

    .scroll-arrow.right {
        right: 0;
    }

    .scroll-arrow.disabled {
        opacity: 0.3;
        pointer-events: none;
    }

    .buy.card .card-image {
        height: clamp(120px, 12vh, 160px);
        position: relative;
        pointer-events: none;
    }

    .buy.card .hidden-img {
        visibility: hidden;
    }

    .buy.card .pulse-img {
        position: absolute;
        top: clamp(25%, calc(50vh - 18%), 45%);
        left: 50%;
        transform: translate(-50%, -50%) scale(1.3);
        z-index: -5;
        object-fit: contain;
        pointer-events: none;
        animation: pulse 4s infinite ease-in-out;
        box-shadow: none !important;
        filter: none !important;
        text-shadow: none !important;
        drop-shadow: none !important;
    }

    @keyframes pulse {
        0%, 100% {
            transform: translate(-50%, -50%) scale(1.3);
        }
        50% {
            transform: translate(-50%, -50%) scale(1.4);
        }
    }
    #featurebuy-overlay .scroll-container {
        transform-origin: top center;
        will-change: transform;
    }
}


:root {
    /*--bet-wrapper-height: 80px;*/
    --grid-base-height: 420px;
}

@media (orientation: landscape) and (max-height: 620px) {
    #featurebuy-overlay {
        grid-template-rows: auto 1fr auto;
    }

    .scroll-container {
        grid-area: scroll;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        width: 100%;
        max-height: calc(100dvh - var(--bet-wrapper-height));
        overflow: hidden;
        transform-origin: top center;
    }

    #block-wrapper {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));

        gap: clamp(1vh, 2vh, 2.5vh) clamp(1vw, 2vw, 2.5vw);
        align-content: start;
        justify-content: center;
        width: 90%;
        height: 100%;
        box-sizing: border-box;
    }

    .card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        border-radius: 16px;
        padding: clamp(6px, 1vw, 12px);
        height: auto;
        max-height: none;
    }
    .card {
        flex: unset !important;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
    }

    .card-description {
        font-size: clamp(0.5rem, calc(1rem + 1vw), 0.8rem);
        line-height: 1.2;
    }

    #featurebuy-overlay .scroll-container {
        transform: scale(0.9) !important;
        transform-origin: top center;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .scroll-container {
        width: 100% !important;
        max-width: 100% !important;
    }

    /*#block-wrapper {*/
    /*    display: grid !important;*/
    /*    grid-template-columns: 1fr 1fr;*/
    /*    gap: clamp(1vw, 2vw, 3vw);*/
    /*    width: 100%;*/
    /*}*/

    .card {
        flex: unset !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
    }
    .card-title {
        min-height: 0;
    }

    #featurebuy-overlay .scroll-container {
        transform: scale(0.9) !important;
        transform-origin: top center;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1400px) {
    #featurebuy-overlay .scroll-container {
        transform: scale(0.8) !important;
        transform-origin: top center;
    }
    .bet-control-wrapper-bf {
        transform: scale(0.7) !important;
        transform-origin: bottom center;
    }
}

@media (orientation: landscape) and (max-height: 300px) {
    .card-title {
        min-height: clamp(1.6em, 1.8em, 2em);
    }
    .buy.card .card-image {
        height: clamp(13vh, 14vh, 15vh);
    }
    #featurebuy-overlay .scroll-container {
        transform: scale(0.70) !important;
        transform-origin: top center;
    }
    .bet-control-wrapper-bf {
        transform: scale(0.65) !important;
        transform-origin: bottom center;
    }
}

@media (orientation: landscape) and (max-height: 200px) {
    #featurebuy-overlay .scroll-container {
        transform: scale(0.5) !important;
        transform-origin: top center;
    }
}

/* ---------------------- PORTRAIT ---------------------- */
@media (orientation: portrait) {
    #featurebuy-overlay {
        padding-top: 3vh;
    }

    #block-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
        justify-content: flex-start;
        padding-top: 15px;
        padding-bottom: 30px;
        max-width: 100%;
    }

    .card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto;
        padding: 10px;
        width: 100%;
        max-width: clamp(280px, 85vw, 360px);
    }

    .card--ultra {
        height: auto;
        max-height: calc(100dvh - clamp(22vh, 27vh, 33vh));
        z-index: 2;
        border-radius: 20px;
        background-color: hsla(240, 15%, 9%, 1);
        background-image: radial-gradient(
                at 88% 40%,
                hsla(240, 15%, 9%, 1) 0px,
                transparent 85%
        ),
        radial-gradient(at 49% 30%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
        radial-gradient(at 14% 26%, hsla(240, 15%, 9%, 1) 0px, transparent 85%),
        radial-gradient(at 0% 64%, hsla(263, 93%, 56%, 1) 0px, transparent 85%),
        radial-gradient(at 41% 94%, hsla(284, 100%, 84%, 1) 0px, transparent 85%),
        radial-gradient(at 100% 99%, hsla(306, 100%, 57%, 1) 0px, transparent 85%);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);

        border: 2px solid #b51cfd;
    }

    .card--regular {
        background-color: hsl(233, 22%, 38%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);

        border: 1px solid hsla(232, 22%, 100%, 0.1);
        height: auto;
        border-radius: 20px;
        z-index: 1;
    }

    .card,
    .card--ultra,
    .card--regular {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto;
        border-radius: 20px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .card-content {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 8px;
        align-items: center;
        flex: 1;
    }

    .card-title {
        margin-bottom: 4px;
        margin-top: 0;
        text-align: left;
        grid-column: 2;
        z-index: 5;
    }

    .card-icon {
        position: absolute;
        transition: transform 0.2s ease, filter 0.2s ease;
        width: clamp(18px, 3.5vh, 40px);
        height: clamp(18px, 3.5vh, 40px);
        z-index: 5;
    }

    .card-image {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: clamp(100px, 20vw, 140px);
        align-self: center;
        box-sizing: border-box;
        position: relative;
        transform: translateY(calc(-18% - ((100% - 300px) / 100 * 0.1)));
    }

    .card-image img {
        image-rendering: smooth;
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }
    .card-main {
        display: flex;
        width: 100%;
        flex-wrap: nowrap;
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        position: relative;
        z-index: 1;
    }

    .card-description {
        text-align: left;
        font-size: clamp(0.9rem, 1.5vw, 1rem);
        height: auto;
        position: relative;
        z-index: 2;
        font-weight: 500;
    }

    .buy.card .hidden-img {
        visibility: hidden;
        width: clamp(100px, 20vw, 140px);
        height: auto;
    }

    .buy.card .pulse-img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: clamp(80px, 16vw, 110px);
        max-width: clamp(80px, 16vw, 110px);
        height: auto;
        pointer-events: none;
        object-fit: contain;
        animation: pulse-portrait 4s infinite ease-in-out;
        z-index: -5;
    }

    @keyframes pulse-portrait {
        0%, 100% {
            transform: scale(1.2);
        }
        50% {
            transform: scale(1.3);
        }
    }

    .card-text {
        margin-bottom: 5%;
        padding-right: 1%;
    }

    .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        flex-wrap: nowrap;
        min-width: 0;
        position: relative;
        z-index: 2;
    }
    .card-price {
        display: block;
        font-size: clamp(0.6rem, calc(2vw + 1.2vh), 1.2rem);
        flex: 0 1 auto;
        max-width: calc(100% - 60px);
        font-weight: 700;
        color: #ffffff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }

    .scroll-container {
        position: relative;
        width: 100%;
        height: calc(100dvh - 30vh);
        overflow: hidden;
        box-sizing: border-box;
        justify-content: center;
        padding-left: 8px;
        padding-right: 0;
    }

    .scroll {
        height: 100%;
        overflow-y: auto;
        box-sizing: content-box;
        padding-right: 10px;
        scrollbar-width: thin;
        scrollbar-color: #ffffff80 transparent;

        mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 92%, rgba(0,0,0,0));
        mask-repeat: no-repeat;
        mask-size: 100% 100%;

        -webkit-mask-image: -webkit-linear-gradient(top, rgba(0,0,0,1) 92%, rgba(0,0,0,0));
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-size: 100% 100%;
    }

    .scroll::-webkit-scrollbar {
        width: 8px;
        right: 0;
    }

    .scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .scroll::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.4);
        transition: background 0.3s ease;
    }

    .scroll::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.6);
    }
}

.popup-box, .popup-text {
    font-family: "Noto Sans", sans-serif !important;
}

.popup-btn.confirm {
    font-family: "Noto Sans", sans-serif !important;
}

.popup-btn.cancel {
    font-family: "Noto Sans", sans-serif !important;
}


/* ---- PORTRAIT Not enough balance ---- */
@media (orientation: portrait) {

    :root { --bf-footer-h: clamp(40px, 5vh, 42px); }

    .card-footer {
        margin-top: auto;
        min-height: var(--bf-footer-h);
        align-items: center;
    }

    .card-footer.hidden { display: none; }
    .card-error-bf { display: none; }

    .card-error-bf.active {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        margin-top: auto;
        min-height: var(--bf-footer-h);
        width: 100%;
        text-align: left;
        color: #ff6b6b;
        z-index: 9999 !important;
        position: relative !important;
    }
}

html, body {
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
    height: 100dvh !important;
}