/* ===========================================
   BJJ Tech Tree — Shared Styles (MVP0)
   Extracted from archive/closedguard_prototype.html
   =========================================== */

:root {
  /* Surfaces */
  --bg: #0a0a0c;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --surface-3: #20202a;
  --border: #25252a;
  --border-strong: #3a3a40;

  /* Text */
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-muted: #52525b;

  /* Category colors (Closed Guard 5 categories) */
  --pass-color: #f97316;       /* top pass */
  --pass-bg: rgba(249,115,22,0.10);
  --pass-border: rgba(249,115,22,0.40);

  --sub-color: #f59e0b;        /* submission */
  --sub-bg: rgba(245,158,11,0.10);
  --sub-border: rgba(245,158,11,0.40);

  --sweep-color: #10b981;      /* sweep */
  --sweep-bg: rgba(16,185,129,0.10);
  --sweep-border: rgba(16,185,129,0.40);

  --back-color: #ec4899;       /* back entry */
  --back-bg: rgba(236,72,153,0.10);
  --back-border: rgba(236,72,153,0.40);

  --transit-color: #a78bfa;    /* guard transition */
  --transit-bg: rgba(167,139,250,0.10);
  --transit-border: rgba(167,139,250,0.40);

  /* Cross-module categories (used in index/takedown/side-control) */
  --top-color: #ef4444;        /* top position */
  --top-bg: rgba(239,68,68,0.10);
  --top-border: rgba(239,68,68,0.40);

  --takedown-color: #f59e0b;   /* takedown technique */
  --takedown-bg: rgba(245,158,11,0.10);

  --guard-pull-color: #10b981; /* guard pull */
  --guard-pull-bg: rgba(16,185,129,0.10);

  --escape-color: #94a3b8;     /* escape */
  --escape-bg: rgba(148,163,184,0.10);

  /* Center anchor (position node — focus) */
  --position-color: #8b5cf6;
  --position-bg: rgba(139,92,246,0.18);
  --position-border: rgba(139,92,246,0.50);

  /* Phase 0 banner (community) */
  --phase-color: #f59e0b;
  --phase-bg: rgba(245,158,11,0.08);
  --phase-border: rgba(245,158,11,0.30);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--position-color); }

/* ─────────── Top Bar (shared header) ─────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 50px;
  background: rgba(10,10,12,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 18px; gap: 14px;
  z-index: 1000;
}
.logo {
  font-size: 15px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text);
}
.logo em { color: var(--position-color); font-style: normal; }
.phase-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.10em;
  color: var(--phase-color); background: var(--phase-bg);
  border: 1px solid var(--phase-border);
  padding: 3px 8px; border-radius: 5px; text-transform: uppercase;
}
.topnav {
  margin-left: auto;
  display: flex; gap: 4px;
  font-size: 12px;
}
.topnav a {
  padding: 6px 10px; border-radius: 6px;
  color: var(--text-dim);
  transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* ─────────── Main Content Wrap ─────────── */
.page {
  padding: 70px 0 0; /* offset for fixed topbar */
  min-height: 100vh;
  display: flex; flex-direction: column;
}
.container {
  max-width: 1200px; margin: 0 auto;
  padding: 24px 24px 60px;
  width: 100%;
}

/* ─────────── Hero (index.html) ─────────── */
.hero {
  padding: 60px 24px 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 48px; font-weight: 800; letter-spacing: -0.04em;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--text), var(--position-color));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 17px; color: var(--text-dim);
  max-width: 620px; margin: 0 auto 6px;
}
.hero .sub {
  font-size: 13px; color: var(--text-muted);
  max-width: 540px; margin: 14px auto 0;
}

/* Module entry cards (index.html) */
.module-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  max-width: 1000px; margin: 0 auto; padding: 36px 24px;
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--position-color);
  background: var(--surface-2);
}
.module-card .tag {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; align-self: flex-start;
}
.module-card .tag.entry { color: var(--guard-pull-color); background: var(--guard-pull-bg); }
.module-card .tag.top { color: var(--top-color); background: var(--top-bg); }
.module-card .tag.guard { color: var(--position-color); background: var(--position-bg); }
.module-card h3 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
}
.module-card p {
  font-size: 13px; color: var(--text-dim); line-height: 1.55;
}
.module-card .count {
  font-size: 11px; color: var(--text-muted);
  margin-top: auto;
}

