@import url('https://fonts.googleapis.com/css2?family=Lora:wght@700&display=swap&subset=cyrillic');
@supports (height: 100dvh) {
    html, body,
    #feature-preview-screen,
    #fps-wrapper {
        height: 100dvh !important;
        max-height: 100dvh !important;
    }
    .start-button{
        padding-bottom: clamp(1vh, env(safe-area-inset-bottom, 2vh), 3vh);
        /*bottom: max(env(safe-area-inset-bottom, 0px), clamp(14px, 2.6svh, 36px));*/
    }
}
html, body {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

#feature-preview-screen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transition: opacity 1.2s ease, transform 1.2s ease;
}

.background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}

.landscape-bg {
    display: block;
    z-index: -1;
}
.portrait-bg {
    display: none;
}

/* region ── Landscape Staff Overlays ── */

.staff-overlay {
    position: absolute;
    top: 0;
    height: 100%;
    width: auto;
    z-index: 4;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-overlay-left {
    left: 33.333vw;
    transform: translateX(-50%);
}

.staff-overlay-right {
    left: 67vw;
    transform: translateX(-50%);
}

.staff-stack {
    position: relative;
    height: 100%;
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.15);
    transform-origin: center center;
}

.staff-image {
    height: 100%;
    width: auto;
    max-height: 100vh;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

@media (orientation: portrait) {
    .staff-overlay {
        display: none;
    }
}

/* endregion ── Landscape Staff Overlays ── */


/* region ── Landscape Gears ── */

.staff-gear {
    position: absolute;
    height: auto;
    pointer-events: none;
    animation: gearSpin 6s linear infinite;
    z-index: 0;
}

.gear-bottom-right {
    top: 53%;
    left: 40%;
    width: 70%;
    transform-origin: center center;
}

.gear-top-left {
    top: 49%;
    left: -20%;
    width: 70%;
    transform-origin: center center;
    animation-direction: reverse;
}

.gear-right-bottom {
    top: 43%;
    left: -25%;
    width: 80%;
    transform-origin: center center;
}

.gear-right-top {
    top: 46%;
    left: 45%;
    width: 80%;
    transform-origin: center center;
    animation-direction: reverse;
}

@keyframes gearSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (orientation: portrait) {
    .staff-gear {
        display: none;
    }
}

/* endregion ── Landscape Gears ── */


/* region ── Portrait Staff Overlays ── */

.staff-overlay-pt {
    position: absolute;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 4;
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
}

.staff-overlay-pt-top {
    top: 33%;
    transform: translateY(-50%);
}

.staff-overlay-pt-bottom {
    top: 67%;
    transform: translateY(-50%);
}

.staff-stack-pt {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.3);
    transform-origin: center center;
}

