:root {
  color-scheme: dark;

  /* Backgrounds - deep black with cool graphite undertones */
  --bg: #0a0808;
  --bg-elevated: #0f0c0b;
  --surface: #141110;
  --surface-2: #1a1614;
  --surface-3: #201c1a;

  /* Borders - cyan HUD tinted */
  --line: rgba(55, 213, 255, 0.14);
  --line-strong: rgba(55, 213, 255, 0.26);

  /* Text - warm white */
  --text: #f5ede6;
  --muted: #8a7c74;
  --muted-strong: #c0b0a4;

  /* Reward/action accent: Toxic Orange */
  --orange: #ff6b1a;
  --orange-soft: rgba(255, 107, 26, 0.12);
  --orange-glow: rgba(255, 107, 26, 0.42);
  --orange-mid: rgba(255, 107, 26, 0.28);

  /* SECONDARY: Amber / Warning Yellow */
  --amber: #ffb830;
  --amber-soft: rgba(255, 184, 48, 0.12);
  --yellow: #ffd60a;

  /* Danger Red */
  --red: #ff4444;
  --red-soft: rgba(255, 68, 68, 0.12);

  /* Primary HUD accents */
  --emerald: #32f5a9;
  --emerald-soft: rgba(50, 245, 169, 0.10);
  --cyan: #37d5ff;
  --cyan-soft: rgba(55, 213, 255, 0.09);

  /* Neutrals */
  --white: #ffffff;
  --black: #020202;

  /* Effects */
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.50);
  --shadow-orange: 0 14px 48px rgba(255, 107, 26, 0.22);
  --radius: 8px;
  --radius-sm: 6px;

  /* Layout */
  --sidebar-width: 264px;
  --topbar-height: 72px;
}

/* ─── RESET ─────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body::selection { background: rgba(255, 107, 26, 0.38); color: var(--white); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.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;
}

/* ─── KEYFRAMES ─────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-line {
  0%, 100% { opacity: 0.45; }
  50%       { opacity: 1; }
}

@keyframes scan {
  from { transform: translateY(-100%); }
  to   { transform: translateY(260%); }
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0%   { transform: scale(1);   opacity: 0.7; }
  70%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes nxp-glow {
  0%, 100% { box-shadow: 0 0 14px var(--orange-glow), 0 0 28px rgba(255,107,26,0.18); }
  50%       { box-shadow: 0 0 28px var(--orange-glow), 0 0 56px rgba(255,107,26,0.32), 0 0 8px rgba(255,184,48,0.45); }
}

@keyframes border-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes mission-reveal {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes glitch-flicker {
  0%, 94%, 100% { opacity: 1; transform: none; }
  95%            { opacity: 0.8; transform: translateX(2px) skewX(-1deg); }
  97%            { opacity: 0.9; transform: translateX(-1px); }
}

@keyframes terminal-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes alert-pulse {
  0%, 100% { background: rgba(255, 68, 68, 0.12); border-color: rgba(255, 68, 68, 0.28); }
  50%       { background: rgba(255, 68, 68, 0.22); border-color: rgba(255, 68, 68, 0.50); }
}

@keyframes scan-line {
  from { top: -2px; }
  to   { top: 100%; }
}

/* ─── GLOBAL SCANLINE OVERLAY ────────────────────── */
.site-body,
.app-body {
  position: relative;
}

/* subtle scanline on the whole page */
.app-body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
}

/* ─── BACKDROP / GLASS ───────────────────────────── */
.site-nav,
.app-topbar,
.sidebar {
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

/* ─── SITE NAV (landing) ─────────────────────────── */
.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 8, 0.82);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: var(--black);
  font-weight: 900;
  box-shadow: 0 0 34px var(--orange-glow);
  flex: 0 0 auto;
  animation: glitch-flicker 8s ease-in-out infinite;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.site-links,
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-links a,
.nav-links a,
.nav-links button {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.9rem;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.site-links a:hover,
.nav-links a:hover,
.nav-links button:hover { color: var(--white); }

/* ─── BUTTONS ────────────────────────────────────── */
.btn,
.btn-outline,
.btn-quiet,
.btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 18px;
  font-weight: 750;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn {
  background: linear-gradient(135deg, var(--orange), var(--amber));
  color: #1a0d00;
  box-shadow: 0 12px 32px var(--orange-glow);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}

.btn:hover::after { transform: translateX(100%); }

.btn:hover,
.btn-outline:hover,
.btn-quiet:hover,
.btn-small:hover { transform: translateY(-2px); }

.btn:hover { box-shadow: 0 18px 48px var(--orange-glow); }

.btn-outline {
  background: rgba(255, 107, 26, 0.04);
  border-color: var(--line-strong);
  color: var(--white);
}

.btn-outline:hover {
  border-color: rgba(255, 107, 26, 0.50);
  background: var(--orange-soft);
  color: var(--orange);
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--muted-strong);
}

.btn-quiet:hover { color: var(--white); background: rgba(255,255,255,0.05); }

.btn-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.82rem;
  background: var(--orange-soft);
  color: var(--orange);
  border-color: rgba(255, 107, 26, 0.28);
}

.btn-small:hover { background: rgba(255,107,26,0.20); }

.btn-full { width: 100%; }

.btn[disabled],
.btn-small[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

/* ─── SITE BODY (landing/auth pages) ────────────── */
.site-body { background: var(--bg); }

/* ─── EYEBROW / LABELS ───────────────────────────── */
.eyebrow,
.panel-label,
.metric-label,
.tag,
.status-pill,
.nav-section,
.kicker {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--orange);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

/* ─── HERO ───────────────────────────────────────── */
.landing-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 112px clamp(18px, 4vw, 64px) 72px;
  overflow: hidden;
  isolation: isolate;
}

#intelligence-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: #080504;
}

/* Animated scanline sweep over canvas */
.landing-hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,107,26,0.35), transparent);
  animation: scan-line 6s linear infinite;
  z-index: 0;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10,8,8,0.97) 0%, rgba(10,8,8,0.76) 47%, rgba(10,8,8,0.25) 100%),
    linear-gradient(180deg, rgba(10,8,8,0.10) 0%, rgba(10,8,8,0.95) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.78fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: center;
  max-width: 1320px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-title {
  max-width: 790px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: -0.02em;
  animation: fade-up 0.55s ease both;
}

.hero-title span { color: var(--orange); }

.hero-copy {
  max-width: 650px;
  margin: 26px 0 0;
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.2rem);
  animation: fade-up 0.65s 0.08s ease both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  animation: fade-up 0.65s 0.15s ease both;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
  max-width: 660px;
  animation: fade-up 0.65s 0.22s ease both;
}

.hero-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(20, 14, 10, 0.80);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.hero-metric:hover {
  border-color: rgba(255,107,26,0.35);
  background: rgba(255,107,26,0.06);
}

.hero-metric strong {
  display: block;
  font-size: 1.45rem;
  color: var(--orange);
}

.hero-metric span { color: var(--muted); font-size: 0.78rem; }

/* ─── HERO CONSOLE ───────────────────────────────── */
.hero-console {
  min-height: 560px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(14, 10, 8, 0.88);
  box-shadow: var(--shadow), 0 0 80px rgba(255,107,26,0.06);
  overflow: hidden;
  animation: fade-up 0.65s 0.10s ease both;
  position: relative;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
}

.console-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--orange);
  font-size: 0.82rem;
  font-weight: 800;
}

.console-status::before,
.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 18px var(--orange-glow);
  animation: pulse-line 2.2s ease-in-out infinite;
}

.console-body { padding: 18px; }

.console-score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

/* ─── SCORE RING ─────────────────────────────────── */
.score-ring {
  --score: 80%;
  --ring-color: var(--orange);
  position: relative;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--score), rgba(255,255,255,0.06) 0);
  filter: drop-shadow(0 0 12px var(--orange-glow));
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.05);
}

/* outer pulse ring */
.score-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--ring-color);
  animation: pulse-ring 3s ease-out infinite;
  opacity: 0;
}

.score-ring strong,
.score-ring span { position: relative; z-index: 1; }
.score-ring strong { font-size: 2rem; line-height: 1; }
.score-ring span { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.score-stack { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* ─── CONSOLE LIST ROWS ──────────────────────────── */
.console-list { display: grid; gap: 12px; margin-top: 18px; }

.console-row,
.activity-row,
.challenge-row,
.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.console-row:hover,
.activity-row:hover { border-color: var(--orange-mid); background: var(--orange-soft); }

.row-title { color: var(--white); font-weight: 760; }
.row-copy { color: var(--muted); font-size: 0.84rem; margin-top: 3px; }
.row-value { color: var(--orange); font-weight: 850; white-space: nowrap; }

/* ─── LANDING SECTIONS ───────────────────────────── */
.landing-section {
  padding: 80px clamp(18px, 4vw, 64px);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.section-inner { max-width: 1320px; margin: 0 auto; }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.4fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 30px;
}

.section-heading h2,
.page-title,
.auth-box h1 {
  margin: 0;
  color: var(--white);
  font-weight: 880;
  letter-spacing: -0.02em;
}

.section-heading h2 { font-size: clamp(2rem, 5vw, 4.2rem); line-height: 0.98; }
.section-heading p { margin: 0; color: var(--muted-strong); }

/* ─── MODULE GRID ────────────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.module-card,
.panel,
.metric-card,
.recommendation-card,
.challenge-card,
.auth-box,
.upload-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(20, 17, 16, 0.90);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel:hover,
.module-card:hover,
.challenge-card:hover {
  border-color: rgba(255,107,26,0.28);
  box-shadow: 0 18px 52px rgba(0,0,0,0.28), 0 0 28px rgba(255,107,26,0.07);
}

.module-card {
  min-height: 220px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: mission-reveal 0.5s ease both;
}

.module-card h3 { margin: 16px 0 8px; font-size: 1.02rem; }
.module-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.module-signal {
  height: 48px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
}

.module-signal span,
.mini-bars span,
.heat-cell,
.twin-cell {
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
}

/* orange/amber bar patterns */
.module-signal span:nth-child(3n+1),
.mini-bars span:nth-child(3n+1) { background: var(--orange-soft); }
.module-signal span:nth-child(3n+2),
.mini-bars span:nth-child(3n+2) { background: var(--amber-soft); }
.module-signal span:nth-child(3n)  { background: rgba(255, 68, 68, 0.10); }

/* ─── APP SHELL ──────────────────────────────────── */
.app-body { background: var(--bg); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

/* ─── SIDEBAR ────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(12, 9, 8, 0.96);
  padding: 20px 16px;
  z-index: 30;
  box-shadow: 4px 0 32px rgba(0,0,0,0.40);
}

/* orange left-edge glow line */
.sidebar::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--orange), transparent);
  opacity: 0.6;
}