/* ─────────── Phase 0 Banner ─────────── */
.phase-banner {
  background: var(--phase-bg);
  border: 1px solid var(--phase-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13px; color: var(--text-dim);
}
.phase-banner strong { color: var(--phase-color); }

/* ─────────── Module Page Layout ─────────── */
.module-header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.module-header .breadcrumb {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px;
}
.module-header .breadcrumb a:hover { color: var(--text); }
.module-header h1 {
  font-size: 28px; font-weight: 700; letter-spacing: -0.02em;
}
.module-header .desc {
  font-size: 14px; color: var(--text-dim);
  margin-top: 6px; max-width: 720px;
}

/* Graph stage (D3 will render into this) */
.graph-stage {
  position: relative;
  margin: 18px auto;
  max-width: 1200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  min-height: 600px;
}
.graph-svg { width: 100%; height: 100%; display: block; }

/* SVG node styles */
.node { cursor: pointer; }
.node-bg { transition: fill 0.15s, stroke 0.15s; }
.node:hover .node-bg { stroke-width: 2.5; filter: brightness(1.18); }
.node.cat-pass .node-bg       { fill: var(--surface); stroke: var(--pass-border);    stroke-width: 1.5; }
.node.cat-submission .node-bg { fill: var(--surface); stroke: var(--sub-border);     stroke-width: 1.5; }
.node.cat-sweep .node-bg      { fill: var(--surface); stroke: var(--sweep-border);   stroke-width: 1.5; }
.node.cat-back-entry .node-bg { fill: var(--surface); stroke: var(--back-border);    stroke-width: 1.5; }
.node.cat-guard-transition .node-bg { fill: var(--surface); stroke: var(--transit-border); stroke-width: 1.5; }
.node.cat-position .node-bg   { fill: var(--position-bg); stroke: var(--position-color); stroke-width: 2.5; }
.node.cat-top .node-bg        { fill: var(--surface); stroke: var(--top-border);     stroke-width: 1.5; }
.node.cat-takedown .node-bg   { fill: var(--surface); stroke: var(--takedown-color); stroke-width: 1.5; opacity: 0.9; }
.node.cat-guard-pull .node-bg { fill: var(--surface); stroke: var(--guard-pull-color); stroke-width: 1.5; opacity: 0.9; }
.node.cat-escape .node-bg     { fill: var(--surface); stroke: var(--escape-color);   stroke-width: 1.5; }

/* Unverified nodes — dashed outline */
.node.unverified .node-bg { stroke-dasharray: 4 3; opacity: 0.65; }

/* Node pictogram image */
.node-image { pointer-events: none; }
.node.unverified .node-image { opacity: 0.55; }

.node-title { font-size: 12px; font-weight: 700; fill: var(--text); pointer-events: none; }
.node-sub   { font-size: 9px;  fill: var(--text-dim); pointer-events: none; }

/* Region backgrounds (category groups) */
.region-bg { stroke-width: 1; pointer-events: none; }
.region-bg.cat-pass       { fill: rgba(249,115,22,0.04); stroke: rgba(249,115,22,0.18); }
.region-bg.cat-submission { fill: rgba(245,158,11,0.04); stroke: rgba(245,158,11,0.18); }
.region-bg.cat-sweep      { fill: rgba(16,185,129,0.04); stroke: rgba(16,185,129,0.18); }
.region-bg.cat-back-entry { fill: rgba(236,72,153,0.05); stroke: rgba(236,72,153,0.22); }
.region-bg.cat-guard-transition { fill: rgba(167,139,250,0.04); stroke: rgba(167,139,250,0.18); }
.region-bg.cat-top        { fill: rgba(239,68,68,0.04);  stroke: rgba(239,68,68,0.18); }
.region-bg.cat-escape     { fill: rgba(148,163,184,0.04);stroke: rgba(148,163,184,0.18); }

.region-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; pointer-events: none;
}
.region-label.cat-pass       { fill: var(--pass-color); }
.region-label.cat-submission { fill: var(--sub-color); }
.region-label.cat-sweep      { fill: var(--sweep-color); }
.region-label.cat-back-entry { fill: var(--back-color); }
.region-label.cat-guard-transition { fill: var(--transit-color); }
.region-label.cat-top        { fill: var(--top-color); }
.region-label.cat-escape     { fill: var(--escape-color); }

