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

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: 100vw;
    height: 100vh;
    z-index: -3;
    overflow: hidden;

}

.background-layer img {
    display: none;
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

}

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

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


@media (orientation: landscape) {
    .background-layer img.landscape-bg {
        display: block;
        z-index: -1;
    }

    .background-layer img.portrait-bg {
        display: none;
    }
}

#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(10vh, auto)
        minmax(20vh, auto)
        auto
        minmax(1vh, auto);

    height: 100dvh;
    justify-content: center;
    align-items: end;
    box-sizing: border-box;
    width: 100%;
    max-width: 100dvw;
    padding: 5px;
    /*padding-top: 1vh;*/
    /*gap: 0.5vh;*/
}

#logo-placeholder {
    grid-area: logo;
}

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

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

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

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

#section-button {
    grid-area: start-button;
}


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

.logo-image {
    height: clamp(10vh, 17vh, 20vh);
    display: block;
    opacity: 0;
    animation: logoFadeIn 1s ease-out 0.5s forwards;
    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,
#feature-block3 {
    position: relative;
    display: flex;
    justify-content: center;
    height: clamp(22vh, 32vw, 50vh);
    max-height: 50vh;
    overflow: visible;
    align-items: flex-end;
    margin-bottom: -3vh;
}

#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;
    padding-top: 0;
    max-width: 90%;

    font-family: "Noto Sans", 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(-1vh, -3vh, -5vh));
    z-index: 2;
}

.feature-description .line {
    color: #0eff79;

    font-weight: 900;
    display: block;
    margin-top: 0;

    -webkit-text-stroke: 6px #210030;
    text-stroke: 6px #210030;
    paint-order: stroke fill;
}

.feature-description .subtext {
    display: inline-block;
    position: relative;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    color: #38f6fb;
    width: 100%;
    -webkit-text-stroke: 6px #210030;
    text-stroke: 6px #210030;
    paint-order: stroke fill;
}

#feature-desc3 .subtext {
    display: inline-block;
    max-width: 50ch;
    word-wrap: break-word;
}

.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: screen;
}

.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;
    --glow: 0.5;
    --tilt: 0.1deg;
    animation: flame-flicker 1.8s linear infinite, flame-breathe 4s ease-in-out infinite;
}

#feature-block3 .layer-back {
    animation-delay: 1s, 1s;
}

@keyframes flame-flicker {
    0% {
        filter: url(#heat-warp);
        transform: rotate(var(--tilt)) translateY(0) scale(1);
    }
    50% {
        filter: url(#heat-warp);
        transform: rotate(calc(var(--tilt) * -1)) translateY(-1px) scale(1.01);
    }
    100% {
        filter: url(#heat-warp);
        transform: rotate(var(--tilt)) translateY(0) scale(1);
    }
}

@keyframes flame-breathe {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-0.5px) scale(1.01);
    }
}

@keyframes glass-shine {
    0% {
        filter: brightness(1) drop-shadow(0 20px 15px rgba(255, 255, 255, 0));
    }
    50% {
        filter: brightness(1.15) drop-shadow(0 -10px 20px rgba(255, 255, 255, 0.6));
    }
    100% {
        filter: brightness(1) drop-shadow(0 -40px 15px rgba(255, 255, 255, 0));
    }
}

.layer-middle {
    z-index: 2;
    animation: glass-shine 3s ease-in-out infinite;
}

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

#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,
            #1afa93,
            #2fe6d6,
            #ffe04d,
            #ffb300,
            #ff7a2f,
            #ff3f7f,
            #1afa93
    );
    background-size: 600% 100%;
    animation: shimmer 2s linear infinite;
    transition: width 0.3s ease;
    border-radius: 999px;
    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 {
    position: relative;
    border: none;
    background: none;
    padding: 0;
    width: 100%;
    text-align: center;
    white-space: nowrap;

    font-family: "Noto Sans", sans-serif;
    font-weight: 800;
    font-size: clamp(0.5rem, calc(0.8vw + 0.8vh), 1.3rem);
    letter-spacing: 0.02em;
    text-transform: uppercase;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, transform 0.4s ease;
    z-index: 5;
}

