/* ============================================================
   Arcade hub — design tokens + shared chrome.
   Original "night ember" palette: deep ink, warm bone text,
   ember amber accent, ice cyan secondary. No webfonts, no CDNs.
   ============================================================ */

:root {
  --bg: #08090d;
  --bg-2: #0d1017;
  --panel: #11141c;
  --panel-2: #171b26;
  --line: rgba(243, 237, 225, 0.09);
  --line-2: rgba(243, 237, 225, 0.18);
  --text: #f3ede1;
  --muted: #9aa3b5;
  --faint: #5d6577;
  --ember: #ff8c42;
  --ember-2: #ffc46b;
  --ember-deep: #ff5e3a;
  --ice: #8fd6ff;
  --grad: linear-gradient(120deg, var(--ember), var(--ember-2));
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-lg: 22px;
  --r-md: 14px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.75);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ambient room light — two fixed radial washes over the ink */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 72% -12%, rgba(255, 140, 66, 0.1), transparent 60%),
    radial-gradient(900px 620px at 8% 112%, rgba(143, 214, 255, 0.07), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
canvas { display: block; }
button { font: inherit; color: inherit; }
::selection { background: rgba(255, 140, 66, 0.35); }

.shell { width: min(1240px, 92vw); margin: 0 auto; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ember);
}

/* ------------------------------------------------ scroll reveal */
.rv {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease,
    border-color 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text); }
.btn-primary {
  background: var(--grad);
  color: #1a0e05;
  border: none;
  font-weight: 700;
  box-shadow: 0 12px 32px -12px rgba(255, 140, 66, 0.55);
}
.btn-primary:hover {
  border: none;
  box-shadow: 0 18px 44px -12px rgba(255, 140, 66, 0.7);
}

/* ------------------------------------------------ header */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.hdr.scrolled {
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.hdr-inner {
  width: min(1240px, 92vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.95rem 0;
}
.brand {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-mark {
  color: var(--ember);
  display: inline-block;
  animation: brand-spin 14s linear infinite;
}
@keyframes brand-spin { to { transform: rotate(360deg); } }
.hdr-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.7rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.hdr-nav a { transition: color 0.2s ease; position: relative; }
.hdr-nav a:hover { color: var(--text); }
.hdr-nav a.nav-cta { color: var(--ember); }
.hdr-count {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  color: var(--text);
  letter-spacing: 0.14em;
  white-space: nowrap;
}

/* ------------------------------------------------ section heads */
.sec { padding: 5.5rem 0 3rem; }
.sec-head { margin-bottom: 2.6rem; max-width: 46rem; }
.sec-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  margin: 0.7rem 0 0.6rem;
}
.sec-sub { color: var(--muted); font-size: 1.05rem; }

/* ------------------------------------------------ game cards */
.cards {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.4rem;
}
game-card { display: block; grid-column: span 6; min-width: 0; }
game-card[data-size="xl"] { grid-column: span 12; }
@media (max-width: 820px) {
  game-card, game-card[data-size="xl"] { grid-column: span 12; }
}

.gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--panel);
  transition: transform 0.5s var(--ease-out), border-color 0.3s ease, box-shadow 0.5s ease;
}
.gcard:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 140, 66, 0.45);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 140, 66, 0.14);
}
.gcard-art {
  position: relative;
  aspect-ratio: 16 / 8;
  overflow: hidden;
  background: var(--bg-2);
}
game-card[data-size="xl"] .gcard-art { aspect-ratio: 21 / 9; }
@media (max-width: 820px) {
  .gcard-art, game-card[data-size="xl"] .gcard-art { aspect-ratio: 16 / 9; }
}
.gcard-art canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.8s var(--ease-out);
}
.gcard:hover .gcard-art canvas { transform: scale(1.04); }
.gcard-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 45%, rgba(8, 9, 13, 0.72));
}
.gcard-play {
  position: absolute;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--grad);
  color: #1a0e05;
  font-weight: 700;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.45s var(--ease-out);
}
.gcard:hover .gcard-play { opacity: 1; transform: none; }
.gcard-best {
  position: absolute;
  left: 1.1rem;
  bottom: 1.1rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  color: var(--ember-2);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
.gcard-body { padding: 1.25rem 1.45rem 1.5rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.gcard-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.gcard h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.65rem;
  line-height: 1.1;
}
game-card[data-size="xl"] h3 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.gcard-index {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  color: var(--faint);
  white-space: nowrap;
}
.gcard-tagline { color: var(--muted); font-size: 0.98rem; }
.gcard-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: auto; padding-top: 0.5rem; }

.chip {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  white-space: nowrap;
}

/* ------------------------------------------------ text clamp
   Multi-line truncation that ends on a whole line with a clean ellipsis. */
.clamp-1 { -webkit-line-clamp: 1; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }
.clamp-1,
.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------------------------------------------------ ticker */
.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 1.05rem 0;
  margin: 3.5rem 0 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  gap: 3.2rem;
  width: max-content;
  animation: tick 36s linear infinite;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.ticker-track .tk { display: inline-flex; gap: 3.2rem; }
.ticker-track .tk i { color: var(--ember); font-style: normal; }
@keyframes tick { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}

