/* Game Night Guild launcher -- the combined shell's own chrome.
 *
 * SHELL-OWNED, NOT GAME-OWNED. Nothing here is imported by a game and nothing
 * here belongs to one: these are the Guild's brand tokens for the page that
 * lists every registered island. Each game still ships and owns its own
 * stylesheet, and "common launcher / UI chrome" stays on the NOT YET list in
 * CLAUDE.md.
 *
 * The palette and type are the Guild brand -- navy field, gold accent, the
 * purple-to-cyan rule -- matching the logo and the games' own Game Night
 * themes without reaching into any game's tokens to get them.
 *
 * No JavaScript, no framework, no CDN script. The only off-origin request is
 * the Google Fonts stylesheet, and every family degrades to a stack that is
 * already on the device, so the page is correct offline and on a cold cache.
 */

/* GNG-021: on a corporate deployment every --gng-* below is that client's
 * derived palette (core.branding), so this stylesheet brands itself with no
 * per-client edit. --gng-on-gold is text ON the accent and --gng-gold-text is
 * the accent AS text; on the Guild both are exactly what was here before. */

/* THE BRAND COLOURS ARE NOT DECLARED HERE ANY MORE (GNG-006).
 *
 * Every --gng-* colour this file uses is declared by
 * core/templates/shared/_guild_brand_vars.html, straight out of
 * core.brand.css_variables(), and launcher.html includes that partial. The
 * launcher was where the canonical palette was FIRST written down, and GNG-006
 * promoted those exact values into core.brand so all four games could read
 * them. This file then stopped being a second copy of them, which is the
 * difference between one brand and two that happen to agree today.
 *
 * tests/test_guild_brand.py asserts this file contains no brand colour literal
 * at all, so the promotion cannot quietly be undone.
 *
 * What is still declared here is what is genuinely the LAUNCHER's and not the
 * brand's: its type stack and its corner radius. */
:root {
  --gng-display: "Anton", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --gng-body: "Oswald", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --gng-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gng-radius: 20px;
}

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

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--gng-text-primary);
  font-family: var(--gng-body);
  font-weight: 300;
  line-height: 1.5;
  background-color: var(--gng-navy);
  /* The two glows are ALPHA VARIANTS of brand colours, not new ones. CSS
     cannot take an alpha of a hex custom property without color-mix(), which
     is too new to rely on here, so GNG-021 emits each colour's components as
     --gng-<name>-rgb beside it and every rgba() in this file reads one. Before
     GNG-021 the components were spelled out as Guild literals, which would
     have left a corporate deployment's glows Guild purple and cyan;
     tests/test_guild_brand.py now asserts there is no literal rgba() left. */
  background-image:
    radial-gradient(900px 520px at 10% -12%, rgba(var(--gng-purple-rgb), 0.62), rgba(var(--gng-navy-rgb), 0) 62%),
    radial-gradient(760px 460px at 94% 4%, rgba(var(--gng-cyan-rgb), 0.22), rgba(var(--gng-navy-rgb), 0) 64%),
    linear-gradient(135deg, var(--gng-navy) 0%, var(--gng-navy-mid) 52%, var(--gng-navy) 100%);
  /* Deliberately NOT background-attachment: fixed. The two radial glows are
     sized in pixels, so a fixed attachment paints them against the VIEWPORT and
     leaves a visible seam where the viewport ends on a page taller than one
     screen -- which this page is on a phone. (iOS additionally janks or drops
     fixed backgrounds outright.) Letting the gradients scroll with the document
     keeps the wash continuous at every height. */
  background-repeat: no-repeat;
}

a {
  color: var(--gng-gold-text);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--gng-gold-bright);
}

/* Keyboard users must be able to see where they are. */
a:focus-visible {
  outline: 2px solid var(--gng-gold);
  outline-offset: 3px;
}

.launcher {
  position: relative;
  max-width: 62rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3.5rem;
}

/* --- GNG-022: the Brand Builder link ---------------------------------
   Discreet, top right, inside the header's top padding so it never covers
   the logo. A link to an admin sign-in, not a control: the launcher itself
   stays public and changes nothing. */
.launcher__admin {
  position: absolute;
  top: 1.1rem;
  right: 1.5rem;
}

.launcher__admin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--gng-border-blue);
  border-radius: 999px;
  background: rgba(var(--gng-navy-deep-rgb), 0.55);
  color: var(--gng-text-soft);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.launcher__admin-link:hover,
.launcher__admin-link:focus-visible {
  border-color: var(--gng-gold);
  color: var(--gng-gold-bright);
}

.launcher__admin-icon {
  flex: none;
}

/* --- header -------------------------------------------------------- */
.launcher__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.1rem;
}

.launcher__logo {
  display: block;
  width: 100%;
  max-width: 27rem;
  height: auto;
}

/* GNG-021: a corporate logo has no known shape. Fit it inside the Guild
   wordmark's box instead of stretching it to the wordmark's width. */
.launcher__logo--brand {
  width: auto;
  max-width: min(100%, 27rem);
  max-height: 11rem;
  object-fit: contain;
}

.launcher__eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gng-gold-text);
}

/* GNG-021: a corporate deployment's event title (BRAND_EVENT_NAME). Not
   rendered at all when unset, so the Guild launcher is unchanged. */
.launcher__event {
  margin: 0;
  font-family: var(--gng-display);
  font-weight: 400;
  font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gng-gold-text);
  overflow-wrap: anywhere;
}