.sidebar .brand { margin-bottom: 28px; }

.sidebar-nav { display: grid; gap: 4px; }

.nav-section {
  margin: 16px 10px 8px;
  color: var(--orange);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.sidebar-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted-strong);
  border: 1px solid transparent;
  font-size: 0.88rem;
  transition: all 0.18s ease;
  position: relative;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--white);
  background: rgba(255,107,26,0.08);
  border-color: rgba(255,107,26,0.20);
}

.sidebar-link.active {
  color: var(--orange);
}

.sidebar-link.active::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.player-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,107,26,0.04);
  transition: border-color 0.2s ease;
}

.player-chip:hover { border-color: rgba(255,107,26,0.30); }
.player-chip strong { display: block; font-size: 0.9rem; }
.player-chip span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 3px; word-break: break-all; }

/* ─── WORKSPACE / TOPBAR ─────────────────────────── */
.workspace { min-width: 0; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 8, 0.88);
  overflow: hidden;
}

/* topbar scanline sweep */
.app-topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  bottom: 0;
  background: linear-gradient(90deg, transparent, var(--orange-mid), transparent);
  animation: border-flow 4s linear infinite;
  background-size: 200% 100%;
}

.topbar-title { min-width: 0; }
.topbar-title span { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.topbar-title strong { display: block; color: var(--white); font-size: 1rem; }

.topbar-actions { display: flex; align-items: center; gap: 10px; }

.mobile-menu { display: none; }

/* ─── PAGE LAYOUT ────────────────────────────────── */
.page {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 34px);
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.page-title { font-size: clamp(2rem, 4vw, 4rem); line-height: 0.98; letter-spacing: -0.02em; }
.page-subtitle { max-width: 760px; margin: 12px 0 0; color: var(--muted-strong); }

/* ─── STATUS PILLS / TAGS ────────────────────────── */
.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* good - restored positive signal */
.status-pill.good {
  color: var(--emerald);
  border-color: rgba(50,245,169,0.30);
  background: var(--emerald-soft);
}

/* info - restored cyan HUD signal */
.status-pill.info {
  color: var(--cyan);
  border-color: rgba(55,213,255,0.28);
  background: var(--cyan-soft);
}

/* warn - red */
.status-pill.warn {
  color: var(--red);
  border-color: rgba(255,68,68,0.28);
  background: var(--red-soft);
}

.status-pill.fail {
  color: var(--red);
  border-color: rgba(255, 68, 68, 0.34);
  background: rgba(255, 68, 68, 0.09);
}

.vision-report,
.vision-summary {
  display: grid;
  gap: 14px;
}

.vision-report .activity-list,
.vision-summary .activity-list {
  margin-top: 4px;
}

/* ─── PAGE GRID ──────────────────────────────────── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.span-12 { grid-column: span 12; }
.span-9  { grid-column: span 9; }
.span-8  { grid-column: span 8; }
.span-7  { grid-column: span 7; }
.span-6  { grid-column: span 6; }
.span-5  { grid-column: span 5; }
.span-4  { grid-column: span 4; }
.span-3  { grid-column: span 3; }

/* ─── PANELS / CARDS ─────────────────────────────── */
.panel,
.metric-card,
.recommendation-card,
.challenge-card { padding: 18px; }

.panel-header,
.metric-header,
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel h2,
.panel h3,
.metric-card h3,
.recommendation-card h3,
.challenge-card h3 { margin: 0; color: var(--white); font-size: 1rem; }

.panel p,
.metric-card p,
.recommendation-card p,
.challenge-card p { color: var(--muted); margin: 0; }

.metric-card { min-height: 174px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-value { color: var(--white); font-size: clamp(2rem, 5vw, 3.2rem); line-height: 0.95; font-weight: 900; }
.metric-delta { color: var(--orange); font-size: 0.85rem; font-weight: 800; }

/* ─── SCORE GRID ─────────────────────────────────── */
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.score-card .score-ring { width: 112px; }
.score-card .score-ring strong { font-size: 1.8rem; }
.score-copy h3 { margin: 0 0 6px; font-size: 1rem; }
.score-copy p  { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ─── RECOMMENDATION CARD ────────────────────────── */
.recommendation-card {
  background:
    linear-gradient(135deg, rgba(255,107,26,0.10), transparent 46%),
    rgba(20, 17, 16, 0.92);
  border-color: rgba(255,107,26,0.20);
  position: relative;
  overflow: hidden;
}

.recommendation-card::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), var(--amber), transparent);
  animation: border-flow 3s linear infinite;
  background-size: 200% 100%;
}

.recommendation-main { display: grid; gap: 14px; }
.recommendation-main h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2.5rem); line-height: 1.05; }
.recommendation-main p  { color: var(--muted-strong); }

.explain-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.explain-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.2s ease;
}

.explain-item:hover { border-color: rgba(255,107,26,0.30); }
.explain-item strong { display: block; color: var(--orange); font-size: 1.05rem; }
.explain-item span   { color: var(--muted); font-size: 0.78rem; }

/* ─── MINI BARS ──────────────────────────────────── */
.mini-bars {
  min-height: 120px;
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 12), minmax(0, 1fr));
  gap: 7px;
  align-items: end;
}

.mini-bars span {
  min-height: 12px;
  background: linear-gradient(180deg, var(--orange), rgba(255,107,26,0.12));
  border: 1px solid rgba(255,107,26,0.14);
  border-radius: 3px 3px 0 0;
}

.axis-row,
.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ─── HEATMAP ────────────────────────────────────── */
.heatmap {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 5px;
}

.heat-cell,
.twin-cell {
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 3px;
  transition: transform 0.15s ease;
}

.heat-cell:hover { transform: scale(1.15); z-index: 1; }

.behavior-heatmap { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.behavior-metric { font-size: 1.35rem; overflow-wrap: anywhere; }

/* ─── SIGNAL LIST ────────────────────────────────── */
.signal-list,
.activity-list,
.challenge-list,
.settings-list { display: grid; gap: 10px; }

.signal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 12px;
  align-items: center;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--amber));
  box-shadow: 0 0 8px rgba(255,107,26,0.40);
}

/* ─── TIMELINE ───────────────────────────────────── */
.timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  animation: mission-reveal 0.4s ease both;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--orange);
  box-shadow: 0 0 14px var(--orange-glow);
}

.timeline-copy strong { color: var(--white); }
.timeline-copy p { margin-top: 4px; font-size: 0.88rem; color: var(--muted); }

/* ─── DIGITAL TWIN STAGE ─────────────────────────── */
.twin-stage {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255,107,26,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,26,0.03) 1px, transparent 1px),
    #0f0c0b;
  background-size: 34px 34px;
}

/* orange scan sweep */
.twin-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(255,107,26,0.07), transparent);
  animation: scan 4.5s linear infinite;
  pointer-events: none;
}

/* radar ring overlay */
.twin-stage::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  border: 1px solid rgba(255,107,26,0.12);
  box-shadow:
    0 0 0 84px rgba(255,107,26,0.04),
    0 0 0 168px rgba(255,107,26,0.025),
    0 0 0 252px rgba(255,107,26,0.01);
  pointer-events: none;
}

.twin-map {
  position: absolute;
  inset: 20px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 8px;
}