.staff-image-pt {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

@media (orientation: portrait) {
    .staff-overlay-pt {
        display: flex;
    }
}

@media (orientation: landscape) {
    .staff-overlay-pt {
        display: none;
    }
}

/* endregion ── Portrait Staff Overlays ── */


/* region ── Portrait Gears ── */

.staff-gear-pt {
    position: absolute;
    height: auto;
    pointer-events: none;
    animation: gearSpin 6s linear infinite;
    z-index: 0;
}

.gear-pt-top-right {
    top: -10%;
    right: 17%;
    left: auto;
    height: clamp(20px, 7vw, 50px);
    width: auto;
    transform-origin: center center;
}

.gear-pt-top-left {
    bottom: -10%;
    left: 72%;
    top: auto;
    height: clamp(20px, 6vw, 50px);
    width: auto;
    transform-origin: center center;
    animation-direction: reverse;
}

.gear-pt-bottom-right {
    bottom: -23%;
    left: 20%;
    top: auto;
    height: clamp(18px, 8vw, 45px);
    width: auto;
    transform-origin: center center;
}

.gear-pt-bottom-left {
    top: -25%;
    right: 69%;
    left: auto;
    height: clamp(22px, 6vw, 55px);
    width: auto;
    transform-origin: center center;
    animation-direction: reverse;
}

@media (orientation: landscape) {
    .staff-gear-pt {
        display: none;
    }
}

/* endregion ── Portrait Gears ── */


/*  region ── Lightning (JS-driven) ── */

.staff-lightning {
    position: absolute;
    top: 0;
    left: 50%;
    width: 40px;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

@media (orientation: portrait) {
    .staff-lightning:not(.staff-lightning-pt) {
        display: none;
    }
}

.staff-lightning-pt {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

@media (orientation: portrait) {
    .staff-lightning-pt {
        display: block;
    }
}

@media (orientation: landscape) {
    .staff-lightning-pt {
        display: none;
    }
}

/* endregion ── Lightning ── */

@media (orientation: portrait) {
    .landscape-bg {
        display: none;
    }

    .portrait-bg {
        display: block;
        z-index: -1;
    }
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}

#fps-wrapper {
    display: grid;
    place-items: center;
    grid-template-areas:
            "logo"
            "spacer"
            "descriptions"
            "start-button";

    grid-template-columns: 1fr;

    grid-template-rows:
        minmax(12vh, auto)
        clamp(40vh, 50vh, 60vh)
        auto
        1fr;

    height: 100dvh;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100dvw;
    padding: 5px;
}

/*#fps-wrapper {*/
/*    display: grid;*/
/*    place-items: center;*/
/*    grid-template-areas:*/
/*        "logo"*/
/*        "spacer"*/
/*        "descriptions"*/
/*        "start-button";*/
/*    grid-template-columns: 1fr;*/
/*    grid-template-rows:*/
/*            minmax(8vh, auto)*/
/*            50vh*/
/*            auto*/
/*            1fr;*/
/*    height: 100dvh;*/
/*    justify-content: center;*/
/*    align-items: center;*/
/*    box-sizing: border-box;*/
/*    width: 100%;*/
/*    max-width: 100dvw;*/
/*    padding: 5px;*/
/*}*/

#logo-placeholder        { grid-area: logo; }
#descriptions-container  { grid-area: descriptions; }
#section-button          { grid-area: start-button; }
.spacer                  { grid-area: spacer; }

#descriptions-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
    align-items: start;
    justify-items: center;
    align-self: end;
    padding-bottom: clamp(4px, 0.5vh, 10px);
    box-sizing: border-box;
}

.desc-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.panel-desc {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 28vw;
    margin: 0 auto;
    padding: 0;
    border-radius: 0;
    box-sizing: border-box;
    overflow: visible;
}


.line-stroke,
.line-fill {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Lora', serif;
    font-weight: 900;
    font-size: min(clamp(0.5rem, calc(0.8vw + 0.8vh), 1.3rem), 2.8cqi);
    /*font-size: clamp(0.6rem, calc(1vw + 1vh), 1.3rem);*/
    text-transform: none;
    letter-spacing: 0.07em;
    white-space: nowrap;
    pointer-events: none;
}

.line-stroke {
    z-index: 2;
    color: transparent;
    -webkit-text-stroke: clamp(1px, 0.2vw, 1.5px) #eeed13;
    text-stroke: clamp(1px, 0.2vw, 1.5px) #eeed13;
    -webkit-text-fill-color: transparent;
    filter:
            drop-shadow(0 1px 0px rgba(0, 0, 0, 0.9))
            drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

/* Top layer: gradient fill, no stroke */
.line-fill {
    z-index: 3;
    /* Fallback для браузерів без background-clip */
    color: #eeed13;
    background: linear-gradient(
            to bottom,
            #eeed13 0%,
            #eebb13 60%,
            #ff9100 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    -webkit-text-stroke: 0;
    text-stroke: 0;
    filter: drop-shadow(0 0 2px rgba(255, 228, 38, 0.4));
}

.panel-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 1;
}

.description-text {
    margin-top: clamp(10px, calc(0.5vw + 0.5vh), 30px);
    text-align: center;
    max-width: 28vw;
    line-height: 1.4;
}

.description-text .subtext {
    font-family: Lora, serif;
    /*font-family: 'Cambria', Georgia, serif;*/
    font-weight: 800;
    font-size: clamp(0.6rem, calc(1vw + 1vh), 1.3rem);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #ffde52;
    -webkit-text-stroke: 1px #ffde52;
    text-stroke: 1px #ffde52;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
}

.description-text {
    position: relative;
}

.description-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at center,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.4) 25%,
    rgba(0, 0, 0, 0.15) 50%,
    transparent 70%
    );
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    filter: blur(4px);
}

#logo-placeholder {
    position: absolute;
    grid-area: logo;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    user-select: none;
    margin-bottom: 5vh;
}

.logo-image {
    height: clamp(10vh, 17vh, 20vh);
    display: block;
    opacity: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
    animation: logoFadeIn 1s ease-out 0.5s forwards;
    margin-top: 1vh;
}

