@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@500;700;900&display=swap');
@supports (height: 100svh) {
    html, body,
    #feature-preview-screen,
    #fps-wrapper {
        height: 100svh !important;
        max-height: 100svh !important;
    }
    #section-button {
        padding-bottom: clamp(1vh, env(safe-area-inset-bottom, 2vh), 3vh);
    }
}
html, body {
    margin: 0;
    padding: 0;
    height: 100dvh;
    overflow: hidden;
}

#feature-preview-screen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100dvw;
    height: 100dvh;
    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;
}

#starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center;
    animation: zoomInOut 10s ease-in-out infinite;
}

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

#fps-wrapper {
    display: grid;
    place-items: center;
    grid-template-areas:
            "logo logo logo"
            "feature-block1 . feature-block3"
            "feature-desc1 . feature-desc3"
            "start-button start-button start-button";

    grid-template-columns: 40vw 1vw 40vw;
    /*grid-template-rows:*/
    /*  minmax(8vh, auto)*/
    /*  minmax(0, 2fr)*/
    /*  minmax(0, 0.5fr)*/
    /*  minmax(8vh, auto);*/

    height: 100vh;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
}

#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, 14vh, 16vh);
    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-bottom: 4vh;
    margin-top: 1vh;
}

#sound-toggle {
    position: absolute;
    bottom: 3vh;
    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-block3 {
    grid-area: feature-block3;
}

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

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

.highlight {
    background: linear-gradient(to top, #fe662a, #ff9700, #ffff15);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
}

.feature-description {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 4px rgba(0, 0, 0, 0.4));
}

#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;*/
    padding: 0;
    width: 100%;
    height: auto;
    min-width: unset;
    justify-content: center;
    overflow: visible;
    transform-origin: center;
}

.feature-image {
    display: block;
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    filter: none !important;
    mix-blend-mode: normal;
}

.glow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    mix-blend-mode: screen;
}

.stacked-block {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    /*align-self: baseline;*/
}

.feature-description {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;

    font-size: clamp(0.5rem, calc(1vw + 1vh), 1.8rem);
    line-height: 1.3;
    font-weight: 900;
    margin: 0;
    padding: 0;
    max-width: 40vw;
    width: 100%;
    box-sizing: border-box;
    z-index: 3;
    font-family: "Noto Sans", sans-serif;
    text-transform: uppercase;
    color: white;
    letter-spacing: 0.6px;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 4px rgba(0, 0, 0, 0.4));
}

.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);
    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,
            #00CFFF,
            #00FFE3,
            #8A2BE2,
            #3A00FF,
            #00CFFF
    );
    background-size: 300% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.3s ease;
    border-radius: 999px;
    box-shadow:
            0 0 12px rgba(0, 207, 255, 0.6),
            0 0 24px rgba(138, 43, 226, 0.5),
            0 0 36px rgba(58, 0, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}


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

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

/* START BUTTON */
.start-button {
    font-family: "Noto Sans", sans-serif;
    width: clamp(40vw, 50vw, 60vw);
    font-size: clamp(0.5rem, calc(1vw + 1vh), 1.2rem);
    text-transform: uppercase;
    padding: clamp(1.2vh, 2vh, 3vh) clamp(3vw, 5vw, 6vw);
    bottom: 1vh;
    text-align: center;
    letter-spacing: 0.05em;
    font-weight: 700;

    background: linear-gradient(
            to right,
            #99d9ff,
            #66ccff,
            #c4d4ff,
            #66ccff,
            #99d9ff
    );
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(102, 204, 255, 0.4));

    border: none;
    color: white;

    position: static;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.4s ease;
    animation: shimmerMetallic 6s linear infinite, pulseZoom 4s ease-in-out infinite;
    white-space: nowrap;
    z-index: 5;
}

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

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

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

@keyframes blurPulse {
    0%, 100% { filter: blur(6px); }
    50% { filter: blur(10px); }
}

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

@keyframes parallaxZoom {
    0%, 100% { transform: scale(1.05) translate(0, 0); }
    50% { transform: scale(1.12) translate(-1.5%, 1.5%); }
}

@keyframes parallaxShift {
    0% { transform: translate(0%, 0%) scale(1.05); }
    25% { transform: translate(1.5%, -1%) scale(1.08); }
    50% { transform: translate(-1%, 2%) scale(1.1); }
    75% { transform: translate(2%, 1%) scale(1.07); }
    100% { transform: translate(0%, 0%) scale(1.05); }
}

@keyframes brightnessPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

@keyframes overlayPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.28; }
}

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

/*@keyframes pulseGlow {*/
/*    0%, 100% { filter: drop-shadow(0 2px 8px rgb(20, 35, 81)); }*/
/*    50% { filter: drop-shadow(0 4px 14px rgb(30, 46, 103)); }*/
/*}*/

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

@media (orientation: landscape) and (max-height: 500px) and (max-width: 1400px){
    .feature-description {
        font-size: clamp(0.4rem, calc(1vw + 1vh), 0.8rem);
    }
}

