:root {
    --main-font: 'Noto Sans', sans-serif;
    --info-title-font: clamp(11px, calc(2vw + 2vh), 32px);
    --adaptive-font: clamp(16px, calc(1.5vw + 0.5vh), 26px);
    --info-h2-font: clamp(9px, calc(1.8vw + 1.6vh), 30px);
}

/* region !IMPORTANT for background and button! */
#menu-overlay {
    position: fixed;
    inset: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    background: rgba(1, 2, 16, 0.80);
    padding: 0;
    color: white;
    display: none;
}

#menu-overlay::before{
    content:"";
    position:absolute; inset:0;
    backdrop-filter: blur(20px);           /* blur на окремий шар */
    -webkit-backdrop-filter: blur(20px);
    pointer-events: none;
}
#menu-overlay > .scroll-area {
    position: absolute; inset: 0;
    padding: 3% 5%;
    height: 100dvh;                          /* стабільна висота на iOS */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;       /* інерційний скрол */
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#menu-overlay::before{
    content:"";
    position:absolute;
    inset:0;
    /*background: rgba(1, 2, 16, 0.50);*/
    background: rgb(0 0 0 / 0.001);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}

/* Додатковий шар затемнення (за замовчуванням прозорий) */
#menu-overlay::after{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background: transparent;
    z-index: 0;
}

/* iPhone SE — підсилити затемнення тільки тут */
@media (orientation: portrait) and (max-width: 385px){   /* покриває портрет і ландшафт SE */
    @supports (-webkit-touch-callout: none){        /* iOS-гейт */
        #menu-overlay::after{
            z-index: -100;
            /* Якщо базовий фон #menu-overlay = rgba(...,0.60),
               то щоб отримати ~0.80 загалом, верхній шар має бути ~0.50
               (0.50 + 0.60*(1-0.60) ≈ 0.80) */
            background: rgba(1, 2, 16, 0.50) !important;
        }
    }
}

@media (orientation: landscape) and (max-height: 385px) and (max-width: 667px) and (-webkit-min-device-pixel-ratio: 2){   /* покриває портрет і ландшафт SE */
    @supports (-webkit-touch-callout: none){        /* iOS-гейт */
        #menu-overlay::after{
            z-index: -100;
            /* Якщо базовий фон #menu-overlay = rgba(...,0.60),
               то щоб отримати ~0.80 загалом, верхній шар має бути ~0.50
               (0.50 + 0.60*(1-0.60) ≈ 0.80) */
            background: rgba(1, 2, 16, 0.50) !important;
        }
    }
}

/* iPad / iPad Pro — підсилити затемнення */
@media screen and (orientation: portrait)
and (min-device-width: 768px) and (max-device-width: 1024px)
and (-webkit-min-device-pixel-ratio: 2) {
    @supports (-webkit-touch-callout: none){
        #menu-overlay::after{
            z-index: -100;
            /* 0.50 поверх базових 0.60 дає ~0.80 загалом */
            background: rgba(1, 2, 16, 0.50) !important;
        }
    }
}

@media screen and (orientation: landscape)
and (min-device-width: 1024px) and (max-device-width: 1366px)
and (-webkit-min-device-pixel-ratio: 2) {
    @supports (-webkit-touch-callout: none){
        #menu-overlay::after{
            z-index: -100;
            /* 0.50 поверх базових 0.60 дає ~0.80 загалом */
            background: rgba(1, 2, 16, 0.50) !important;
        }
    }
}
/* endregion */

.menu-button{
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: none; /* фон додаєш тільки .active */
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.menu-button:focus{ outline: none; }

#info p {
    font-family: 'Noto Sans', sans-serif !important;
    font-weight: 400 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* region MENU-UI */
/* INFO ICON */
#info-icon {
    display: none;
}

/*#menu-ui-info-button,*/
/*#menu-ui-info-button-active {*/
/*    display: none;*/
/*}*/

/* Активна кнопка — показати активну іконку */
.menu-button.active #info-icon{
    display: block;
}

/* Неактивна кнопка — показати звичайну іконку */
.menu-button:not(.active) #info-icon {
    display: block;
}

/* SETTINGS ICON */
#setting-icon {
    display: none;
}

/* Активна кнопка — показати активну іконку */
.menu-button.active #setting-icon {
    display: block;
}

/* Неактивна кнопка — показати звичайну іконку */
.menu-button:not(.active) #setting-icon {
    display: block;
}

/* HISTORY ICON */
#history-icon {
    display: none;
}

/* Активна кнопка — показати активну іконку */
.menu-button.active #history-icon {
    display: block;
}

