:root {
    --page: #070b16;
    --panel: rgba(13, 20, 37, 0.9);
    --panel-deep: rgba(7, 11, 23, 0.96);
    --line: rgba(172, 206, 255, 0.17);
    --text: #f4f7ff;
    --muted: #aab6ca;
    --forest: #efad57;
    --forest-rgb: 239, 173, 87;
    --classic: #97b8ff;
    --classic-rgb: 151, 184, 255;
    --space: #71e7ff;
    --space-rgb: 113, 231, 255;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 300px;
    color-scheme: dark;
    background: var(--page);
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(46, 100, 154, 0.22), transparent 29rem),
        radial-gradient(circle at 88% 24%, rgba(124, 41, 154, 0.2), transparent 31rem),
        linear-gradient(155deg, #090f20 0%, #050812 54%, #080b16 100%);
    font-family:
        Inter, Avenir, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body::before {
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    content: "";
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(136, 186, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(136, 186, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
}

a {
    color: inherit;
}

.cosmos,
.cosmos span {
    position: fixed;
    pointer-events: none;
}

.cosmos {
    z-index: 0;
    inset: 0;
    overflow: hidden;
}

.cosmos::before,
.cosmos::after {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.4px),
        radial-gradient(circle, rgba(113, 231, 255, 0.55) 0 1px, transparent 1.5px);
    background-position: 20px 30px, 90px 110px;
    background-size: 170px 170px, 250px 250px;
}

.cosmos::after {
    opacity: 0.48;
    transform: scale(1.25) rotate(12deg);
}

.cosmos span {
    border-radius: 999px;
    filter: blur(2px);
}

.cosmos span:nth-child(1) {
    top: 16%;
    left: -11rem;
    width: 28rem;
    height: 28rem;
    border: 1px solid rgba(89, 206, 255, 0.15);
    box-shadow: inset -4rem -3rem 8rem rgba(33, 92, 143, 0.15);
}

.cosmos span:nth-child(2) {
    top: 38%;
    right: -16rem;
    width: 34rem;
    height: 34rem;
    background: rgba(117, 34, 145, 0.08);
    box-shadow: 0 0 8rem rgba(159, 54, 189, 0.08);
}

.cosmos span:nth-child(3) {
    bottom: 8%;
    left: 40%;
    width: 10rem;
    height: 1px;
    transform: rotate(-24deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
    box-shadow: 0 0 1.3rem rgba(110, 223, 255, 0.65);
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 34px 0 30px;
}

.lab-header {
    display: grid;
    gap: 38px;
    padding-bottom: 38px;
}

.back-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 160ms ease, transform 160ms ease;
}

.back-link span {
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
}

.back-link:hover {
    color: #fff;
    transform: translateX(-3px);
}

.lab-intro {
    max-width: 780px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    color: #c5d2e7;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.lock-mark {
    position: relative;
    display: inline-block;
    width: 12px;
    height: 10px;
    margin-top: 4px;
    border: 1.5px solid #8cecff;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(113, 231, 255, 0.4);
}

.lock-mark::before {
    position: absolute;
    bottom: 7px;
    left: 2px;
    width: 5px;
    height: 6px;
    border: 1.5px solid #8cecff;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    content: "";
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 5.8rem);
    font-weight: 850;
    letter-spacing: -0.065em;
    line-height: 0.94;
    text-wrap: balance;
    background: linear-gradient(105deg, #fff 15%, #bdcbe0 55%, #71e7ff 112%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lead {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.18rem);
    line-height: 1.7;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.game-card {
    --accent: var(--space);
    --accent-rgb: var(--space-rgb);
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(18, 27, 48, 0.96), var(--panel-deep));
    box-shadow:
        0 28px 75px rgba(0, 0, 0, 0.42),
        inset 0 1px rgba(255, 255, 255, 0.035);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.forest-card {
    --accent: var(--forest);
    --accent-rgb: var(--forest-rgb);
}

.classic-card {
    --accent: var(--classic);
    --accent-rgb: var(--classic-rgb);
}

.game-card::after {
    position: absolute;
    inset: auto 12% -1px;
    height: 1px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: 0 0 22px rgba(var(--accent-rgb), 0.65);
}

.game-card:hover {
    transform: translateY(-7px);
    border-color: rgba(var(--accent-rgb), 0.4);
    box-shadow:
        0 34px 85px rgba(0, 0, 0, 0.52),
        0 0 45px rgba(var(--accent-rgb), 0.07);
}

.cover-link {
    display: block;
    text-decoration: none;
}

.cover {
    position: relative;
    aspect-ratio: 2 / 3;
    margin: 0;
    overflow: hidden;
    background: #050713;
}

.cover::before {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    content: "";
    background:
        linear-gradient(to bottom, transparent 62%, rgba(5, 8, 17, 0.12) 74%, rgba(5, 8, 17, 0.96) 100%),
        linear-gradient(100deg, rgba(var(--accent-rgb), 0.07), transparent 40%);
}

.cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1), filter 250ms ease;
}

.game-card:hover .cover img {
    transform: scale(1.025);
    filter: saturate(1.06) contrast(1.02);
}

.cover-action {
    position: absolute;
    z-index: 2;
    right: 22px;
    bottom: 20px;
    left: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.cover-action b {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    border: 1px solid rgba(var(--accent-rgb), 0.55);
    border-radius: 50%;
    color: var(--accent);
    background: rgba(5, 9, 20, 0.72);
    font-size: 1.1rem;
    transition: transform 180ms ease, background 180ms ease;
}

.cover-link:hover .cover-action b {
    transform: translateX(3px);
    background: rgba(var(--accent-rgb), 0.17);
}

.game-copy {
    padding: 25px 25px 27px;
}

.game-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.game-type {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.035em;
}

.experiment-badge {
    flex: none;
    padding: 7px 9px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.075);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.game-copy > p {
    min-height: 4.8em;
    margin: 18px 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.62;
}

.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 6px 9px;
    border: 1px solid rgba(184, 205, 237, 0.13);
    border-radius: 6px;
    color: #bdc8da;
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.launch-button {
    display: flex;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 16px;
    border: 1px solid rgba(var(--accent-rgb), 0.38);
    border-radius: 10px;
    color: #fff;
    background:
        linear-gradient(105deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.045)),
        rgba(5, 9, 19, 0.64);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.launch-button span {
    color: var(--accent);
    font-size: 1.05rem;
}

.launch-button:hover {
    border-color: rgba(var(--accent-rgb), 0.75);
    background:
        linear-gradient(105deg, rgba(var(--accent-rgb), 0.26), rgba(var(--accent-rgb), 0.08)),
        rgba(5, 9, 19, 0.74);
    transform: translateY(-2px);
}

.lab-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 38px 0 2px;
    color: #758299;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}

.footer-line {
    width: 42px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(154, 188, 235, 0.35));
}

.footer-line:last-child {
    transform: rotate(180deg);
}

:focus-visible {
    outline: 3px solid #8cecff;
    outline-offset: 4px;
}

@media (max-width: 1040px) and (min-width: 761px) {
    .games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .game-card:last-child {
        width: calc(50% - 11px);
        grid-column: 1 / -1;
        justify-self: center;
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(560px, calc(100% - 26px));
        padding-top: 24px;
    }

    .lab-header {
        gap: 30px;
        padding-bottom: 30px;
    }

    .eyebrow {
        letter-spacing: 0.13em;
    }

    .games-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }

    .game-card:hover {
        transform: translateY(-3px);
    }

    .game-copy > p {
        min-height: 0;
    }
}

@media (max-width: 430px) {
    .page-shell {
        width: calc(100% - 20px);
    }

    .game-card {
        border-radius: 16px;
    }

    .game-copy {
        padding: 21px 18px 20px;
    }

    .game-heading {
        display: block;
    }

    .experiment-badge {
        display: inline-block;
        margin-top: 11px;
    }

    .cover-action {
        right: 17px;
        bottom: 16px;
        left: 17px;
    }

    .lab-footer {
        gap: 10px;
        letter-spacing: 0.08em;
    }

    .footer-line {
        width: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