@media (orientation: portrait) {
    #feature-preview-screen {
        height: 100dvh;
        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"
        "feature-block1"
        "feature-desc1"
        "feature-block3"
        "feature-desc3"
        "start-button";
        grid-template-columns: 1fr;
        grid-template-rows:
        minmax(12vh, auto)        /* logo */
        minmax(clamp(20vh, 25vh, 28vh), auto)  /* block1 */
        auto                      /* desc1 */
        minmax(clamp(20vh, 25vh, 28vh), auto)  /* block3 */
        auto                      /* desc3 */
        minmax(10vh, auto);       /* start-button */
        row-gap: 1.2vh;
        height: 100dvh;
        min-height: 0;
        box-sizing: border-box;
        padding-top: env(safe-area-inset-top, 2vh);
        padding-bottom: env(safe-area-inset-bottom, 2vh);
        width: 100vw;
        overflow-x: hidden;
        align-content: start;
    }

    #feature-desc1 {
        grid-area: feature-desc1;
        justify-content: center;
        align-items: center;
    }

    #feature-desc3 {
        grid-area: feature-desc3;
        justify-content: center;
        align-items: center;
    }

    .feature-block.small {
        width: min(70vw, 35vh);
        height: min(70vw, 35vh);
        align-self: center;
        aspect-ratio: 1 / 1;
        justify-content: center;
        position: relative;
        overflow: visible;
    }

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

    .layer-under {
        z-index: 1;
    }
    .layer-middle {
        z-index: 2;
    }
    .layer-top {
        z-index: 3;
    }

    .feature-block {
        max-width: 100vw;
        margin: 0 auto;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        overflow: visible;
    }

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

    .glow-svg {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        pointer-events: none;
        z-index: 3;
        mix-blend-mode: screen;
    }

    .stacked-block {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;

        display: flex;
        justify-content: center;
        align-items: center;
        align-self: center;
    }

    .star-particle {
        z-index: 12;
        mix-blend-mode: screen;
        pointer-events: none;
        animation: sparkleFade 1.8s ease-in-out forwards;
        opacity: 0;
        position: absolute;
    }

    #logo-placeholder {
        position: relative;
        grid-area: logo;
        display: flex;
        justify-content: center;
        align-items: center;
        /*padding-top: min(2vh, 2vw);*/
        margin-bottom: 0;
        margin-top: 1.5vh;
        z-index: 5;
    }

    .logo-image {
        height: clamp(6vh, 10vh, 12vh);
        width: auto;
        max-width: 70vw;
    }

    .feature-description {
        font-size: clamp(0.5rem, calc(1.5vw + 1.2vh), 1.8rem);
        line-height: 1.2;
        max-width: 85vw;
        margin-top: 1%;
        padding: 0 2vw;
        text-align: center;
    }
    #feature-desc3, #feature-desc1 {
        justify-content: center;
        align-items: center;
    }

    .start-fixed-portrait {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        background: linear-gradient(to top, rgba(18, 16, 48, 0.88), rgba(18, 16, 48, 0));
        box-sizing: border-box;
        z-index: 3;
        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(2vh, 2.5vh, 3.5vh);*/
        left: 50%;
        transform: translateX(-50%);
        width: clamp(40vw, 45vw, 50vw);
        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;
    }

    .start-button {
        font-family: "Noto Sans", sans-serif;
        font-size: clamp(0.5rem, calc(1vw + 1vh), 1.2rem);
        padding: clamp(1.5vh, 2.5vh, 3vh) 0;
        margin: 0 auto;
    }

    .start-button.visible {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (orientation: portrait) {
    #sound-toggle {
        position: fixed;
        bottom: clamp(2vh, 3vh, 4vh);
        right: clamp(3vw, 4vw, 5vw);
        width: 40px;
        height: 40px;
        z-index: 9999;
    }

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


@media (orientation: landscape) {
    #fps-wrapper {
        display: grid;
        grid-template-rows:
          minmax(8vh, auto)
          auto
          auto
          minmax(8vh, auto);
        height: 100dvh;
        min-height: 0;
    }

    .feature-block {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .feature-image {
        max-width: 100%;
        max-height: 100%;
        width: 100%;
        height: 100%;
        object-fit: contain;
        flex-shrink: 1;
    }

    .feature-description {
        align-self: start;
        margin: 0 auto;
        min-height: 0;
        text-align: center;
    }

    .feature-block.small,
    .stacked-block {
        position: relative;
        aspect-ratio: 1 / 1;
        /*display: flex;*/
        align-items: center;
        justify-content: center;
        max-width: 55vh;
        height: auto;
        min-height: 0;
    }

    #feature-block1, #feature-block3 {
        align-self: end;
    }

    .feature-image,
    .overlay-image,
    .glow-svg {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }
    .feature-block img.feature-image {
        position: relative;
        display: block;
        margin: 0 auto;
        object-fit: contain;
        flex-shrink: 1;
    }

    .feature-block {
        padding: 0 !important;
        display: flex;
        /*align-items: flex-start;*/
        /*justify-content: center;*/
        height: auto;
        min-height: 0;
    }

    .feature-description {
        text-align: center;
        min-height: 0;
        transform: translateY(-3vh);
    }

    #feature-desc1, #feature-desc3 {
        max-width: 80%;
    }
}

@media (orientation: landscape) and (min-width: 1200px) {
    .feature-block.small,
    .stacked-block {
        max-width: 65vh;
    }
    .feature-description {
        transform: translateY(-4vh);
    }
}