/* ALIEN LIFE ARCADE — shared chrome
 *
 * ONE SOURCE OF TRUTH for tokens and chrome (AEONGRADE Gate 4). Every page
 * mounts this; no page forks it and no page inlines a second copy of a token.
 *
 * The palette is inherited VERBATIM from alienlifecreations.com's _shared/
 * styles.css so the two sites read as siblings rather than as two studios.
 * Values were copied from the live file, not from a doc, because the standard's
 * prose describes the Theories of Anything TIER palette (gold/cyan/violet/stone,
 * where colour is an evidence claim) and that is a different argument for a
 * different site. Here colour identifies a game, not a confidence level.
 */

:root {
  /* ---- inherited from ALC, do not drift ---- */
  --green:#48FF2B;  --green-deep:#2ECF1A;
  --cyan:#3FFAF5;   --cyan-deep:#1F9AA5;
  --violet:#A35AAF; --violet-deep:#6E3C79;
  --lime:#93FB06;   --lime-deep:#5FA400;
  --gold:#DBFF07;   --gold-deep:#A6C000;

  --space:#0A0A12;
  --space-2:#0E1420;
  --card:#0F1620;
  --card-2:#0C121b;
  --card-line:#1E3A2A;
  --ink:#EAF2E8;
  --ink-soft:#9DB2A6;
  --ink-label:#7FBF6A;

  --maxw:1160px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;

  /* ---- arcade's own, additive only ---- */
  --accent: var(--green);          /* per-page accent, overridden inline */
  --rule: color-mix(in srgb, var(--accent) 22%, transparent);
  --glow: color-mix(in srgb, var(--accent) 45%, transparent);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* 100vh FIRST as the fallback, then 100dvh, per the estate rule for any
   * mobile-reachable page: on iOS the dynamic bar makes 100vh overflow. */
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--space);
  color: var(--ink);
  font: 16px/1.65 var(--font);
  overflow-x: clip;                /* U3: no horizontal scroll, ever */
}

/* The field. A very faint grid that reads as depth without competing with
 * anything. Static by default: it earns no motion, so it gets none. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 620px at 50% -12%,
      color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 38px,
      color-mix(in srgb, var(--accent) 4%, transparent) 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 38px,
      color-mix(in srgb, var(--accent) 4%, transparent) 38px 39px);
  mask-image: linear-gradient(180deg, #000 0%, #000 45%, transparent 92%);
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 96px;
}

/* ---------------------------------------------------------------- chrome */

.site-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 20px 0;
}

.wm {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}
.wm-mark {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  display: grid; place-items: center;
  box-shadow: 0 0 18px var(--glow), inset 0 0 12px var(--glow);
}
.wm-mark span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
/* The wordmark is a div, NOT an h1. The page's single h1 is its subject. */
.wm-title {
  font: 600 15px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
.wm-title b { color: var(--accent); font-weight: 600; }

.site-nav { margin-left: auto; display: flex; gap: 4px; }
.site-nav a {
  font: 500 13px/1 var(--font);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 7px;
  transition: color .18s, background .18s;
}
.site-nav a:hover, .site-nav a:focus-visible {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* ------------------------------------------------------- the bubble pass */

.hero-bubble {
  margin: 54px auto 0;
  padding: 46px 34px 42px;
  max-width: 880px;
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%,
      color-mix(in srgb, var(--accent) 8%, transparent), transparent 62%),
    var(--card-2);
  border: 1px solid var(--card-line);
  border-radius: 20px;
  /* A cool RIM rather than a warm smear. The first version threw a wide
   * accent-coloured shadow below the bubble and it read as a green puddle the
   * eye went to before the headline: a key that competes with the subject is
   * not a key. The light now describes the EDGE and stops. */
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
              0 1px 0 color-mix(in srgb, var(--accent) 16%, transparent) inset,
              0 26px 70px -60px #000;
}

.eyebrow {
  font: 600 11px/1 var(--mono);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-label);
  margin-bottom: 18px;
}

.hero-bubble h1 {
  margin: 0;
  font-size: clamp(30px, 6.4vw, 54px);
  line-height: 1.06;
  letter-spacing: -.022em;
  font-weight: 700;
}
.hero-bubble h1 .g {
  color: var(--accent);
  text-shadow: 0 0 34px var(--glow);
}

.hero-deck {
  margin: 20px auto 0;
  max-width: 62ch;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.1vw, 18px);
}

.stat-row {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  font: 500 12px/1 var(--mono);
  letter-spacing: .08em;
  color: var(--ink-soft);
}
.stat-row b { color: var(--ink); font-weight: 600; }
.dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ink-soft);
  opacity: .5;
  align-self: center;
}

