/* Games index — the page around the cabinets.
 *
 * Loaded after Kit/kit.css and built on its tokens: the four screens (colour
 * sets on .arcade[data-theme]), the two pixel fonts, .arcade-btn and friends.
 * The kit sheet is written for a full-screen game, so the first block below
 * turns the body back into a page that scrolls.
 *
 * Press Start 2P is drawn on an 8px grid; its sizes here stay on 8, 16, 24,
 * 32 and 40 where a heading carries it, so the glyphs land on whole pixels.
 * Motion is stepped on purpose, and all of it stops for reduced motion.
 */

/* ---- the page ------------------------------------------------------------ */

body.arcade.hub {
    height: auto;
    min-height: 100%;
    overflow: visible;
    overflow-x: clip;
    overscroll-behavior: auto;
    line-height: 1.25;
}

.hub {
    --hub-surface: color-mix(in srgb, var(--fg) 3%, var(--bg));
    --hub-raised: color-mix(in srgb, var(--fg) 6%, var(--bg));
    --hub-shadow: color-mix(in srgb, var(--fg) 10%, transparent);
    --hub-floor: color-mix(in srgb, var(--right) 34%, transparent);
    --hub-hl-a: var(--p2);
    --hub-hl-b: var(--p4);
    --hub-gap: clamp(64px, 9vw, 120px);
}

.hub[data-theme="phosphor"] {
    --hub-hl-a: var(--p4);
    --hub-hl-b: var(--p1);
}

.hub[data-theme="amber"] {
    --hub-hl-a: var(--p2);
    --hub-hl-b: var(--p1);
}

.hub[data-theme="synthwave"] {
    --hub-hl-a: var(--p1);
    --hub-hl-b: var(--p2);
}

.hub ::selection {
    background: var(--wild);
    color: var(--bg);
}

.hub a {
    color: inherit;
}

.hub h1,
.hub h2,
.hub h3 {
    font-weight: 400;
}

.hub svg {
    fill: currentColor;
}

.hub-icon {
    width: auto;
    height: 0.9em;
    flex: none;
}

.hub-wrap {
    width: min(1180px, 100% - 32px);
    margin-inline: auto;
}

/* The glass over everything: scanlines only, and nothing to click on. */
body.hub::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 3px);
    will-change: transform;
}

body.hub[data-crt="off"]::after {
    display: none;
}

.hub-skip {
    position: absolute;
    left: 16px;
    top: -80px;
    z-index: 95;
    padding: 12px 14px;
    background: var(--fg);
    color: var(--bg);
    font-family: var(--pixel);
    font-size: 10px;
    text-decoration: none;
}

.hub-skip:focus {
    top: 12px;
}

/* ---- boot: every block steps in, top to bottom --------------------------- */

.hub-in {
    animation: hub-boot 0.42s steps(6, end) backwards;
    animation-delay: calc(min(var(--i, 0), 14) * 45ms + 60ms);
}

@keyframes hub-boot {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ---- header ---------------------------------------------------------------- */

.hub-head {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 2px solid var(--line);
    background: var(--bg);
}

.hub-head-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 64px;
}

.hub-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--fg);
    text-decoration: none;
    white-space: nowrap;
}

.hub-mark {
    width: 27px;
    height: 27px;
    flex: none;
    filter: drop-shadow(0 0 5px var(--glow));
}

.hub-mark .hub-mark-ball {
    fill: var(--bad);
}

.hub-mark .hub-mark-button {
    fill: var(--wild);
}

.hub-brand:hover .hub-mark {
    animation: arcade-hop 1.2s ease-in-out infinite;
}

.hub-brand-name {
    font-family: var(--pixel);
    font-size: 16px;
    letter-spacing: 0.06em;
    text-shadow: 0 0 8px var(--glow);
}