/* ------------------------------------------------ footer */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 6rem;
  padding: 3.6rem 0 2.4rem;
  background: linear-gradient(180deg, transparent, rgba(255, 140, 66, 0.04));
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand {
  font-family: var(--font-mono);
  letter-spacing: 0.34em;
  font-size: 0.85rem;
  text-transform: uppercase;
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
}
.foot-blurb { color: var(--muted); margin-top: 1rem; max-width: 26rem; font-size: 0.95rem; }
.foot h4 {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}
.foot-links { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.foot-links a { color: var(--muted); transition: color 0.2s ease; font-size: 0.95rem; }
.foot-links a:hover { color: var(--ember-2); }
.foot-base {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 640px) {
  .hdr-nav { gap: 1rem; }
  .hdr-count { display: none; }
}

/* ============================================================
   Hub shelf components
   ------------------------------------------------------------
   The landing page opens on a shelf of games (see _shared/hub/hero.js):
   a left icon rail, a lead tile that spans two rows beside a 2×2, and a
   horizontal strip underneath. Everything here is shared chrome — the page
   owns its own grid, this owns the pieces every shelf is built from.
   ============================================================ */

:root {
  --rail-w: 76px;
  --hdr-h: 3.3rem;
}

/* ------------------------------------------------ icon rail */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 55;
  width: var(--rail-w);
  padding: 0.7rem 0 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 16, 23, 0.92), rgba(8, 9, 13, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }

.rail-brand {
  display: grid;
  place-items: center;
  height: var(--hdr-h);
  margin-bottom: 0.7rem;
  font-size: 1.15rem;
  color: var(--ember);
}
.rail-tags { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; }
.rail-sep { width: 22px; height: 1px; background: var(--line); margin: 0.5rem 0; flex: 0 0 auto; }
.rail-flex { flex: 1 1 auto; min-height: 0.5rem; }

.rail-btn {
  position: relative;
  width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.1rem;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  transition: color 0.2s ease, background 0.2s ease, transform 0.3s var(--ease-out);
}
.rail-btn svg { width: 19px; height: 19px; display: block; }
.rail-btn:hover { color: var(--text); background: rgba(243, 237, 225, 0.06); transform: translateY(-1px); }
.rail-btn:focus-visible { outline: 1px solid var(--ember); outline-offset: 2px; }
.rail-btn.on { color: var(--ember-2); background: rgba(255, 140, 66, 0.13); }
.rail-btn.on::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 2px;
  height: 22px;
  border-radius: 2px;
  background: var(--ember);
  transform: translateY(-50%);
}

/* The rail takes its width out of the page, and nothing else has to know. */
body:has(.rail) { padding-left: var(--rail-w); }
body:has(.rail) .hdr { left: var(--rail-w); }
body:has(.rail) .shell,
body:has(.rail) .hdr-inner { width: min(1240px, calc(100vw - var(--rail-w) - 8vw)); }

@media (max-width: 1000px) {
  /* The rail becomes a horizontal strip under the header: same chrome, one
     thumb's reach, no wasted width. */
  .rail {
    position: sticky;
    inset: auto;
    top: var(--hdr-h);
    z-index: 54;
    flex-direction: row;
    align-items: center;
    width: auto;
    height: auto;
    padding: 0.45rem 0.7rem;
    gap: 0.3rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 9, 13, 0.86);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .rail-brand, .rail-sep, .rail-flex, .rail-btn.on::before { display: none; }
  .rail-tags { flex-direction: row; gap: 0.3rem; }
  .rail-btn { width: auto; min-width: 44px; min-height: 40px; }
  body:has(.rail) { padding-left: 0; }
  body:has(.rail) .hdr { left: 0; }
}

/* ------------------------------------------------ tiles */
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  isolation: isolate;
  transition: transform 0.5s var(--ease-out), border-color 0.3s ease, box-shadow 0.5s ease;
}
.tile:hover,
.tile:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(255, 140, 66, 0.5);
  box-shadow: var(--shadow);
  outline: none;
}
.tile-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out);
}
.tile:hover .tile-img { transform: scale(1.05); }

.tile-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(8, 9, 13, 0.3) 0%,
    rgba(8, 9, 13, 0.03) 32%,
    rgba(8, 9, 13, 0.62) 76%,
    rgba(8, 9, 13, 0.9) 100%
  );
}
.tile-body {
  position: absolute;
  z-index: 2;
  left: 1rem;
  right: 1rem;
  bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tile-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.15;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}
.tile-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
.tile-play {
  position: absolute;
  z-index: 3;
  right: 0.9rem;
  bottom: 0.9rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: #1a0e05;
  background: rgba(243, 237, 225, 0.92);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out), background 0.2s ease;
}
.tile:hover .tile-play { opacity: 1; transform: none; background: var(--grad); }
.tile-lead .tile-title { font-size: clamp(1.4rem, 2.1vw, 2rem); }
.tile-lead .tile-body { bottom: 1.1rem; }
/* the lead tile, and every tile in a strip, states its call to action up front */
.tile-lead .tile-play,
.row > .tile .tile-play { opacity: 1; transform: none; }

/* ------------------------------------------------ horizontal strip */
.row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  /* edge fade, so the strip reads as continuing rather than cut off */
  mask-image: linear-gradient(90deg, transparent, #000 1.5%, #000 98.5%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 1.5%, #000 98.5%, transparent);
  padding: 0.35rem 0.15rem 1rem;
  margin: 0 -0.15rem;
}
.row::-webkit-scrollbar { display: none; }
.row > .tile {
  flex: 0 0 min(300px, 68vw);
  scroll-snap-align: start;
  aspect-ratio: 16 / 10;
}
.row > .tile:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* ------------------------------------------------ shelf states */
.shelf-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding: 2.6rem 1.6rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--muted);
}
.shelf-clear {
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: transparent;
  color: var(--ember-2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.shelf-clear:hover { border-color: var(--ember); color: var(--text); }

/* a card with a real still image instead of procedural art */
.gcard-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease-out);
}
.gcard:hover .gcard-img { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
  .tile, .tile-img, .rail-btn, .gcard-img { transition: none; }
  .tile:hover, .gcard:hover .gcard-img { transform: none; }
}