/* A labelled divider. Labels are Capital-First; the node is the punctuation. */
.signal-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 58px 0 24px;
  font: 600 11px/1 var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink-label);
}
.signal-rule::before, .signal-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--rule), transparent);
}
.signal-rule .node {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.sec-head {
  text-align: center;
  font-size: clamp(21px, 3.4vw, 28px);
  letter-spacing: -.015em;
  margin: 0 0 6px;
}
.lead {
  max-width: 62ch;
  margin: 0 auto 26px;
  text-align: center;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- the grid */

.game-grid {
  display: grid;
  /* U3: minmax(min(Npx,100%),1fr), never a bare fixed minimum, or the track
   * overflows its container below Npx and the page scrolls sideways. */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 18px;
}

.gcard {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.gcard:hover, .gcard:focus-visible {
  border-color: color-mix(in srgb, var(--ca, var(--accent)) 55%, transparent);
  transform: translateY(-3px);
  box-shadow: 0 22px 50px -34px var(--ca, var(--accent));
}

/* Thumbnail-led card, so the accent rides the EYEBROW rather than a 3px left
 * bar. That is the documented exemption for media cards (episodes, videos) and
 * it is recorded here as a decision rather than left as an accident. */
.gcard .art {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(140deg, var(--space-2), var(--card-2));
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--card-line);
}
.gcard .art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* An empty art slot must read as WAITING, not as a broken image. A card with a
 * blank rectangle is the same failure as a 404 thumbnail: the visitor cannot
 * tell "not made yet" from "went wrong", so the slot says which. Drawn in CSS,
 * so it costs no request and cannot itself 404. */
.gcard .art:not(:has(img))::after {
  content: "";
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ca, var(--accent)) 42%, transparent);
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--ca, var(--accent)) 7%, transparent),
              0 0 26px color-mix(in srgb, var(--ca, var(--accent)) 22%, transparent);
  background:
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--ca, var(--accent)) 55%, transparent) 0 2.5px,
      transparent 3px);
}

.gcard .genre {
  position: absolute;
  top: 10px; left: 10px;
  font: 600 10px/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ca, var(--accent));
  background: color-mix(in srgb, var(--space) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--ca, var(--accent)) 30%, transparent);
  padding: 6px 9px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.gcard .body { padding: 16px 17px 18px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.gcard h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.gcard p { margin: 0; color: var(--ink-soft); font-size: 14.5px; flex: 1; }

/* Capability strip. Every chip here is CHECKABLE by the bench against the
 * built game, which is the whole reason it exists: a claim a player can read
 * before spending a click, and that a gate can falsify. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 11px/1 var(--mono);
  letter-spacing: .06em;
  color: var(--ink-soft);
  border: 1px solid var(--card-line);
  border-radius: 5px;
  padding: 5px 7px;
}
.chip.on { color: var(--ca, var(--accent)); border-color: color-mix(in srgb, var(--ca, var(--accent)) 34%, transparent); }

.go {
  margin-top: 4px;
  font: 600 13px/1 var(--font);
  color: var(--ca, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* The honest empty state. Not a fake card: it says what is true. */
.gcard.soon { opacity: .62; pointer-events: none; }
.gcard.soon .art { background: repeating-linear-gradient(135deg,
  var(--card-2) 0 11px, var(--space-2) 11px 22px); }
.gcard.soon .go { color: var(--ink-soft); }

/* The empty cabinet. An honest state, not a placeholder card: a card that goes
 * nowhere is a promise the page cannot keep, and Gate 3 applies to a hub's own
 * copy exactly as it applies to an article's. */
.empty-cabinet {
  grid-column: 1 / -1;
  text-align: center;
  padding: 54px 24px 58px;
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--card-line));
  border-radius: 14px;
  background: var(--card-2);
}
.empty-mark {
  display: block;
  width: 54px; height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 6%, transparent);
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--accent) 55%, transparent) 0 2.5px, transparent 3px);
}
.empty-cabinet h3 { margin: 0 0 8px; font-size: 19px; }
.empty-cabinet p { margin: 0 auto; max-width: 52ch; color: var(--ink-soft); font-size: 14.5px; }

/* ------------------------------------------------------ the game surface */

.stage-frame {
  position: relative;
  border: 1px solid var(--card-line);
  border-radius: 14px;
  overflow: hidden;
  background: #06060c;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 9%, transparent);
}
.game-frame {
  display: block;
  width: 100%;
  /* Explicit ratio so the box is RESERVED before the frame loads. A lazy iframe
   * with no reserved height is the commonest cause of layout shift on a page
   * like this, and CLS is measured in the field even though the parent's own
   * JavaScript cannot see inside the frame. */
  aspect-ratio: 16 / 10;
  border: 0;
}

.howto-list {
  max-width: 62ch;
  margin: 0 auto;
  padding-left: 1.1em;
  color: var(--ink-soft);
}
.howto-list li { margin: 6px 0; }
.howto-list b, .howto-list kbd { color: var(--ink); }

.changelog { max-width: 62ch; margin: 0 auto; padding-left: 1.2em; color: var(--ink-soft); }
.changelog > li { margin: 14px 0; }
.changelog b { color: var(--accent); font: 600 13px/1 var(--mono); }
.changelog .when { font: 500 12px/1 var(--mono); margin-left: 9px; opacity: .7; }
.changelog ul { margin: 7px 0 0; padding-left: 1.1em; }

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

.site-foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-line);
  margin-top: 20px;
  padding: 26px 20px 40px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
}
.site-foot a { color: var(--ink-soft); }
.site-foot nav { margin-top: 9px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------- a11y, V6 */

a:focus-visible, button:focus-visible, .gcard:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Reduced motion is honoured by REMOVING the motion, not by damping it.
 * The Accessible Games Initiative lists a slider that only reduces an effect
 * to a minimum as an explicit FAIL: damping is a fail, an off switch is a pass. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .gcard:hover, .gcard:focus-visible { transform: none; }
}
