: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;
    }
}

.title-underline {
    width: clamp(300px, 50vw, 800px);
    height: clamp(2px, calc(0.5vw + 0.5vh), 3px);
    background: linear-gradient(90deg, rgba(147, 154, 187, 0.00) 0%, #e81cff 47.5%, rgba(147, 154, 187, 0.00) 97.81%);
    margin-top: 1%;
}
.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: 13px;
    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: 13px;
    border-radius: 50%;
    background: linear-gradient(
            90deg,
            rgba(119, 139, 253, 0) 0%,
            rgb(71, 174, 242) 47.5%,
            rgba(119, 139, 253, 0) 97.81%
    );
    box-shadow: 0 6px 12px rgba(119, 139, 253, 0.5);
    z-index: -3;
}

.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;
}

.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-size: clamp(20px, 2vw, 22px);
    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;
    }

    #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;*/
    }

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

        max-height: 100%;
        flex-direction: row;
        gap: clamp(1.2vw, 2vw, 30px);
        justify-content: center;
        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);
    }

    #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: stretch;
        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 {
        position: relative;
        z-index: 2;
        overflow: hidden;
        border-radius: 20px;

        background:
                linear-gradient(#18183b, #0d0d1f) padding-box,
                linear-gradient(145deg, transparent 35%, #e81cff, #40c9ff) border-box;
        border: 2px solid transparent;
    }

    .card--ultra::before {
        content: "";
        position: absolute;
        width: 120%;
        height: 20%;
        top: 30%;
        left: -10%;
        background: linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
        animation: keyframes-floating-light 2.5s infinite ease-in-out;
        filter: blur(20px);
        pointer-events: none;
        z-index: 1;
    }

    @keyframes keyframes-floating-light {
        0% {
            transform: rotate(-5deg) translateY(-5%);
            opacity: 0.5;
        }
        50% {
            transform: rotate(5deg) translateY(5%);
            opacity: 1;
        }
        100% {
            transform: rotate(-5deg) translateY(-5%);
            opacity: 0.5;
        }
    }

    .card--ultra {
        position: relative;
        overflow: hidden;
        border-radius: 20px;
        z-index: 1;
    }

    .card-hex-grid {
        position: absolute;
        z-index: 0;
        opacity: 0.6;
        pointer-events: none;
        mix-blend-mode: screen;
    }

    .card-hex-grid svg {
        width: 100%;
        height: auto;
        display: block;
    }

    .card-hex-grid.top-right {
        top: -30px;
        right: -20px;
        transform: scale(1.3);
    }

    .card-hex-grid.bottom-left {
        bottom: -5px;
        left: -30px;
        transform: scale(1.3);
    }

    .card--regular {
        position: relative;
        z-index: 2;
        overflow: hidden;
        border-radius: 20px;

        background:
                linear-gradient(#171735, #28284a) padding-box,
                linear-gradient(145deg, transparent 35%, #5d668f, #8f99ca) border-box;
        border: 2px solid transparent;
    }

    .card--regular::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0%;
        background: radial-gradient(
                circle at center,
                #8590c1 0%,
                #5d668f 60%,
                #2d314d 100%
        );
        filter: blur(16px);
        pointer-events: none;
        z-index: 1;
        opacity: 0.25;
    }

    .card-content, .card-main, .card-image, .card-footer {
        position: relative;
        z-index: 3;
    }

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

    .card-main {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 100%;
        height: 100%;
        padding-inline: clamp(0.5vw, 1vw, 1.5vw);
        min-height: 0;
    }

    .card-title {
        font-size: clamp(13px, 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(18px, 2.5vw, 32px);
        min-height: clamp(2em, 2.2em, 2.5em);
        align-items: flex-start;
    }

    .card-text {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

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

    .card-image {
        max-height: clamp(10vh, 20vh, 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: 0.5vh;
        flex-wrap: nowrap;
        /*margin-top: 1%;*/
        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::-webkit-scrollbar {
        display: none;
    }

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

    /* BOOST CARD - VISIBLE IMAGE */
    .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);
        }
    }
}

@media screen and (min-width: 1200px) {
    .card-hex-grid.top-right,
    .card-hex-grid.bottom-left {
        transform: scale(1.6);
    }
}

: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-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
        margin-top: auto;
    }

    .card-price {
        flex: 1;
        font-weight: 700;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
    /*.card-description {*/
    /*    line-height: 1.2;*/
    /*    margin-top: 3%;*/
    /*    text-align: center;*/
    /*}*/

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

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

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

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

    .card-description {
        text-align: center;
    }
    .card-footer {
        padding: 0 2%;
    }
    .card-hex-grid.top-right,
    .card-hex-grid.bottom-left {
        transform: scale(1);
    }
    .card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
        margin-top: auto;
    }

    .card-price {
        flex: 1;
        font-weight: 700;
        color: #fff;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
    }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1400px) {
    .bet-control-wrapper-bf {
        transform: scale(0.7) !important;
        transform-origin: bottom center;
    }
    .card-description {
        text-align: center;
    }
}

@media (orientation: landscape) and (min-width: 450px) and (max-width: 950px) {
    #block-wrapper {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center;
        align-items: stretch;
        overflow-x: auto;
        gap: clamp(1.2vw, 2vw, 30px);
        width: 100%;
        max-width: 95vw;
    }

    .scroll-container {
        transform: scale(0.9);
        transform-origin: top center;
    }

    .bet-control-wrapper-bf {
        transform: scale(0.85);
        transform-origin: bottom center;
    }

    .bet-value-bf { font-size: 18px;}

}

