/* ==========================================================================
   oosh shell — layout built from brand.css primitives
   ========================================================================== */

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.shell-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: var(--bw-heavy) solid var(--line);
}
.shell-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
}
.shell-nav__brand {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 78, 'wght' 900;
  font-size: clamp(1.6rem, 5vw, 2rem);
  text-transform: lowercase;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
  color: var(--fg);
}
.shell-nav__brand-dot { color: var(--accent); }

.shell-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.shell-nav__links a {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-decoration: none;
  padding: 0.85rem 0.75rem;      /* 44px+ tap target */
  color: var(--fg-muted);
  transition: color var(--snap) var(--ease);
}
.shell-nav__links a:hover,
.shell-nav__links a:focus-visible { color: var(--accent); }

/* --------------------------------------------------------------------------
   Hero — asymmetric, left-weighted, poster-like
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  /* padding-block only — the horizontal gutter belongs to .container and must survive */
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem);
  overflow: hidden;
}
.hero__kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.hero__kicker::after {
  content: '';
  flex: 1;
  height: var(--bw);
  background: var(--line);
  opacity: 0.35;
}
.hero__title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 78, 'wght' 900;
  font-size: var(--fs-hero);
  text-transform: uppercase;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
  max-width: 15ch;
  text-wrap: balance;
  overflow-wrap: break-word;
}
/* Highlighted phrase — solid orange knockout block, like a marker swipe */
.hero__title mark {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0 0.12em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.hero__lede {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--fg-muted);
  max-width: 46ch;
  margin: 0;
}

/* Dot-grid wash bleeding off the right edge */
.hero__deco {
  position: absolute;
  top: 0;
  right: calc(var(--gutter) * -0.5);
  width: min(38%, 320px);
  height: 100%;
  color: var(--oosh-teal);
  opacity: 0.22;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(250deg, #000 20%, transparent 78%);
          mask-image: linear-gradient(250deg, #000 20%, transparent 78%);
}
@media (max-width: 720px) { .hero__deco { display: none; } }

/* --------------------------------------------------------------------------
   Games section
   -------------------------------------------------------------------------- */
.games {
  padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(3rem, 8vw, 5rem);
}
.games__head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
  border-bottom: var(--bw-heavy) solid var(--line);
}
.games__head h2 {
  font-size: var(--fs-h3);
  margin: 0;
  font-variation-settings: 'wdth' 84, 'wght' 800;
}
.games__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}

.games__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: clamp(1.1rem, 2.5vw, 1.6rem);
}
@media (max-width: 380px) {
  .games__grid { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   Tile
   -------------------------------------------------------------------------- */
.tile {
  --tile-surface: var(--oosh-ink);
  --tile-mark:    var(--oosh-orange);
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border: var(--bw) solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--fg);
  transition: transform var(--settle) var(--ease), box-shadow var(--settle) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-lift); }
  .tile:hover .tile__art::after { transform: translateX(0); }
}
.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--oosh-ink); }

/* Art panel: flat brand colour + one pattern. No photos, no gradients. */
.tile__art {
  position: relative;
  aspect-ratio: 5 / 3;
  background: var(--tile-surface);
  border-bottom: var(--bw) solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile__pattern {
  position: absolute;
  inset: 0;
  color: var(--tile-mark);
  opacity: 0.3;
}
.tile__mark {
  position: relative;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 78, 'wght' 900;
  font-size: clamp(1.15rem, 5vw, 1.7rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: center;
  padding: 0 0.6rem;
  color: var(--tile-mark);
}
/* Orange sweep that slides in on hover */
.tile__art::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: var(--tile-mark);
  transform: translateX(-101%);
  transition: transform var(--settle) var(--ease);
}

.tile__body {
  padding: 0.95rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.tile__slug {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
}
.tile__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.tile__tag {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  margin: 0;
  max-width: none;
}

/* Coming-soon / updating state */
.tile[aria-disabled="true"] {
  pointer-events: none;
  box-shadow: var(--shadow-sm);
  border-style: dashed;
}
.tile[aria-disabled="true"] .tile__art { filter: grayscale(1) contrast(0.75); opacity: 0.7; }

/* Per-title art themes — flat colour + pattern only */
.tile--nightgrid   { --tile-surface: var(--oosh-ink);    --tile-mark: var(--oosh-orange); }
.tile--shrovetide  { --tile-surface: var(--oosh-orange); --tile-mark: var(--oosh-ink); }
.tile--peapops     { --tile-surface: var(--oosh-teal);   --tile-mark: var(--oosh-ice); }
.tile--coloursnap  { --tile-surface: var(--ice-deep);    --tile-mark: var(--oosh-teal); }

/* --------------------------------------------------------------------------
   Footer — inverted ink block
   -------------------------------------------------------------------------- */
.shell-footer {
  background: var(--oosh-ink);
  color: var(--fg-invert);
  border-top: var(--bw-heavy) solid var(--line);
  padding: clamp(2rem, 5vw, 3rem) 0 calc(clamp(2rem, 5vw, 3rem) + var(--safe-b));
}
.shell-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.shell-footer__brand {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 78, 'wght' 900;
  font-size: 2rem;
  text-transform: lowercase;
  letter-spacing: -0.045em;
  line-height: 1;
}
.shell-footer__brand span { color: var(--accent); }
.shell-footer p {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice-deep);
  opacity: 0.75;
  margin: 0;
}
/* Hazard strip along the top of the footer */
.shell-footer__stripe {
  height: 14px;
  color: var(--oosh-orange);
  border-bottom: var(--bw) solid var(--oosh-ink);
}

/* --------------------------------------------------------------------------
   Per-game page
   -------------------------------------------------------------------------- */
.game-page { padding-block: 1.25rem clamp(2.5rem, 6vw, 4rem); }

.game-page__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.game-page__back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.75rem 0.6rem 0;
  text-decoration: none;
  color: var(--fg-muted);
  transition: color var(--snap) var(--ease);
}
.game-page__back:hover { color: var(--accent); }
.game-page__crumb { color: var(--fg-muted); opacity: 0.6; }