/* Edges */
.edge { fill: none; stroke-width: 1.4; opacity: 0.55; }
.edge.cat-pass       { stroke: var(--pass-color); }
.edge.cat-submission { stroke: var(--sub-color); }
.edge.cat-sweep      { stroke: var(--sweep-color); }
.edge.cat-back-entry { stroke: var(--back-color); }
.edge.cat-guard-transition { stroke: var(--transit-color); }
.edge.cat-top        { stroke: var(--top-color); }
.edge.unverified     { stroke-dasharray: 4 3; opacity: 0.4; }

/* Suggest icon on node hover */
.node-suggest {
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s;
  pointer-events: none;
}
.node:hover .node-suggest {
  opacity: 1;
  pointer-events: all;
}
.node-suggest circle {
  fill: var(--surface-3);
  stroke: var(--border-strong);
  stroke-width: 1;
}
.node-suggest:hover circle {
  fill: var(--position-bg);
  stroke: var(--position-color);
}
.node-suggest-icon {
  font-size: 9px;
  fill: var(--text-dim);
  pointer-events: none;
}
.node-suggest:hover .node-suggest-icon {
  fill: var(--position-color);
}

/* Per-page Suggest button (top-right of graph stage) */
.suggest-page-btn {
  position: absolute;
  top: 14px; right: 14px;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  z-index: 10;
}
.suggest-page-btn:hover {
  background: var(--surface-3);
  border-color: var(--position-color);
  color: var(--text);
}

/* suggest button (standalone use, no panel) */
.suggest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-dim);
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.suggest-btn:hover {
  color: var(--phase-color);
  border-color: var(--phase-border);
  background: var(--phase-bg);
}

/* ─────────── Node Detail Panel ─────────── */
/*
 * Slides in from the right on desktop; bottom-sheet on mobile.
 * Used by side-control.html and future module pages.
 * Toggled via aria-hidden="true/false" and .panel-open on body.
 */
.panel {
  display: none; /* hidden by default; JS sets aria-hidden + display */
  position: fixed;
  top: 50px; right: 0; bottom: 0;
  width: 320px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  z-index: 200;
  flex-direction: column;
  gap: 12px;
}
.panel[aria-hidden="false"] {
  display: flex;
}
.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-tag {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px;
  align-self: flex-start;
}
/* tag colours by category */
.panel-tag.cat-submission     { color: var(--sub-color);     background: var(--sub-bg); }
.panel-tag.cat-top            { color: var(--top-color);     background: var(--top-bg); }
.panel-tag.cat-back-entry     { color: var(--back-color);    background: var(--back-bg); }
.panel-tag.cat-escape         { color: var(--escape-color);  background: var(--escape-bg); }
.panel-tag.cat-guard-transition { color: var(--transit-color); background: var(--transit-bg); }
.panel-tag.cat-position       { color: var(--position-color);background: var(--position-bg); }

.panel-title {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
}
.panel-sub {
  font-size: 11px; color: var(--text-muted);
}
.panel-desc {
  font-size: 13px; color: var(--text-dim);
  line-height: 1.65;
}
/* Cross-module link block */
.panel-conn {
  margin-top: 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--position-color);
  border-radius: 6px;
  font-size: 12px; color: var(--text-dim);
  display: none; /* shown only when node has crossModule data */
}
.panel-conn.visible { display: block; }
.panel-conn a {
  color: var(--position-color);
  font-weight: 600;
}
.panel-conn a:hover { text-decoration: underline; }

.panel-suggest {
  margin-top: auto;
  padding-top: 14px;
}

/* Close button */
.panel-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px; color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.panel-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* Mobile: bottom-sheet */
@media (max-width: 768px) {
  .panel {
    top: auto; right: 0; left: 0; bottom: 0;
    width: 100%;
    height: 55vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
  }
}