.hub-brand-tag {
    padding: 4px 6px 3px;
    background: var(--wild);
    color: var(--bg);
    font-family: var(--pixel);
    font-size: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hub-nav {
    display: flex;
    gap: 28px;
    margin-left: auto;
}

.hub-nav a {
    position: relative;
    padding: 12px 0;
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 10px;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.hub-nav a::before {
    content: '';
    position: absolute;
    left: -13px;
    top: 50%;
    border: 4px solid transparent;
    border-left: 5px solid currentColor;
    transform: translateY(-50%);
    opacity: 0;
}

.hub-nav a:hover,
.hub-nav a:focus-visible {
    color: var(--fg);
}

.hub-nav a:hover::before,
.hub-nav a:focus-visible::before {
    opacity: 1;
    animation: arcade-blink 0.8s steps(1) infinite;
}

.hub-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hub-screen-icon {
    width: 16px;
    height: 16px;
}

.hub-screen-icon .hub-screen-a { fill: var(--fg); }
.hub-screen-icon .hub-screen-b { fill: var(--p2); }
.hub-screen-icon .hub-screen-c { fill: var(--p3); }
.hub-screen-icon .hub-screen-d { fill: var(--p4); }

.hub-head-exit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border: 2px solid var(--line);
    color: var(--fg);
    font-family: var(--pixel);
    font-size: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.hub-head-exit:hover {
    border-color: var(--fg);
    box-shadow: 0 0 10px var(--glow);
}

.hub-head-exit-short {
    display: none;
}

/* ---- shared section grammar ---------------------------------------------- */

.hub-section {
    padding: var(--hub-gap) 0;
    border-top: 2px dashed var(--line);
}

.hub-ticker + .hub-section {
    border-top: 0;
}

.hub-section-head {
    max-width: 52rem;
    margin-bottom: clamp(32px, 5vw, 56px);
}

.hub-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin: 0 0 20px;
    color: var(--wild);
    font-family: var(--pixel);
    font-size: 10px;
    line-height: 1.6;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hub-eyebrow::before {
    content: '';
    width: 8px;
    height: 8px;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.hub-h2 {
    margin: 0;
    font-family: var(--pixel);
    font-size: 16px;
    line-height: 1.6;
    text-shadow: 0 0 12px var(--glow);
    text-wrap: balance;
}

.hub-lead {
    margin: 18px 0 0;
    max-width: 42rem;
    color: var(--dim);
    font-size: 24px;
    line-height: 1.2;
}

/* Two bands of colour, like the marquee of a cabinet. */
.hub-hl {
    background: linear-gradient(180deg, var(--hub-hl-a) 0 52%, var(--hub-hl-b) 52% 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--hub-hl-b) 45%, transparent));
}

.hub-btn.arcade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto;
    text-decoration: none;
    white-space: nowrap;
}

.hub-btn.arcade-btn:focus-visible::before {
    display: none;
}

/* ---- hero ----------------------------------------------------------------- */

.hub-hero {
    position: relative;
    isolation: isolate;
    overflow: clip;
    padding: clamp(40px, 8vh, 88px) 0 clamp(64px, 9vw, 112px);
}

/* A floor of light running towards the viewer. The fade into the page is a
   gradient on top rather than a mask, so the moving grid stays on the GPU. */
.hub-floor {
    position: absolute;
    left: -20%;
    right: -20%;
    bottom: 0;
    height: 42%;
    z-index: -1;
    overflow: hidden;
    perspective: 240px;
    perspective-origin: 50% 0;
    pointer-events: none;
    opacity: 0.5;
}

.hub-floor::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 18%, color-mix(in srgb, var(--bg) 55%, transparent) 55%, transparent 100%);
}

.hub-floor::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 260%;
    transform-origin: 50% 0;
    transform: rotateX(64deg);
    background-image:
        linear-gradient(var(--hub-floor) 2px, transparent 2px),
        linear-gradient(90deg, var(--hub-floor) 2px, transparent 2px);
    background-size: 56px 56px;
    background-position: center top;
    animation: hub-floor 2.8s linear infinite;
    will-change: transform;
}

@keyframes hub-floor {
    from { transform: rotateX(64deg) translateY(0); }
    to { transform: rotateX(64deg) translateY(56px); }
}

