:root {
    color-scheme: dark;
    --bg: #10131c;
    --panel: #1b2030;
    --line: #2b3244;
    --accent: #a9f342;
    --muted: #a0a9bb;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 95px;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    background: var(--bg);
    color: #f5f7fb;
    font: 15px/1.5 system-ui,sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
}

button, a, input {
    outline-offset: 4px;
}

button {
    cursor: pointer;
}

header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #151925f5;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
}

.nav {
    max-width: 1440px;
    margin: auto;
    padding: 17px 32px;
    display: flex;
    gap: 40px;
    align-items: center;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 23px;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 4px;
    margin-top: 5px;
}

.accent {
    color: var(--accent);
}

nav {
    display: flex;
    gap: 24px;
    color: var(--muted);
    font-weight: 600;
}

nav a:hover, footer a:hover {
    color: var(--accent);
}

.navbutton {
    margin-left: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 14px;
}

main {
    max-width: 1440px;
    margin: auto;
    padding: 28px 32px 60px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 800;
}

h1 {
    font-size: clamp(34px,4vw,60px);
    letter-spacing: -2px;
    line-height: 1.04;
    margin: 14px 0;
}

h2 {
    font-size: 24px;
    letter-spacing: -.7px;
    margin: 6px 0;
}

p {
    color: var(--muted);
}

.primary {
    background: var(--accent);
    color: #142009;
    font-weight: 800;
    display: inline-flex;
    gap: 25px;
    padding: 13px 22px;
    border-radius: 9px;
    border: 0;
    margin-top: 12px;
}

.primary:hover {
    background: #c4ff7b;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button, input {
    background: var(--panel);
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 15px;
}

input {
    min-width: 220px;
}

.sectionhead {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sectionhead>span, small {
    color: var(--muted);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(190px,1fr));
    gap: 16px;
}

.tile {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 11px;
    overflow: hidden;
    transition: transform .18s,border-color .18s;
    position: relative;
}

.tile:hover, .tile:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.art {
    position: relative;
    aspect-ratio: 4/3;
    background: #30374a;
    overflow: hidden;
}

.art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tile-info {
    padding: 10px 12px;
}

.tile-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

article {
    margin-top: 32px;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

footer {
    max-width: 1440px;
    margin: auto;
    border-top: 1px solid var(--line);
    padding: 30px 32px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
}

.back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--muted);
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 260px;
    gap: 24px;
}

.player {
    position: relative;
    aspect-ratio: var(--ratio);
    background: #080a10;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    isolation: isolate;
    max-height: 80vh;
}

.player>img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.35) blur(4px);
    z-index: -1;
}

.launch {
    text-align: center;
    padding: 15px;
}

.launch h1 {
    font-size: clamp(22px,4vw,45px);
}

.launch small {
    display: block;
    margin-top: 15px;
}

.player iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.gamebar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--panel);
    border-radius: 0 0 10px 10px;
}

.sidegrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.sidegrid .tile-info {
    padding: 7px;
}

.sidegrid .tile-info strong {
    font-size: 12px;
}

[hidden] {
    display: none !important;
}

@media(max-width:850px) {
    .nav {
        gap: 20px;
        padding: 12px 18px;
    }

    .navbutton {
        display: none;
    }

    main {
        padding: 18px;
    }

    .game-layout {
        grid-template-columns: 1fr;
    }

    .sidegrid {
        grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
    }
}

@media(max-width:500px) {
    nav {
        gap: 10px;
        font-size: 12px;
    }

    .brand {
        font-size: 18px;
    }

    .brand img {
        width: 28px;
    }

    .grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 10px;
    }

    input {
        width: 100%;
    }

    footer {
        flex-direction: column;
    }

    .tile-info strong {
        font-size: 13px;
    }
}

#status:not(:empty) {
    padding: 14px 0;
    color: var(--muted);
}

#more {
    display: block;
    margin: 24px auto;
}

#retry {
    margin-bottom: 20px;
}

.hover-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0;
}