/* ─────────── Static Pages (about, sources, changelog) ─────────── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  font-size: 15px; color: var(--text-dim); line-height: 1.7;
}
.prose h1 {
  font-size: 32px; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text); margin-bottom: 8px;
}
.prose .lead {
  font-size: 16px; color: var(--text-dim);
  margin-bottom: 32px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.prose h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text);
  margin: 36px 0 12px;
}
.prose h3 {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  margin: 24px 0 8px;
}
.prose p { margin-bottom: 14px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 6px; }
.prose code {
  background: var(--surface-2); padding: 1px 6px;
  border-radius: 4px; font-size: 13px;
  border: 1px solid var(--border);
  color: var(--text);
}
.prose .phase-block {
  background: var(--surface);
  border-left: 3px solid var(--phase-color);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 14px 0;
}
.prose .phase-block strong { color: var(--text); }

/* Changelog entries */
.changelog-entry {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.changelog-entry:last-child { border-bottom: none; }
.changelog-date {
  font-size: 12px; color: var(--text-muted); font-weight: 600;
  letter-spacing: 0.04em;
}
.changelog-title { font-size: 15px; color: var(--text); margin-top: 4px; }
.changelog-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.empty-state {
  padding: 80px 20px; text-align: center;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 17px; color: var(--text-dim); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ─────────── Footer ─────────── */
.footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px; color: var(--text-muted);
}
.footer .links { margin-bottom: 6px; }
.footer .links a { margin: 0 8px; color: var(--text-dim); }
.footer .links a:hover { color: var(--text); }
.footer .meta { font-size: 11px; }

/* ─────────── View Toggle (index.html) ─────────── */
.view-toggle {
  display: flex;
  justify-content: center;
  padding: 16px 24px 8px;
}
.toggle-pill {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.toggle-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toggle-btn.active {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.toggle-btn svg { width: 14px; height: 14px; }

/* View sections */
.view-section {
  transition: opacity 0.2s ease;
}
.view-section.hidden {
  display: none;
}

/* Secondary (non-primary) toggle button — dimmer weight than .active */
.toggle-btn.secondary {
  color: var(--text-muted);
  font-weight: 500;
}
.toggle-btn.secondary:hover {
  color: var(--text-dim);
  background: var(--surface-2);
}
.toggle-btn.secondary.active {
  /* secondary can still become active when selected */
  background: var(--surface-2);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* MVP1 roadmap badge inside toggle button */
.toggle-coming-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text-muted);
  background: rgba(82,82,91,0.20);
  border: 1px solid rgba(82,82,91,0.30);
  line-height: 1.4;
}

/* ─────────── Full Graph Placeholder ─────────── */
.fullgraph-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 420px;
  padding: 48px 24px;
}
.fullgraph-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 400px;
}
.fullgraph-icon {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 4px;
}
.fullgraph-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-dim);
}
.fullgraph-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
}
.fullgraph-roadmap-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 5px;
  color: var(--text-muted);
  background: rgba(82,82,91,0.15);
  border: 1px solid rgba(82,82,91,0.25);
}

@media (max-width: 600px) {
  .fullgraph-placeholder {
    min-height: 320px;
    padding: 36px 16px;
  }
  .fullgraph-title { font-size: 22px; }
  .fullgraph-desc { font-size: 14px; }
}

/* ─────────── Index Flow Graph ─────────── */
.index-flow-stage {
  max-width: 960px; margin: 0 auto;
  padding: 12px 24px 24px;
}
.index-flow-svg { width: 100%; height: auto; min-height: 320px; display: block; }
.flow-node { cursor: pointer; }
.flow-node.no-link { cursor: default; }
.flow-node-bg { transition: fill 0.15s, stroke 0.15s; stroke-width: 1.5; }
.flow-node:not(.no-link):hover .flow-node-bg { filter: brightness(1.2); stroke-width: 2.5; }
.flow-node-label { font-size: 15px; font-weight: 700; fill: var(--text); pointer-events: none; text-anchor: middle; dominant-baseline: middle; }
.flow-node-sub { font-size: 11px; fill: var(--text-muted); pointer-events: none; text-anchor: middle; }
.flow-edge { fill: none; stroke: var(--text-muted); stroke-width: 1.6; opacity: 0.5; }
.flow-edge.dashed { stroke-dasharray: 4 3; opacity: 0.3; }

