@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@700;800;900&display=swap');
:root {
    --description-font: 'Exo 2', sans-serif;
    --adaptive-font: clamp(16px, calc(1.5dvw + 0.5dvh), 1.8rem);
}
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;
}

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

.landscape-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
}
.portrait-bg {
    display: none;
}

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

    .portrait-bg {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform-origin: center;
    }
}

#fps-wrapper {
    display: grid;
    place-items: center;
    grid-template-areas:
            "logo logo logo"
            "feature-block1 feature-block2 feature-block3"
            "feature-desc1 feature-desc2 feature-desc3"
            "start-button start-button start-button";
    grid-template-rows: 23dvh 1fr minmax(10dvh, auto) 15dvh;
    grid-template-columns: 26dvw 30dvw 26dvw;
    height: 100%;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    padding: 0 6dvw;
    column-gap: 0.5dvw;
    width: 100%;
    max-width: 100dvw;
}

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

.logo-image {
    height: 20vh;
    display: block;
    opacity: 0;
    margin-bottom: 4vh;
    animation:
            logoFadeIn 1.2s ease-out 0.5s forwards,
            logoShadowPulse 4s ease-in-out infinite 2s;
    filter:
            drop-shadow(0 0 8px rgba(10, 2, 25, 0.5))
            drop-shadow(0 0 16px rgba(10, 2, 25, 0.3));
    transition: transform 0.3s ease;
    will-change: transform, filter;
}

@keyframes logoShadowPulse {
    0%, 100% {
        filter:
                drop-shadow(0 0 8px rgba(10, 2, 25, 0.5))
                drop-shadow(0 0 16px rgba(10, 2, 25, 0.3));
    }
    50% {
        filter:
                drop-shadow(0 0 12px rgba(10, 2, 25, 0.6))
                drop-shadow(0 0 24px rgba(10, 2, 25, 0.4));
    }
}

#sound-toggle {
    position: fixed;
    bottom: clamp(2vh, 2vh, 2vh);
    right: clamp(2vw, 3vw, 4vw);
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
}

#sound-toggle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#feature-block1 {
    grid-area: feature-block1;
}

#feature-block2 {
    grid-area: feature-block2;
}

#feature-block3 {
    grid-area: feature-block3;
}

#feature-desc1 {
    grid-area: feature-desc1;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

#feature-desc2 {
    grid-area: feature-desc2;
    display: flex;
    height: 100%;
    justify-content: flex-start;
    align-items: center;

}

#feature-desc3 {
    grid-area: feature-desc3;
    height: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.stacked-block {
    position: relative;
    display: inline-block;
    width: fit-content;
    height: auto;
}

.layer-base,
.layer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.layer-base {
    z-index: 2;
}

.layer-overlay {
    z-index: 1;
}

.stacked-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    z-index: 1;
}

#section-button {
    position: sticky;
    grid-area: start-button;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 1vh;
    z-index: 10;
}

.feature-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    width: 80%;
    height: auto;
    min-width: unset;
    justify-content: center;
    overflow: visible;
    transform-origin: center;
    max-height: 50vh;
}

.feature-image {
    display: block;
    object-fit: contain;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: auto;
}

#feature-block1,
#feature-block3 {
    height: clamp(30vh, 50vh, 60vh);
    display: flex;
    justify-content: center;
    align-items: center;
}

#feature-block1 .feature-image,
#feature-block3 .feature-image {
    height: 100%;
    width: 100%;
    object-fit: contain;
    display: block;
}

.feature-description {
    position: relative;
    display: inline-block;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    text-transform: uppercase;
    transform: translateY(-3dvh);

    font-size: var(--adaptive-font);
    line-height: 1.2;
    padding:  clamp(0.5dvh, 1dvh, 1.5dvh) 0 1.2dvh;
    margin: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    font-family: var(--description-font);
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    flex-wrap: wrap;
    z-index: 11;
}

