@font-face{
    font-family: "GemunuLibre";
    src: local("GemunuLibre"),
        url("../assets/main/fonts/GemunuLibre-ExtraBold.woff2") format("woff2");
    font-style: normal;
    font-display: swap;
}

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

:root {
    --main-font: 'Noto Sans', sans-serif;
}

.card {
    font-family: var(--main-font);
    position: relative;
    border-radius: 20px;
    padding: 16px;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 1;
    box-shadow: 3px 3px 8px 0 rgb(255 0 0 / 0%) inset, 0 3px 3px 0 rgb(0 0 0 / 64%);
}
.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: -10px;
    height: 13px;
    border-radius: 50%;
    background: linear-gradient(
            90deg,
            rgba(255, 183, 0, 0) 0%,
            rgba(255, 183, 0, 0.66) 32%,
            rgba(255, 255, 255, 0.82) 51%,
            rgba(255, 183, 0, 0.66) 71%,
            rgba(255, 183, 0, 0) 100%
    );
    /*box-shadow: 0 6px 12px rgba(119, 139, 253, 0.5);*/
    z-index: -3;
}

@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-image img {
    image-rendering: smooth;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.card-title {
    font-family: 'GemunuLibre', sans-serif;
    font-size: clamp(16px, 1.2dvw + 1.4dvh, 20px);
    font-weight: 800;
    margin: 0 0 4px 0;
    text-transform: uppercase;
    background: linear-gradient(to right, #F9D15D, #FFA008, #F9D15D);
    background-size: 300% 100%;
    background-position: 0% 50%;
    background-repeat: no-repeat;

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    display: inline-block;
    animation: gradientShift 5s linear infinite;
}
@keyframes gradientShift {
    0%   { background-position:   0% 50%; }
    100% { background-position: 100% 50%; }
}

.card-description {
    font-family: var(--main-font);
    text-align: left;
    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-family: var(--main-font);
    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;
    }

    #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: clamp(1vh, 2vh, 2.5vh) 0;
        padding-top: clamp(2vh, 4vh, 6vh);
        scrollbar-width: none;
        scroll-padding-inline: clamp(24px, 5vw, 40px);

        overflow-y: hidden;
    }

    .card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto;
        padding: 10px;
        width: 100%;
        max-width: clamp(280px, 50vw, 380px);
        position: relative;
        z-index: 0;
    }

    .card--ultra {
        height: auto;
        max-height: calc(100dvh - clamp(22vh, 27vh, 33vh));
        z-index: 2;
        border-radius: 16px;

        /*ТУТ МІНЯТИ КОЛІР*/
        border: 1px solid #80F;
        background: linear-gradient(180deg, #970C82 2.88%, #530237 33.17%, #35001C 66.12%, #470124 96.15%);
        box-shadow: 2px 2px 6px 0 rgba(217, 0, 255, 0.66) inset, 0 2px 2px 0 rgba(0, 0, 0, 0.80);
    }

    /* REGULAR CARD */
    .card--regular {
        background-color: #4C5278;
        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: 16px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .card-content {
        display: grid;
        /*height: 100%;*/
        height: auto;
        grid-template-columns: auto 1fr;
        gap: 1px;
        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;
        top: 10px;
        left: 10px;
        transition: transform 0.2s ease, filter 0.2s ease;
        height: auto;
        z-index: 5;
    }

    .card-icon img {
        image-rendering: smooth;
        width: 100%;
        height: clamp(30px, 3.2vh, 35px)
    }

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

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

    .card-description {
        text-align: start;
        font-size: clamp(0.8rem, 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: 100%;
        max-width: 100%;
        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.3);
        }
        50% {
            transform: scale(1.35);
        }
    }

    .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.5rem);
        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 - 30dvh);
        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);
    }

    @keyframes pulse {
        0%, 100% {
            transform: translate(-50%, -50%) scale(1.3);
        }
        50% {
            transform: translate(-50%, -50%) scale(1.4);
        }
    }
    .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: 8vh;
        font-size: clamp(0.7rem, calc(1.5vw + 0.8vh), 1.1rem) !important;
    }
    .bet-control-wrapper-bf {
        position: unset !important;
    }
}

@media (orientation: landscape) and (max-height: 390px) {
    #block-wrapper {
        transform: scale(0.8);
    }
}

@media (max-width: 720px) and (orientation: landscape) {
    #block-wrapper {
        transform: scale(0.8);
    }
}

/*@media screen and (max-height: 280px) and (orientation: landscape) {*/
/*    .card {*/
/*        padding: 8px;*/
/*        max-height: 100dvh;*/
/*    }*/

/*    .card-image {*/
/*        display: none;*/
/*    }*/

/*    .buy.card .pulse-img {*/
/*        display: none;*/
/*    }*/

/*    .card-description {*/
/*        display: -webkit-box;*/
/*        -webkit-box-orient: vertical;*/
/*        -webkit-line-clamp: 2;*/
/*        overflow: scroll;*/
/*        text-overflow: ellipsis;*/
/*        line-height: 1.2;*/
/*        height: calc(1.3em * 2);*/
/*    }*/

/*    .card-footer {*/
/*        align-items: end;*/
/*    }*/
/*}*/

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