@keyframes preview-reveal {
    from {
        opacity: 0;
        transform: scale(.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media(prefers-reduced-motion:reduce) {
    .tile {
        transition: none;
    }
}

.portal {
    --bg: #151622;
    --panel: #222435;
    --line: #303244;
    --accent: #a9f342;
    --header-h: 64px;
    --sidebar-w: 214px;
    --muted: #a6a8bb;
}

.portal header {
    position: fixed;
    inset: 0 0 auto;
    height: var(--header-h);
    z-index: 20;
    background: #202131;
    border: 0;
    box-shadow: 0 2px 8px #0003;
}

.portal .nav {
    height: 100%;
    max-width: none;
    padding: 0 20px;
    gap: 15px;
}

.portal .brand {
    font-size: 23px;
    flex-shrink: 0;
}

.menu-toggle {
    background: transparent;
    border: 0;
    font-size: 23px;
    padding: 4px 8px;
    line-height: 1.5;
    display: grid;
    place-items: center;
}

.menu-toggle:hover {
    background: #ffffff12;
}

.search-wrap {
    position: relative;
    margin: 0 auto;
    width: min(470px,45vw);
    display: flex;
    align-items: center;
}

.search-wrap svg {
    position: absolute;
    left: 15px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: #b4b6c8;
    stroke-width: 2;
    pointer-events: none;
}

.search-wrap input {
    min-width: 0;
    width: 100%;
    background: #34364a;
    border: 1px solid #44465b;
    border-radius: 24px;
    padding: 11px 16px 11px 44px;
    color: white;
}

.search-wrap input::placeholder {
    color: #b4b6c8;
}

.sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    width: var(--sidebar-w);
    background: #202131;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 15;
    padding: 12px 9px;
    scrollbar-width: thin;
    scrollbar-color: #44465a transparent;
}

.sidebar .chips {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #ececf3;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 13px;
    border-radius: 8px;
    min-height: 43px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.side-link:hover, .side-link.active {
    background: #35374a;
    color: #fff;
}

.side-link.active {
    box-shadow: inset 3px 0 var(--accent);
}

.category-icon {
    text-align: center;
    font-size: 21px;
    color: #b9b9cf;
    line-height: 1;
    display: grid;
    place-items: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
}

.active .category-icon {
    color: var(--accent);
}

.nav-heading {
    padding: 18px 12px 7px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #9da0b7;
    border-top: 1px solid #ffffff0a;
    margin-top: 8px;
}

.portal main {
    max-width: none;
    margin: var(--header-h) 0 0 var(--sidebar-w);
    padding: 22px 24px 44px;
}

.portal footer {
    max-width: none;
    margin-left: var(--sidebar-w);
}

.portal.menu-collapsed main, .portal.menu-collapsed footer {
    margin-left: 0;
}

.portal.menu-collapsed .sidebar {
    display: none;
}

.portal #catalog {
    padding-top: 8px;
    --tile-min: 132px;
    --tile-gap: 10px;
}

.portal .sectionhead {
    align-items: center;
    margin: 0 0 12px;
}

.portal .sectionhead h1, .portal .sectionhead h2 {
    font-size: 23px;
    line-height: 1.25;
    letter-spacing: -.4px;
    margin: 0;
    font-weight: 750;
}

.portal .recent-section {
    margin-bottom: 36px;
}

.portal .tile {
    border: 0;
    border-radius: 9px;
    background: transparent;
    overflow: visible;
}

.portal .tile:hover {
    transform: none;
}

.portal .art {
    border-radius: 9px;
    overflow: hidden;
}

.portal .tile-info {
    padding: 5px 3px 2px;
}

.portal .tile-info strong {
    font-size: 13px;
    font-weight: 650;
}

.portal .art.preview-playing {
    overflow: visible;
}

.portal .game-layout {
    grid-template-columns: minmax(0,1fr) minmax(180px,260px);
}

.portal .sidegrid {
    gap: 9px;
}

.portal .back {
    margin-bottom: 12px;
}

#scrim {
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 14;
    background: #0009;
    border: 0;
    border-radius: 0;
}

@media(max-width:1100px) {
    .portal .game-layout {
        grid-template-columns: 1fr;
    }

    .portal .sidegrid {
        grid-template-columns: repeat(auto-fill,minmax(130px,1fr));
    }
}

@media(max-width:760px) {
    .portal {
        --header-h: 58px;
    }

    .portal .nav {
        gap: 8px;
        padding: 0 10px;
    }

    .portal .brand {
        font-size: 18px;
    }

    .portal .brand img {
        width: 28px;
        height: 28px;
    }

    .portal .brand small {
        font-size: 8px;
        letter-spacing: 2px;
    }

    .search-wrap {
        flex: 1;
        width: auto;
        margin-left: 6px;
    }

    .search-wrap input {
        font-size: 13px;
        padding: 9px 10px 9px 35px;
    }

    .search-wrap svg {
        left: 10px;
        width: 17px;
    }

    .sidebar, .portal.menu-collapsed .sidebar {
        display: none;
    }

    .portal.menu-open .sidebar {
        display: block;
    }

    .portal main, .portal footer {
        margin-left: 0;
        padding: 16px 12px;
    }

    .portal .sectionhead h1, .portal .sectionhead h2 {
        font-size: 20px;
    }
}

@media(max-width:380px) {
    .portal .brand img {
        display: none;
    }
}

.portal #catalog .grid {
    grid-template-columns: repeat(auto-fill, minmax(min(var(--tile-min), calc((100% - var(--tile-gap)) / 2)), 1fr));
    gap: var(--tile-gap);
    align-items: start;
}