.feature-description .stroke-text {
    position: relative;
    color: transparent;
    padding-bottom: 0.1em;
    -webkit-text-stroke: 3.5px #250066;
    text-shadow:
            0 2.5px 0 #16003a,
            0 0 3px #250066,
            0 0 4px #350063,
            0 0 7px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.feature-description .fill-text {
    background: linear-gradient(to top, #cf00b3, #ffbefc, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: absolute;
    z-index: 2;
}
.fill-text span {
    display: inline-block;
    background: linear-gradient(to top, #cf00b3, #ffbefc, #ffffff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

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

.start-gradient-background {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to top, rgba(18, 16, 48, 0.85), rgba(18, 16, 48, 0.0));
    z-index: 1;
    pointer-events: none;
}

.loading-bar-wrapper {
    position: absolute;
    width: clamp(20vw, 25vw, 35vw);
    height: clamp(2vh, 2.5vh, 3.5vh);
    margin-top: clamp(5vh, 7vh, 10vh);
    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,
            #6e00b5,
            #ff00d4,
            #00cfff,
            #ff00d4,
            #6e00b5
    );
    background-size: 300% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.3s ease;
    border-radius: 999px;

    box-shadow:
            0 0 10px rgba(110, 0, 181, 0.6),
            0 0 20px rgba(255, 0, 212, 0.5),
            0 0 30px rgba(0, 207, 255, 0.4);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.loading-percent {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--main-font);
    font-size: clamp(12px, 2vw, 16px);
    color: white;
    font-weight: bold;
    pointer-events: none;
}

.start-button {
    width: clamp(40vw, 50vw, 60vw);
    font-size: 1.4rem;
    text-transform: uppercase;
    padding: clamp(1.2vh, 2vh, 3vh) clamp(3vw, 5vw, 6vw);
    margin-top: clamp(3vh, 4vh, 5vh);
    text-align: center;
    font-family: var(--description-font);
    font-weight: 700;

    letter-spacing: 0.05em;
    background-size: 200% auto;
    background: linear-gradient(to right, rgb(255, 193, 13), #ffe53c, #ffc10d);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: white;
    border: none;

    transform: scale(0.95);
    opacity: 0;
    pointer-events: none;

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

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

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

@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 (orientation: portrait) {
    #feature-preview-screen {
        height: auto;
        min-height: 100svh;
        overflow-y: hidden;
        padding-bottom: env(safe-area-inset-bottom, 2dvh);
        padding-top: env(safe-area-inset-top, 2dvh);
    }

    #fps-wrapper {
        display: grid;
        grid-template-areas:
      "logo"
      "feature-block1"
      "feature-desc1"
      "feature-block2"
      "feature-desc2"
      "feature-block3"
      "feature-desc3"
      "start-button";
        grid-template-columns: 1fr;
        grid-template-rows:
    minmax(4dvh, auto)       /* logo */
    minmax(10dvh, auto)      /* feature 1 */
    minmax(1dvh, auto)     /* desc 1 */
    minmax(10dvh, auto)      /* feature 2 */
    minmax(1dvh, auto)     /* desc 2 */
    minmax(10dvh, auto)      /* feature 3 */
    minmax(1dvh, auto)     /* desc 3 */
    minmax(4dvh, auto);      /* button */

        width: 100dvw;
        height: 100%;
        box-sizing: border-box;
        padding: 0 5dvw;
        gap: 1dvh;
        align-content: start;
    }

    .feature-block {
        /*transform: scale(0.9);*/
        margin: 0 auto;
        padding: 0;
    }

    #feature-block1, #feature-block3 {
        width: clamp(40dvw, 50dvw, 60dvw);
        height: clamp(14dvh, 18dvh, 20dvh);
        margin: 0 auto;
    }

    #feature-block2 {
        width: clamp(60dvw, 80dvw, 90dvw);
        height: clamp(18dvh, 22dvh, 24dvh);
        margin: 0 auto;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    #logo-placeholder {
        position: relative;
        grid-area: logo;
        display: flex;
        justify-content: center;
        align-items: flex-end;
        height: 100%;
        box-sizing: border-box;
        margin-top: 0.7dvh;
    }

    .logo-image {
        height: clamp(9dvh, 11dvh, 14dvh);
        width: auto;
        object-fit: contain;
        margin-bottom: 1.5dvh;
    }

    #feature-desc1 {
        transform: scale(0.9);
        grid-area: feature-desc1;
        margin-top: 0;
    }

    #feature-desc2 {
        transform: scale(0.9);
        grid-area: feature-desc2;
        margin-top: 0;
    }

    #feature-desc3 {
        transform: scale(0.9);
        grid-area: feature-desc3;
        margin-top: 0;
    }

    .feature-description {
        max-width: 85%;
        margin-top: 0;
        line-height: 1.1;
        padding: 0.3dvh 0;
        text-align: center;
        transform: translateY(-1dvh);
    }
    .feature-description .stroke-text {
        position: relative;
        color: transparent;
        -webkit-text-stroke: 2px #250066;
        text-shadow:
                0 2.5px 0 #16003a,
                0 0 3px #250066,
                0 0 4px #350063;
        z-index: 1;
    }

    .start-fixed-portrait {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        box-sizing: border-box;
        z-index: 2;
        display: flex;
        justify-content: center;
        align-items: center;
        padding-top: 2vh;
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .loading-bar-wrapper {
        position: absolute;
        bottom: clamp(1vh, 2vh, 3vh);
        left: 50%;
        transform: translateX(-50%);
        width: clamp(40vw, 45vw, 50vw);
        height: clamp(1.6vh, 2vh, 2.5vh);
    }

    .start-button {
        font-size: clamp(0.9rem, 1.5vw, 1.1rem);
        padding: clamp(1.5vh, 2.5vh, 3vh) 0;
        text-align: center;
        text-transform: uppercase;
        background: linear-gradient(to right, #ffc10d, white, #ffc10d);
        background-size: 200% auto;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        border: none;
        opacity: 0;
        pointer-events: none;
        transform: scale(0.95) translateX(-50%);
        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) translateX(-50%);
    }

    #sound-toggle {
        bottom: 1.5vh;
        right: clamp(3vw, 4vw, 5vw);
        z-index: 999;
    }
}