/* ─────────── Mobile (bottom sheet pattern) ─────────── */
@media (max-width: 768px) {
  .topbar { padding: 0 12px; gap: 8px; height: 46px; }
  .logo { font-size: 14px; }
  .topnav { gap: 0; font-size: 11px; }
  .topnav a { padding: 5px 7px; }
  .phase-badge { display: none; }

  .page { padding-top: 56px; }

  .hero { padding: 36px 16px 28px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 14px; }

  .module-grid { padding: 24px 14px; gap: 12px; }
  .module-card { padding: 18px; }

  .prose { padding: 24px 18px 60px; font-size: 14px; }
  .prose h1 { font-size: 24px; }
  .prose h2 { font-size: 18px; }
}

/* ─────────── Planet Card Grid (index.html redesign) ─────────── */
.planet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  align-items: start; /* allow accordion card to grow without stretching neighbours */
}

/* ── Base planet card ── */
/* Reset anchor default styles when planet-card is an <a> element */
a.planet-card {
  text-decoration: none;
  color: inherit;
}

.planet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  position: relative;
  min-height: 160px;
}
.planet-card:not(.coming):not(.transit-card) {
  cursor: pointer;
}
.planet-card:not(.coming):not(.transit-card):hover {
  transform: translateY(-2px);
  border-color: var(--position-color);
  background: var(--surface-2);
}

/* Inactive / coming cards */
.planet-card.coming {
  opacity: 0.55;
  cursor: default;
}

/* Transit card (Guard — accordion) */
.planet-card.transit-card {
  cursor: pointer;
  border-color: var(--transit-border);
}
.planet-card.transit-card:hover {
  background: var(--surface-2);
  border-color: var(--transit-color);
}
.planet-card.transit-card.open {
  border-color: var(--transit-color);
  background: var(--surface-2);
}

/* ── Card status badge ── */
.planet-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  align-self: flex-start;
}
.planet-status.live {
  color: #10b981;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
}
.planet-status.live::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}
.planet-status.coming-w2 {
  color: var(--phase-color);
  background: var(--phase-bg);
  border: 1px solid var(--phase-border);
}
.planet-status.coming-later {
  color: var(--text-muted);
  background: rgba(82,82,91,0.15);
  border: 1px solid rgba(82,82,91,0.30);
}

/* ── Card heading ── */
.planet-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.15;
}
.planet-card.coming .planet-name { color: var(--text-dim); }

/* ── Card description ── */
.planet-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  flex: 1;
}

/* ── Pictogram slot (reserved for designer) ── */
.planet-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  align-self: flex-end;
  margin-top: auto;
  font-size: 20px; /* fallback text/emoji if no img */
  color: var(--text-muted);
  overflow: hidden;
}
.planet-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Transit chevron row */
.transit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.transit-label {
  font-size: 10px;
  color: var(--transit-color);
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
}
.transit-chevron {
  font-size: 11px;
  color: var(--transit-color);
  transition: transform 0.2s;
  display: inline-block;
  line-height: 1;
}
.planet-card.open .transit-chevron { transform: rotate(90deg); }

/* ── Guard accordion body ── */
.guard-variants {
  display: none;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.planet-card.open .guard-variants { display: flex; }

.guard-variant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
}
.guard-variant-item.live-variant {
  cursor: pointer;
  border-color: var(--border-strong);
}
.guard-variant-item.live-variant:hover {
  background: var(--surface-3);
  border-color: var(--position-color);
}
.guard-variant-item.coming-variant {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.guard-variant-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.guard-variant-item.coming-variant .guard-variant-name { color: var(--text-dim); }

/* "Start here" badge inside accordion */
.start-here-badge {
  display: inline-flex;
  align-items: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  color: #10b981;
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.35);
  white-space: nowrap;
  flex-shrink: 0;
}
.coming-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(82,82,91,0.15);
  border: 1px solid rgba(82,82,91,0.25);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Responsive grid breakpoints ── */
@media (max-width: 900px) {
  .planet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .planet-grid {
    grid-template-columns: 1fr;
    padding: 24px 14px 40px;
    gap: 12px;
  }
  .planet-card {
    min-height: auto;
  }
  .planet-name { font-size: 20px; }
}