.hub-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    align-items: center;
    gap: clamp(40px, 5vw, 72px);
}

.hub-hero .hub-eyebrow {
    color: var(--dim);
}

.hub-hero .hub-eyebrow::before {
    background: var(--good);
    box-shadow: 0 0 8px var(--good);
}

.hub-freeplay {
    padding: 3px 6px 2px;
    border: 2px solid var(--wild);
    color: var(--wild);
}

@keyframes hub-pulse {
    0%, 55% { opacity: 1; }
    56%, 100% { opacity: 0.2; }
}

.hub-hero-title {
    margin: 0;
    font-family: var(--pixel);
    font-size: 20px;
    line-height: 1.5;
    text-shadow: 0 0 16px var(--glow), 0 0 2px var(--fg);
}

.hub-cursor {
    display: inline-block;
    width: 0.62em;
    height: 0.9em;
    margin-left: 0.18em;
    vertical-align: -0.04em;
    background: var(--hub-hl-b);
    box-shadow: 0 0 12px var(--hub-hl-b);
    animation: arcade-blink 1s steps(1) infinite;
}

.hub-hero-lead {
    max-width: 34rem;
    margin: 28px 0 0;
    font-size: 26px;
    line-height: 1.2;
}

.hub-hero-note {
    max-width: 34rem;
    margin: 16px 0 0;
    color: var(--dim);
    font-size: 22px;
}

.hub-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hub-actions .hub-icon {
    height: 8px;
}

.hub-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 44px;
    margin: 40px 0 0;
    padding-top: 26px;
    border-top: 2px dashed var(--line);
}

.hub-stat {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
}

.hub-stat dd {
    margin: 0;
    font-family: var(--pixel);
    font-size: 24px;
    line-height: 1;
    text-shadow: 0 0 12px var(--glow);
    font-variant-numeric: tabular-nums;
}

.hub-stat dt {
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---- the monitor ------------------------------------------------------------ */

.hub-tv {
    margin: 0;
    min-width: 0;
}

.hub-tv-case {
    position: relative;
    padding: clamp(12px, 2vw, 20px) clamp(12px, 2vw, 20px) 0;
    border: 2px solid var(--line);
    background: linear-gradient(180deg, var(--hub-raised), var(--hub-surface));
    box-shadow:
        10px 10px 0 var(--hub-shadow),
        0 0 80px -30px var(--glow);
}

.hub-tv-screen {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 26px / 20px;
    background: var(--bg);
    box-shadow: 0 0 0 2px #000, 0 0 0 5px var(--line);
}

.hub-tv-nosignal {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 10px;
    text-transform: uppercase;
    animation: arcade-blink 1.4s steps(1) infinite;
}

.hub-tv-screen canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    animation: hub-power 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.35s backwards;
}

@keyframes hub-power {
    0% {
        transform: scale(0.04, 0.008);
        filter: brightness(4);
    }
    40% {
        transform: scale(1, 0.008);
        filter: brightness(3);
    }
    75% {
        transform: scale(1, 1);
        filter: brightness(1.5);
    }
    100% {
        transform: none;
        filter: none;
    }
}

/* Curved glass: scanlines, a dark rim, a soft reflection and one rolling band. */
.hub-tv-glass {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
    background:
        repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.3) 2px 3px),
        radial-gradient(120% 90% at 30% 10%, rgba(255, 255, 255, 0.07), transparent 45%),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.65) 100%);
    box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.85);
}

.hub-tv-glass::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -25%;
    height: 25%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: hub-roll 7s linear infinite;
    will-change: transform;
}

@keyframes hub-roll {
    to { transform: translateY(500%); }
}

.hub[data-crt="off"] .hub-tv-glass {
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
}

.hub[data-crt="off"] .hub-tv-glass::after {
    display: none;
}

.hub-tv-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 64px;
    padding: 8px 2px;
}

