/* =====================================================================
   Ghost World Gaming — shared site theme (v1)
   Modernized "terminal / pixel" identity: dark base, teal accent,
   animated layered gradients, pixel grid, glassy cards.

   Used by every GWG child site (ghostworldgaming.com, stickpit.*, ...).
   Keep this file canonical in /mnt/claude01/gwg-web/shared/ and bundle a
   copy into each site's web root so they all render identically.
   ===================================================================== */

:root {
  /* Base surfaces */
  --bg-0: #0b0d12;
  --bg-1: #131722;
  --bg-2: #181d2b;
  /* Text */
  --fg-0: #e7eaf0;
  --fg-1: #9aa3b2;
  --fg-2: #6b7384;
  /* Accent (electric blue/cyan — from the GWG "Glasses Electric" logo) */
  --accent: #38a8ff;
  --accent-2: #58dfee;        /* cyan tail for gradients */
  --accent-dim: #2c6fb0;
  --accent-glow: rgba(56, 168, 255, 0.35);
  /* Status colors (roadmap, pills) */
  --ok: #38a8ff;
  --wip: #f2c66c;
  --planned: #8aa0c4;
  /* Lines + radii */
  --border: #232a3a;
  --border-bright: #33415c;
  --radius: 10px;
  --radius-sm: 6px;
  /* Type */
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--mono);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Animated layered gradient field behind everything. */
body {
  position: relative;
  background:
    radial-gradient(circle at 18% 8%, rgba(56, 168, 255, 0.10), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(88, 223, 238, 0.08), transparent 52%),
    radial-gradient(circle at 50% 120%, rgba(56, 168, 255, 0.06), transparent 55%),
    var(--bg-0);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3.5rem 1.5rem 3rem;
  animation: bgdrift 22s ease-in-out infinite alternate;
}

/* Sticky-footer layout: the content column grows so the footer is pushed
   to the bottom of the viewport on short pages instead of floating mid-screen
   and jumping around as you click between pages of different lengths. */
body > main { flex: 1 0 auto; }
@keyframes bgdrift {
  0%   { background-position: 0% 0%, 100% 100%, 50% 120%, 0 0; }
  100% { background-position: 6% 4%, 94% 92%, 50% 110%, 0 0; }
}

/* Fixed pixel grid overlay. */
.pixel-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(88, 223, 238, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(88, 223, 238, 0.022) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at 50% 30%, #000 55%, transparent 100%);
}

main { position: relative; z-index: 1; max-width: 880px; width: 100%; }

/* ---------- Top bar / brand / nav ---------- */
/* Sticky so the nav stays reachable while scrolling, and a fixed max-width +
   min-height so it renders identically on every page (no reflow/jump when
   navigating). The header + footer are injected by /site.js from one config,
   so the markup can no longer drift page to page. */
.site-header {
  position: sticky; top: 0; z-index: 30;
  width: 100%; max-width: 880px; min-height: 3.6rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  border: 1px solid var(--border);
  background: rgba(19, 23, 34, 0.82);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
a.brand { text-decoration: none; color: inherit; }
.brand-mark {
  font-size: 1.3rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-tag {
  font-size: 0.72rem; color: var(--fg-1);
  text-transform: uppercase; letter-spacing: 0.18em;
}
.brand-logo {
  height: 2.6rem; width: auto; display: block;
  image-rendering: -webkit-optimize-contrast;
}
@media (max-width: 600px) { .brand-logo { height: 2.1rem; } }
/* Publisher mark on game subsites: small GWG logo linking back to the
   studio site, shown where the "// a Ghost World Gaming title" text used
   to sit. */
.brand-studio { display: inline-flex; align-items: center; text-decoration: none; }
.brand-studio img {
  height: 1.9rem; width: auto; display: block;
  opacity: 0.75; transition: opacity 0.15s ease, filter 0.15s ease;
}
.brand-studio:hover img { opacity: 1; filter: drop-shadow(0 0 6px var(--accent-glow)); }
@media (max-width: 600px) { .brand-studio img { height: 1.5rem; } }

.nav { display: flex; gap: 0.4rem; flex-wrap: nowrap; align-items: center; }
.nav a {
  color: var(--fg-1); text-decoration: none; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.12em; white-space: nowrap;
  padding: 0.45rem 0.7rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; transition: all 0.15s ease;
}
.nav a:hover { color: var(--accent); border-color: var(--border-bright); }
.nav a.active { color: var(--accent); border-color: var(--accent-dim); }

/* Hamburger button — hidden on desktop, shown in the mobile breakpoint. */
.nav-toggle {
  display: none;
  flex-direction: column; justify-content: center; gap: 4px;
  width: 40px; height: 36px; padding: 8px;
  background: rgba(11, 13, 18, 0.65);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle .bar {
  display: block; width: 100%; height: 2px; border-radius: 2px;
  background: var(--fg-0); transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile: collapse the inline nav into a hamburger dropdown anchored to the
   header (which is the positioned/sticky containing block). */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    position: absolute; top: calc(100% + 0.4rem); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    background: rgba(16, 20, 30, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-bright); border-radius: var(--radius);
    padding: 0.5rem; box-shadow: var(--shadow); z-index: 40;
  }
  .nav.open { display: flex; }
  .nav a { padding: 0.7rem 0.8rem; font-size: 0.9rem; }
}

/* ---------- Hero ---------- */
h1 {
  font-size: clamp(1.9rem, 5.5vw, 2.9rem);
  margin: 0 0 0.6rem 0; line-height: 1.12; letter-spacing: -0.015em;
}
h1 .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede {
  color: var(--fg-1); font-size: 1.05rem; line-height: 1.65;
  margin: 0 0 2rem 0;
}

/* ---------- Cards / sections ---------- */
section, .card {
  border: 1px solid var(--border);
  background: rgba(19, 23, 34, 0.5);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem; margin-bottom: 1.25rem;
}
section h2, .card h2 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--accent); margin: 0 0 0.9rem 0;
}
section p, section li, .card p, .card li {
  color: var(--fg-0); font-size: 0.95rem; line-height: 1.65;
}
section ul { margin: 0; padding-left: 1.2rem; }
section li { margin-bottom: 0.35rem; }

