:root {
    --bg: #000000;
    --ink: #ffffff;
    --muted: #9a9a9a;
    --card: #111111;
    --line: #2a2a2a;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top,0px);
    padding-bottom: env(safe-area-inset-bottom,0px);
}

    :root[data-theme="light"] {
        --bg: #ffffff;
        --ink: #111111;
        --muted: #666666;
        --card: #f6f6f6;
        --line: #e2e2e2;
        color-scheme: light
    }

    :root[data-theme="dark"] {
        --bg: #181818;
        --ink: #f2f2f2;
        --muted: #a0a0a0;
        --card: #242424;
        --line: #343434;
        color-scheme: dark
    }

    :root[data-theme="black"] {
        --bg: #000000;
        --ink: #ffffff;
        --muted: #9a9a9a;
        --card: #111111;
        --line: #2a2a2a;
        color-scheme: dark
    }

    :root[data-theme="purple"] {
        --bg: #15131f;
        --ink: #f4f1ff;
        --muted: #a29fb8;
        --card: #201d2e;
        --line: #322e45;
        color-scheme: dark
    }

html {
    scroll-padding-top: env(safe-area-inset-top,0px)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Bricolage Grotesque",system-ui,-apple-system,"Segoe UI",sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column
}

    body::before {
        content: "";
        position: fixed;
        inset: 0 0 auto;
        height: env(safe-area-inset-top,0px);
        background: var(--bg);
        z-index: 10
    }

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%
}

a {
    color: inherit
}

main {
    flex: 1
}

/* top bar */
.top {
    position: sticky;
    top: env(safe-area-inset-top,0px);
    z-index: 11;
    background: var(--bg);
    border-bottom: 1px solid var(--line)
}

    .top .wrap {
        display: flex;
        justify-content: center;
        padding-top: 14px;
        padding-bottom: 14px
    }

.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px
}

.icons {
    display: flex;
    gap: 8px;
    margin-right: 6px
}

.ic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: .7rem;
    font-weight: 700;
    transition: background .2s
}

    .ic:hover {
        background: var(--line)
    }

.nb {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: inline-block;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 9px 16px;
    border-radius: 4px;
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    transition: background .2s
}

    .nb:hover {
        background: var(--line)
    }

    .nb.on {
        background: var(--ink);
        color: var(--bg);
        border-color: var(--ink)
    }

    .ic:focus-visible, .nb:focus-visible, .btn:focus-visible, .game:focus-visible, .drop summary:focus-visible {
        outline: 3px solid var(--ink);
        outline-offset: 3px
    }

/* home */
.hero {
    text-align: center;
    padding: 140px 0 130px
}

h1 {
    font-size: clamp(3rem,12vw,7rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
    margin: 0
}

.hero p {
    font-size: clamp(1.1rem,3vw,1.5rem);
    color: var(--muted);
    margin: 16px 0 36px;
    font-weight: 400
}

.btn {
    display: inline-block;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    font-size: 1rem;
    padding: 13px 28px;
    border-radius: 4px;
    text-decoration: none;
    transition: opacity .2s
}

    .btn:hover {
        opacity: .85
    }

/* games + contact pages */
h2.t {
    font-size: clamp(2.2rem,7vw,3.6rem);
    letter-spacing: -.04em;
    margin: 50px 0 6px;
    font-weight: 800
}

.sub {
    color: var(--muted);
    margin: 0 0 30px;
    font-size: 1.1rem
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(250px,1fr));
    gap: 22px;
    padding-bottom: 70px
}

.game {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color .2s
}

    .game:hover, .game:focus-visible {
        border-color: var(--ink)
    }

.thumb {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    display: grid;
    place-items: center;
    font-size: 3.4rem;
    background: color-mix(in srgb,var(--c) 24%,var(--card))
}

    .thumb img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

    .thumb b {
        font-weight: 700;
        color: color-mix(in srgb,var(--c) 60%,var(--ink))
    }

.info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px 18px
}

    .info h3 {
        margin: 0 0 4px;
        font-size: 1.25rem;
        letter-spacing: -.02em
    }

    .info p {
        margin: 0 0 12px;
        color: var(--muted);
        font-size: .95rem
    }

