@font-face {
    font-family: 'PressStart2P';
    src: url('fonts/PressStart2P.woff2') format('woff2'), url('fonts/PressStart2P.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter_24pt-Regular.woff2') format('woff2'), url('fonts/Inter_24pt-Regular.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('fonts/Inter_24pt-SemiBold.woff2') format('woff2'), url('fonts/Inter_24pt-SemiBold.woff') format('woff');
    font-weight: 600;
    font-display: swap;
}

:root {
    color-scheme: dark;
    --navy: #070a26;
    --gold: #f7b600;
    --text: #eef1ff;
    --muted: #a9b2d8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-width: 280px;
    min-height: 100vh;
    min-height: 100svh;
    color: var(--text);
    background: var(--navy);
    font: 400 14px/1.5 'Inter', sans-serif;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(180deg, #070a26c9, #070a26e8), url('./assets/bg-neon-2.jpg') center / cover no-repeat;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button:focus-visible, a:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 5px;
}

.hub {
    width: min(100%, 920px);
    margin-inline: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding: max(76px, calc(env(safe-area-inset-top) + 72px)) 24px max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.eyebrow {
    margin: 0 0 25px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .22em;
    text-align: center;
}
.eyebrow > span:first-child { color: var(--gold); font-size: 15px; margin-right: 6px; }
.eyebrow-divider { margin-inline: 9px; opacity: .5; }
.carousel { width: 100%; }
.game-heading { min-height: 88px; text-align: center; }
.game-counter { margin: 0 0 13px; font-size: 10px; letter-spacing: .2em; color: var(--gold); }
h1 {
    margin: 0 0 26px;
    font: 400 clamp(15px, 3.4vw, 25px)/1.6 'PressStart2P', monospace;
    text-shadow: 0 3px 20px #0008;
}
.stage {
    display: grid;
    grid-template-columns: 52px minmax(0, 460px) 52px;
    gap: clamp(12px, 3vw, 32px);
    align-items: center;
    justify-content: center;
}
.viewport {
    overflow: hidden;
    border: 1px solid #6d8ad780;
    border-radius: 18px;
    background: #0f1338;
    box-shadow: 0 0 0 6px #1a1f712e, 0 20px 65px #0008, 0 0 65px #3543cb26;
    touch-action: pan-y pinch-zoom;
}
.track {
    display: flex;
    transition: transform 420ms cubic-bezier(.22, .68, .21, 1);
}
.slide { flex: 0 0 100%; min-width: 0; margin: 0; }
.game-art {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 1;
    background: #0f1338;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
}
a.game-art { cursor: pointer; }
button.game-art { cursor: default; }
.game-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    transition: filter 180ms ease;
    user-select: none;
    -webkit-user-drag: none;
}
.game-art:focus-visible { outline-offset: -5px; }
.play-badge {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border: 1px solid #ffe28a;
    border-radius: 6px;
    background: var(--gold);
    box-shadow: 0 4px 20px #0006;
    color: var(--navy);
    font-weight: 600;
    white-space: nowrap;
}
.arrow {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 13px;
    border: 1px solid #5664b0;
    border-radius: 12px;
    background: #12163fe6;
    color: var(--text);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.arrow svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; }
.arrow:disabled { opacity: .28; cursor: default; }
.arrow:active:not(:disabled) { transform: scale(.94); }
.launch-hint { min-height: 21px; margin: 16px 0 20px; text-align: center; color: var(--muted); font-size: 12px; }
.launch-hint.available { color: var(--gold); }
.thumbnails { display: grid; grid-template-columns: repeat(4, minmax(0, 80px)); gap: 14px; justify-content: center; }
.thumbnail {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 4px;
    border: 2px solid #3b4679;
    border-radius: 11px;
    background: #0a0d33;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.thumbnail img { width: 100%; height: 100%; display: block; object-fit: contain; border-radius: 5px; opacity: .6; transition: opacity 160ms ease; }
.thumbnail[aria-current='true'] { border-color: var(--gold); box-shadow: 0 0 20px #f7b60026; transform: translateY(-4px); }
.thumbnail[aria-current='true'] img { opacity: 1; }
.thumbnail[aria-current='true']::after { content: ''; position: absolute; width: 16px; height: 3px; bottom: -10px; left: calc(50% - 8px); background: var(--gold); border-radius: 2px; }
.controls-hint { margin: 25px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.controls-hint span { margin-inline: 6px; color: var(--gold); }
.noscript { text-align: center; }

.view-switch {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 10;
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid #5664b0;
    border-radius: 12px;
    background: #0a0d33f5;
    box-shadow: 0 4px 20px #0004;
}
.view-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: color 160ms ease, background 160ms ease;
}
.view-switch svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.view-switch button[aria-pressed='true'] { background: #f7b6001f; color: var(--gold); border-color: #f7b60070; }
.cards-view { width: 100%; max-width: 680px; }
.cards-view h1 { text-align: center; }
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 0; list-style: none; }
.game-card {
    min-width: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid #6d8ad780;
    border-radius: 15px;
    background: #0f1338;
    box-shadow: 0 12px 32px #0005;
    transition: border-color 180ms ease, transform 180ms ease;
}
.game-card .game-art { height: 100%; aspect-ratio: auto; text-align: left; }
.game-card img { object-fit: cover; }
.card-caption {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 55px 20px 20px;
    background: linear-gradient(transparent, #070a26e8 55%, #070a26fa);
    pointer-events: none;
}
.card-name { font: 400 clamp(11px, 1.8vw, 15px)/1.7 'PressStart2P', monospace; }
.card-status { color: var(--gold); font-size: 12px; font-weight: 600; }
.game-art[aria-disabled='true'] .card-status { color: var(--muted); }

@media (hover: hover) {
    .view-switch button:hover { background: #252c6b; color: var(--text); }
    .game-card:has(a):hover { border-color: var(--gold); transform: translateY(-3px); }
    .arrow:hover:not(:disabled) { background: #252c6b; border-color: var(--gold); }
    .thumbnail:hover { border-color: #ffe28a; }
    .thumbnail:hover img { opacity: 1; }
    a.game-art:hover img { filter: brightness(1.08); }
}

@media (max-width: 580px) {
    .hub { padding-inline: 16px; }
    .view-switch button span { display: none; }
    .game-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .game-card { aspect-ratio: 4 / 3; }
    .card-name { font-size: clamp(11px, 3vw, 15px); }
    .eyebrow { margin-bottom: 24px; font-size: 9px; }
    .game-heading { min-height: 80px; }
    .stage { position: relative; display: block; padding-bottom: 62px; max-width: 460px; margin-inline: auto; }
    .viewport { border-radius: 12px; }
    .arrow { position: absolute; bottom: 0; width: 44px; height: 44px; padding: 10px; }
    .arrow-prev { left: calc(50% - 54px); }
    .arrow-next { right: calc(50% - 54px); }
    .launch-hint { margin-top: 12px; }
    .thumbnails { gap: 10px; grid-template-columns: repeat(4, minmax(0, 68px)); }
    .controls-hint { font-size: 10px; }
}

@media (min-width: 581px) and (max-height: 820px) {
    .stage { grid-template-columns: 52px minmax(0, min(430px, 51vh)) 52px; }
    .eyebrow { margin-bottom: 14px; }
    .game-heading { min-height: 78px; }
    .thumbnails { grid-template-columns: repeat(4, minmax(0, 65px)); }
    .hub:has(.cards-view:not([hidden])) {
        padding-top: max(76px, calc(env(safe-area-inset-top) + 72px));
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    .hub:has(.cards-view:not([hidden])) .eyebrow { margin-bottom: 12px; }
    .cards-view h1 { margin-bottom: 16px; }
    .game-grid {
        gap: 16px;
        grid-auto-rows: clamp(120px, calc((100vh - 210px) / 2), 300px);
        grid-auto-rows: clamp(120px, calc((100svh - 210px) / 2), 300px);
    }
    .game-card { aspect-ratio: auto; }
    .card-caption { gap: 6px; padding: 36px 16px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}
