.main-page #nos-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -200;
    background-image: url('../assets/nos-bg-1.png');
    background-size: cover;
    background-position: 75% calc(70% + var(--bgY) * 1px);
    background-repeat: no-repeat;
    transform-origin: center center;
    will-change: background-position, transform, opacity;
    animation: nos-bg-intro 1800ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.main-page #nos-bg-mask {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: 100vh;
    pointer-events: none;
    z-index: -100;
    background: var(--md-default-bg-color, #fff);
}

.main-page #nos-bg-gradient {
    position: fixed;
    left: 0;
    right: 0;
    height: 520px;
    top: calc(100vh - 520px);
    pointer-events: none;
    z-index: -8;
    opacity: 0;
    background: linear-gradient(to bottom,
            color-mix(in srgb, var(--md-default-bg-color) 0%, transparent) 0%,
            color-mix(in srgb, var(--md-default-bg-color) 2%, transparent) 20%,
            color-mix(in srgb, var(--md-default-bg-color) 8%, transparent) 38%,
            color-mix(in srgb, var(--md-default-bg-color) 22%, transparent) 56%,
            color-mix(in srgb, var(--md-default-bg-color) 50%, transparent) 74%,
            color-mix(in srgb, var(--md-default-bg-color) 82%, transparent) 88%,
            var(--md-default-bg-color, #fff) 100%);
}

.main-page #nos-chars,
.main-page #nos-chars-glow {
    position: fixed;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -10;
    transform-origin: bottom right;
    height: clamp(80vh, calc(80vh + var(--charsX, 0px)*120px), 150vh);
    width: auto;
    max-width: none;
    transform: translateX(clamp(0px, calc((1 - var(--charsX, 1)) * 500px), 500px)) translateY(var(--charsY, 0px));
}

.main-page #nos-chars {
    z-index: -10;
    animation: nos-chars-intro 1000ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both;
}

.main-page #nos-chars-glow {
    mix-blend-mode: color-dodge;
    animation: nos-chars-glow-intro 1300ms cubic-bezier(0.2, 0.7, 0.2, 1) 220ms both;
}

.main-page #nos-scroll-indicator {
    --scroll-indicator-opacity: 1;
    position: fixed;
    left: 50%;
    bottom: clamp(20px, 5vh, 44px);
    transform: translateX(-50%);
    z-index: 20;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: color-mix(in srgb, var(--md-default-fg-color, #fff) 92%, transparent);
    text-decoration: none;
    opacity: var(--scroll-indicator-opacity, 1);
    transition: opacity 180ms linear;
    animation: nos-scroll-bob 1.8s ease-in-out infinite;
}

.main-page #nos-scroll-indicator:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    border-radius: 8px;
}

.main-page .nos-scroll-text {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.66rem;
    font-weight: 700;
}

.main-page .nos-scroll-icon {
    width: 20px;
    height: 34px;
    border: 2px solid currentColor;
    border-radius: 999px;
    position: relative;
}

.main-page .nos-scroll-icon::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 6px;
    width: 4px;
    height: 8px;
    border-radius: 99px;
    background: currentColor;
    transform: translateX(-50%);
    animation: nos-scroll-wheel 1.5s ease-in-out infinite;
}

.main-page .games-section {
    position: relative;
    margin: clamp(12vh, 12vh, 12vh) auto 0;
    width: min(1100px, 92vw);
    text-align: center;
    z-index: 2;
}

.main-page .games-section h2 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 4.6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--md-default-fg-color, #fff) 96%, transparent);
    text-shadow: 0 8px 34px rgba(0, 0, 0, 0.35);
    animation: games-title-rise 700ms ease-out both;
}

.main-page .games-grid {
    margin-top: clamp(1.2rem, 3.2vw, 2rem);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
    gap: clamp(14px, 2.6vw, 26px);
}

.main-page .game-button {
    position: relative;
    display: block;
    border-radius: 18px;
    overflow: visible;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(0);
    transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
    animation: games-card-rise 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.main-page .game-button:nth-child(2) {
    animation-delay: 110ms;
}

.main-page .game-button-bg-wrap {
    position: relative;
    display: block;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
    aspect-ratio: 16 / 7.25;
}

.main-page .game-button-bg {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 100%;
    transform: scale(1);
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.main-page .game-button-chars-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: -22%;
    border-radius: 18px;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.main-page .game-button-chars {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 92%;
    height: auto;
    transform: scale(1);
    transform-origin: right bottom;
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.main-page .game-button-logo {
    position: absolute;
    left: 0;
    top: 59%;
    transform: translateY(-50%) scale(1);
    width: 60%;
    height: auto;
    object-fit: contain;
    object-position: left center;
    pointer-events: none;
    z-index: 1;
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.main-page .game-button:hover .game-button-logo,
.main-page .game-button:focus-visible .game-button-logo {
    transform: translateY(-50%) scale(1.03);
}

.main-page .game-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 42%, rgba(255, 255, 255, 0.22));
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.main-page .game-button:hover,
.main-page .game-button:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.45);
    filter: saturate(1.08);
}

.main-page .game-button:hover .game-button-bg,
.main-page .game-button:focus-visible .game-button-bg {
    transform: scale(1.03);
}

.main-page .game-button:hover .game-button-chars,
.main-page .game-button:focus-visible .game-button-chars {
    transform: scale(1.06);
}

.main-page .game-button:hover::after,
.main-page .game-button:focus-visible::after {
    opacity: 1;
}

.main-page .game-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--md-default-fg-color, #fff) 86%, transparent);
    outline-offset: 4px;
}

@media (max-width: 760px) {
    .main-page .games-section {
        margin-top: clamp(12vh, 16vh, 20vh);
    }

    .main-page .games-grid {
        grid-template-columns: 1fr;
        gap: clamp(28px, 6vw, 48px);
    }
}

@keyframes nos-scroll-bob {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 6px);
    }
}

@keyframes nos-scroll-wheel {
    0% {
        opacity: 0;
        transform: translate(-50%, 0);
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translate(-50%, 12px);
    }
}

@keyframes games-title-rise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes games-card-rise {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {

    .main-page #nos-bg,
    .main-page #nos-chars,
    .main-page #nos-chars-glow {
        animation: none !important;
    }
}

@keyframes nos-bg-intro {
    from {
        opacity: 0.82;
        transform: translateX(26px) scale(1.03);
        filter: saturate(1.08);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: saturate(1);
    }
}

@keyframes nos-chars-intro {
    from {
        opacity: 0;
        filter: blur(5px);
        transform: translateX(calc(clamp(0px, calc((1 - var(--charsX, 1)) * 500px), 500px) + 150px)) translateY(calc(var(--charsY, 0px) + 18px)) scale(0.992);
    }

    to {
        opacity: 1;
        filter: blur(0);
        transform: translateX(clamp(0px, calc((1 - var(--charsX, 1)) * 500px), 500px)) translateY(var(--charsY, 0px)) scale(1);
    }
}

@keyframes nos-chars-glow-intro {
    from {
        opacity: 0;
        filter: blur(14px) saturate(1.25);
        transform: translateX(calc(clamp(0px, calc((1 - var(--charsX, 1)) * 500px), 500px) + 180px)) translateY(calc(var(--charsY, 0px) + 28px)) scale(1.02);
    }

    70% {
        opacity: 0.82;
    }

    to {
        opacity: 1;
        filter: blur(0) saturate(1);
        transform: translateX(clamp(0px, calc((1 - var(--charsX, 1)) * 500px), 500px)) translateY(var(--charsY, 0px)) scale(1);
    }
}