.hub-tv-brand {
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.hub-tv-led {
    width: 8px;
    height: 8px;
    background: var(--good);
    box-shadow: 0 0 8px var(--good);
    animation: hub-led 3.2s steps(1) infinite;
}

@keyframes hub-led {
    0%, 92% { opacity: 1; }
    93%, 96% { opacity: 0.35; }
    97%, 100% { opacity: 1; }
}

.hub-tv-dial {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.hub-tv-knob {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--line);
    background: var(--bg);
    color: var(--fg);
    cursor: var(--cur-hand, pointer);
}

.hub-tv-knob:hover {
    border-color: var(--fg);
    box-shadow: 0 0 10px var(--glow);
}

.hub-tv-knob:active {
    transform: translateY(2px);
}

.hub-tv-knob .hub-icon {
    height: 12px;
}

.hub-tv-channel {
    min-width: 5.5em;
    padding: 6px 4px;
    border: 2px solid var(--line);
    background: #000;
    color: var(--good);
    font-family: var(--pixel);
    font-size: 10px;
    text-align: center;
    text-shadow: 0 0 6px var(--good);
}

.hub-tv-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 16px;
    color: var(--dim);
    font-size: 22px;
}

.hub-tv-now strong {
    margin-left: 6px;
    color: var(--fg);
    font-family: var(--pixel);
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

.hub-tv-play {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--wild);
    font-family: var(--pixel);
    font-size: 10px;
    text-decoration: none;
    text-transform: uppercase;
}

.hub-tv-play:hover .hub-icon {
    animation: arcade-blink 0.8s steps(1) infinite;
}

.hub-tv-play .hub-icon {
    height: 10px;
}

/* ---- ticker ----------------------------------------------------------------- */

.hub-ticker {
    overflow: hidden;
    border-block: 2px solid var(--line);
    background: var(--hub-surface);
}

.hub-ticker-track {
    display: flex;
    width: max-content;
    animation: hub-ticker 56s linear infinite;
    will-change: transform;
}

.hub-ticker:hover .hub-ticker-track {
    animation-play-state: paused;
}

.hub-ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    padding: 14px 28px 14px 0;
    font-family: var(--pixel);
    font-size: 10px;
    text-transform: uppercase;
    white-space: nowrap;
}

.hub-ticker-item::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--dim);
}

.hub-ticker-item.is-tone-1 { color: var(--fg); }
.hub-ticker-item.is-tone-2 { color: var(--p2); }
.hub-ticker-item.is-tone-3 { color: var(--p3); }
.hub-ticker-item.is-tone-4 { color: var(--p4); }

@keyframes hub-ticker {
    to { transform: translateX(-50%); }
}

/* ---- 01 the games ----------------------------------------------------------- */

.hub-games {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hub-games > li {
    min-width: 0;
}

.hub-cart {
    --tone: var(--p3);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 2px solid var(--line);
    background: var(--hub-surface);
    box-shadow: 6px 6px 0 var(--hub-shadow);
    transition: transform 0.12s steps(2, end), box-shadow 0.12s steps(2, end), border-color 0.12s steps(2, end);
}

.hub-cart.is-tone-2 { --tone: var(--p2); }
.hub-cart.is-tone-3 { --tone: var(--p4); }

.hub-cart:hover,
.hub-cart:has(:focus-visible) {
    transform: translate(-3px, -3px);
    border-color: var(--tone);
    box-shadow: 10px 10px 0 color-mix(in srgb, var(--tone) 40%, transparent);
}

.hub-cart-screen {
    position: relative;
    aspect-ratio: 16 / 10;
    margin: 12px 12px 0;
    overflow: hidden;
    border: 2px solid var(--line);
    background: var(--bg);
}

.hub-cart-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.28) 2px 3px),
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

.hub[data-crt="off"] .hub-cart-screen::after {
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}

.hub-cart-logo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 12px;
    color: var(--tone);
    font-family: var(--pixel);
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 0 12px var(--tone);
}

.hub-cart-screen canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.hub-cart-no {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    padding: 4px 5px 3px;
    border: 2px solid var(--line);
    background: var(--bg);
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
}