/* ---------- Games portal grid ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.game-card {
  border: 1px solid var(--border); background: rgba(11, 13, 18, 0.65);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  text-decoration: none; color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
a.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dim);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--accent-dim);
}
.game-card.featured { border-color: var(--accent-dim); }
.game-card .title { color: var(--accent); font-size: 1.15rem; letter-spacing: 0.04em; }
.game-card .desc { color: var(--fg-1); font-size: 0.85rem; line-height: 1.55; }
.game-card.soon { opacity: 0.55; }

/* ---------- Pills / badges ---------- */
.pill {
  align-self: flex-start; font-size: 0.64rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--bg-0);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  padding: 0.12rem 0.5rem; border-radius: 999px; font-weight: 700;
}
.pill.dim { background: transparent; color: var(--fg-1); border: 1px solid var(--border); }

/* ---------- Link chips ---------- */
.links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }
.link-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 1px solid var(--border); background: rgba(11, 13, 18, 0.65);
  color: var(--fg-0); text-decoration: none;
  padding: 0.55rem 0.85rem; font-size: 0.85rem; border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.link-chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.link-chip.soon { opacity: 0.45; pointer-events: none; }
.link-chip .arrow { color: var(--accent); }

/* ---------- Roadmap: Now / Next / Later ---------- */
.roadmap-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 760px) { .roadmap-grid { grid-template-columns: repeat(3, 1fr); } }
.lane {
  border: 1px solid var(--border); background: rgba(19, 23, 34, 0.5);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.lane-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.18em;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--border);
}
.lane-head .dot { width: 9px; height: 9px; border-radius: 50%; }
.lane.now    .lane-head { color: var(--ok); }
.lane.now    .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.lane.next   .lane-head { color: var(--wip); }
.lane.next   .dot { background: var(--wip); box-shadow: 0 0 8px var(--wip); }
.lane.later  .lane-head { color: var(--planned); }
.lane.later  .dot { background: var(--planned); }
.lane ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.lane li {
  font-size: 0.88rem; line-height: 1.45; color: var(--fg-0);
  padding-left: 1rem; position: relative;
}
.lane li::before {
  content: "▪"; position: absolute; left: 0; color: var(--fg-2);
}
.lane li .sub { display: block; color: var(--fg-1); font-size: 0.78rem; margin-top: 0.15rem; }

/* ---------- Footer meta ---------- */
/* Lives at body level (sibling of <main>) and is injected by /site.js. The
   min-height reserves space so it doesn't pop in after the script runs. */
.meta {
  width: 100%; max-width: 880px; min-height: 2.4rem;
  color: var(--fg-1); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.14em; padding-top: 1.5rem; border-top: 1px solid var(--border);
  margin-top: 2rem; display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.meta a { color: var(--fg-1); text-decoration: none; }
.meta a:hover { color: var(--accent); }

/* ---------- Language picker (flag button in the top bar, injected by
   site.js). The flag stays legible even when the page language isn't. ---------- */
.lang-menu { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono); font-size: 1.05rem; line-height: 1;
  color: var(--fg-1); background: rgba(11, 13, 18, 0.65);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem; cursor: pointer;
}
.lang-btn .caret { font-size: 0.6rem; color: var(--fg-2); }
.lang-btn:hover, .lang-btn:focus { border-color: var(--accent); outline: none; }
.lang-btn:hover .caret { color: var(--accent); }
.lang-list {
  display: none;
  position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 50;
  list-style: none; margin: 0; padding: 0.4rem;
  min-width: 14rem; max-height: 60vh; overflow-y: auto;
  background: rgba(16, 20, 30, 0.98); backdrop-filter: blur(10px);
  border: 1px solid var(--border-bright); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.lang-menu.open .lang-list { display: block; }
.lang-list li {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 0.85rem; color: var(--fg-0); white-space: nowrap;
  padding: 0.45rem 0.6rem; border-radius: var(--radius-sm); cursor: pointer;
}
.lang-list li:hover { background: rgba(56, 168, 255, 0.12); color: var(--accent); }
.lang-list li.active { color: var(--accent); }
.lang-list .flag { font-size: 1.05rem; }
[dir="rtl"] .lang-list { right: auto; left: 0; }

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] section ul { padding-left: 0; padding-right: 1.2rem; }
[dir="rtl"] .lane li { padding-left: 0; padding-right: 1rem; }
[dir="rtl"] .lane li::before { left: auto; right: 0; }
[dir="rtl"] .status-dot { margin-right: 0; margin-left: 0.5rem; }
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 0.5rem;
  box-shadow: 0 0 8px var(--accent); animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.4; } }

/* ---------- Responsive video embed ---------- */
/* 16:9 wrapper so the iframe scales fluidly on mobile. */
.video-embed {
  position: relative; width: 100%; max-width: 880px;
  aspect-ratio: 16 / 9; margin: 0.25rem 0 1.75rem;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: #000;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (prefers-reduced-motion: reduce) {
  body { animation: none; }
  .status-dot { animation: none; }
}
