@import url('https://fonts.googleapis.com/css2?family=Aclonica&display=swap');

@supports (height: 100svh) {
    html, body,
    #feature-preview-screen,
    #fps-wrapper {
        height: 100svh !important;
        max-height: 100svh !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;
    overflow: hidden;
    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;
}

@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;
    overflow: hidden;
    grid-template-areas:
            "logo logo logo"
            "feature-block3 . feature-block1"
            "feature-desc3 . feature-desc1"
            "start-button start-button start-button";

    grid-template-columns: 40vw 1vw 40vw;
    /*grid-template-rows:*/
    /*    minmax(12vh, auto)*/
    /*    minmax(28vh, auto)*/
    /*    auto*/
    /*    minmax(12vh, auto);*/

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

#logo-placeholder { grid-area: logo; }
.feature-section:has(#feature-block1) { 
    grid-column: 3 / 4;
    grid-row: 2 / 4;
}
.feature-section:has(#feature-block3) { 
    grid-column: 1 / 2;
    grid-row: 2 / 4;
}
#section-button   { grid-area: start-button; }

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


#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(19vh, 22vh, 27vh);
    display: block;
    opacity: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 14, 96, 0.8));
    animation: logoFadeIn 1s ease-out 0.5s forwards,
    pulseGlow 6s ease-in-out infinite 2s;
    margin-top: 1vh;
}

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

#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,
#feature-block3 {
    position: relative;
    display: flex;
    justify-content: center;
    /*height: clamp(50vh, 70vw, 90vh);*/
    /*width: clamp(50vh, 70vw, 90vh);*/
}

#feature-desc1,
#feature-desc3 {
    height: auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0;
}

.feature-description {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    margin-top: 0.5vh;
    /*max-width: 90%;*/

    font-family: 'Aclonica', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: antialiased;

    font-size: clamp(0.45rem, calc(1.2vw + 0.85vh), 1.65rem);
    line-height: 1.5;
    /*transform: translateY(clamp(-0.5vh, -2vh, -3vh));*/
    z-index: 5;
}

.feature-description .subtext {
    position: relative;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    text-shadow: none !important;
}

.feature-description .subtext span {
    display: inline;
    background: linear-gradient(
            to bottom,
            #ffe426 40%,
            #f28c65 70%,
            #ff7f21 30%,
            #f14c0b 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    -webkit-text-stroke: clamp(0.4px, 0.12vw, 1px) #eeed13;
    text-stroke: clamp(0.4px, 0.12vw, 1px) #eeed13;

    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;

    filter: drop-shadow(clamp(0.5px, 0.12vw, 1px) clamp(1px, 0.35vw, 4px) 0px #880034);
}

.stacked-block {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.glow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
}

.feature-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;

    max-width: 100%;
    max-height: 100%;
}

.layer-back {
    mix-blend-mode: normal;
    z-index: 1;

    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
    isolation: isolate;
}

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

.layer-top {
    z-index: 10;
}

.big-wheel {
    z-index: 3;
}

.small-wheel {
    z-index: 4;
}

.big-wheel.spin {
    animation: spinBigWheel 7s cubic-bezier(0.33, 0, 0.2, 1) forwards,
                wheelDarken 7.2s cubic-bezier(0.33, 0, 0.2, 1) forwards;
}

.small-wheel.spin {
    animation: spinSmallWheel 7s cubic-bezier(0.33, 0, 0.2, 1) forwards,
                wheelDarken 7.2s cubic-bezier(0.33, 0, 0.2, 1) forwards;
}


@keyframes spinBigWheel {
    0% {
        transform: rotate(144deg);
    }
    71.4% {
        transform: rotate(1440deg);
    }
    100% {
        transform: rotate(1440deg);
    }
}

@keyframes spinSmallWheel {
    0% {
        transform: rotate(-90deg);
    }
    71.4% {
        transform: rotate(-1440deg);
    }
    100% {
        transform: rotate(-1440deg);
    }
}

@keyframes wheelDarken {
    0%, 70% {
        filter: brightness(1);
    }
    75% {
        filter: brightness(0.7);
    }
    100% {
        filter: brightness(0.6);
    }
}

.feature-image.static {
    position: absolute;
    z-index: 5;
}

.m-win {
    position: absolute;
    z-index: 12;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.m-win.show-m {
    animation: winAppear 1s cubic-bezier(0.33, 0, 0.2, 1) forwards, glowPulse 2s ease-in-out infinite;
    animation-delay: 5.7s, 6.7s;
}

.fs-win {
    position: absolute;
    z-index: 13;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9);
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.fs-win.show-fs {
    animation: winAppear 1s cubic-bezier(0.33, 0, 0.2, 1) forwards, glowPulse 2s ease-in-out infinite;
    animation-delay: 5.1s, 6.1s;
}

@keyframes winAppear {
    0% {
        opacity: 0;
        visibility: visible;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        visibility: visible;
        transform: scale(1);
    }
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1) translateZ(0);
        opacity: 0.95;
    }
    50% {
        transform: scale(1.08) translateZ(0);
        opacity: 1;
    }
}

#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: "Noto Sans", sans-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,
            #f813f4,
            #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;
    outline: 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;
}

.start-button:focus {
    outline: none;
}

.start-button:focus-visible {
    outline: none;
}

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

.shimmer {
    animation:  shimmerFlash 3s ease-in-out infinite;
}
@keyframes shimmerFlash {
    0%, 100% { opacity: 1;   filter: brightness(1); }
    50%      { opacity: 0.9; filter: brightness(1.3); }
}

.feature-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.ncs-feature-text {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#feature-block1,
#feature-block3 {
    width: 100%;
    height: 100%;
}