/* Неактивна кнопка — показати звичайну іконку */
.menu-button:not(.active) #history-icon {
    display: block;
}

.icon-wrapper  {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: pointer;
}

/* коли на батьківському елементі є .active */
.menu-button.active .icon-wrapper #info-icon path,
.menu-button.active .icon-wrapper #setting-icon path {
    fill: #fff;
}

#menu-ui-history-button.active #history-icon path[stroke-linecap="round"] {
    stroke: #fff !important;
}

/* 2) Робимо foreignObject повністю білим, але з тим самим alpha-розкладом */
#menu-ui-history-button.active #history-icon foreignObject {
    filter: brightness(0) invert(1);
}



.icon-wrapper svg {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    display: block;
}

#info-up img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (orientation: portrait) {
    #menu-ui {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 40px;
        display: flex;
        background: linear-gradient(to bottom, rgba(1, 2, 16, 0) 0%, #010210 100%);
        justify-content: center;
        gap: 5px;
        margin: 0 auto;
    }

    #menu-ui-container {
        position: relative;
        width: 100%;
        height: 40px;
        border-radius: 0 12px 0 0;
        background: rgba(29, 26, 52);
        box-shadow: 0 -1.5px 1.5px rgba(0, 0, 0, 0.7);
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    .menu-button {
        width: 100%;
        height: 100%;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: background 0.3s ease;
        cursor: pointer;
    }

    .menu-button{ filter: none !important; }

    .menu-button.active {
        filter: none !important;
        background: linear-gradient(to right, rgba(239, 66, 48, 1), rgba(136, 20, 8, 1));
        border-top-right-radius: 12px;
        border-top-left-radius: 12px;
        box-shadow: 0 -1.5px 1.5px rgba(0,0,0,.80);
        /*filter: drop-shadow(1px 0 2px rgba(0, 0, 0, 0.80));*/
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #info-icon.menu-button.active {
        border-top-left-radius: 0;
        cursor: pointer;
    }

    /*#info-icon.menu-button.active {*/
    /*    border-top-left-radius: 0;*/
    /*    cursor: pointer;*/
    /*}*/

    #menu-close-button {
        pointer-events: all !important;
        height: 40px;
        width: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px 12px 0 0;
        background: rgba(57, 61, 86, 1);
        box-shadow: 0 -1.5px 1.5px rgba(0, 0, 0, 0.7);
        cursor: pointer;
        box-sizing: border-box;
    }

    .close-icon {
        height: 55%;
        width: auto;
        display: block;
        filter: drop-shadow(0px 1.59px 1.59px rgba(0, 0, 0, 0.50));
    }

    #up-btn {
        pointer-events: none;
        position: fixed;
        bottom: 46px;
        left: 0;
        right: 0;
        width: 100%;
        height: 40px;
        display: flex;
        justify-content: center;
        gap: 5px;
        margin: 0 auto;
        cursor: pointer;
        z-index: 9999;
    }

    #info-up-empty-container {
        flex: 1;
        width: calc(100% - 90px); /* 100% мінус ширина кнопки закриття */
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    #info-up {
        pointer-events: all !important;
        height: 40px;
        width: clamp(60px, 18vw, 80px);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-sizing: border-box;

        transition: opacity 0.3s ease;
        opacity: 0;
        z-index: auto;
    }
}