.start-button .stroke,
.start-button .fill {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.start-button .stroke {
    -webkit-text-stroke: 6px #000;
    -webkit-text-fill-color: transparent;
    color: transparent;
    z-index: 0;
}

.start-button .fill {
    position: relative;
    z-index: 1;

    background: linear-gradient(90deg,
    #16ff7b, #6fe7ff, #ffed8e, #ffb300, #ff6b2c, #ff3f7f, #16ff7b);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: shimmerMetallic 6s linear infinite;
}

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

.bear {
    opacity: 0;
    transform: scale(0) translateY(30%);
    animation: bear-appear-hide 3.2s infinite ease-in-out,
    bear-zoom-shine 3.2s infinite ease-in-out;
}

.bear:nth-child(2) {
    animation-delay: 0s, 0s;
}

.bear:nth-child(3) {
    animation-delay: 0.4s, 0.4s;
}

.bear:nth-child(4) {
    animation-delay: 0.8s, 0.8s;
}

@keyframes bear-appear-hide {
    0% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    10% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    70% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    75% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(30%);
    }
}

@keyframes bear-zoom-shine {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    40% {
        transform: scale(1.06);
        filter: brightness(1.3);
    }
    70% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

.multiplier {
    opacity: 0;
    transform: scale(0) translateY(30%);
    animation: multiplier-appear-hide 12.8s infinite ease-in-out,
    multiplier-zoom-shine 3.2s infinite ease-in-out;
}

.multiplier:nth-child(4) {
    animation-delay: 0s, 0s;
}

.multiplier:nth-child(5) {
    animation-delay: 3.2s, 0s;
}

.multiplier:nth-child(6) {
    animation-delay: 6.4s, 0s;
}

.multiplier:nth-child(7) {
    animation-delay: 9.6s, 0s;
}

@keyframes multiplier-appear-hide {
    0% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    2% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    23% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    25% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(30%);
    }
}

@keyframes multiplier-zoom-shine {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    40% {
        transform: scale(1.06);
        filter: brightness(1.6);
    }
    70% {
        transform: scale(1.02);
        filter: brightness(1.2);
    }
}

@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 shimmer {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: 200% center;
    }
}


@media (max-height: 500px) and (max-width: 1400px) and (orientation: landscape) {
    #feature-block1,
    #feature-block3 {
        max-height: 50vh;
    }

    .feature-description {
        line-height: 1.2;
        margin-top: 0.2vh;
    }

    .start-button {
        font-size: clamp(0.7rem, 1vw + 0.5vh, 1.2rem);
    }
}

@media (orientation: landscape) and (max-aspect-ratio: 5/4) and (min-aspect-ratio: 3/4) and (max-aspect-ratio: 4/3) {
    .feature-description {
        transform: translateY(clamp(-5vh, -6vh, -7vh));
    }
}

@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-block1"
        "feature-desc1"
        "feature-block3"
        "feature-desc3"
        "start-button";
        grid-template-columns: 1fr;

        grid-template-rows:
          minmax(10vh, auto)
          minmax(22vh, 2fr)
          auto
          minmax(22vh, 2fr)
          auto
          minmax(8vh, auto);

        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;
        gap: 1vh;
    }

    #feature-block1,
    #feature-block3 {
        height: min(65vw, 26vh) !important;
        max-height: 26vh;
        align-self: end;
        justify-content: center;
        position: relative;
        overflow: visible;
        margin-bottom: 0;
        margin-top: 0;
    }

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

    .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: 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: flex-start;
        margin-bottom: 0;
        z-index: 2;
    }

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

    .feature-description {
        font-size: clamp(0.45rem, calc(1.65vw + 1.2vh), 1.25rem);
        line-height: 1.2;
        max-width: 85vw;
        margin: 0 auto;
        padding: 0.5vh 2vw;
        text-align: center;
        transform: none;
    }

    .feature-description .subtext {
        -webkit-text-stroke: 4px #210030;
        text-stroke: 4px #210030;
        paint-order: stroke fill;
    }

    .start-button .stroke {
        -webkit-text-stroke: 4px #000;
        -webkit-text-fill-color: transparent;
        color: transparent;
        z-index: 0;
    }

    .feature-description .line {
        -webkit-text-stroke: 4px #210030;
        text-stroke: 4px #210030;
        paint-order: stroke fill;
    }

    #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;
        border: none;
        opacity: 0;
        pointer-events: none;
    }

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

    .shaking {
        animation: golden-glow 3.2s infinite ease-in-out,
        golden-sparkle 3.2s infinite ease-in-out;
        transform-origin: center;
    }
}

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

    .feature-description {
        transform: translateY(-3vh);
    }
}