.launcher__title {
  margin: 0;
  font-family: var(--gng-display);
  font-weight: 400;
  font-size: clamp(2.3rem, 6.2vw, 3.9rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--gng-text-primary);
  text-wrap: balance;
}

.launcher__subtitle {
  margin: 0;
  max-width: 34rem;
  font-size: 1.02rem;
  color: var(--gng-text-soft);
  text-wrap: pretty;
}

/* --- the game islands (one card per registered game) ---------------- */
.game-grid {
  list-style: none;
  margin: 3.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr));
}

.game-grid__item {
  display: flex;
}

.game-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  padding: 1.7rem 1.6rem 1.45rem;
  border-radius: var(--gng-radius);
  color: var(--gng-text-primary);
}

.game-card--live {
  border: 1px solid var(--gng-border-blue);
  background: linear-gradient(162deg, var(--gng-navy-card) 0%, var(--gng-navy-deep) 100%);
  box-shadow: 0 18px 40px rgba(var(--gng-shadow-rgb), 0.45);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.game-card--live:hover,
.game-card--live:focus-visible {
  transform: translateY(-4px);
  border-color: var(--gng-gold);
  box-shadow: 0 24px 52px rgba(var(--gng-shadow-rgb), 0.6);
  color: var(--gng-text-primary);
}

/* A pending island is not a link, and must not look like one. */
.game-card--pending {
  border: 1px dashed var(--gng-line-dashed);
  background: linear-gradient(
    162deg,
    rgba(var(--gng-navy-card-rgb), 0.55) 0%,
    rgba(var(--gng-navy-deep-rgb), 0.75) 100%
  );
}

/* The purple-to-cyan rule across the top of a live card; a fading gold one
   marks a card that is still waiting for its migration. */
.game-card__rule {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.game-card--live .game-card__rule {
  background: linear-gradient(
    90deg,
    var(--gng-purple) 0%,
    var(--gng-magenta) 55%,
    var(--gng-cyan) 100%
  );
}

.game-card--pending .game-card__rule {
  background: linear-gradient(
    90deg,
    rgba(var(--gng-gold-rgb), 0.85) 0%,
    rgba(var(--gng-gold-rgb), 0.15) 100%
  );
}

.game-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.game-card__name {
  margin: 0;
  font-family: var(--gng-display);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--gng-text-primary);
}

.game-card__route {
  margin: 0;
  font-family: var(--gng-mono);
  font-size: 1.05rem;
  color: var(--gng-cyan-bright);
}

.game-card--pending .game-card__route {
  color: var(--gng-text-soft);
}

.game-card__meta {
  margin: 0;
  font-family: var(--gng-mono);
  font-size: 0.78rem;
  color: var(--gng-text-muted);
}

.game-card__cta {
  margin-top: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: var(--gng-gold);
  color: var(--gng-on-gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.game-card__cta--muted {
  background: none;
  border: 1px solid var(--gng-line-dashed);
  color: var(--gng-text-soft);
  font-weight: 500;
}

/* --- status --------------------------------------------------------- */
/* The registry's migration status, rendered on every card. Kept visible
   rather than folded into the pill: /healthz reports these exact words, and
   the launcher saying something different would be the drift worth catching. */
.game-card__status {
  margin: 0;
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status--migrated {
  background: rgba(var(--gng-cyan-rgb), 0.16);
  color: var(--gng-cyan-bright);
  border: 1px solid rgba(var(--gng-cyan-rgb), 0.45);
}

.status--pending {
  background: rgba(var(--gng-gold-rgb), 0.15);
  color: var(--gng-gold-text);
  border: 1px solid rgba(var(--gng-gold-rgb), 0.4);
}

.pill {
  flex: none;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pill--live {
  border: 1px solid rgba(var(--gng-cyan-rgb), 0.55);
  background: rgba(var(--gng-cyan-rgb), 0.16);
  color: var(--gng-cyan-bright);
}

.pill--soon {
  border: 1px solid rgba(var(--gng-gold-rgb), 0.5);
  background: rgba(var(--gng-gold-rgb), 0.15);
  color: var(--gng-gold-text);
}

/* --- footer --------------------------------------------------------- */
.launcher__footer {
  margin-top: 3rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--gng-border-blue);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.launcher__footer p {
  margin: 0;
  max-width: 40rem;
  font-size: 0.88rem;
  color: var(--gng-text-muted);
  text-wrap: pretty;
}

.launcher__footer code {
  font-family: var(--gng-mono);
  color: var(--gng-text-soft);
}

.launcher__health {
  display: inline-block;
  flex: none;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--gng-border-blue);
  border-radius: 999px;
  font-family: var(--gng-mono);
  font-size: 0.82rem;
}

.launcher__health:hover,
.launcher__health:focus-visible {
  border-color: var(--gng-gold);
}

/* --- the placeholder island pages ----------------------------------- */
/* A pending game's island page uses this same stylesheet (see
   games/trivia/shell.py), so it gets the brand for free. */
.placeholder {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
}

.placeholder h1 {
  margin: 0 0 1rem;
  font-family: var(--gng-display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.placeholder p {
  color: var(--gng-text-soft);
}

.placeholder .status {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.placeholder__meta {
  font-family: var(--gng-mono);
  font-size: 0.8rem;
  color: var(--gng-text-muted);
}

/* --- motion --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .game-card--live {
    transition: none;
  }

  .game-card--live:hover,
  .game-card--live:focus-visible {
    transform: none;
  }
}