@media (orientation: landscape) and (max-height: 390px) {
    #block-wrapper {
        transform: scale(0.75);
    }
    .title-container {
        transform: scale(0.9);
    }
    #buy-close {
        transform: scale(0.9);
    }
}

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

@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 {
        height: auto;
        max-height: calc(100dvh - clamp(22vh, 27vh, 33vh));
        z-index: 2;
        border-radius: 20px;

        /*ТУТ МІНЯТИ КОЛІР*/
        border: 1px solid #80F;
        background: linear-gradient(180deg, #970C82 2.88%, #530237 33.17%, #35001C 66.12%, #470124 96.15%);
        box-shadow: 2px 2px 6px 0 rgba(217, 0, 255, 0.66) inset, 0 2px 2px 0 rgba(0, 0, 0, 0.80);
        /*background: radial-gradient(circle at top center, #4C5ED2 0%, #1F224A 100%);*/
        /*border: 2px solid #47aef2;*/
        /*box-shadow: 0 0 6px rgba(119, 139, 253, 0.6), 0 0 12px rgba(119, 139, 253, 0.4);*/
    }

    /* REGULAR CARD */
    .card--regular {
        background-color: #4C5278;
        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;
        height: 100%;
        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;
        top: 10px;
        left: 10px;
        transition: transform 0.2s ease, filter 0.2s ease;
        height: auto;
        z-index: 5;
    }

    .card-icon img {
        image-rendering: smooth;
        width: 100%;
        height: clamp(30px, 3.2vh, 35px)
    }

    .card-image {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: clamp(110px, 20vw, 150px);
        align-self: center;
        box-sizing: border-box;
        position: relative;
        transform: translateY(calc(-26% - ((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(110px, 20vw, 150px);
        height: auto;
    }

    .buy.card .pulse-img {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: auto;
        width: 100%;
        max-width: 100%;
        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: absolute;
        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 - 30dvh);
        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);
    }
}

/* region BUTTON "CONFIRM" */
.confirm-btn {
    --w: 76px;
    --h: 40px;

    width: var(--w);
    height: var(--h);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    border: 1.5px solid #fff;
    background:
            radial-gradient(50% 50% at 50% 50%,
            #35F866 32%, #41497D 100%);

    box-shadow:
            inset 0 2px 8px -2px rgba(255, 255, 255, .95),
            inset 0 -2px 8px -2px rgba(0, 0, 0, .65),
            0 2px 2px rgba(0, 0, 0, .5);

    padding: 0;
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;

    position: relative;

    --icon-w: 42%;
}

.confirm-btn .tick-svg {
    width: var(--icon-w);
    height: auto;
    display: block;
    pointer-events: none;
}
/* endregion */

/* region Footer for Android */
@media (orientation: landscape) {
    .card-content { min-height: 0; }
    .card-main {
        display: grid;
        grid-template-rows: 1fr auto;
        min-height: 0;            /* критично для Android */
        align-self: stretch;
    }
    .card-text {
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
    }
    .card-footer {
        width: auto;
        min-height: var(--bf-footer-h);
        gap: 8px;
    }
    .card-price {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .card-check {
        flex: 0 0 auto;
    }
}
/* endregion */

@media (orientation: portrait) {
    .card {
        --card-pad-x: 10px;
        --card-pad-y: 10px;
    }

    .card-main {
        position: static;
        padding-bottom: calc(var(--bf-footer-h) + var(--card-pad-y));
    }

    .card-footer{
        left: var(--card-pad-x);
        right: var(--card-pad-x);
        bottom: var(--card-pad-y);
        width: auto;
        margin: 0;

        display: flex;
        align-items: center;
        justify-content: space-between;
        z-index: 3;
    }

    .card-price{
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .card-check, .confirm-btn{ flex: 0 0 auto; }
}

/* region iPad Safari hard-fix */
@media (orientation: portrait) {
    @supports (-webkit-touch-callout: none) {
        .card-content{
            --icon-col: clamp(110px, 22vw, 160px);
            display: grid;
            grid-template-columns: var(--icon-col) 1fr;
            grid-template-rows: auto 1fr auto;
            column-gap: 12px;
            align-items: stretch;
            min-height: 0;
        }
        .card-image{
            grid-column: 1;
            grid-row: 1 / -1;
            width: var(--icon-col);
            align-self: center;
            justify-self: start;
            transform: none;
        }
        .card-main{ display: contents; }
        .card-title{
            grid-column: 2;
            grid-row: 1;
            margin: 0;
            text-align: left;
            min-width: 0;
        }
        .card-description{
            grid-column: 2;
            grid-row: 2;
            min-height: 0;
            min-width: 0;
            overflow: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .card-footer{
            grid-column: 2;
            grid-row: 3;
            align-self: end;
            margin: 0;
            min-width: 0;
        }
        .card-text{
            min-height: 0;
            overflow: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .card-footer{
            display: contents;
            position: static;
            margin: 0;
            min-width: 0;
        }
        .card-price {
            grid-column: 1;
            grid-row: 3;
            align-self: end;
            justify-self: start;
            position: static;
        }
        .card-check {
            grid-column: 2;
            grid-row: 3;
            align-self: end;
            justify-self: end;
            position: static;
            display: inline-flex;
        }
        .card-description{ padding-bottom: 6px; }
    }
}
/* endregion */