#section-button {
    grid-area: start-button;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(1vh, 2vh, 3vh);
    text-align: center;

    align-self: end;
    padding-bottom: clamp(1.5vh, 2vh, 3vh);
}

@keyframes outlinePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.start-fixed-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.loading-bar-wrapper {
    position: absolute;
    width: clamp(20vw, 25vw, 35vw);
    height: clamp(2vh, 2.5vh, 3.5vh);
    /*bottom: 2vh;*/
    background: radial-gradient(circle at center,
    rgba(60, 90, 120, 0.4),
    rgba(10, 30, 60, 0.6));
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.6);
    border: 2px solid #f8f8f8;
}
.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(
            90deg,
            #35ff6b,
            #a3ff3b,
            #ffd700,
            #ff9a16,
            #ff5edb,
            #b23cff,
            #4de8ff,
            #3ca0ff,
            #35ff6b
    );
    background-size: 600% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.3s ease;
    border-radius: 999px;
    box-shadow:
            0 0 28px rgba(53, 255, 107, 0.7),
            0 0 45px rgba(255, 117, 221, 0.6),
            0 0 60px rgba(255, 186, 38, 0.5),
            0 0 85px rgba(77, 232, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes shimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.loading-percent {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--main-font, sans-serif);
    font-size: clamp(0.5rem, calc(1vw + 1vh), 1.1rem);;
    color: white;
    font-weight: bold;
    pointer-events: none;
}

.start-button {
    font-family: Lora, serif;
    /*font-family: 'Cambria', Georgia, serif;*/
    font-weight: 600;
    font-size: clamp(0.5rem, calc(0.8vw + 0.8vh), 1.3rem);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-align: center;
    width: 100%;
    background: linear-gradient(
            to right,
            #baff3b,
            #ffdd00,
            #00ff3f,
            #f86b13,
            #baff3b
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgb(186, 255, 59));

    border: none;
    color: white;
    white-space: nowrap;
    /*padding: 0.6em 1em;*/
    position: static;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.4s ease;
    animation: shimmerMetallic 6s linear infinite;
    white-space: nowrap;
    z-index: 5;
}

@keyframes shimmerMetallic {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}