.twin-zone {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  padding: 10px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.twin-zone:hover { border-color: rgba(255,107,26,0.35); background: rgba(255,107,26,0.06); }

.twin-zone strong { position: relative; z-index: 1; font-size: 0.78rem; }
.twin-zone span   { position: absolute; right: 10px; bottom: 8px; color: var(--muted); font-size: 0.72rem; }

.twin-zone.good  { background: rgba(50,245,169,0.08);  border-color: rgba(50,245,169,0.18); }
.twin-zone.watch { background: rgba(255,184,48,0.09);  border-color: rgba(255,184,48,0.22); }
.twin-zone.risk  { background: rgba(255,68,68,0.09);   border-color: rgba(255,68,68,0.22);  animation: alert-pulse 2.5s ease-in-out infinite; }

.zone-a { grid-column: 1 / 5; grid-row: 1 / 4; }
.zone-b { grid-column: 5 / 9; grid-row: 1 / 3; }
.zone-c { grid-column: 9 / 13; grid-row: 1 / 5; }
.zone-d { grid-column: 1 / 4; grid-row: 4 / 9; }
.zone-e { grid-column: 4 / 9; grid-row: 3 / 7; }
.zone-f { grid-column: 9 / 13; grid-row: 5 / 9; }
.zone-g { grid-column: 4 / 9; grid-row: 7 / 9; }

/* sensor dots */
.sensor {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 16px var(--orange-glow);
  animation: pulse-line 2.4s ease-in-out infinite;
}

.sensor.s1 { left: 14%; top: 22%; }
.sensor.s2 { left: 44%; top: 18%; animation-delay: -0.7s; }
.sensor.s3 { left: 76%; top: 28%; animation-delay: -1.2s; }
.sensor.s4 { left: 28%; top: 70%; animation-delay: -1.7s; }
.sensor.s5 { left: 63%; top: 62%; animation-delay: -2.1s; }

/* ─── MAP GRID ───────────────────────────────────── */
.map-grid {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  gap: 4px;
}

.map-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.03);
}

/* ─── CHALLENGE / MISSION CARDS ──────────────────── */
.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: mission-reveal 0.45s ease both;
  position: relative;
  overflow: hidden;
}

/* animated top border on challenge card */
.challenge-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--orange-mid), transparent);
  animation: border-flow 3.5s linear infinite;
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.challenge-card:hover::before { opacity: 1; }

.challenge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── COACH / EFI INPUT ──────────────────────────── */
.coach-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.coach-input input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--white);
  padding: 0 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea { min-height: 112px; padding: 12px 13px; resize: vertical; }

.coach-input input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(255,107,26,0.55);
  box-shadow: 0 0 0 3px rgba(255,107,26,0.12);
}

/* terminal cursor */
.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--orange);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: terminal-blink 1.1s step-end infinite;
}

/* ─── AUTH ───────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 104px 18px 42px;
  background:
    linear-gradient(rgba(255,107,26,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,107,26,0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 42px 42px;
}

.auth-box { width: min(440px, 100%); padding: 24px; }
.auth-box h1 { font-size: 2rem; }
.auth-sub { margin: 8px 0 24px; color: var(--muted-strong); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--muted-strong); font-size: 0.84rem; font-weight: 750; }
#error { color: var(--red); min-height: 22px; margin: 12px 0 0; font-size: 0.88rem; }

/* ─── UPLOAD ─────────────────────────────────────── */
.upload-page { max-width: 760px; }
.upload-box { padding: 18px; margin-top: 18px; }

.drop-area {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 8px;
  border: 1px dashed rgba(255,107,26,0.38);
  background: rgba(255,107,26,0.04);
  color: var(--muted-strong);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.drop-area:hover { border-color: var(--orange); background: rgba(255,107,26,0.08); }

#preview { display: block; max-height: 340px; margin: 16px auto; border-radius: 8px; border: 1px solid var(--line); }
.ai-badge { display: inline-flex; margin-top: 12px; color: var(--amber); }
.pass    { color: var(--emerald); font-weight: 800; }
.fail    { color: var(--red);     font-weight: 800; }
.checking{ color: var(--muted-strong); }

/* ─── LIVE DOT ───────────────────────────────────── */
.live-dot { display: inline-flex; align-items: center; gap: 8px; }

/* ─── EMPTY STATE ────────────────────────────────── */
.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

/* ─── PLAYER CODE ────────────────────────────────── */
.player-code {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255,107,26,0.32);
  border-radius: 8px;
  color: var(--orange);
  background: var(--orange-soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 800;
  letter-spacing: 0.05em;
  animation: nxp-glow 3s ease-in-out infinite;
}

/* ─── MODAL ──────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.72);
}

.modal-overlay.open { display: flex; }

.modal-box {
  width: min(420px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}

.modal-box h3 { margin: 0 0 8px; }
.item-code { margin: 14px 0; }

/* ─── REDUCED MOTION ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 1180px) {
  .hero-grid,
  .section-heading { grid-template-columns: 1fr; }
  .hero-console { min-height: auto; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-9, .span-8, .span-7, .span-6, .span-5, .span-4, .span-3 { grid-column: span 12; }
  .score-grid { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .site-links a:not(.btn):not(.btn-outline),
  .brand-subtitle { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 82vw);
    transform: translateX(-104%);
    transition: transform 0.22s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .mobile-menu { display: inline-flex; }
  .page-header { grid-template-columns: 1fr; }
  .topbar-actions .status-pill { display: none; }
  .hero-metrics { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-nav { height: 64px; }
  .landing-hero { padding-top: 94px; }
  .hero-title { font-size: clamp(2.55rem, 16vw, 4rem); }
  .module-grid { grid-template-columns: 1fr; }
  .console-score, .score-card { grid-template-columns: 1fr; }
  .explain-grid { grid-template-columns: 1fr 1fr; }
}

/* GAME-FIRST PLAYER HUB */
.game-dashboard {
  --game-panel: rgba(24, 20, 19, 0.92);
  --game-border: rgba(255, 255, 255, 0.09);
  max-width: 1480px;
  padding-top: 30px;
  padding-bottom: 70px;
}

.game-dashboard h1,
.game-dashboard h2,
.game-dashboard h3 { letter-spacing: -0.025em; }

.game-currency {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(255, 184, 48, 0.24);
  border-radius: 999px;
  background: rgba(255, 184, 48, 0.08);
}

.game-currency span { color: var(--amber); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.12em; }
.game-currency strong { color: #fff2bd; font-size: 0.88rem; }
.game-cta-small { border-radius: 999px; background: var(--orange); color: white; box-shadow: 0 8px 24px rgba(255, 107, 26, 0.24); }

.game-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.game-kicker,
.game-section-heading > div > span,
.game-main-copy > small,
.game-world-card small,
.game-reward-row small,
.game-quest-footer small {
  color: var(--orange);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.game-welcome h1 { margin: 5px 0 6px; max-width: 760px; font-size: clamp(2rem, 3.2vw, 3.35rem); line-height: 1.03; }
.game-welcome h1 span { color: var(--orange); }
.game-welcome p { margin: 0; color: var(--muted-strong); }

.game-profile-card {
  display: grid;
  grid-template-columns: 58px 170px;
  gap: 13px;
  align-items: center;
  min-width: 270px;
  padding: 13px;
  border: 1px solid var(--game-border);
  border-radius: 18px;
  background: var(--game-panel);
  box-shadow: 0 14px 38px rgba(0,0,0,0.2);
}

.game-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 17px;
  color: white;
  font-size: 1.45rem;
  font-weight: 950;
  background: linear-gradient(145deg, #ff9a31, #ee3e16);
  box-shadow: inset 0 1px rgba(255,255,255,0.35), 0 8px 24px rgba(255,107,26,0.28);
}

.game-profile-card > div:last-child { display: grid; }
.game-profile-card span { color: var(--amber); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.12em; }
.game-profile-card strong { margin: 1px 0 5px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; }
.game-profile-card small { margin-top: 3px; color: var(--muted); font-size: 0.65rem; text-align: right; }
.game-xp { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.08); }
.game-xp i { display: block; width: 72%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--amber)); }

.game-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.game-stats article {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--game-border);
  border-radius: 16px;
  background: var(--game-panel);
}

.game-stats article > div { display: grid; min-width: 0; }
.game-stats small { color: var(--muted); font-size: 0.72rem; }
.game-stats strong { color: white; font-size: 1.15rem; }
.game-stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; font-size: 0.72rem; font-weight: 950; }
.game-stat-icon.emerald, .game-quest-icon.emerald { color: var(--emerald); background: var(--emerald-soft); }
.game-stat-icon.amber, .game-quest-icon.amber { color: var(--amber); background: var(--amber-soft); }
.game-stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.game-stat-icon.blue, .game-quest-icon.blue { color: var(--cyan); background: var(--cyan-soft); }

.game-hero-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.8fr); gap: 14px; }
.game-main-quest,
.game-world-card,
.game-panel,
.game-quest-card { border: 1px solid var(--game-border); border-radius: 22px; background: var(--game-panel); }

.game-main-quest {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  padding: 25px;
  background:
    radial-gradient(circle at 85% 10%, rgba(255,184,48,0.18), transparent 28%),
    linear-gradient(135deg, rgba(255,107,26,0.16), rgba(18,15,14,0.96) 54%);
}

.game-main-quest::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  right: -80px;
  bottom: -130px;
  border: 44px solid rgba(255,107,26,0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255,184,48,0.035), 0 0 80px rgba(255,107,26,0.12);
}