@media (orientation: landscape) {
    #menu-ui {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: clamp(40px, 6svh, 80px);
        display: flex;
        background: linear-gradient(to bottom, rgba(1, 2, 16, 0) 0%, #010210 100%);
        justify-content: center;
        gap: 5px;
        margin: 0 auto;
    }

    #menu-ui-container {
        position: relative;
        width: 80%;
        height: clamp(40px, 6vh, 80px);
        border-radius: 16px 16px 0 0;
        background: rgba(29, 26, 52);
        box-shadow: 0px -2.918px 2.918px 0px rgba(0, 0, 0, 0.80);
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    .menu-button {
        width: 100%;
        height: 100%;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        transition: background 0.3s ease;
        /*cursor: pointer;*/
    }

    .menu-button.active {
        filter: none !important;
        background: linear-gradient(to right, rgba(239, 66, 48, 1), rgba(136, 20, 8, 1));
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -1.5px 1.5px rgba(0,0,0,.80);
        /*filter: drop-shadow(1px 0 2px rgba(0, 0, 0, 0.80));*/
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    #menu-ui-info-button.menu-button.active {
        border-radius: 16px 0 16px 0;
        cursor: pointer;
    }

    #menu-ui-history-button.menu-button.active {
        border-radius: 0 16px 0 16px;
        cursor: pointer;
    }

    #menu-close-button {
        pointer-events: all !important;
        height: clamp(40px, 6svh, 80px);
        width: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(57,61,86,1);
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -2.918px 3px 0 rgba(0, 0, 0, 0.80);
        cursor: pointer;
        box-sizing: border-box;
    }

    .close-icon {
        height: 55%;
        width: auto;
        display: block;
        filter: drop-shadow(0px 1.59px 1.59px rgba(0, 0, 0, 0.50));
    }

    #up-btn {
        pointer-events: none;
        position: fixed;
        bottom: calc(clamp(40px, 6dvh, 10dvh) + 1%);
        left: 0;
        right: 0;
        width: 100%;
        height: clamp(40px, 6vh, 60px);
        display: flex;
        justify-content: center;
        gap: 5px;
        margin: 0 auto;
        z-index: 9999;
    }

    #info-up-empty-container {
        position: relative;
        width: 80%;
        height: clamp(40px, 6vh, 60px);
        border-radius: 16px 16px 0 0;
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    #info-up {
        pointer-events: all !important;
        height: clamp(40px, 6vh, 60px);
        width: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-sizing: border-box;

        transition: opacity 0.3s ease;
        opacity: 0;
        z-index: 9999;
    }
}
/* endregion */
/* region INFO-PAGE */
#info-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    overflow-x: hidden;
    box-sizing: border-box;
    /*background: rgba(1, 2, 16, 0.50);*/
    /*backdrop-filter: blur(20px);*/
    padding: 2% 5%;
    color: white;
    display: none;
}

/*body.no-scroll {*/
/*    overflow: hidden;*/
/*}*/

.title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.paytable-title {
    font-family: var(--main-font);
    font-size: var(--info-title-font);
    color: #FFF;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    margin-top: 4%;
    margin-bottom: 0;
}

.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%, #E03B2A 47.5%, rgba(147, 154, 187, 0.00) 97.81%);
    margin-top: 1%;
}

@media (orientation: portrait) {
    .title-underline {
        height: 2px;
    }
}

h2 {
    font-size: var(--info-h2-font);
    color: white;
    font-family: var(--main-font);
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    font-variant: all-small-caps;
}

.h2-container {
    padding-block: clamp(1vh, 4vh, 8vh);
    display: flex;
    align-items: baseline;                 /* базові лінії */
    gap: clamp(8px, 2vw, 24px);
    --tri-size: clamp(0.6em, calc(1dvh + 1dvw), 2em);
}
.h2-container h2 {
    margin: 0;
    line-height: 1;                        /* прибирає зайвий внутрішній лідинг */
}
.triangle {
    block-size: var(--tri-size);
    align-self: baseline;                  /* прив’язка саме до базової лінії */
    transform: translateY(0.06em);         /* тонке вирівнювання вниз */
}
.triangle svg {
    display: block;
    height: 100%;
    width: auto;
}

#info-page #paytable {
    /*display: grid;*/
    grid-template-columns: repeat(auto-fit, 340px);
    gap: 3%;
    padding: 10px;
    justify-content: center;
}

#info-page .symbol {
    width: clamp(120px, calc(10vw + 10vh), 380px);
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

#info-page .special-symbols img {
    width: clamp(66px, calc(12vw + 12vh), 200px);
    height: clamp(66px, calc(12vw + 12vh), 200px);
    height: auto;
    object-fit: contain;
    margin-bottom: clamp(1vh, 2vmin, 3vh);
}

#info-page .high-symbols img {
    width: clamp(15vmin, 18vw, 30vmin);
    height: auto;
    object-fit: contain;
    margin-bottom: clamp(1vh, 2vmin, 3vh);
}

#info-page .low-symbols img {
    width: clamp(45px, calc(12vw + 12vh), 140px);
    height: clamp(45px, calc(12vw + 12vh), 140px);
    height: auto;
    object-fit: contain;
    margin-bottom: clamp(1vh, 2vmin, 3vh);
}

@media (orientation: portrait) {
    #info-page .symbol {
        width: clamp(70vmin, 100vw, 90vmax);
        margin: 0 auto;
        text-align: center;
        align-items: center;
    }
    #info-image3 {
        margin-bottom: 20px;
    }

    #info-page .high-symbols img {
        width: clamp(80px, 40vw, 240px);
        height: clamp(10vmin, 14vh, 25vmin);
    }
}

@media (orientation: portrait) and (max-width: 500px) {
    #info-page .symbol {
        width: clamp(70vw, 90vw, 95vw);
    }
}