@keyframes shimmerMetallic {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.start-button.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

@keyframes logoFadeIn {
    0% { opacity: 0; transform: translateY(-20px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}

@media (max-height: 500px) and (max-width: 1400px) and (orientation: landscape) {
    .start-button {
        font-size: clamp(0.7rem, 1vw + 0.5vh, 1.2rem);
    }
}

@media (orientation: portrait) {
    #feature-preview-screen {
        height: 100dvh;
        min-height: 100svh;
        min-height: 100vh;

        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    html, body {
        overflow-x: hidden;
        min-height: 100vh;
        width: 100vw;
    }

    #fps-wrapper {
        display: grid;
        grid-template-areas:
            "logo"
            "descriptions"
            "start-button";
        grid-template-columns: 1fr;
        grid-template-rows:
            0px
            1fr
            auto;

        height: 100dvh;
        box-sizing: border-box;
        padding-top: 0;
        padding-bottom: env(safe-area-inset-bottom, 2vh);
        width: 100vw;
        overflow: hidden;
    }

    .spacer {
        display: none;
    }

    #descriptions-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1.1fr 0.97fr;
        gap: 0;
        max-width: 100vw;
        width: 100%;
        height: 100%;
        padding: 0;
        align-items: center;
        justify-items: center;
    }

    .desc-column {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        text-align: center;
        width: 100%;
        height: 100%;
        padding-bottom: clamp(1vh, 2vh, 3vh);
        box-sizing: border-box;
    }
    .desc-column {
        position: relative;
        z-index: 5;
    }

    .panel-desc {
        max-width: clamp(55vw, 65vw, 75vw);
        width: 90%;
    }

    .description-text {
        max-width: 80vw;
        margin-top: 0px;
        line-height: calc(1em + 0.5vh);
    }

    .description-text .subtext {
        line-height: calc(1em + 0.5vh);
    }

    .background-layer {
        position: fixed;
        top: env(safe-area-inset-top, 0px);
        left: 0;
        width: 100vw;
        height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow: hidden;
    }

    .background-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center top;
    }

    .staff-overlay-pt {
        position: fixed;
        left: 0;
        width: 100%;
        height: auto;
        z-index: 4;
        pointer-events: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .staff-overlay-pt-top {
        top: calc(env(safe-area-inset-top, 0px) + (100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 0.33);
        transform: translateY(-50%);
    }

    .staff-overlay-pt-bottom {
        top: calc(env(safe-area-inset-top, 0px) + (100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 0.666);
        transform: translateY(-50%);
    }

    #logo-placeholder {
        position: absolute;
        grid-area: logo;
        top: 10vh;
        left: 5vw;
        width: auto;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        margin-bottom: 0;
        z-index: 2;
        pointer-events: none;
        user-select: none;
    }

    .logo-image {
        height: clamp(6vh, 8vh, 10vh);
        width: auto;
        margin-top: 0;
        max-width: 40vw;
    }

    #section-button {
        grid-area: start-button;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: clamp(1vh, 2vh, 3vh);
        text-align: center;

        align-self: end;
        padding-bottom: clamp(2vh, env(safe-area-inset-bottom, 3vh), 5vh);
    }

    .loading-bar-wrapper {
        order: 1;
        width: clamp(40vw, 50vw, 60vw);
        height: clamp(1.6vh, 2vh, 2.5vh);
        background: radial-gradient(circle at center,
        rgba(60, 90, 120, 0.4),
        rgba(10, 30, 60, 0.6));
        border-radius: 999px;
        overflow: hidden;
        box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1),
        0 4px 12px rgba(0, 0, 0, 0.6);
        border: 2px solid #f8f8f8;
        margin: 0;
        bottom: auto;
    }

    .start-button {
        order: 2;
        font-size: clamp(0.5rem, calc(1vw + 1vh), 1.1rem);;
        text-transform: uppercase;
        text-align: center;
        color: #ffed00;
        background-size: 200% auto;
        -webkit-background-clip: text;
        border: none;

        opacity: 0;
        pointer-events: none;
        transform: scale(0.95);
        transition: opacity 0.6s ease, transform 0.4s ease;
        animation: gradientShift 5s linear infinite, pulseZoom 5s ease-in-out infinite;
    }

    .start-button.visible {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }

    #fps-wrapper {
        z-index: 5;
    }

    .staff-overlay-pt {
        z-index: 0;
    }
}

@media (orientation: portrait) and (min-width: 768px) {
    .panel-desc {
        max-width: 50vw;
        width: 50%;
    }

    .description-text {
        max-width: 50vw;
    }
}

@media (orientation: portrait) and (min-width: 1024px) {
    .panel-desc {
        max-width: 40vw;
        width: 40%;
    }

    .description-text {
        max-width: 40vw;
    }
}

#fps-wrapper {
    position: relative;
    z-index: 2;
    isolation: isolate;
}

.background-layer {
    z-index: 0;
}

@media (max-height: 500px) and (orientation: landscape) {
    #fps-wrapper {
        display: grid;
        place-items: center;
        grid-template-areas:
        "logo"
        "spacer"
        "descriptions"
        "start-button";
        grid-template-columns: 1fr;
        grid-template-rows:
            minmax(5vh, auto)
            minmax(0, 0.8fr)
            auto
            auto;
        height: 100dvh;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        max-width: 100dvw;
        padding: 5px;
    }

    .spacer {
        grid-area: spacer;
        min-height: 0;
    }

    #descriptions-container {
        align-self: end;
    }

    #section-button {
        align-self: end;
        padding-bottom: clamp(1vh, 2vh, 3vh);
    }

    #logo-placeholder {
        margin-bottom: 0;
    }

    .logo-image {
        height: clamp(10vh, 13vh, 15vh);
        margin-top: 0;
    }

    .description-text {
        margin-top: 2px;
        text-align: center;
        max-width: 28vw;
        line-height: 1;
        padding: 0;
    }

    .description-text .subtext {
        font-size: clamp(0.7rem, calc(0.7vw + 0.7vh), 1rem);
        line-height: 1.1;
        margin: 0;
        padding: 0;
        letter-spacing: 0.09em;
    }
}

/*.panel-desc {*/
/*    font-size: clamp(0.6rem, calc(1vw + 1vh), 1.3rem);*/
/*}*/

@media (orientation: portrait) {
    .line-stroke,
    .line-fill {
        font-size: min(clamp(0.7rem, calc(1.2vw + 0.8vh), 1.3rem), 3.5cqi);
    }
}