.game-card-top,
.game-progress-row,
.game-reward-row,
.game-quest-head,
.game-quest-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-card-top { position: relative; z-index: 1; }
.game-badge { padding: 6px 9px; border-radius: 7px; color: #1a1006; background: var(--amber); font-size: 0.65rem; font-weight: 950; letter-spacing: 0.11em; }
.game-time { color: var(--muted-strong); font-size: 0.76rem; }
.game-time::before { content: "◷"; margin-right: 5px; color: var(--orange); }
.game-main-copy { position: relative; z-index: 1; max-width: 650px; margin: 44px 0 28px; }
.game-main-copy h2 { margin: 4px 0 8px; color: white; font-size: clamp(1.7rem, 3vw, 2.65rem); line-height: 1; }
.game-main-copy p { max-width: 580px; margin: 0; color: var(--muted-strong); }
.game-progress-row { position: relative; z-index: 1; margin-bottom: 7px; color: var(--muted); font-size: 0.75rem; }
.game-progress-row strong { color: white; }
.game-progress { position: relative; z-index: 1; height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,0.08); }
.game-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--orange), var(--amber)); box-shadow: 0 0 18px rgba(255,107,26,0.45); }
.game-reward-row { position: relative; z-index: 1; margin-top: 22px; }
.game-reward-row > div { display: grid; }
.game-reward-row strong { color: var(--amber); }
.game-play-btn { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 17px; border-radius: 12px; background: var(--orange); color: white; font-size: 0.8rem; font-weight: 850; box-shadow: 0 10px 28px rgba(255,107,26,0.25); }
.game-play-btn:hover { transform: translateY(-2px); background: #ff7c35; }
.game-play-btn span { font-size: 1.3rem; }

.game-world-card { overflow: hidden; min-height: 340px; padding: 22px; text-align: center; background: radial-gradient(circle at 50% 54%, rgba(50,245,169,0.12), transparent 40%), var(--game-panel); }
.game-world-card .game-card-top { text-align: left; }
.game-world-card h2 { margin: 2px 0 0; font-size: 1.1rem; }
.game-world-card .game-card-top a,
.game-section-heading > a,
.game-section-heading.compact a { color: var(--orange); font-size: 0.75rem; font-weight: 750; }
.game-planet {
  position: relative;
  display: grid;
  place-items: center;
  width: 166px;
  height: 166px;
  margin: 15px auto 10px;
  border: 1px solid rgba(50,245,169,0.36);
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 35% 35%, rgba(50,245,169,0.72) 0 7%, transparent 8%),
    radial-gradient(ellipse at 60% 58%, rgba(50,245,169,0.34) 0 18%, transparent 19%),
    radial-gradient(circle at 42% 38%, #294b3e, #101d1b 58%, #07100f 59%);
  box-shadow: inset -18px -16px 34px rgba(0,0,0,0.58), 0 0 34px rgba(50,245,169,0.16), 0 0 0 9px rgba(50,245,169,0.035);
}
.game-planet::after { content: ""; position: absolute; inset: -9px; border: 3px solid transparent; border-top-color: var(--emerald); border-right-color: var(--emerald); border-radius: 50%; transform: rotate(25deg); }
.game-planet span { display: grid; color: white; font-size: 2.2rem; font-weight: 950; text-shadow: 0 2px 12px #000; }
.game-planet span small { color: var(--emerald); font-size: 0.7rem; }
.game-world-card > p { margin: 0; color: white; font-size: 0.82rem; font-weight: 750; }
.game-world-card > small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.7rem; font-weight: 500; letter-spacing: 0; }
.game-live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 10px var(--emerald); }

.game-section { margin-top: 34px; }
.game-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.game-section-heading h2 { margin: 2px 0 0; font-size: 1.45rem; }
.game-section-heading > a span { margin-left: 5px; font-size: 1.05rem; }
.game-quest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.game-quest-card { display: grid; gap: 18px; min-height: 258px; padding: 18px; transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.game-quest-card:hover { transform: translateY(-4px); border-color: rgba(255,107,26,0.3); box-shadow: 0 16px 38px rgba(0,0,0,0.24); }
.game-quest-card.is-complete { opacity: 0.7; }
.game-quest-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; font-weight: 950; }
.game-quest-type { margin-right: auto; color: var(--muted); font-size: 0.63rem; font-weight: 900; letter-spacing: 0.12em; }
.game-complete-label { color: var(--emerald); font-size: 0.61rem; font-weight: 900; letter-spacing: 0.08em; }
.game-quest-card h3 { margin: 0 0 6px; color: white; font-size: 1.08rem; }
.game-quest-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: 0.78rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.game-quest-footer { align-self: end; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.06); }
.game-quest-footer > div { display: grid; }
.game-quest-footer strong { color: var(--amber); font-size: 0.82rem; }
.game-quest-footer a { display: inline-flex; align-items: center; gap: 8px; color: white; font-size: 0.75rem; font-weight: 800; }
.game-quest-footer a span { color: var(--orange); font-size: 1.15rem; }
.game-done { color: var(--emerald); font-size: 0.75rem; font-weight: 800; }

.game-lower-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 14px; margin-top: 34px; }
.game-panel { padding: 20px; }
.game-section-heading.compact { align-items: center; margin-bottom: 18px; }
.game-section-heading.compact h2 { font-size: 1.15rem; }
.game-section-heading.compact > strong { padding: 6px 10px; border-radius: 9px; color: var(--amber); background: var(--amber-soft); font-size: 0.78rem; }
.game-goals { display: grid; gap: 8px; }
.game-goals > div { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: rgba(255,255,255,0.025); }
.game-goals i { display: grid; place-items: center; flex: 0 0 auto; width: 23px; height: 23px; border: 1px solid rgba(255,255,255,0.14); border-radius: 50%; color: #07100f; font-size: 0.72rem; font-style: normal; }
.game-goals .done i { border-color: var(--emerald); background: var(--emerald); }
.game-goals > div > span { display: grid; color: var(--muted-strong); font-size: 0.78rem; }
.game-goals small { color: var(--muted); font-size: 0.66rem; }
.game-goals a { margin-left: auto; padding: 5px 9px; border-radius: 8px; color: var(--orange); background: var(--orange-soft); font-size: 0.72rem; font-weight: 800; }
.game-impact-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.game-impact-stats div { display: grid; padding: 11px; border-radius: 12px; background: rgba(255,255,255,0.025); }
.game-impact-stats strong { color: white; font-size: 1.25rem; }
.game-impact-stats small { color: var(--muted); font-size: 0.67rem; }
.game-impact-chart { display: flex; align-items: end; gap: 5px; height: 72px; margin-top: 15px; padding-top: 8px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.game-impact-chart i { flex: 1; min-height: 8px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--emerald), rgba(50,245,169,0.16)); opacity: 0.85; }

@media (max-width: 1120px) {
  .game-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-hero-grid { grid-template-columns: 1fr; }
  .game-world-card { min-height: auto; }
  .game-quest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .game-dashboard { padding: 22px 16px 50px; }
  .game-welcome { align-items: stretch; flex-direction: column; }
  .game-profile-card { width: 100%; grid-template-columns: 58px 1fr; }
  .game-hero-grid, .game-lower-grid, .game-quest-grid { grid-template-columns: 1fr; }
  .game-main-quest { min-height: 0; padding: 20px; }
  .game-main-copy { margin: 34px 0 24px; }
  .game-reward-row { align-items: stretch; flex-direction: column; }
  .game-play-btn { justify-content: center; }
}

@media (max-width: 480px) {
  .game-currency { display: none; }
  .game-stats { grid-template-columns: 1fr 1fr; }
  .game-stats article { padding: 10px; }
  .game-stat-icon { display: none; }
  .game-section-heading { align-items: flex-start; }
  .game-section-heading > a { max-width: 90px; text-align: right; }
  .game-impact-stats { grid-template-columns: 1fr; }
}

/* SCI-FI GAME HUD V2 */
@keyframes sci-scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(700%); }
}

@keyframes sci-flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.72; }
  96% { opacity: 0.94; }
}

@keyframes sci-orbit {
  to { transform: rotate(360deg); }
}

.sci-game-body {
  --hud-cyan: #53edff;
  --hud-cyan-soft: rgba(83, 237, 255, 0.11);
  --hud-blue: #5694ff;
  --hud-violet: #9b6cff;
  --hud-void: #05070d;
  --hud-panel: rgba(9, 16, 27, 0.9);
  --hud-line: rgba(83, 237, 255, 0.22);
  background:
    radial-gradient(circle at 70% 12%, rgba(52, 94, 181, 0.16), transparent 30%),
    radial-gradient(circle at 24% 62%, rgba(155, 108, 255, 0.08), transparent 28%),
    #04060a;
}

.sci-game-body::before {
  background-image:
    radial-gradient(circle, rgba(83,237,255,0.28) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,255,255,0.15) 0 1px, transparent 1.5px);
  background-position: 0 0, 19px 27px;
  background-size: 46px 46px, 71px 71px;
  opacity: 0.28;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.sci-game-body .app-shell { position: relative; }