.hub-cart-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 20px 20px 18px;
}

.hub-cart-title {
    margin: 0;
    font-family: var(--pixel);
    font-size: 16px;
    line-height: 1.5;
}

.hub-cart-link {
    color: var(--tone);
    text-decoration: none;
    text-shadow: 0 0 10px color-mix(in srgb, var(--tone) 55%, transparent);
}

/* The whole cartridge is the link; the title carries its name. */
.hub-cart-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
}

.hub-cart-link:focus-visible {
    outline: none;
}

.hub-cart:has(.hub-cart-link:focus-visible) {
    outline: 2px dashed var(--wild);
    outline-offset: 4px;
}

.hub-cart-summary {
    margin: 0;
    color: var(--dim);
    font-size: 22px;
    line-height: 1.15;
}

.hub-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
}

.hub-chip {
    padding: 5px 6px 4px;
    border: 2px solid var(--line);
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
    line-height: 1.3;
    text-transform: uppercase;
}

.hub-chip.is-lead {
    border-color: color-mix(in srgb, var(--tone) 70%, transparent);
    color: var(--fg);
}

.hub-cart-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: auto 0 0;
    padding-top: 16px;
    border-top: 2px dashed var(--line);
    font-family: var(--pixel);
    font-size: 8px;
    text-transform: uppercase;
}

.hub-cart-seats {
    color: var(--dim);
}

.hub-cart-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tone);
    white-space: nowrap;
}

.hub-cart-start .hub-icon {
    height: 8px;
}

.hub-cart:hover .hub-cart-start,
.hub-cart:has(:focus-visible) .hub-cart-start {
    animation: arcade-blink 0.8s steps(1) infinite;
}

.hub-empty {
    margin: 0;
    padding: 28px;
    border: 2px dashed var(--line);
    color: var(--dim);
    text-align: center;
}

/* ---- 02 the cabinet ----------------------------------------------------------- */

.hub-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0 36px;
    margin: 0;
}

.hub-facts:not(:has(> :nth-child(4))) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hub-fact {
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    border-top: 2px solid var(--line);
}

.hub-fact dd {
    margin: 0;
}

.hub-fact-label {
    order: 1;
    margin-top: 12px;
    color: var(--wild);
    font-family: var(--pixel);
    font-size: 8px;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
}

.hub-fact-value {
    order: 0;
    font-family: var(--pixel);
    font-size: 24px;
    line-height: 1.2;
    text-shadow: 0 0 12px var(--glow);
}

.hub-fact .hub-fact-note {
    order: 2;
    margin-top: 8px;
    color: var(--dim);
    font-size: 21px;
    line-height: 1.15;
}

.hub-tune {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    margin-top: 36px;
    padding: 22px;
    border: 2px solid var(--line);
    background: var(--hub-surface);
}

.hub-tune-copy {
    flex: 1 1 200px;
}

.hub-tune-title {
    margin: 0;
    font-family: var(--pixel);
    font-size: 10px;
    text-transform: uppercase;
}

.hub-tune-note {
    margin: 8px 0 0;
    color: var(--dim);
    font-size: 20px;
}

.hub-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Each swatch wears its own screen: .arcade[data-theme] scopes the kit's colours. */
.hub-swatch {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px;
    border: 2px solid var(--line);
    background: var(--bg);
    color: var(--fg);
    font-family: var(--pixel);
    font-size: 8px;
    line-height: 1.3;
    text-transform: uppercase;
    cursor: var(--cur-hand, pointer);
    transition: box-shadow 0.1s steps(2, end), border-color 0.1s steps(2, end);
}

.hub-swatch:hover {
    border-color: var(--fg);
}

.hub-swatch[aria-pressed="true"] {
    border-color: var(--fg);
    box-shadow: 0 0 0 2px var(--bg), 0 0 16px var(--glow);
}

.hub-swatch-screen {
    position: relative;
    display: block;
    width: 88px;
    height: 55px;
    border: 2px solid var(--line);
    background:
        repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, 0.3) 2px 3px),
        var(--bg);
}