#info-page .symbol p {
    font-family: var(--main-font);
    margin: 4px 0;
    text-align: center;
}

p {
    font-weight: 400;
    font-family: var(--main-font);
    font-size: var(--adaptive-font);
    margin: 30px 0;
    text-align: justify;
}

.play-mode {
    display: block;
    text-align: center;
}

.special-symbols {
    display: flex;
    justify-content: center;
    gap: clamp(5%, 15%, 30%);
    flex-wrap: wrap;
    margin-bottom: 40px;
}

@media (orientation: portrait) {
    .high-symbols,
    .low-symbols {
        /*display: grid;*/
        /*grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));*/
        /*gap: 20px;*/
        /*justify-content: center;*/
        /*margin-bottom: 40px;*/
        display: flex;
        justify-content: center;
        column-gap: 20px;
        gap: clamp(5%, 15%, 30%);
        flex-wrap: wrap;
        padding-bottom: 10px;
    }
}

@media (orientation: landscape) {
    .high-symbols,
    .low-symbols {
        display: flex;
        flex-wrap: wrap;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 20px;
        justify-content: center;
        margin-bottom: 40px;
    }
}

.separator {
    display: flex;
    align-items: center;
    width: 100%;
    /*width: clamp(300px, 50vw, 800px);*/
    height: clamp(2px, calc(0.5vw + 0.5vh), 3px);
    margin: 0 auto 0 auto;
    background: linear-gradient(90deg, rgba(147, 154, 187, 0.00) 0%, #939ABB 47.5%, rgba(147, 154, 187, 0.00) 97.81%);
}

@media (orientation: portrait) {
    .separator {
        height: 2px;
    }
}

.feature-container {
    display: flex;
    flex-direction: column;
    padding: 0;
    color: white;
}

@media (orientation: portrait) {
    .feature-content {
        display: flex;
        flex-direction: row;
        text-align: left;
        padding: 0 5% 0 5%;
    }
}

.feature-content {
    display: flex;
    align-items: flex-start;
    gap: 5%;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.feature-preview {
    width: clamp(300px, 50vw, 550px);
    height: clamp(220px, 36vw, 400px);
    object-fit: cover;
    margin-bottom: 10%;
}

.feature-text {
    flex-direction: column;
    flex: 1;
    line-height: 1.6;
    display: flex;
    font-family: var(--main-font);
    font-size: var(--adaptive-font);
    padding: 0;
    margin: 0;
}

.feature-text p {
    margin: 0 0 1em 0; /* або взагалі margin: 0 */
}

/* Адаптив */
@media (max-width: 1000px) {
    .feature-content {
        flex-direction: column;
        align-items: center;
    }
}

.paylines-container {
    margin-bottom: 50px;
}

@media (orientation: landscape) {
    .paylines-content {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 30px;
        justify-items: start;
    }
}

@media (orientation: portrait) {
    .paylines-content {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        justify-items: start;
    }
}

.payline {
    flex: 1;
    display: flex;
    align-items: center;
    font-family: var(--main-font);
    font-size: var(--adaptive-font);
}

.line-box {
    width: clamp(70px, 20vw, 200px);
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-number {
    width: 30px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: right;
}

.payline-info p {
    margin-top: 20px;
}

.rtp-info {
    text-align: center;
}

.highlight {
    color: #DB3928;
    display: block;
    text-align: center;
    margin: 0;
}

.red-bold {
    color: #DB3928;
    font-weight: bold;
}

.info-button-container .button-info {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
    align-items: flex-start;
}

#info p {
    line-height: 1.6;
    margin: 0 0 3% 0;
}

#info {
    margin-bottom: 10%;
}

#btn-info {
    width: clamp(50px, 10vw, 96px);
    height: auto;
    margin-right: 20px;
    flex-shrink: 0;
}

.button-info p {
    flex: 1;
    line-height: 1.6;
    /*margin: 10px;*/
    margin-top: 10px;
}

ul.menu-list-items {
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    list-style-type: disc;
    padding-left: 10%;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--main-font);
    font-size: var(--adaptive-font);
    padding-bottom: 10px;
}

li. list {
    display: flex;
    align-items: center;
}

ul.menu-list-items li {
    margin-bottom: 10px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.info-button-container span {
    font-weight: bold;
    color: #DB3928;
}

/*@media (orientation: portrait), (max-width: 900px) and (min-height: 600px) {*/
/*    #info-up {*/
/*        width: clamp(40px, 8vh, 12vh);*/
/*    }*/
/*}*/
/* endregion */