.sci-game-body .workspace {
  position: relative;
  background-image:
    linear-gradient(rgba(83,237,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,237,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.sci-game-body .sidebar {
  border-right: 1px solid rgba(83,237,255,0.19);
  background:
    linear-gradient(180deg, rgba(15,26,42,0.96), rgba(3,7,13,0.98)),
    var(--hud-void);
  box-shadow: 18px 0 70px rgba(0, 0, 0, 0.38);
}

.sci-game-body .sidebar::before {
  background: linear-gradient(90deg, transparent, rgba(83,237,255,0.12), transparent);
  opacity: 0.9;
}

.sci-game-body .sidebar::after {
  content: "";
  position: absolute;
  top: 108px;
  right: -2px;
  width: 3px;
  height: 82px;
  background: var(--hud-cyan);
  box-shadow: 0 0 18px var(--hud-cyan);
}

.sci-game-body .brand-mark {
  color: #031015;
  border-color: rgba(83,237,255,0.8);
  border-radius: 3px 12px 3px 12px;
  background: linear-gradient(135deg, #dcfbff, var(--hud-cyan));
  box-shadow: 0 0 24px rgba(83,237,255,0.38);
}

.sci-game-body .brand-name { letter-spacing: 0.12em; }
.sci-game-body .brand-subtitle { color: rgba(83,237,255,0.55); }
.sci-game-body .nav-section { color: var(--hud-cyan); letter-spacing: 0.2em; }
.sci-game-body .sidebar-link {
  border-color: transparent;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.sci-game-body .sidebar-link:hover,
.sci-game-body .sidebar-link.active {
  color: #e9fdff;
  border-color: rgba(83,237,255,0.18);
  background: linear-gradient(90deg, rgba(83,237,255,0.14), rgba(83,237,255,0.025));
}
.sci-game-body .sidebar-link.active::before {
  content: ">";
  color: var(--hud-cyan);
  font-weight: 900;
}
.sci-game-body .sidebar-link.active::after { background: var(--hud-cyan); box-shadow: 0 0 11px var(--hud-cyan); }
.sci-game-body .player-chip { border-color: rgba(83,237,255,0.16); border-radius: 2px 12px 2px 12px; background: rgba(83,237,255,0.045); }
.sci-game-body .sidebar-footer .btn-outline { border-color: rgba(83,237,255,0.2); border-radius: 2px 10px 2px 10px; color: var(--hud-cyan); }

.sci-game-body .app-topbar {
  border-bottom-color: rgba(83,237,255,0.14);
  background: rgba(4, 8, 14, 0.86);
  backdrop-filter: blur(18px);
}
.sci-game-body .app-topbar::after { background: linear-gradient(90deg, var(--hud-cyan), transparent 22%, transparent 78%, var(--orange)); opacity: 0.65; }
.sci-game-body .topbar-title span { color: rgba(83,237,255,0.52); letter-spacing: 0.16em; }
.sci-game-body .topbar-title strong { color: #e9fdff; letter-spacing: 0.16em; text-shadow: 0 0 16px rgba(83,237,255,0.26); }
.sci-game-body .game-currency { border-color: rgba(83,237,255,0.28); border-radius: 2px 10px 2px 10px; background: rgba(83,237,255,0.07); }
.sci-game-body .game-currency span { color: var(--hud-cyan); }
.sci-game-body .game-cta-small { border-radius: 2px 12px 2px 12px; clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px)); }

.sci-status-rail {
  position: sticky;
  top: var(--topbar-height);
  z-index: 19;
  display: flex;
  align-items: center;
  gap: 25px;
  min-height: 28px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(83,237,255,0.11);
  color: rgba(194,241,247,0.52);
  background: rgba(5,10,18,0.88);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.59rem;
  letter-spacing: 0.11em;
  backdrop-filter: blur(12px);
}
.sci-status-rail span { white-space: nowrap; }
.sci-status-rail strong { color: var(--hud-cyan); }
.sci-status-rail i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 9px var(--emerald); }
.sci-status-rail .sci-coords { margin-left: auto; color: rgba(255,107,26,0.64); }

.sci-game-body .game-dashboard {
  --game-panel: var(--hud-panel);
  --game-border: var(--hud-line);
  padding-top: 34px;
}

.sci-game-body .game-dashboard h1,
.sci-game-body .game-dashboard h2,
.sci-game-body .game-dashboard h3 {
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  font-weight: 900;
  letter-spacing: 0.035em;
}

.sci-game-body .game-welcome {
  position: relative;
  padding: 26px 28px;
  border-left: 2px solid var(--hud-cyan);
  background: linear-gradient(90deg, rgba(83,237,255,0.075), transparent 67%);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}
.sci-game-body .game-welcome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, var(--hud-cyan), transparent 55%);
}
.sci-game-body .game-kicker { color: var(--hud-cyan); text-shadow: 0 0 12px rgba(83,237,255,0.35); }
.sci-game-body .game-welcome h1 { margin-top: 10px; font-size: clamp(2rem, 3.6vw, 3.8rem); line-height: 0.93; }
.sci-game-body .game-welcome h1 span { color: var(--orange); text-shadow: 0 0 25px rgba(255,107,26,0.32); }
.sci-game-body .game-welcome > div:first-child > p { color: rgba(220,247,250,0.64); letter-spacing: 0.04em; }

.sci-game-body .game-profile-card {
  position: relative;
  grid-template-columns: 64px 180px;
  border-color: rgba(83,237,255,0.24);
  border-radius: 2px 18px 2px 18px;
  background: linear-gradient(135deg, rgba(83,237,255,0.1), rgba(8,14,24,0.95));
  box-shadow: inset 0 0 34px rgba(83,237,255,0.035), 0 0 30px rgba(83,237,255,0.06);
}
.sci-game-body .game-profile-card::after { content: "PILOT LINK"; position: absolute; right: 10px; top: -8px; padding: 1px 5px; color: var(--hud-cyan); background: #070c14; font-size: 0.5rem; letter-spacing: 0.12em; }
.sci-game-body .game-avatar { position: relative; border: 1px solid var(--hud-cyan); border-radius: 50%; background: radial-gradient(circle, rgba(83,237,255,0.22), rgba(5,15,24,0.94)); box-shadow: 0 0 25px rgba(83,237,255,0.2); }
.sci-game-body .game-avatar b { color: var(--hud-cyan); text-shadow: 0 0 10px var(--hud-cyan); }
.sci-game-body .game-avatar > i { position: absolute; inset: -6px; border: 1px dashed rgba(83,237,255,0.4); border-radius: 50%; animation: sci-orbit 13s linear infinite; }
.sci-game-body .game-profile-card span { color: var(--hud-cyan); }
.sci-game-body .game-xp i { background: linear-gradient(90deg, var(--hud-cyan), var(--hud-violet)); box-shadow: 0 0 12px var(--hud-cyan); }

.sci-game-body .game-stats { gap: 7px; }
.sci-game-body .game-stats article {
  position: relative;
  min-height: 64px;
  border-color: rgba(83,237,255,0.15);
  border-radius: 0;
  background: linear-gradient(135deg, rgba(83,237,255,0.075), rgba(7,13,22,0.92));
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}
.sci-game-body .game-stats article::after { content: ""; position: absolute; right: 11px; bottom: 8px; width: 22px; height: 2px; background: rgba(83,237,255,0.5); }
.sci-game-body .game-stats small { color: rgba(172,231,239,0.52); font-family: Consolas, monospace; letter-spacing: 0.1em; }
.sci-game-body .game-stats strong { color: #eafbff; font-family: Consolas, monospace; }
.sci-game-body .game-stat-icon { width: 38px; border: 1px solid currentColor; border-radius: 2px 10px 2px 10px; font-size: 0.58rem; }

.sci-game-body .game-main-quest,
.sci-game-body .game-world-card,
.sci-game-body .game-panel,
.sci-game-body .game-quest-card {
  border-color: rgba(83,237,255,0.18);
  border-radius: 2px 24px 2px 24px;
  background-color: var(--hud-panel);
}

.sci-game-body .game-main-quest {
  min-height: 360px;
  background:
    linear-gradient(110deg, rgba(6,12,21,0.96) 0 46%, rgba(6,12,21,0.5) 70%),
    radial-gradient(circle at 80% 50%, rgba(255,107,26,0.28), transparent 27%),
    repeating-linear-gradient(0deg, rgba(83,237,255,0.025) 0 1px, transparent 1px 5px),
    #070c15;
  box-shadow: inset 0 0 55px rgba(83,237,255,0.025), 0 18px 50px rgba(0,0,0,0.34);
}
.sci-game-body .game-main-quest::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 16%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(83,237,255,0.07), transparent);
  animation: sci-scan 8s linear infinite;
}
.sci-game-body .game-main-quest::after { border-color: rgba(83,237,255,0.09); box-shadow: 0 0 0 24px rgba(83,237,255,0.025), 0 0 90px rgba(83,237,255,0.1); }
.sci-game-body .game-badge { color: #001115; border: 1px solid var(--hud-cyan); border-radius: 2px 9px 2px 9px; background: var(--hud-cyan); box-shadow: 0 0 18px rgba(83,237,255,0.26); }
.sci-game-body .game-main-copy > small { color: var(--orange); }
.sci-game-body .game-main-copy h2 { max-width: 610px; color: #f2fdff; font-size: clamp(2rem, 3.2vw, 3.25rem); line-height: 0.91; text-shadow: 0 0 28px rgba(83,237,255,0.12); animation: sci-flicker 9s infinite; }
.sci-game-body .game-progress { height: 5px; border-radius: 0; background: rgba(83,237,255,0.08); }
.sci-game-body .game-progress i { border-radius: 0; background: linear-gradient(90deg, var(--hud-cyan), var(--orange)); box-shadow: 0 0 15px var(--hud-cyan); }
.sci-game-body .game-play-btn { border: 1px solid rgba(255,255,255,0.18); border-radius: 2px 13px 2px 13px; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px)); letter-spacing: 0.09em; }

.sci-game-body .game-world-card {
  position: relative;
  background:
    repeating-linear-gradient(0deg, rgba(83,237,255,0.025) 0 1px, transparent 1px 5px),
    radial-gradient(circle at 50% 56%, rgba(83,237,255,0.15), transparent 42%),
    #07101a;
}
.sci-game-body .game-world-card::before { content: "HOLOGRAM FEED 03"; position: absolute; left: 16px; bottom: 13px; color: rgba(83,237,255,0.35); font-family: Consolas, monospace; font-size: 0.5rem; letter-spacing: 0.12em; }
.sci-game-body .game-world-card .game-card-top a { color: var(--hud-cyan); }
.sci-game-body .game-planet { border-color: var(--hud-cyan); background: radial-gradient(ellipse at 35% 35%, rgba(83,237,255,0.8) 0 7%, transparent 8%), radial-gradient(ellipse at 60% 58%, rgba(83,237,255,0.34) 0 18%, transparent 19%), radial-gradient(circle at 42% 38%, #1d6270, #0a2833 58%, #031018 59%); box-shadow: inset -18px -16px 34px rgba(0,0,0,0.62), 0 0 34px rgba(83,237,255,0.22), 0 0 0 9px rgba(83,237,255,0.035); }
.sci-game-body .game-planet::after { border-top-color: var(--hud-cyan); border-right-color: var(--hud-cyan); animation: sci-orbit 18s linear infinite; }
.sci-game-body .game-planet span small { color: var(--hud-cyan); }
.sci-game-body .game-live-dot { background: var(--hud-cyan); box-shadow: 0 0 10px var(--hud-cyan); }

.sci-game-body .game-section-heading > div > span,
.sci-game-body .game-world-card small,
.sci-game-body .game-reward-row small,
.sci-game-body .game-quest-footer small { color: var(--hud-cyan); }
.sci-game-body .game-section-heading h2 { color: #effdff; }
.sci-game-body .game-section-heading > a,
.sci-game-body .game-section-heading.compact a { color: var(--hud-cyan); }
.sci-game-body .game-section-heading { border-left: 2px solid var(--hud-cyan); padding-left: 12px; }

.sci-game-body .game-quest-grid { gap: 10px; }
.sci-game-body .game-quest-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(83,237,255,0.07), transparent 35%),
    rgba(7,13,22,0.94);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.sci-game-body .game-quest-card::before { content: ""; position: absolute; top: 0; left: 0; width: 38%; height: 1px; background: var(--hud-cyan); box-shadow: 0 0 9px var(--hud-cyan); }
.sci-game-body .game-quest-card:hover { border-color: var(--hud-cyan); box-shadow: 0 10px 45px rgba(83,237,255,0.1); }
.sci-game-body .game-quest-icon { width: 44px; border: 1px solid currentColor; border-radius: 2px 10px 2px 10px; font-family: Consolas, monospace; font-size: 0.53rem; letter-spacing: 0.05em; }
.sci-game-body .game-quest-type { color: rgba(83,237,255,0.6); }
.sci-game-body .game-quest-card h3 { color: #eafcff; letter-spacing: 0.025em; }
.sci-game-body .game-quest-footer a { color: var(--hud-cyan); }

.sci-game-body .game-panel { background: linear-gradient(135deg, rgba(83,237,255,0.055), rgba(7,13,22,0.95)); }
.sci-game-body .game-goals > div,
.sci-game-body .game-impact-stats div { border-left: 1px solid rgba(83,237,255,0.18); border-radius: 0 8px 8px 0; background: rgba(83,237,255,0.035); }
.sci-game-body .game-goals i { border-radius: 2px; font-size: 0.5rem; }
.sci-game-body .game-goals .done i { color: #001015; border-color: var(--hud-cyan); background: var(--hud-cyan); }
.sci-game-body .game-impact-chart i { border-radius: 0; background: linear-gradient(180deg, var(--hud-cyan), rgba(83,237,255,0.08)); box-shadow: 0 0 9px rgba(83,237,255,0.12); }

@media (max-width: 880px) {
  .sci-status-rail { padding: 0 16px; gap: 14px; overflow: hidden; }
  .sci-status-rail span:nth-child(2), .sci-status-rail .sci-coords { display: none; }
}

@media (max-width: 760px) {
  .sci-game-body .game-welcome { padding: 20px 16px; }
  .sci-game-body .game-welcome h1 { font-size: clamp(2rem, 11vw, 3.2rem); }
  .sci-game-body .game-profile-card { grid-template-columns: 64px 1fr; }
  .sci-game-body .game-main-copy h2 { font-size: 2.25rem; }
}

/* SHARED STARBRIDGE MODULES */
.sci-game-body:not(:has(.game-dashboard)) .page,
.sci-game-body .page:not(.game-dashboard) {
  max-width: 1440px;
  padding-top: 34px;
  padding-bottom: 70px;
}

.sci-game-body .page-header {
  position: relative;
  min-height: 180px;
  padding: 26px 28px;
  border: 1px solid rgba(83,237,255,0.17);
  border-left: 3px solid var(--hud-cyan);
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(83,237,255,0.085), transparent 67%),
    repeating-linear-gradient(0deg, rgba(83,237,255,0.018) 0 1px, transparent 1px 5px);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}
.sci-game-body .page-header::before { content: ""; position: absolute; top: 0; left: 0; width: 34%; height: 1px; background: var(--hud-cyan); box-shadow: 0 0 12px var(--hud-cyan); }
.sci-game-body .page-header::after { content: "MODULE FEED // LIVE"; position: absolute; right: 26px; bottom: 16px; color: rgba(83,237,255,0.33); font-family: Consolas, monospace; font-size: 0.55rem; letter-spacing: 0.13em; }
.sci-game-body .page-header .eyebrow { color: var(--hud-cyan); text-shadow: 0 0 12px rgba(83,237,255,0.28); }
.sci-game-body .page-title { max-width: 960px; margin-top: 8px; color: #f0fdff; font-family: "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(2.2rem, 4.8vw, 4.6rem); font-weight: 950; line-height: 0.94; letter-spacing: 0.025em; text-transform: uppercase; }
.sci-game-body .page-subtitle { max-width: 780px; color: rgba(205,239,244,0.62); }

.sci-game-body .page-grid { gap: 11px; margin-top: 11px; }
.sci-game-body .panel,
.sci-game-body .recommendation-card,
.sci-game-body .challenge-card,
.sci-game-body .metric-card,
.sci-game-body .upload-box {
  position: relative;
  overflow: hidden;
  border-color: rgba(83,237,255,0.16);
  border-radius: 0 18px 0 18px;
  background:
    linear-gradient(135deg, rgba(83,237,255,0.055), transparent 38%),
    rgba(7,13,22,0.93);
  box-shadow: inset 0 0 32px rgba(83,237,255,0.015), 0 14px 38px rgba(0,0,0,0.18);
}
.sci-game-body .panel::before,
.sci-game-body .metric-card::before,
.sci-game-body .upload-box::before { content: ""; position: absolute; top: 0; left: 0; width: 30%; height: 1px; background: var(--hud-cyan); box-shadow: 0 0 8px rgba(83,237,255,0.45); }
.sci-game-body .panel:hover,
.sci-game-body .challenge-card:hover,
.sci-game-body .metric-card:hover { border-color: rgba(83,237,255,0.34); box-shadow: 0 15px 45px rgba(83,237,255,0.055); }
.sci-game-body .panel-label { color: var(--hud-cyan); font-family: Consolas, monospace; letter-spacing: 0.12em; }
.sci-game-body .panel h2,
.sci-game-body .panel h3,
.sci-game-body .challenge-card h3,
.sci-game-body .recommendation-card h2,
.sci-game-body .recommendation-card h3 { color: #effdff; font-family: "Arial Narrow", "Segoe UI", sans-serif; letter-spacing: 0.025em; text-transform: uppercase; }
.sci-game-body .panel p,
.sci-game-body .challenge-card p,
.sci-game-body .recommendation-card p { color: rgba(194,225,231,0.58); }
.sci-game-body .panel-header { padding-bottom: 13px; border-bottom: 1px solid rgba(83,237,255,0.09); }

.sci-game-body .status-pill { border-radius: 2px 8px 2px 8px; font-family: Consolas, monospace; letter-spacing: 0.08em; }
.sci-game-body .status-pill.info { color: var(--hud-cyan); border-color: rgba(83,237,255,0.27); background: rgba(83,237,255,0.07); }
.sci-game-body .btn,
.sci-game-body .btn-small,
.sci-game-body .btn-outline,
.sci-game-body .btn-quiet { border-radius: 2px 10px 2px 10px; letter-spacing: 0.06em; }
.sci-game-body .btn { clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 11px 100%, 0 calc(100% - 11px)); }
.sci-game-body .btn-small { color: var(--hud-cyan); border-color: rgba(83,237,255,0.22); background: rgba(83,237,255,0.06); }

.sci-game-body .metric-label { color: rgba(83,237,255,0.56); font-family: Consolas, monospace; letter-spacing: 0.09em; }
.sci-game-body .metric-value,
.sci-game-body .row-value { color: var(--hud-cyan); text-shadow: 0 0 10px rgba(83,237,255,0.16); }
.sci-game-body .activity-row,
.sci-game-body .console-row,
.sci-game-body .setting-row { border-color: rgba(83,237,255,0.1); background: rgba(83,237,255,0.025); }
.sci-game-body .activity-row:hover,
.sci-game-body .setting-row:hover { background: rgba(83,237,255,0.05); }
.sci-game-body .progress-track { border-radius: 0; background: rgba(83,237,255,0.07); }
.sci-game-body .progress-fill { border-radius: 0; background: linear-gradient(90deg, var(--hud-cyan), var(--hud-violet)); box-shadow: 0 0 10px rgba(83,237,255,0.25); }
.sci-game-body .mini-bars span { background: linear-gradient(180deg, var(--hud-cyan), rgba(83,237,255,0.08)); }
.sci-game-body .heat-cell,
.sci-game-body .map-cell { border-radius: 1px; filter: hue-rotate(122deg) saturate(1.25); }
.sci-game-body .map-grid,
.sci-game-body .heatmap { border-color: rgba(83,237,255,0.13); background: rgba(2,9,16,0.82); }

.sci-game-body .twin-stage {
  border-color: rgba(83,237,255,0.22);
  border-radius: 0 18px 0 18px;
  background:
    linear-gradient(rgba(83,237,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,237,255,0.04) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(83,237,255,0.1), rgba(3,9,15,0.96) 62%);
  background-size: 28px 28px, 28px 28px, auto;
  box-shadow: inset 0 0 50px rgba(83,237,255,0.055);
}
.sci-game-body .twin-zone { border-color: rgba(83,237,255,0.27); background: rgba(8,23,34,0.9); box-shadow: 0 0 20px rgba(83,237,255,0.06); }
.sci-game-body .sensor { background: var(--hud-cyan); box-shadow: 0 0 14px var(--hud-cyan); }

.sci-game-body .coach-input {
  border-color: rgba(83,237,255,0.18);
  border-radius: 0 14px 0 14px;
  background: rgba(3,10,17,0.9);
}
.sci-game-body .coach-input input,
.sci-game-body input,
.sci-game-body select,
.sci-game-body textarea { color: #eaffff; border-color: rgba(83,237,255,0.19); border-radius: 2px 9px 2px 9px; background: rgba(3,10,18,0.9); }
.sci-game-body input:focus,
.sci-game-body select:focus,
.sci-game-body textarea:focus { border-color: var(--hud-cyan); outline: 1px solid rgba(83,237,255,0.2); box-shadow: 0 0 16px rgba(83,237,255,0.09); }

.sci-game-body .drop-area {
  min-height: 230px;
  border-color: rgba(83,237,255,0.28);
  border-radius: 0 18px 0 18px;
  background:
    linear-gradient(rgba(83,237,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,237,255,0.035) 1px, transparent 1px),
    rgba(3,11,18,0.8);
  background-size: 24px 24px;
}
.sci-game-body .drop-area:hover { border-color: var(--hud-cyan); background-color: rgba(83,237,255,0.045); }

/* PILOT LOGIN + FORGE */
.sci-auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 72% 48%, rgba(83,237,255,0.15), transparent 24%),
    radial-gradient(circle at 25% 70%, rgba(155,108,255,0.08), transparent 28%),
    #04070c;
}
.sci-auth-body::before,
.sci-landing-body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(circle, rgba(83,237,255,0.24) 0 1px, transparent 1.5px); background-size: 48px 48px; opacity: 0.28; }
.sci-auth-body .site-nav,
.sci-landing-body .site-nav { border-bottom-color: rgba(83,237,255,0.13); background: rgba(4,9,16,0.82); backdrop-filter: blur(18px); }
.sci-auth-body .brand-mark,
.sci-landing-body .brand-mark { color: #031015; border-color: var(--hud-cyan, #53edff); border-radius: 3px 12px 3px 12px; background: linear-gradient(135deg, #dcfbff, #53edff); box-shadow: 0 0 24px rgba(83,237,255,0.28); }
.sci-auth-body .brand-subtitle,
.sci-landing-body .brand-subtitle { color: rgba(83,237,255,0.55); }
.sci-auth-body .auth-layout { position: relative; min-height: 100vh; padding-top: 110px; }
.sci-auth-body .auth-layout::before { content: "PILOT AUTH NODE // ASIA-07"; position: absolute; top: 108px; left: 50%; width: min(520px, calc(100% - 32px)); transform: translateX(-50%); color: rgba(83,237,255,0.38); font-family: Consolas, monospace; font-size: 0.58rem; letter-spacing: 0.14em; }
.sci-auth-body .auth-box {
  position: relative;
  overflow: hidden;
  width: min(520px, 100%);
  padding: 34px;
  border: 1px solid rgba(83,237,255,0.24);
  border-left: 3px solid #53edff;
  border-radius: 0 24px 0 24px;
  background:
    linear-gradient(135deg, rgba(83,237,255,0.08), transparent 42%),
    repeating-linear-gradient(0deg, rgba(83,237,255,0.018) 0 1px, transparent 1px 5px),
    rgba(7,14,24,0.94);
  box-shadow: 0 26px 80px rgba(0,0,0,0.48), inset 0 0 50px rgba(83,237,255,0.025);
}
.sci-auth-body .auth-box::before { content: ""; position: absolute; top: 0; left: 0; width: 44%; height: 1px; background: #53edff; box-shadow: 0 0 12px #53edff; }
.sci-auth-body .auth-box::after { content: "ENCRYPTION: ACTIVE"; position: absolute; right: 16px; bottom: 10px; color: rgba(83,237,255,0.25); font-family: Consolas, monospace; font-size: 0.5rem; letter-spacing: 0.12em; }
.sci-auth-body .eyebrow { color: #53edff; }
.sci-auth-body .auth-box h1 { margin: 9px 0; color: #f1fdff; font-family: "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(2rem, 5vw, 3.35rem); font-weight: 950; line-height: 0.95; letter-spacing: 0.025em; }
.sci-auth-body .auth-sub { color: rgba(199,233,238,0.6); }
.sci-auth-body .form-group label { color: rgba(83,237,255,0.68); font-family: Consolas, monospace; font-size: 0.68rem; letter-spacing: 0.09em; text-transform: uppercase; }
.sci-auth-body .form-group input { border-color: rgba(83,237,255,0.2); border-radius: 2px 10px 2px 10px; background: rgba(2,9,16,0.86); }
.sci-auth-body .form-group input:focus { border-color: #53edff; outline: 1px solid rgba(83,237,255,0.2); box-shadow: 0 0 18px rgba(83,237,255,0.09); }
.sci-auth-body .btn-full { border-radius: 2px 12px 2px 12px; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); letter-spacing: 0.08em; }
.sci-auth-body .row-copy a { color: #53edff; }

/* STARBRIDGE LANDING */
.sci-landing-body { --hud-cyan: #53edff; min-height: 100vh; background: #04070c; }
.sci-landing-body .landing-hero { background: radial-gradient(circle at 72% 35%, rgba(83,237,255,0.1), transparent 30%); }
.sci-landing-body .hero-scrim { background: linear-gradient(90deg, rgba(4,7,12,0.98) 0 42%, rgba(4,7,12,0.42) 70%, rgba(4,7,12,0.8)); }
.sci-landing-body .eyebrow { color: var(--hud-cyan); text-shadow: 0 0 12px rgba(83,237,255,0.32); }
.sci-landing-body .hero-title { max-width: 920px; color: #effdff; font-family: "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(3.4rem, 7vw, 6.9rem); font-weight: 950; line-height: 0.82; letter-spacing: 0.005em; }
.sci-landing-body .hero-title span { color: var(--orange); text-shadow: 0 0 36px rgba(255,107,26,0.32); }
.sci-landing-body .hero-copy { max-width: 720px; color: rgba(201,235,240,0.66); font-size: 1.02rem; }
.sci-landing-body .hero-console { border-color: rgba(83,237,255,0.23); border-radius: 0 28px 0 28px; background: repeating-linear-gradient(0deg, rgba(83,237,255,0.022) 0 1px, transparent 1px 5px), rgba(5,13,22,0.9); box-shadow: 0 24px 80px rgba(0,0,0,0.4), inset 0 0 44px rgba(83,237,255,0.025); }
.sci-landing-body .hero-console::before { content: "LIVE PLANET FEED"; position: absolute; top: -9px; right: 22px; padding: 1px 7px; color: var(--hud-cyan); background: #060b12; font-family: Consolas, monospace; font-size: 0.52rem; letter-spacing: 0.12em; }
.sci-landing-body .console-header { border-bottom-color: rgba(83,237,255,0.12); }
.sci-landing-body .console-status,
.sci-landing-body .panel-label,
.sci-landing-body .row-value { color: var(--hud-cyan); }
.sci-landing-body .hero-metric { border-color: rgba(83,237,255,0.14); border-radius: 0 12px 0 12px; background: rgba(83,237,255,0.035); }
.sci-landing-body .hero-metric strong { color: var(--hud-cyan); }
.sci-landing-body .landing-section { border-top-color: rgba(83,237,255,0.1); background: linear-gradient(180deg, rgba(83,237,255,0.018), transparent); }
.sci-landing-body .section-heading h2 { color: #f0fdff; font-family: "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(2.1rem, 4vw, 4rem); font-weight: 950; line-height: 0.95; letter-spacing: 0.02em; }
.sci-landing-body .panel,
.sci-landing-body .module-card { border-color: rgba(83,237,255,0.14); border-radius: 0 18px 0 18px; background: linear-gradient(135deg, rgba(83,237,255,0.055), transparent 40%), rgba(7,13,22,0.93); }
.sci-landing-body .panel:hover,
.sci-landing-body .module-card:hover { border-color: rgba(83,237,255,0.34); box-shadow: 0 18px 42px rgba(83,237,255,0.055); }
.sci-landing-body .panel-label { color: var(--hud-cyan); }

@media (max-width: 640px) {
  .sci-auth-body .auth-box { padding: 26px 20px; }
  .sci-landing-body .hero-title { font-size: clamp(3.15rem, 17vw, 5rem); }
  .sci-game-body .page-header { padding: 22px 18px; }
  .sci-game-body .page-header::after { display: none; }
}

/* NOXIOUS GAME COMPANION EXTENSION */
:root {
  --mouse-x: 50vw;
  --mouse-y: 50vh;
}

@keyframes companion-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -8px, 0); }
}

@keyframes companion-particle {
  0% { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.65); }
  18%, 82% { opacity: 0.72; }
  100% { opacity: 0; transform: translate3d(28px, -38px, 0) scale(1); }
}

@keyframes companion-boot {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes companion-reward {
  0% { opacity: 0; transform: translateY(14px) scale(0.96); }
  60% { opacity: 1; transform: translateY(-3px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sci-game-body {
  --hud-cyan: #53edff;
  --hud-cyan-soft: rgba(83, 237, 255, 0.11);
  --hud-violet: #9b6cff;
  --hud-panel: rgba(7, 13, 22, 0.94);
  background:
    radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(83,237,255,0.105), transparent 21rem),
    radial-gradient(circle at 78% 10%, rgba(255,107,26,0.08), transparent 24rem),
    #04070c;
}

.sci-game-body .workspace {
  background:
    linear-gradient(115deg, rgba(83,237,255,0.045), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.015), transparent 38%);
}

.sci-game-body .brand-mark {
  background: linear-gradient(135deg, #dcfbff, var(--hud-cyan));
  box-shadow: 0 0 28px rgba(83,237,255,0.36);
}

.sci-game-body .sidebar,
.sci-game-body .app-topbar {
  border-color: rgba(83,237,255,0.18);
}

.sci-game-body .sidebar-link:hover,
.sci-game-body .sidebar-link.active,
.sci-game-body .panel:hover,
.sci-game-body .challenge-card:hover,
.sci-game-body .metric-card:hover,
.mission-card:hover,
.inventory-card:hover,
.achievement-card:hover,
.leaderboard-row:hover {
  border-color: rgba(83,237,255,0.44);
  box-shadow: 0 16px 50px rgba(83,237,255,0.075), 0 20px 55px rgba(0,0,0,0.24);
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle-field span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(83, 237, 255, 0.9);
  box-shadow: 0 0 12px rgba(83, 237, 255, 0.65);
  animation: companion-particle 5.8s var(--delay) ease-in-out infinite;
}

.cursor-aura {
  position: fixed;
  z-index: 9998;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(83,237,255,0.14), transparent 62%);
  mix-blend-mode: screen;
  transition: transform 0.08s linear;
}

.terminal-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(83,237,255,0.14), transparent 28rem),
    rgba(4,7,12,0.96);
}

.terminal-loader-core {
  width: min(420px, calc(100vw - 36px));
  display: grid;
  justify-items: center;
  gap: 15px;
  color: var(--white);
  font-family: Consolas, monospace;
  letter-spacing: 0.14em;
  text-align: center;
}

.terminal-loader-core i {
  width: 100%;
  height: 4px;
  transform-origin: left;
  background: linear-gradient(90deg, var(--hud-cyan), var(--orange));
  box-shadow: 0 0 18px rgba(83,237,255,0.46);
  animation: companion-boot 0.72s ease both;
}

.is-ready .terminal-loader,
.is-leaving .terminal-loader {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

.is-leaving .workspace,
.is-leaving main {
  opacity: 0.55;
  transform: translateY(8px) scale(0.995);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.companion-hero {
  overflow: hidden;
}

.companion-hero::after {
  content: "COMPANION LINK // NOXIOUS PLANET";
}

.mission-grid,
.inventory-grid,
.achievement-list,
.leaderboard-list,
.eco-timeline,
.behavior-grid,
.ai-pipeline {
  display: grid;
  gap: 12px;
}

.mission-grid,
.inventory-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mission-card,
.inventory-card,
.achievement-card,
.leaderboard-row,
.eco-timeline-node,
.behavior-card,
.ai-pipeline-step,
.mission-brief {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(83,237,255,0.16);
  border-radius: 0 18px 0 18px;
  background:
    linear-gradient(135deg, rgba(83,237,255,0.07), transparent 38%),
    rgba(7, 13, 22, 0.93);
  box-shadow: inset 0 0 32px rgba(83,237,255,0.018), 0 14px 40px rgba(0,0,0,0.22);
}

.floating-card {
  animation: mission-reveal 0.5s var(--delay, 0ms) ease both, companion-float 7s calc(var(--delay, 0ms) * 1) ease-in-out infinite;
}

.mission-card::before,
.inventory-card::before,
.achievement-card::before,
.leaderboard-row::before,
.eco-timeline-node::before,
.mission-brief::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32%;
  height: 1px;
  background: var(--hud-cyan);
  box-shadow: 0 0 12px rgba(83,237,255,0.58);
}

.mission-card {
  min-height: 294px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
}

.mission-card-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.mission-card h3,
.inventory-card h3,
.achievement-card h3,
.eco-timeline-node h3,
.mission-brief h2 {
  margin: 0;
  color: #fff6ef;
  font-family: "Arial Narrow", "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mission-card p,
.inventory-card p,
.achievement-card p,
.eco-timeline-node p,
.behavior-card p,
.mission-brief p,
.ai-system-head p {
  margin: 0;
  color: rgba(245,237,230,0.62);
}

.mission-reward-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mission-reward-grid div {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(83,237,255,0.12);
  background: rgba(83,237,255,0.045);
}

.mission-reward-grid small {
  display: block;
  color: rgba(255,184,48,0.72);
  font-family: Consolas, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mission-reward-grid strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--white);
  font-size: clamp(0.82rem, 1.4vw, 1rem);
}

.mission-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-brief {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr);
  gap: 22px;
  padding: 18px;
}

.mission-brief-visual {
  min-height: 360px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(83,237,255,0.18);
  background:
    radial-gradient(circle at center, rgba(83,237,255,0.24), transparent 36%),
    linear-gradient(rgba(83,237,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83,237,255,0.045) 1px, transparent 1px),
    #050b12;
  background-size: auto, 26px 26px, 26px 26px, auto;
}

.mission-brief-visual span {
  display: grid;
  place-items: center;
  width: min(180px, 62%);
  aspect-ratio: 1;
  border: 1px solid var(--hud-cyan);
  border-radius: 50%;
  color: var(--hud-cyan);
  font-family: Consolas, monospace;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  font-weight: 900;
  text-shadow: 0 0 18px rgba(83,237,255,0.5);
  box-shadow: inset 0 0 45px rgba(83,237,255,0.08), 0 0 42px rgba(83,237,255,0.18);
}

.mission-brief-copy {
  display: grid;
  align-content: center;
  gap: 18px;
}

.ai-system-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ai-pipeline {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ai-pipeline-step {
  min-height: 134px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
}

.ai-pipeline-step span,
.timeline-index,
.leaderboard-rank {
  color: var(--hud-cyan);
  font-family: Consolas, monospace;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(83,237,255,0.32);
}

.ai-pipeline-step strong {
  color: var(--white);
  line-height: 1.12;
}

.ai-pipeline-step small {
  color: rgba(245,237,230,0.48);
}

.behavior-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.behavior-card {
  padding: 14px;
}

.inventory-card {
  min-height: 280px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 16px;
}

.inventory-art {
  min-height: 112px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(83,237,255,0.16);
  background: radial-gradient(circle, rgba(83,237,255,0.18), transparent 60%);
}

.inventory-art span,
.achievement-medal {
  display: grid;
  place-items: center;
  width: 58px;
  aspect-ratio: 1;
  border: 1px solid var(--hud-cyan);
  border-radius: 50%;
  color: var(--hud-cyan);
  font-family: Consolas, monospace;
  font-weight: 900;
}

.achievement-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 15px;
  padding: 16px;
}

.achievement-card.is-unlocked {
  animation: companion-reward 0.55s ease both;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 120px 100px;
  align-items: center;
  gap: 14px;
  padding: 15px;
}

.leaderboard-row.is-player {
  border-color: rgba(255,184,48,0.42);
  background:
    linear-gradient(90deg, rgba(255,184,48,0.09), transparent),
    rgba(8, 7, 6, 0.94);
}

.leaderboard-row small,
.leaderboard-stat span {
  display: block;
  color: rgba(245,237,230,0.48);
}

.leaderboard-stat {
  text-align: right;
}

.leaderboard-stat strong {
  color: var(--white);
}

.eco-timeline {
  position: relative;
}

.eco-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 42px;
  width: 1px;
  background: linear-gradient(var(--hud-cyan), transparent);
  box-shadow: 0 0 12px rgba(83,237,255,0.28);
}

.eco-timeline-node {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.eco-timeline-node .timeline-index {
  position: relative;
  z-index: 1;
}

@media (max-width: 1120px) {
  .mission-grid,
  .inventory-grid,
  .ai-pipeline {
    grid-template-columns: 1fr;
  }

  .mission-brief {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .mission-card-top,
  .leaderboard-row,
  .achievement-card,
  .eco-timeline-node {
    grid-template-columns: 1fr;
  }

  .mission-reward-grid,
  .behavior-grid {
    grid-template-columns: 1fr;
  }

  .ai-system-head,
  .mission-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .leaderboard-stat {
    text-align: left;
  }
}