@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;
    }
    .card-description {
        text-align: center;
    }
    .card-hex-grid.top-right,
    .card-hex-grid.bottom-left {
        transform: scale(1);
    }
}

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

/* ---------------------- PORTRAIT ---------------------- */
@media (orientation: portrait) {
    #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);
        position: relative;
        z-index: 0;
    }

    .card--ultra {
        position: relative;
        z-index: 2;
        overflow: hidden;
        border-radius: 20px;

        background:
                linear-gradient(#18183b, #0d0d1f) padding-box,
                linear-gradient(145deg, transparent 35%, #e81cff, #40c9ff) border-box;
        border: 2px solid transparent;
    }

    .card--ultra::before {
        content: "";
        position: absolute;
        width: 120%;
        height: 20%;
        top: 30%;
        left: -10%;
        background: linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
        animation: keyframes-floating-light 2.5s infinite ease-in-out;
        filter: blur(20px);
        pointer-events: none;
        z-index: 0;
    }

    @keyframes keyframes-floating-light {
        0% {
            transform: rotate(-5deg) translateY(-5%);
            opacity: 0.5;
        }
        50% {
            transform: rotate(5deg) translateY(5%);
            opacity: 1;
        }
        100% {
            transform: rotate(-5deg) translateY(-5%);
            opacity: 0.5;
        }
    }

    .card--regular {
        position: relative;
        z-index: 2;
        overflow: hidden;
        border-radius: 20px;

        background:
                linear-gradient(#171735, #28284a) padding-box,
                linear-gradient(145deg, transparent 35%, #5d668f, #8f99ca) border-box;
        border: 2px solid transparent;
    }

    .card--regular::before {
        content: "";
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0%;
        background: radial-gradient(
                circle at center,
                #8590c1 0%,
                #5d668f 60%,
                #2d314d 100%
        );
        filter: blur(16px);
        pointer-events: none;
        z-index: 0;
        opacity: 0.25;
    }

    .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-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 {
        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: 90%;
        max-width: 90%;
        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(1rem, 5vw, 1.6rem);
        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;

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

    .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);
    }
    .card-hex-grid {
        position: absolute;
        z-index: 0;
        opacity: 0.6;
        pointer-events: none;
        mix-blend-mode: screen;
        width: 100%;
        height: auto;
        max-width: none;
    }

    .card-hex-grid svg {
        display: block;
        width: auto;
        height: auto;
        max-width: none;
    }

    .card-hex-grid.top-right {
        top:0;
        right: -200px;
        transform: translate(20%, -20%) scale(1.1);
    }

    .card-hex-grid.bottom-left {
        bottom: 0;
        left: 20px;
        transform: translate(-20%, 20%) scale(1.1);
    }
}

.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;
    }
}
.card-icon {
    position: absolute;
    width: clamp(35px, 3.1vw, 40px);
    height: clamp(35px, 3.1vw, 40px);
    flex-shrink: 0;
    z-index: 5;
}

@media (orientation: landscape) {
    .card-icon {
        top: clamp(8px, 1vh, 10px);
        left: clamp(8px, 1vh, 10px);
    }
}

@media (orientation: portrait) {
    .card-icon {
        top: 10px;
        left: 10px;
    }
}