@media (orientation: portrait) and (max-height: 560px) {
    .start-button {
        font-size: clamp(0.7rem, 1vh, 0.9rem);
    }
    #fps-wrapper {
        row-gap: 0;
    }
}

@media (orientation: portrait) and (min-height: 1000px) {
    .start-button {
        font-size: clamp(1rem, 1.6vh, 1.3rem);
    }
}

@media (orientation: portrait) and (min-width: 768px) and (min-height: 1000px) {
    .start-button {
        font-size: 1.2rem;
    }
}

@media (min-width: 1200px) {
    .start-button {
        font-size: 1.4rem;
    }
}

@media (orientation: landscape) and (max-height: 700px) {

    #fps-wrapper {
        display: grid;
        grid-template-areas:
      "logo logo logo"
      "feature-block1 feature-block2 feature-block3"
      "feature-desc1 feature-desc2 feature-desc3"
      "start-button start-button start-button";

        grid-template-columns: 22dvw 25dvw 22dvw;
        width: 100dvw;
        height: 100dvh;
        justify-content: center;
        align-items: center;
        padding: 0 3dvw;
        box-sizing: border-box;
    }

    #feature-block1,
    #feature-block3 {
        height: clamp(35vh, 45vh, 55vh);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .feature-description {
        line-height: 1.1;
        padding: 0.3dvh 0;
        margin: 0;
        max-width: 100%;
    }

    #feature-desc1, #feature-desc2, #feature-desc3 {
        justify-content: unset;
        align-items: center;
    }

    .start-button {
        font-size: clamp(0.8rem, 1.3vw, 1.1rem);
        padding: clamp(1vh, 1.5vh, 2vh);
        margin-top: 0;
    }

    #sound-toggle {
        bottom: 3vh;
        right: clamp(2vw, 3vw, 4vw);
    }
}

@media (min-device-width: 768px) and (min-device-height: 768px) {
    #sound-toggle {
        width: 45px;
        height: 45px;
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #fps-wrapper {
        display: grid;
        grid-template-areas:
      "logo logo logo"
      "feature-block1 feature-block2 feature-block3"
      "feature-desc1 feature-desc2 feature-desc3"
      "start-button start-button start-button";

        grid-template-columns: 27dvw 35dvw 27dvw;
        width: 100dvw;
        height: 100dvh;
        justify-content: center;
        align-items: center;
        padding: 0 3dvw;
        box-sizing: border-box;
    }
}
@media screen and (min-width: 1024px) and (max-width: 1400px) and (orientation: landscape) {
   .feature-description {
        transform: translateY(-7dvh);
    }
}

@media (orientation: landscape) and (max-height: 260px) {
    #fps-wrapper {
        grid-template-columns: 30dvw 35dvw 30dvw;
        grid-template-rows: 15dvh auto auto auto;
        row-gap: 0.6dvh;
        column-gap: 1dvw;
        padding: 0 2dvw;
    }

    .feature-block.small,
    #feature-block1,
    #feature-block3 {
        width: clamp(25dvw, 30dvw, 35dvw);
    }

    #feature-block2 {
        width: clamp(30dvw, 35dvw, 40dvw);
        aspect-ratio: unset;
    }

    .feature-description {
        line-height: 1.1;
        padding: 0.3dvh 0;
        white-space: normal;
        text-align: center;
    }

    .feature-description .stroke-text {
        -webkit-text-stroke: 2px #250066;
    }

    .start-button {
        padding: clamp(0.6dvh, 1dvh, 1.4dvh) clamp(3dvw, 4dvw, 5dvw);
        z-index: 3;
        transform: scale(1);
    }

    #section-button {
        padding-bottom: 3dvh;
    }

    .logo-image {
        height: clamp(12dvh, 15dvh, 18dvh);
    }

    #sound-toggle {
        bottom: 2dvh;
        right: 2dvw;
        z-index: 999;
    }
}