.hub-swatch-screen i {
    position: absolute;
    display: block;
}

.hub-swatch-screen i:nth-child(1) {
    left: 6px;
    top: 12px;
    width: 3px;
    height: 16px;
    background: var(--left);
    box-shadow: 0 0 6px var(--glow);
}

.hub-swatch-screen i:nth-child(2) {
    right: 6px;
    top: 24px;
    width: 3px;
    height: 16px;
    background: var(--right);
    box-shadow: 0 0 6px var(--glow);
}

.hub-swatch-screen i:nth-child(3) {
    left: 42px;
    top: 4px;
    width: 1px;
    height: 43px;
    background: repeating-linear-gradient(to bottom, var(--line) 0 3px, transparent 3px 6px);
}

.hub-swatch-screen i:nth-child(4) {
    left: 56px;
    top: 17px;
    width: 4px;
    height: 4px;
    background: var(--p2);
    box-shadow: 0 0 6px var(--p2);
}

.hub-swatch[aria-pressed="true"] .hub-swatch-screen i:nth-child(4) {
    animation: hub-rally 1.6s steps(8, end) infinite alternate;
}

@keyframes hub-rally {
    from { transform: translate(-44px, 14px); }
    to { transform: translate(18px, -8px); }
}

/* A switch, not a pressed key: a lamp next to the word. */
.hub-crt-toggle.arcade-seg-btn,
.hub-crt-toggle.arcade-seg-btn[aria-pressed] {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: none;
    padding: 10px 14px;
    border-color: var(--line);
    background: transparent;
    color: var(--fg);
    box-shadow: none;
}

.hub-crt-toggle.arcade-seg-btn:hover {
    border-color: var(--fg);
}

.hub-crt-toggle::before {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid var(--dim);
}

.hub-crt-toggle[aria-pressed="true"]::before {
    border-color: var(--good);
    background: var(--good);
    box-shadow: 0 0 8px var(--good);
}

/* ---- 03 the exits ----------------------------------------------------------- */

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

.hub-exit {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 22px 20px;
    border: 2px solid var(--line);
    background: var(--hub-surface);
    color: var(--fg);
    text-decoration: none;
    transition: border-color 0.1s steps(2, end), box-shadow 0.1s steps(2, end);
}

.hub-exit:hover {
    border-color: var(--fg);
    box-shadow: 0 0 16px -2px var(--glow);
}

.hub-exit-icon {
    flex: none;
    width: 30px;
    height: auto;
    margin-top: 2px;
    color: var(--p3);
    filter: drop-shadow(0 0 5px color-mix(in srgb, var(--p3) 60%, transparent));
}

.hub-exit-body {
    flex: 1;
    min-width: 0;
}

.hub-exit-body strong {
    display: block;
    margin-bottom: 10px;
    font-family: var(--pixel);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: uppercase;
}

.hub-exit-body span {
    display: block;
    color: var(--dim);
    font-size: 21px;
    line-height: 1.15;
}

.hub-exit-arrow {
    flex: none;
    width: 10px;
    height: 10px;
    margin-top: 4px;
    color: var(--dim);
}

.hub-exit:hover .hub-exit-arrow {
    color: var(--wild);
    transform: translate(2px, -2px);
}

/* ---- 04 continue ------------------------------------------------------------ */

.hub-cta {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px 48px;
    padding: clamp(28px, 4.5vw, 52px);
    border: 2px solid var(--fg);
    background: var(--panel);
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--line), 0 0 40px -8px var(--glow);
}

.hub-cta .hub-lead {
    max-width: 38rem;
}

.hub-cta-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hub-cta-actions .hub-icon {
    height: 9px;
}

.hub-continue {
    position: absolute;
    top: -15px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 4px;
    border: 2px solid var(--wild);
    background: var(--bg);
    color: var(--wild);
    font-family: var(--pixel);
    font-size: 10px;
    line-height: 1;
    text-transform: uppercase;
}

.hub-countdown {
    display: inline-block;
    width: 1ch;
    height: 1em;
    overflow: hidden;
    line-height: 1;
}