.game-page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: var(--bw-heavy) solid var(--line);
}
.game-page__title {
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 76, 'wght' 900;
  font-size: var(--fs-h1);
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0;
}
.game-page__tagline {
  color: var(--fg-muted);
  margin: 0.5rem 0 0;
  font-size: var(--fs-small);
  max-width: 48ch;
}

.game-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: var(--bw-heavy) solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--oosh-ink);
}
.game-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 640px) {
  .game-frame {
    aspect-ratio: 3 / 4;
    max-height: calc(100dvh - 210px);
    box-shadow: var(--shadow-sm);
  }
}

/* Fullscreen toggle — a sibling of the iframe, not inside it, so it stays
   clickable and visible once .game-frame itself is the fullscreen element
   (only the fullscreened element and its DOM descendants render). */
.game-frame__fs {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 5;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--oosh-ink);
  color: var(--oosh-ice);
  border: var(--bw) solid var(--oosh-ice);
  cursor: pointer;
  opacity: 0.82;
  transition: opacity var(--snap) var(--ease), transform var(--snap) var(--ease);
}
.game-frame__fs svg { width: 18px; height: 18px; }
.game-frame__fs:hover, .game-frame__fs:focus-visible { opacity: 1; }
.game-frame__fs:active { transform: scale(0.92); }
.game-frame__fs[hidden] { display: none; }

/* Fullscreen state: fill the real screen instead of the aspect-ratio box,
   and drop the card chrome (border/shadow read as a stray frame at 100vw). */
.game-frame:fullscreen,
.game-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  aspect-ratio: unset;
  border: 0;
  box-shadow: none;
}
.game-frame:fullscreen iframe,
.game-frame:-webkit-full-screen iframe { width: 100vw; height: 100vh; }

/* CSS-only fallback for browsers where the real Fullscreen API is missing
   or silently refuses (iOS Safari/Chrome on iPhone, notably). This can't
   hide the browser's own address bar — no web API can — but it does make
   the game fill the actual visible viewport edge to edge, same as native
   fullscreen everywhere else does. */
.game-frame--fallback-fs {
  position: fixed;
  inset: 0;
  z-index: 999;
  width: 100vw;
  height: 100dvh;
  max-height: none;
  aspect-ratio: unset;
  border: 0;
  box-shadow: none;
}
html.fs-fallback-lock, html.fs-fallback-lock body { overflow: hidden; height: 100%; }

.game-page__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: var(--bw) solid var(--line);
}
.game-page__meta h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--orange-deep);
  margin: 0 0 0.5rem;
  line-height: 1.4;
}
.game-page__meta p { font-size: var(--fs-small); color: var(--fg-muted); }

/* --------------------------------------------------------------------------
   Intro slot — reusable animation container
   -------------------------------------------------------------------------- */
.intro-slot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--oosh-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: var(--gutter);
  padding-bottom: calc(var(--gutter) + var(--safe-b));
  touch-action: manipulation;
  animation: introIn 160ms var(--ease);
}
.intro-slot[hidden] { display: none; }
.intro-slot--out { animation: introOut 340ms var(--ease) forwards; pointer-events: none; }

.intro-slot__wordmark {
  display: flex;
  font-family: var(--font-display);
  font-variation-settings: 'wdth' 76, 'wght' 900;
  font-size: clamp(4.5rem, 22vw, 15rem);
  text-transform: lowercase;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--oosh-ice);
}
.intro-slot__wordmark span {
  display: inline-block;
  animation: introDrop 620ms var(--ease) both;
}
.intro-slot__wordmark span:nth-child(1) { animation-delay:  40ms; }
.intro-slot__wordmark span:nth-child(2) { animation-delay: 130ms; color: var(--oosh-orange); }
.intro-slot__wordmark span:nth-child(3) { animation-delay: 220ms; }
.intro-slot__wordmark span:nth-child(4) { animation-delay: 310ms; }
.intro-slot__wordmark span:nth-child(5) {
  animation-delay: 430ms;
  color: var(--oosh-orange);
}

/* Hazard bars top and bottom */
.intro-slot__bar {
  position: absolute;
  left: 0; right: 0;
  height: 16px;
  color: var(--oosh-orange);
  opacity: 0.85;
}
.intro-slot__bar--top    { top: 0; }
.intro-slot__bar--bottom { bottom: 0; }

.intro-slot__skip {
  position: absolute;
  bottom: calc(2.75rem + var(--safe-b));
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ice-deep);
  opacity: 0.55;
}

@keyframes introDrop {
  from { transform: translateY(-0.35em); opacity: 0; }
  to   { transform: translateY(0);       opacity: 1; }
}
@keyframes introIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes introOut { from { opacity: 1; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .intro-slot__wordmark span { animation: none; }
}