.soon, .tag {
    display: inline-block;
    margin-top: auto;
    font-size: .8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--line)
}

.cbox {
    display: grid;
    gap: 14px;
    max-width: 520px;
    padding-bottom: 70px
}

    .cbox a {
        display: block;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 4px;
        padding: 16px 18px;
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
        transition: border-color .2s
    }

        .cbox a:hover {
            border-color: var(--ink)
        }

    .cbox small {
        display: block;
        color: var(--muted);
        font-weight: 400;
        font-size: .9rem
    }

/* dropdown sections on the games page */
.drop {
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px
}

    .drop summary {
        cursor: pointer;
        list-style: none;
        display: flex;
        align-items: center;
        padding: 18px 0;
        font-size: 1.6rem;
        font-weight: 800;
        letter-spacing: -.03em
    }

        .drop summary::-webkit-details-marker {
            display: none
        }

        .drop summary::after {
            content: "";
            margin-left: auto;
            margin-right: 6px;
            width: 10px;
            height: 10px;
            border-right: 3px solid var(--ink);
            border-bottom: 3px solid var(--ink);
            transform: rotate(45deg);
            transition: transform .2s
        }

    .drop[open] summary::after {
        transform: rotate(-135deg)
    }

    .drop summary span {
        font-size: 1rem;
        font-weight: 400;
        color: var(--muted);
        margin-left: 10px
    }

    .drop .grid {
        padding: 10px 0 40px
    }

.empty {
    color: var(--muted);
    margin: 0;
    padding: 6px 0 40px
}

/* footer */
footer {
    border-top: 1px solid var(--line);
    padding: 30px 0 40px;
    margin-top: 20px
}

    footer .wrap {
        display: flex;
        flex-wrap: wrap;
        gap: 14px 28px;
        align-items: center;
        justify-content: center
    }

    footer small {
        color: var(--muted)
    }

/* pop-ups (game window + settings) */
dialog {
    border: 0;
    padding: 0;
    background: var(--card);
    color: var(--ink);
    border-radius: 4px;
    width: min(1000px,96vw);
    max-height: 94vh;
    overflow: hidden
}

    dialog::backdrop {
        background: rgba(0,0,0,.7);
        backdrop-filter: blur(4px)
    }

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px
}

    .bar h3 {
        margin: 0;
        font-size: 1.1rem
    }

    .bar button {
        all: unset;
        cursor: pointer;
        font-weight: 600;
        padding: 6px 16px;
        border-radius: 99px;
        background: var(--line)
    }

        .bar button:hover {
            background: var(--ink);
            color: var(--bg)
        }

        .bar button:focus-visible {
            outline: 3px solid var(--ink)
        }

.frame {
    width: 100%;
    aspect-ratio: var(--ar,16/10);
    max-height: 76vh;
    background: #000;
    display: grid;
    place-items: center;
    color: #fff;
    text-align: center
}

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

    .frame div {
        padding: 30px;
        max-width: 420px
    }

.desc {
    padding: 12px 18px 16px;
    color: var(--muted);
    margin: 0
}

/* settings window */
.settings-dlg {
    width: min(420px,94vw)
}

.sbody {
    padding: 6px 18px 22px
}

    .sbody h4 {
        margin: 0 0 10px;
        font-size: 1rem;
        color: var(--muted);
        font-weight: 600
    }

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

    .swatches button {
        all: unset;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 14px;
        border: 2px solid var(--line);
        border-radius: 4px;
        font-weight: 600;
        font-size: .95rem
    }

        .swatches button:hover {
            border-color: var(--muted)
        }

        .swatches button[aria-pressed="true"] {
            border-color: var(--ink)
        }

        .swatches button:focus-visible {
            outline: 3px solid var(--ink);
            outline-offset: 2px
        }

    .swatches i {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 1px solid #888;
        flex: none
    }

@media (prefers-reduced-motion:reduce) {
    * {
        transition: none !important
    }
}