.hub-countdown span {
    display: block;
    width: 10ch;
    white-space: nowrap;
    animation: hub-countdown 10s steps(10, end) infinite;
}

@keyframes hub-countdown {
    to { transform: translateX(-10ch); }
}

/* ---- footer ---------------------------------------------------------------- */

.hub-foot {
    padding: 64px 0 32px;
    border-top: 2px solid var(--line);
    background: var(--hub-surface);
}

.hub-foot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
    gap: 36px;
}

.hub-foot-brand p {
    max-width: 24rem;
    margin: 18px 0 0;
    color: var(--dim);
    font-size: 22px;
}

.hub-foot-heading {
    margin: 0 0 16px;
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hub-foot ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hub-foot ul a {
    font-size: 23px;
    text-decoration: none;
}

.hub-foot ul a:hover {
    color: var(--wild);
}

.hub-foot-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-top: 48px;
    padding-top: 20px;
    border-top: 2px dashed var(--line);
    color: var(--dim);
    font-family: var(--pixel);
    font-size: 8px;
    line-height: 1.6;
    text-transform: uppercase;
}

.hub-foot-bottom p {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
}

.hub-foot-bottom a {
    text-decoration: none;
}

.hub-foot-bottom a:hover {
    color: var(--fg);
}

.hub-credit {
    color: var(--wild);
    animation: hub-pulse 2.4s steps(1) infinite;
}

/* ---- sizes ------------------------------------------------------------------ */

@media (min-width: 360px) {
    .hub-hero-title { font-size: 24px; }
}

@media (min-width: 560px) {
    .hub-hero-title { font-size: 32px; }
}

@media (min-width: 640px) {
    .hub-hero-title { font-size: 40px; }
}

@media (min-width: 760px) {
    .hub-h2 { font-size: 24px; }
}

@media (min-width: 960px) and (max-width: 1179.98px) {
    .hub-hero-title { font-size: 32px; }
}

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

/* Two columns and an odd count: the last cartridge lies across both. */
@media (min-width: 760px) and (max-width: 1099.98px) {
    .hub-games > li:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .hub-games > li:last-child:nth-child(odd) .hub-cart {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .hub-games > li:last-child:nth-child(odd) .hub-cart-screen {
        align-self: start;
        margin: 12px 0 12px 12px;
    }
}

@media (max-width: 959.98px) {
    .hub-hero-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-tv {
        width: min(600px, 100%);
    }

    .hub-facts,
    .hub-facts:not(:has(> :nth-child(4))) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hub-exits {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-cta {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-cta-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hub-foot-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hub-foot-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 759.98px) {
    .hub-nav {
        display: none;
    }

    .hub-head-actions {
        margin-left: auto;
    }

    .hub-head-exit-long {
        display: none;
    }

    .hub-head-exit-short {
        display: inline;
    }

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

    .hub-lead {
        font-size: 22px;
    }

    .hub-hero-lead {
        font-size: 24px;
    }

    .hub-tune {
        padding: 16px;
    }

    .hub-continue {
        right: 16px;
    }
}

@media (max-width: 479.98px) {
    .hub-brand-name {
        font-size: 12px;
    }

    .hub-brand-tag {
        display: none;
    }

    .hub-facts,
    .hub-facts:not(:has(> :nth-child(4))) {
        grid-template-columns: minmax(0, 1fr);
    }

    .hub-stats {
        gap: 16px 28px;
    }

    .hub-stat dd {
        font-size: 16px;
    }

    .hub-swatches {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .hub-swatch-screen {
        width: 100%;
    }

    .hub-tv-brand {
        display: none;
    }

    .hub-actions .hub-btn {
        flex: 1 1 auto;
    }

    .hub-foot-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- motion ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .hub *,
    .hub *::before,
    .hub *::after {
        animation: none !important;
        transition: none !important;
    }

    .hub-cart:hover,
    .hub-cart:has(:focus-visible) {
        transform: none;
    }
}