@media (orientation: landscape) {
    .feature-visual {
        height: min(90vh, 55vw);
        width: min(90vh, 50vw);
    }
    
    .ncs-feature-text {
        margin-top: -18vh;
    }
    
    .feature-description {
        max-width: 38vw;
    }
}

@media (orientation: landscape) and (max-height: 500px) {
    .feature-visual {
        height: min(70vh, 35vw);
        width: min(70vh, 35vw);
    }
    
    .ncs-feature-text {
        margin-top: -14vh;
    }

    .feature-description {
        font-size: clamp(0.4rem, calc(1vw + 0.7vh), 1.2rem);
        max-width: 38vw;
    }
}

@media (orientation: landscape) and (max-aspect-ratio: 5/4) and (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3){
    .feature-visual {
        height: min(75vh, 40vw);
        width: min(75vh, 40vw);
    }

    .ncs-feature-text{
        margin-top: -10vh;
    }
    
    .feature-description {
        max-width: 38vw;
    }
}


@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"
        "feature-section1"
        "feature-section2"
        "start-button";
        grid-template-columns: 1fr;

        /*grid-template-rows:*/
        /*  minmax(10vh, 12vh)*/
        /*  minmax(auto, 1fr)*/
        /*  minmax(auto, 1fr)*/
        /*  minmax(10vh, 12vh);*/

        grid-template-rows:
        minmax(10dvh, 12dvh)
        1fr
        1fr
        minmax(10dvh, 12dvh);

        height: 100dvh;
        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;
        overflow-y: auto;
    }
    
    .feature-section:has(#feature-block3) {
        grid-area: feature-section1;
    }
    
    .feature-section:has(#feature-block1) {
        grid-area: feature-section2;
    }
    
    .feature-visual {
        height: min(100vw, 50vh);
        width: min(100vw, 50vh);
    }

    .ncs-feature-text {
        margin-top: max(-120px, min(-60px, -20vw));
    }

    @supports (height: 100dvh) {
        .ncs-feature-text {
            margin-top: max(-120px, min(-60px, -20dvw));
        }
    }

    @media (orientation: portrait) and (max-width: 375px) and (max-height: 670px) {
        .ncs-feature-text {
            margin-top: max(-110px, min(-50px, -17dvw));
        }
    }

    #feature-desc3 {
        margin-top: -10px;
    }
    
    .feature-section {
        margin-bottom: 2vh;
        min-height: 0;
    }

    #feature-block1,
    #feature-block3 {
        width: 100%;
        height: 100%;
    }

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

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

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

        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        align-self: baseline;
    }
    .glow-svg {
        z-index: 1 !important;
    }

    #logo-placeholder {
        position: relative;
        grid-area: logo;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 0;
        z-index: 2;
    }

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

    .feature-description {
        font-size: clamp(0.45rem, calc(1.5vw + 1vh), 1.05rem);
        line-height: 1.15;
        margin: 0 auto;
        padding: 0 2vw;
        text-align: center;
        transform: translateY(0);
    }
}

/* Portrait tablets - larger font size */
@media (orientation: portrait) and (min-width: 600px) {
    .feature-description {
        font-size: clamp(0.65rem, calc(1.8vw + 1.2vh), 1.5rem);
        line-height: 1.2;
        max-width: 70vw;
    }
}

@media (orientation: portrait) {
    #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);
    }

    #sound-toggle {
        position: fixed;
        bottom: max(env(safe-area-inset-bottom, 6px), 2vh);
        right: clamp(2vw, 3vw, 4vw);
        z-index: 999999;
    }

    .feature-image.static { z-index: 1;}
}

@media (max-width: 280px) and (orientation: portrait) {
    #feature-block1,
    #feature-block3 {
        max-height: 25vh;
        margin-bottom: 0;
    }
    .feature-description {
        transform: translateY(-3vh);
    }
}

@media (max-width: 600px) {
    .feature-description {
        letter-spacing: 0.3px;
    }
    
    .feature-description .subtext span {
        -webkit-text-stroke: 0.4px #eeed13;
        text-stroke: 0.4px #eeed13;
        filter: drop-shadow(0.5px 1.5px 0px #820206);
        letter-spacing: 0.01em;
    }
}

@media (max-width: 400px) {
    .feature-description .subtext span {
        -webkit-text-stroke: 0.3px #eeed13;
        text-stroke: 0.3px #eeed13;
        filter: drop-shadow(0.3px 1px 0px #820206);
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .feature-description .subtext span {
        -webkit-text-stroke: 0.35px #eeed13;
        text-stroke: 0.35px #eeed13;
        filter: drop-shadow(0.4px 1.2px 0px #820206);
    }
}


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

#fps-image4 {
    mix-blend-mode: screen;
    filter: brightness(1.2) contrast(1.05);
    isolation: auto;
}

.star1,
.star2,
.star3,
.star4,
.star5 {
    mix-blend-mode: lighten;
    pointer-events: none;
    isolation: auto;

    filter: brightness(1.1) contrast(1.05);
    will-change: transform, opacity, filter;

    animation:
            starTwinkle 2.5s infinite ease-in-out,
            starRotate 12s infinite linear;
}
.star1 { animation-delay: 0s,    0s;    }
.star2 { animation-delay: 0.6s,  2.3s;  }
.star3 { animation-delay: 1.4s,  5.1s;  }
.star4 { animation-delay: 2.1s,  8.7s;  }
.star5 { animation-delay: 3.2s,  12.3s;  }

@keyframes starTwinkle {
    0%   { opacity: 0.6; filter: brightness(0.9); }
    20%  { opacity: 1;   filter: brightness(1.4); }
    50%  { opacity: 0.7; filter: brightness(1); }
    80%  { opacity: 1;   filter: brightness(1.6); }
    100% { opacity: 0.6; filter: brightness(1); }
}