.portal .tile .art {
    background: transparent;
}

.portal .tile .art>img {
    transition: opacity .18s ease;
}

.portal .tile .art.preview-playing>img {
    opacity: 0;
}

.hover-preview.floating-preview {
    position: fixed;
    inset: auto;
    left: var(--preview-left);
    top: var(--preview-top);
    width: var(--preview-width);
    height: var(--preview-height);
    object-fit: contain;
    opacity: 1;
    pointer-events: none;
    z-index: 19;
    border-radius: 11px;
    box-shadow: 0 12px 35px #000b;
    outline: 1px solid var(--accent);
    animation: preview-reveal .18s ease-out both;
    background: transparent;
}

@media(max-width:760px) {
    .portal #catalog {
        --tile-min: 110px;
        --tile-gap: 8px;
    }
}

@media(prefers-reduced-motion:reduce) {
    .portal .tile .art>img {
        transition: none;
    }

    .hover-preview.floating-preview {
        animation: none;
    }
}

.category-icon svg {
    width: 24px;
    height: 24px;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.action-footer {
    border-top: 0;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    padding: 24px 24px 40px;
    color: inherit;
}

.footer-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 54px;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 750;
    font-size: 17px;
    line-height: 1.25;
    white-space: nowrap;
    transition: background .15s,filter .15s;
}

.footer-action svg {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
}

.random-game {
    border: 1px solid #e1e3ed;
    background: transparent;
    color: #f5f7fb;
}

.random-game:hover {
    background: #ffffff12;
    color: #fff;
}

.random-game:disabled {
    opacity: .45;
    cursor: default;
}

.back-top {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #142009;
}

.back-top:hover, .action-footer .back-top:hover {
    filter: brightness(1.1);
    color: #142009;
}

.portal main {
    padding-bottom: 20px;
    min-height: 0;
}

@media(max-width:760px) {
    .action-footer, .portal .action-footer {
        gap: 12px;
        padding: 18px 12px 28px;
    }

    .footer-action {
        font-size: 14px;
        padding: 10px 16px;
        min-height: 46px;
    }

    .footer-action svg {
        width: 20px;
        height: 20px;
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto;
    }

    .footer-action {
        transition: none;
    }
}

/* Information links share the category navigation style. */
.sidebar-links {
    margin: 18px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #ececf3;
}
.sidebar-links .side-link {
    justify-content: center;
    text-align: center;
}

.sidebar-links button.side-link {
    border: 0;
    background: transparent;
    color: inherit;
}

.sidebar-links button.side-link:hover {
    background: #35374a;
    color: #fff;
}
