/**
 * Arcade hub — the game picker at the site root.
 *
 * Shares tokens.css with the games so the hub and what it launches read as one
 * product. Self-contained reset, like pages.css: this page scrolls, so it must
 * not inherit the game shell's viewport lock.
 */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

body {
  min-height: 100svh;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  /* Kill pull-to-refresh and rubberbanding without locking the page. */
  overscroll-behavior: none;
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: var(--r-md);
}

/* Visually hidden but reachable by screen readers. Mirrors base.css so the hub
   stays independent of the game shell. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: clamp(2rem, 7vw, 4.5rem) var(--sp-4)
           calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
}

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

.masthead {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.masthead__title {
  font-size: var(--fs-3xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: 800;
}

.masthead__lead {
  color: var(--text-secondary);
  max-width: 42ch;
}

/* --- game grid ------------------------------------------------------------ */

.games {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  text-decoration: none;
  color: inherit;
  /* Comfortably past the 48px touch-target floor. */
  min-height: 6.5rem;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

a.card:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: var(--shadow-2);
}

/* Reads as pressable: the tile takes a real displacement on press. */
a.card:active { transform: translateY(1px); box-shadow: var(--shadow-1); }

.card--soon {
  opacity: 0.55;
  cursor: not-allowed;
}

.card__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--card-accent, var(--accent)) 22%, transparent);
  color: var(--card-accent, var(--accent));
  border: 1px solid color-mix(in oklab, var(--card-accent, var(--accent)) 45%, transparent);
  font-family: var(--font-num);
  font-size: var(--fs-lg);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.card__title {
  font-size: var(--fs-lg);
  font-weight: 650;
}

.card__blurb {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
}

.card__status {
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--accent-strong);
  font-weight: 650;
}

.card__status--soon { color: var(--text-muted); }

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

.colophon {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.colophon a { color: var(--text-secondary); }
.colophon a:hover { color: var(--text-primary); }