@media (orientation: landscape) and (max-height: 480px) {
    #fps-wrapper {
        display: grid;
        grid-template-areas:
      "logo logo logo"
      "feature-block1 feature-block2 feature-block3"
      "feature-desc1 feature-desc2 feature-desc3"
      "start-button start-button start-button";

        grid-template-columns: 24dvw 32dvw 24dvw;
        width: 100dvw;
        height: 100dvh;
        justify-content: center;
        align-items: center;
        padding: 0 3dvw;
        box-sizing: border-box;
    }

    #feature-block1,
    #feature-block2,
    #feature-block3 {
        height: clamp(25dvh, 45dvh, 50dvh);
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .loading-bar-wrapper {
        position: absolute;
        bottom: 3dvh;
        left: 50%;
        transform: translateX(-50%);
        width: 150px;
        height: 13px;
        margin: 0;
        padding: 0;
    }
    .feature-description {
        font-size: clamp(1rem, 1.3dvw, 1.2rem);
        transform: translateY(-0.8dvh);
    }

    .feature-description .stroke-text {
        position: relative;
        color: transparent;
        -webkit-text-stroke: 2px #250066;
        text-shadow:
                0 2px 0 #16003a,
                0 0 2px #250066,
                0 0 3px #350063;
        z-index: 1;
    }

    .loading-percent {
        font-size: 0.8rem;
    }
}

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

@keyframes shimmerFlash {
    0% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.9; filter: brightness(1.5); }
    100% { opacity: 1; filter: brightness(1); }
}

.breath {
    animation: breath 2s ease-in-out;
}

.shimmer {
    animation: shimmerFlash 2s ease-in-out;
}

@keyframes firePulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
        filter: blur(20px);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
        filter: blur(45px);
    }
}

.layer-overlay.glow-shadow {
    --glow-opacity: 1;
    filter:
            drop-shadow(0 0 5px rgba(255, 220, 0, calc(0.75 * var(--glow-opacity))))
            drop-shadow(0 0 10px rgba(255, 170, 0, calc(0.6 * var(--glow-opacity))))
            drop-shadow(0 0 18px rgba(255, 120, 0, calc(0.5 * var(--glow-opacity))))
            drop-shadow(0 0 28px rgba(255, 80, 0, calc(0.4 * var(--glow-opacity))));
    transition: filter 0.5s ease, --glow-opacity 0.8s ease;
}

/* iPad, only iOS/iPadOS Safari */
@media (orientation: landscape) and (min-width: 768px) and (max-width: 1366px) {
    @supports (-webkit-touch-callout: none) {
       #section-button {
           bottom: 6dvh;
       }
    }
}

/* ===== HARD FIX for cut text on desktops (MacBook etc) ===== */
@media screen and (min-width: 1200px) and (orientation: landscape) {
    .feature-description {
        /* той самий базовий розмір, можна трохи менший, але не обовʼязково */
        font-size: var(--adaptive-font);

        /* головне: більше простору для stroke + тіней */
        line-height: 1.45;
        padding-top: 0.1em;
        padding-bottom: 0.35em;

        /* нічого не обрізати */
        overflow: visible;
        white-space: normal;
        text-overflow: clip;

        /* менше підтягуємо вгору, щоб не впиралося в межі рядка ґріда */
        transform: translateY(-1.5vh);
    }

    .feature-description .stroke-text {
        /* робимо box трохи “вищим” за рахунок padding, щоб glow не рубався */
        display: inline-block;
        padding-bottom: 0.1em;
    }
}
@media screen
and (min-width: 1400px) and (max-width: 1600px)
and (min-height: 800px) and (max-height: 1100px)
and (orientation: landscape) {

    .feature-description {
        font-size: calc(var(--adaptive-font) * 0.9); /* трохи менше, чисто запас */
        transform: translateY(-1vh);
        padding-bottom: 0.4em;
    }
}


