/* N43 Flow 皓學堂 — design tokens
   "Night flight deck": deep navy cockpit + green instrument glow.
   Canonical palette locked to SOP: #23394e (primary) / #5bba62 (accent/success). */

:root {
  /* navy ramp — built around #23394e */
  --navy-950: #0E1820;
  --navy-900: #142330;
  --navy-850: #18293A;
  --navy-800: #1E3346;
  --navy-700: #23394E;   /* CANONICAL primary */
  --navy-600: #2E4961;
  --navy-500: #3C5A76;

  /* surfaces & lines */
  --surface:      #1B2D3E;
  --surface-2:    #213b50;
  --hairline:     rgba(166, 199, 222, 0.12);
  --hairline-2:   rgba(166, 199, 222, 0.07);
  --glow-green:   rgba(91, 186, 98, 0.30);

  /* accent — CANONICAL #5bba62 + harmonious siblings (shared L/C, varied hue) */
  --green:        #5BBA62;   /* success / go */
  --green-bright: #74D67B;
  --green-deep:   #3C8F46;
  --gold:         #E0A94E;   /* streak / heat   oklch ~0.78 0.12 78 */
  --cyan:         #4FB6C4;   /* info / voice    oklch ~0.74 0.09 215 */
  --rose:         #D9728B;   /* due / overdue   oklch ~0.70 0.11 13 */

  /* text on navy */
  --ink:        #ECF3F7;
  --ink-soft:   #B7CAD7;
  --ink-mute:   #7E97A8;
  --ink-faint:  #566F80;

  /* type */
  --f-display: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
  --f-body:    'Noto Sans TC', 'Space Grotesk', system-ui, sans-serif;

  /* radii */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  /* spacing rhythm */
  --gap: 16px;

  /* ── Sprint Alpha v3.5 semantic tokens ── */
  --success: var(--green);
  --warning: var(--gold);
  --danger: var(--rose);

  /* motion tokens */
  --motion-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --motion-stepped: steps(4, end);

  /* universe radius tokens */
  --radius-cosmic: 999px;
  --radius-gb: 0px;
}

/* ── Universe interaction tokens (geometry + navigation + feedback) ── */
[data-universe="gameboy"] {
  --geo-button: rect;
  --geo-card: rect;
  --geo-panel: rect;
  --geo-cursor: triangle;
  --nav-mode: cursor;
  --feedback-mode: physical;
  --motion-primary: var(--motion-stepped);
  --radius-primary: var(--radius-gb);
}

[data-universe="cosmic"] {
  --geo-button: capsule;
  --geo-card: glass;
  --geo-panel: glass;
  --geo-cursor: orbit;
  --nav-mode: orbital;
  --feedback-mode: ambient;
  --motion-primary: var(--motion-spring);
  --radius-primary: var(--radius-cosmic);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.n43-root {
  font-family: var(--f-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.01em;
  height: 100%;
}

/* Flow shell — full-bleed stage + responsive content rail (≥768) */
.n43-flow-stage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr;
  overflow: hidden;
  height: 100%;
}
.n43-flow-stage--with-topbar {
  grid-template-rows: auto 1fr;
}
.n43-flow-content {
  min-height: 0;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 768px) {
  .n43-flow-topbar {
    max-width: min(760px, 100%);
    margin-inline: auto;
    width: 100%;
  }
  .n43-flow-page {
    max-width: min(760px, 100%);
    margin-inline: auto;
  }
}

[data-universe="cosmic"] .n43-root {
  background: var(--fl-space, #02020a);
}
[data-universe="gameboy"] .n43-root {
  background: var(--gb-bg, #15140f);
}

/* Cosmic — full-viewport deep space bleed */
.n43-cosmic-bleed {
  position: fixed;
  inset: 0;
  width: 100vw;
  z-index: 0;
  pointer-events: none;
  background: var(--fl-space, #02020a);
  overflow: hidden;
}
.n43-cosmic-scroll {
  background: transparent;
}
.n43-cosmic-content {
  position: relative;
  z-index: 5;
  width: 100%;
}
@media (min-width: 768px) {
  .n43-cosmic-content {
    max-width: min(760px, 100%);
    margin-inline: auto;
  }
  .n43-cosmic-orbit-stage {
    min-height: clamp(460px, 68vh, 720px);
    transform: rotate(var(--orbit-tilt)) scale(clamp(1, 0.95 + (100vw - 768px) / 1600, 1.22));
    transform-origin: 50% 45%;
  }
  .n43-cosmic-orbit-stage__galaxy {
    width: clamp(160px, 32vw, 280px);
    height: clamp(160px, 32vw, 280px);
  }
}

/* GameBoy — centered handheld device (cream shell, dark viewport) */
.n43-gb-world {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  padding: max(12px, env(safe-area-inset-top, 0px)) 12px calc(92px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}
.n43-gb-device {
  width: 100%;
  max-width: 560px;
  flex-shrink: 0;
  background: var(--gb-shell, #e9e2d0);
  border: 1px solid var(--gb-shell-edge, #d6cbb2);
  border-radius: 18px 18px 28px 28px;
  padding: 14px 14px 10px;
  box-shadow: 0 2px 0 var(--gb-shell-edge, #d6cbb2);
}
.n43-gb-masthead {
  text-align: center;
  padding: 2px 6px 14px;
}
.n43-gb-masthead .n43-overview-masthead__title {
  font-size: clamp(0.95rem, 3.2vw, 1.1rem);
  color: var(--gb-ink, #2f3a16);
}
.n43-gb-masthead .n43-overview-masthead__subtitle {
  font-size: clamp(0.52rem, 1.8vw, 0.62rem);
  letter-spacing: 0.18em;
  color: var(--gb-ink-soft, #6b7740);
}
.n43-gb-world .n43-gb-bezel {
  flex: none;
  margin: 0;
  min-height: unset;
  display: block;
  border-radius: 10px 10px 4px 4px;
  padding: 8px;
  background: #2a2a28;
  border: 1px solid #1e1e1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.n43-gb-world .n43-gb-screen {
  flex: none;
  min-height: unset;
  height: auto;
  position: relative;
  overflow: visible;
  background: var(--gb-shell, #e9e2d0);
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}
.n43-gb-spark-panel {
  margin: 10px 12px 12px;
  background: var(--gb-hud-bg, #ded6bf);
  padding: 12px;
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  box-shadow: none;
}
.n43-gb-spark-panel__text {
  font-size: 8px;
  line-height: 1.7;
  margin: 0 0 10px;
  color: var(--gb-ink, #2f3a16);
}
.n43-gb-spark-panel__btn {
  width: 100%;
  padding: 12px;
  background: var(--gb-ink, #2f3a16);
  color: var(--gb-shell, #e9e2d0);
  border: 1px solid var(--gb-ink, #2f3a16);
  font-size: 8px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: none;
}

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.disp { font-family: var(--f-display); letter-spacing: -0.01em; }

/* scrollbars hidden inside device */
.noscroll::-webkit-scrollbar { width: 0; height: 0; }
.noscroll { scrollbar-width: none; }

@keyframes n43-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Entrance animation is purely decorative — content MUST be visible even when the
   animation clock is throttled/frozen or reduced-motion is on. Force end-state. */
[style*="n43-rise"] { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) {
  [style*="n43-rise"] { animation: none !important; transform: none !important; }
}
@keyframes n43-pulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%     { transform: scale(1.08); opacity: 0.85; }
}
@keyframes n43-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  [style*="n43-spin"] { animation: none !important; }
}
@keyframes n43-slide-l {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes n43-glow {
  0%,100% { box-shadow: 0 0 0 0 var(--glow-green); }
  50%     { box-shadow: 0 0 22px 2px var(--glow-green); }
}
@keyframes n43-node-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.n43-node-bounce { animation: n43-node-bounce 1.4s ease-in-out infinite; }

/* ── Home multiverse motion ───────────────────────────────────── */
@keyframes n43-slow-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes n43-counter-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}
.n43-orbit-spin {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  animation: n43-slow-spin 120s linear infinite;
}
.n43-orbit-counter {
  transform-origin: center center;
  animation: n43-counter-spin 120s linear infinite;
}

@keyframes n43-black-hole-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.14); opacity: 0.88; }
}
.n43-black-hole-core { animation: n43-black-hole-breathe 3.5s ease-in-out infinite; }

@keyframes n43-pixel-hop {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
.n43-pixel-hop { animation: n43-pixel-hop 0.5s steps(2, end) infinite; }

@keyframes n43-path-flow {
  to { stroke-dashoffset: -16; }
}
.n43-path-flow { animation: n43-path-flow 1.2s linear infinite; }

/* Cosmic — gentle float (smooth space physics) */
@keyframes n43-cosmic-float {
  0%, 100% { transform: translateY(0) translateZ(0); }
  50%      { transform: translateY(-18px) translateZ(0); }
}
.n43-cosmic-float { animation: n43-cosmic-float 6s ease-in-out infinite; }

/* Game Boy — flat chunky panels (no bloom) */
.n43-gb-chunky {
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  box-shadow: none;
}
.n43-gb-bezel {
  background: #2a2a28;
  border: 1px solid #1e1e1c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.n43-gb-screen {
  background: var(--gb-shell, #e9e2d0);
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  image-rendering: pixelated;
}
@keyframes n43-gb-float-deco {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50%      { transform: translateY(-8px) rotate(-4deg); }
}
.n43-gb-float-deco { animation: n43-gb-float-deco 4s ease-in-out infinite; }

/* GameBoy boot sequence — plays once via localStorage n43_flow_boot_gb_v1 */
@keyframes gb-boot {
  0%   { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}
.n43-gb-boot {
  animation: gb-boot 2.4s var(--motion-stepped) both;
}

/* GameBoy — rect geometry + stepped motion + physical press */
[data-universe="gameboy"] .n43-geo-btn,
.n43-geo-btn[data-geo="rect"] {
  border-radius: var(--radius-gb);
  transition: transform 0.05s linear, box-shadow 0.05s linear;
  animation-timing-function: var(--motion-stepped);
}
[data-universe="gameboy"] .n43-geo-btn:not(:disabled),
.n43-geo-btn[data-geo="rect"]:not(:disabled) {
  box-shadow: none;
}
[data-universe="gameboy"] .n43-geo-btn:active,
.n43-geo-btn[data-geo="rect"]:active,
[data-universe="gameboy"] .n43-geo-btn.n43-geo-btn--pressed {
  transform: translateY(2px);
  box-shadow: none !important;
}
[data-universe="gameboy"] .n43-geo-panel,
.n43-geo-panel[data-geo="rect"] {
  border-radius: var(--radius-gb);
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  box-shadow: none;
}
.n43-gb-cursor {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: var(--ink);
  line-height: 1;
  margin-right: 4px;
  animation: n43-pixel-hop 0.6s var(--motion-stepped) infinite;
}
[data-universe="gameboy"] .n43-gb-nav-item--focused {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Cosmic — glass geometry + spring motion + orbital glow */
[data-universe="cosmic"] .n43-geo-btn,
.n43-geo-btn[data-geo="capsule"] {
  border-radius: var(--radius-cosmic);
  transition: transform 0.35s var(--motion-spring), box-shadow 0.35s var(--motion-spring);
}
[data-universe="cosmic"] .n43-geo-card,
.n43-geo-card[data-geo="glass"] {
  border-radius: var(--radius-cosmic);
  background: rgba(20, 16, 41, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(184, 174, 255, 0.15);
}
[data-universe="cosmic"] .n43-geo-panel,
.n43-geo-panel[data-geo="glass"] {
  border-radius: var(--radius-cosmic);
  background: rgba(20, 16, 41, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(184, 174, 255, 0.12);
}
.n43-cosmic-orbit-host {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.n43-cosmic-orbit-body {
  transition: transform 0.1s linear;
  animation: n43-cosmic-float 6s var(--motion-spring) infinite;
}
.n43-cosmic-glow--success { --cosmic-glow-color: var(--success); }
.n43-cosmic-glow--warning { --cosmic-glow-color: var(--warning); }
.n43-cosmic-glow--danger  { --cosmic-glow-color: var(--danger); }
.n43-cosmic-glow-host {
  text-shadow: 0 0 calc(40px * var(--cosmic-glow-intensity, 0.5)) var(--cosmic-glow-color, var(--success));
  box-shadow: 0 0 calc(60px * var(--cosmic-glow-intensity, 0.5)) color-mix(in oklab, var(--cosmic-glow-color, var(--success)) 40%, transparent);
}

/* Recall card contract UI */
.n43-recall-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.n43-recall-card__meta { display: flex; gap: 8px; font-size: 11px; color: var(--ink-mute); }

/* MCQ card contract UI */
.n43-mcq-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
.n43-mcq-card__meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-mute);
}
.n43-mcq-card__question {
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  margin: 0;
}
.n43-mcq-card__choices { margin-top: 4px; }
.n43-mcq-choice[data-state="correct"] { font-weight: 600; }
.n43-mcq-choice[data-state="wrong"] { font-weight: 600; }
.n43-mcq-rating--suggested {
  outline: 2px solid color-mix(in oklab, var(--ink) 35%, transparent);
  outline-offset: 2px;
}

/* Pixel hero sprite (8-bit blocks) */
.n43-pixel-hero {
  width: 20px; height: 20px; position: relative;
  image-rendering: pixelated;
}
.n43-pixel-hero::before {
  content: "";
  position: absolute; left: 4px; top: 0;
  width: 12px; height: 8px;
  background: var(--ink);
  box-shadow:
    -4px 8px 0 var(--ink), 4px 8px 0 var(--ink),
    0 16px 0 #5bba62, -4px 16px 0 var(--ink), 4px 16px 0 var(--ink);
}

/* Typewriter cursor */
@keyframes n43-type-cursor {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}
.n43-type-cursor::after {
  content: "▌";
  margin-left: 2px;
  animation: n43-type-cursor 0.8s steps(1) infinite;
}

/* Cosmic glow trail filter */
.n43-glow-trail { filter: drop-shadow(0 0 6px var(--glow-green)) drop-shadow(0 0 14px rgba(255,255,255,0.25)); }

@media (prefers-reduced-motion: reduce) {
  .n43-node-bounce,
  .n43-orbit-spin,
  .n43-orbit-counter,
  .n43-black-hole-core,
  .n43-pixel-hop,
  .n43-path-flow,
  .n43-cosmic-float,
  .n43-gb-float-deco,
  .n43-type-cursor::after,
  .n43-gb-boot { animation: none !important; }
}

/* ───────────────────────────────────────────────────────────────
   THEME TEXTURES
   The .fx-layer holds the whole app screen (topbar + screen + nav).
   Theme family classes live on <html>.
   ─────────────────────────────────────────────────────────────── */
.fx-layer { position: relative; }

/* GAME BOY '89 — flat cream handheld (no phosphor filter / no scanlines). */
.theme-gameboy .fx-layer {
  filter: none;
}
.theme-gameboy .fx-layer::before {
  display: none;
}
/* Game Boy — pixel type for headings & numerals */
.theme-gameboy .disp,
.theme-gameboy .tnum {
  font-family: 'Press Start 2P', monospace;
  letter-spacing: 0.02em;
}
/* 3. physical button depress */
.theme-gameboy button:active,
.theme-gameboy .node-btn:active {
  transform: translate(3px, 3px) !important;
  box-shadow: none !important;
}

/* 星河系列 — deep space starfield (static, capture-safe). */
.theme-galaxy .fx-layer::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.2px 1.2px at 78% 12%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 34% 42%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1.6px 1.6px at 64% 56%, var(--star, #fff), transparent),
    radial-gradient(1.5px 1.5px at 8% 50%, var(--star, #fff), transparent);
  opacity: 0.85;
}
.theme-galaxy .fx-layer { isolation: isolate; }
/* 2. glassmorphism & neon glow (galaxy + night-flight cosmic shells) */
.theme-galaxy .card-glass,
.theme-classic .card-glass,
.theme-flight .card-glass {
  background: rgba(20, 16, 41, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(184, 174, 255, 0.15);
  box-shadow: 0 0 20px rgba(var(--glow-rgb, 155, 140, 255), 0.3);
}
/* Galaxy — Space Grotesk display & body */
.theme-galaxy .disp {
  font-family: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
}

/* ───────────────────────────────────────────────────────────────
   OVERVIEW HOME — dual-skin presentation tokens (Boards v2.0)
   Cosmic observatory + GameBoy world map · engine-agnostic
   ─────────────────────────────────────────────────────────────── */

/* Cosmic skin tokens */
:root {
  --fl-space:   #02020a;
  --fl-panel:   rgba(16, 24, 48, 0.6);
  --fl-green:   #5bba62;
  --fl-cyan:    #4FB6C4;
  --fl-gold:    #E0A94E;
  --orbit-tilt: -7deg;
}

/* GameBoy skin tokens — locked palette (mockup Image2) */
[data-universe="gameboy"] {
  --gb-bg:         #15140f;
  --gb-shell:      #e9e2d0;
  --gb-shell-edge: #d6cbb2;
  --gb-ink:        #2f3a16;
  --gb-ink-soft:   #6b7740;
  --gb-amber:      #9a6a12;
  --gb-hud-bg:     #ded6bf;
  --gb-hud-border: #c9bf9f;
  --gb-lcd-panel:  #a9b878;
  --gb-lcd-edge:   #6f7d3e;
  --gb-cell-bg:    #cdd2a0;
  --gb-cell-border:#8a9650;
  --gb-fill:       #7a8c3e;
  --gb-red:        #c0473f;
  /* legacy aliases */
  --gb-line:       #6f7d3e;
  --gb-lcd:        #a9b878;
  /* map theme vars → flat GB palette (nav + shared UI) */
  --surface:       #ded6bf;
  --surface-2:     #d6cbb2;
  --ink:           #2f3a16;
  --ink-soft:      #6b7740;
  --ink-mute:      #6b7740;
  --ink-faint:     #6b7740;
  --navy-950:      #2f3a16;
  --green:         #cdd2a0;
  --glow-green:    transparent;
  --hairline:      #c9bf9f;
}

/* ── Shared overview masthead (home inline or TopBar subtitle) ── */
.n43-overview-masthead {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.2;
}
.n43-overview-masthead__title {
  font-family: var(--f-display);
  font-size: clamp(1rem, 2.8vw, 1.15rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  margin: 0;
}
.n43-overview-masthead__subtitle {
  font-family: var(--f-display);
  font-size: clamp(0.58rem, 1.6vw, 0.72rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}
.n43-overview-masthead__brand {
  font-size: clamp(0.55rem, 1.4vw, 0.65rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
[data-universe="gameboy"] .n43-overview-masthead__brand {
  color: var(--gb-amber, var(--ink-faint));
}

/* ── Cosmic: Premium HUD (4 glass cards) ── */
.n43-cosmic-premium-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 14px);
  padding: 0 clamp(16px, 4vw, 40px);
  margin-bottom: clamp(12px, 3vw, 20px);
}
@media (max-width: 640px) {
  .n43-cosmic-premium-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.n43-cosmic-hud-card {
  background: var(--fl-panel);
  border: 1px solid color-mix(in oklab, var(--fl-cyan) 22%, transparent);
  border-radius: var(--r-md);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
  box-shadow: 0 0 24px color-mix(in oklab, var(--fl-cyan) 8%, transparent);
}
.n43-cosmic-hud-card[data-accent="gold"] {
  border-color: color-mix(in oklab, var(--fl-gold) 35%, transparent);
  box-shadow: 0 0 20px color-mix(in oklab, var(--fl-gold) 12%, transparent);
}
.n43-cosmic-hud-card[data-accent="green"] {
  border-color: color-mix(in oklab, var(--fl-green) 35%, transparent);
  box-shadow: 0 0 20px color-mix(in oklab, var(--fl-green) 12%, transparent);
}
.n43-cosmic-hud-card__icon {
  font-size: 1.1rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px color-mix(in oklab, var(--fl-cyan) 50%, transparent));
}
.n43-cosmic-hud-card__label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.n43-cosmic-hud-card__value {
  font-family: var(--f-display);
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

/* ── Cosmic: DAILY diamond track ── */
.n43-cosmic-daily {
  padding: 0 clamp(16px, 4vw, 40px);
  margin-bottom: clamp(16px, 4vw, 24px);
}
.n43-cosmic-daily__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.n43-cosmic-daily__track {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}
.n43-cosmic-daily__node {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
}
.n43-cosmic-daily__gem {
  width: clamp(10px, 2.2vw, 14px);
  height: clamp(10px, 2.2vw, 14px);
  flex-shrink: 0;
  transform: rotate(45deg);
  border: 1px solid color-mix(in oklab, var(--ink-faint) 60%, transparent);
  background: color-mix(in oklab, var(--fl-space) 80%, transparent);
  transition: box-shadow 0.35s var(--motion-spring), background 0.35s ease;
}
.n43-cosmic-daily__gem[data-state="done"] {
  background: var(--fl-cyan);
  border-color: var(--fl-cyan);
  box-shadow: 0 0 10px color-mix(in oklab, var(--fl-cyan) 55%, transparent);
}
.n43-cosmic-daily__gem[data-state="current"] {
  background: var(--fl-green);
  border-color: var(--fl-green);
  box-shadow: 0 0 16px color-mix(in oklab, var(--fl-green) 70%, transparent);
}
.n43-cosmic-daily__wire {
  flex: 1;
  height: 1px;
  background: color-mix(in oklab, var(--ink-faint) 35%, transparent);
  min-width: 2px;
}
.n43-cosmic-daily__wire[data-lit="1"] {
  background: linear-gradient(90deg, var(--fl-cyan), color-mix(in oklab, var(--fl-cyan) 40%, transparent));
}

/* ── Cosmic: TODAY'S SPARK ── */
.n43-cosmic-spark {
  margin: 0 clamp(16px, 4vw, 40px) clamp(20px, 5vw, 32px);
  padding: clamp(14px, 3vw, 20px) clamp(16px, 4vw, 24px);
  background: var(--fl-panel);
  border: 1px solid color-mix(in oklab, var(--fl-gold) 28%, transparent);
  border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.n43-cosmic-spark__label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--fl-gold);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.n43-cosmic-spark__card {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--ink-soft);
  margin: 0 0 14px;
  line-height: 1.55;
}
.n43-cosmic-spark__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  background: color-mix(in oklab, var(--fl-green) 18%, transparent);
  border: 1px solid color-mix(in oklab, var(--fl-green) 45%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: box-shadow 0.35s var(--motion-spring), transform 0.35s var(--motion-spring);
}
.n43-cosmic-spark__cta:hover {
  box-shadow: 0 0 24px color-mix(in oklab, var(--fl-green) 35%, transparent);
}
.n43-cosmic-spark__cta:active {
  transform: scale(0.98);
}

/* ── Cosmic: orbit stage (8 planets · real PNG) ── */
.n43-cosmic-orbit-stage {
  position: relative;
  width: 100%;
  min-height: clamp(420px, 72vh, 640px);
  margin: 0 auto;
  transform: rotate(var(--orbit-tilt));
  transform-origin: 50% 45%;
}
.n43-cosmic-orbit-stage__bg {
  position: absolute;
  inset: 0;
  background: var(--fl-space);
  pointer-events: none;
  z-index: 0;
}
.n43-cosmic-orbit-stage__galaxy {
  position: absolute;
  left: 50%;
  top: 42%;
  width: clamp(140px, 28vw, 220px);
  height: clamp(140px, 28vw, 220px);
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.92;
  filter: drop-shadow(0 0 40px color-mix(in oklab, var(--fl-cyan) 25%, transparent));
}
.n43-cosmic-orbit-stage__core-label {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, calc(-50% + clamp(72px, 14vw, 110px)));
  z-index: 3;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.n43-cosmic-orbit-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in oklab, var(--ink-faint) 28%, transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.n43-cosmic-planet-host {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  text-align: center;
}
.n43-cosmic-planet-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.n43-cosmic-planet-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}
.n43-cosmic-planet-img {
  display: block;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.65));
  transition: transform 0.35s var(--motion-spring), filter 0.35s ease;
}
.n43-cosmic-planet-btn:hover .n43-cosmic-planet-img {
  transform: scale(1.06);
  filter: drop-shadow(0 0 18px color-mix(in oklab, var(--fl-cyan) 40%, transparent));
}
.n43-cosmic-planet-meta__num {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.n43-cosmic-planet-meta__name {
  font-family: var(--f-display);
  font-size: clamp(0.72rem, 1.8vw, 0.88rem);
  font-weight: 700;
  color: var(--ink);
}
.n43-cosmic-planet-meta__field {
  font-size: 0.62rem;
  color: var(--ink-mute);
}
.n43-cosmic-coming-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fl-gold);
  border: 1px solid color-mix(in oklab, var(--fl-gold) 40%, transparent);
  border-radius: 999px;
  text-transform: uppercase;
}

/* ── GameBoy: pixel HUD + daily bar ── */
.n43-gb-pixel-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gb-hud-border, #c9bf9f);
  background: var(--gb-shell, #e9e2d0);
}
@media (max-width: 480px) {
  .n43-gb-pixel-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.n43-gb-pixel-card {
  background: var(--gb-hud-bg, #ded6bf);
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  padding: 6px 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.n43-gb-pixel-card__label {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: var(--gb-ink-soft, #6b7740);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.n43-gb-pixel-card__value {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--gb-ink, #2f3a16);
  font-variant-numeric: tabular-nums;
}

.n43-gb-daily {
  padding: 8px 12px 10px;
  background: var(--gb-shell, #e9e2d0);
  border-bottom: 1px solid var(--gb-hud-border, #c9bf9f);
}
.n43-gb-daily__head {
  display: flex;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: var(--gb-ink, #2f3a16);
  margin-bottom: 6px;
}
.n43-gb-daily__bar {
  display: flex;
  gap: 3px;
  height: 12px;
}
.n43-gb-daily__cell {
  flex: 1;
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  background: var(--gb-hud-bg, #ded6bf);
}
.n43-gb-daily__cell[data-filled="1"] {
  background: var(--gb-fill, #7a8c3e);
  border-color: var(--gb-lcd-edge, #6f7d3e);
}

/* ── GameBoy: world map LCD grid ── */
.n43-gb-world-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  background: var(--gb-lcd-panel, #a9b878);
  border: 1px solid var(--gb-lcd-edge, #6f7d3e);
  min-height: 280px;
}
.n43-gb-world-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: var(--gb-cell-bg, #cdd2a0);
  border: 1px solid var(--gb-cell-border, #8a9650);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.n43-gb-world-cell:active {
  transform: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.14);
}
.n43-gb-world-cell__token {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid var(--gb-cell-border, #8a9650);
}
.n43-gb-world-cell__num {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: var(--gb-ink, #2f3a16);
}
.n43-gb-world-cell__name {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--gb-ink, #2f3a16);
  line-height: 1.4;
}
.n43-gb-world-cell__field {
  font-size: 9px;
  color: var(--gb-ink-soft, #6b7740);
}
.n43-gb-world-cell__flag {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 12px;
  line-height: 1;
}
.n43-gb-world-cell__soon {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: var(--gb-amber, #9a6a12);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* GameBoy decorative controls (non-interactive) */
.n43-gb-controls-deco {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 18px 6px;
  pointer-events: none;
  user-select: none;
}
.n43-gb-dpad {
  width: 56px;
  height: 56px;
  position: relative;
}
.n43-gb-dpad::before,
.n43-gb-dpad::after {
  content: "";
  position: absolute;
  background: #2f2f2f;
}
.n43-gb-dpad::before {
  width: 18px;
  height: 56px;
  left: 19px;
  top: 0;
}
.n43-gb-dpad::after {
  width: 56px;
  height: 18px;
  left: 0;
  top: 19px;
}
.n43-gb-ab {
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.n43-gb-ab__btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #8a3028;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  display: grid;
  place-items: center;
  color: #f8f0e8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.n43-gb-ab__btn[data-key="A"],
.n43-gb-ab__btn[data-key="B"] {
  background: var(--gb-red, #c0473f);
  margin-bottom: 8px;
}

/* Coming-soon toast (board tap) */
.n43-overview-toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  padding: 12px 20px;
  font-family: var(--f-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in oklab, var(--fl-panel) 92%, transparent);
  border: 1px solid color-mix(in oklab, var(--fl-gold) 45%, transparent);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s var(--motion-spring);
}
.n43-overview-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
[data-universe="gameboy"] .n43-overview-toast {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  border-radius: 0;
  border: 1px solid var(--gb-hud-border, #c9bf9f);
  background: var(--gb-hud-bg, #ded6bf);
  color: var(--gb-ink, #2f3a16);
  box-shadow: none;
  text-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* GameBoy bottom nav — flat, no glow */
[data-universe="gameboy"] nav > div {
  background: var(--gb-hud-bg, #ded6bf) !important;
  border: 1px solid var(--gb-hud-border, #c9bf9f) !important;
  box-shadow: none !important;
}
[data-universe="gameboy"] .disp,
[data-universe="gameboy"] .tnum,
[data-universe="gameboy"] .n43-gb-masthead,
[data-universe="gameboy"] .n43-gb-world,
[data-universe="gameboy"] .n43-gb-device {
  text-shadow: none;
}
[data-universe="gameboy"] .n43-gb-world-map,
[data-universe="gameboy"] .n43-gb-world-cell,
[data-universe="gameboy"] .n43-gb-pixel-card,
[data-universe="gameboy"] .n43-gb-device {
  box-shadow: none;
}
[data-universe="gameboy"] .n43-gb-world-cell {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .n43-cosmic-planet-btn:hover .n43-cosmic-planet-img,
  .n43-cosmic-spark__cta,
  .n43-overview-toast {
    transition: none !important;
  }
  .n43-domain-orbit-node__dot[data-tier="DUE"] {
    animation: none !important;
  }
}

/* ── Domain L2 · Cosmic SRS orbit ── */
.n43-domain-cosmic {
  --orbit-tilt: -7deg;
}
.n43-domain-orbit-stage {
  position: relative;
  width: 100%;
  min-height: clamp(380px, 68vh, 560px);
  margin: 16px auto 0;
  transform: rotate(var(--orbit-tilt));
  transform-origin: 50% 45%;
}
.n43-domain-orbit-ring {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  border: 1px solid color-mix(in oklab, var(--ink-faint) 22%, transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.n43-domain-orbit-ring[data-tier="DUE"] {
  border-color: color-mix(in oklab, var(--danger) 35%, transparent);
}
.n43-domain-orbit-ring[data-tier="MASTERED"] {
  border-color: color-mix(in oklab, var(--green) 25%, transparent);
  opacity: 0.65;
}
.n43-domain-orbit-core {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  pointer-events: none;
}
.n43-domain-orbit-core__planet {
  width: clamp(72px, 16vw, 96px) !important;
  height: clamp(72px, 16vw, 96px) !important;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 24px color-mix(in oklab, var(--fl-gold) 35%, transparent));
}
.n43-domain-orbit-core__name {
  font-family: var(--f-display);
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 700;
  color: var(--ink);
}
.n43-domain-orbit-core__field {
  font-size: 0.68rem;
  color: var(--ink-mute);
}
.n43-domain-orbit-core__count {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fl-cyan);
  text-transform: uppercase;
}
.n43-domain-orbit-node {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  max-width: 88px;
  pointer-events: none;
}
.n43-domain-orbit-node__dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.n43-domain-orbit-node__dot[data-tier="DUE"] {
  background: var(--danger);
  box-shadow: 0 0 12px color-mix(in oklab, var(--danger) 70%, transparent);
  animation: n43-domain-pulse 1.6s ease-in-out infinite;
}
.n43-domain-orbit-node__dot[data-tier="LEARNING"] {
  background: var(--gold);
  box-shadow: 0 0 8px color-mix(in oklab, var(--gold) 50%, transparent);
}
.n43-domain-orbit-node__dot[data-tier="MASTERED"] {
  background: var(--green);
  opacity: 0.55;
  box-shadow: 0 0 6px color-mix(in oklab, var(--green) 40%, transparent);
}
@keyframes n43-domain-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.75; }
}
.n43-domain-orbit-node__label {
  font-size: 0.48rem;
  line-height: 1.35;
  color: var(--ink-soft);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.n43-domain-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  padding: 12px 20px 0;
}
.n43-domain-legend__item {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
}
.n43-domain-legend__item[data-tier="DUE"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  margin-right: 6px;
  vertical-align: middle;
}
.n43-domain-legend__item[data-tier="LEARNING"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-right: 6px;
  vertical-align: middle;
}
.n43-domain-legend__item[data-tier="MASTERED"]::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  opacity: 0.55;
  margin-right: 6px;
  vertical-align: middle;
}
.n43-domain-review {
  display: flex;
  justify-content: center;
  padding: 20px 20px 0;
}
.n43-domain-review__btn {
  min-width: min(100%, 320px);
}

/* ── Domain L2 · GameBoy STAGE SELECT ── */
.n43-domain-gb-header {
  padding: 10px 12px 8px;
  border-bottom: 3px solid var(--gb-line, #3a4a1e);
  background: var(--gb-lcd, #a7b56a);
}
.n43-domain-gb-header__lcd {
  font-size: 8px;
  color: var(--gb-ink, #2e3a14);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.n43-domain-gb-header__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: var(--gb-ink, #2e3a14);
}
.n43-domain-gb-header__stars span {
  opacity: 0.25;
  margin-left: 2px;
}
.n43-domain-gb-header__stars span[data-lit="1"] {
  opacity: 1;
  color: var(--gb-amber, #9a6a12);
}
.n43-domain-gb-review {
  padding: 10px 12px 0;
}
.n43-domain-gb-review__btn {
  width: 100%;
  padding: 10px 8px;
  font-size: 7px;
  line-height: 1.6;
  cursor: pointer;
  font-family: inherit;
  background: var(--gb-ink, #2e3a14);
  color: var(--gb-lcd, #a7b56a);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 0 #000;
}
.n43-domain-gb-review__btn[data-focused="1"] {
  outline: 3px solid var(--gb-amber, #9a6a12);
  outline-offset: 2px;
}
.n43-domain-gb-review__btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 0 #000;
}
.n43-domain-gb-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 0;
}
.n43-domain-gb-stage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px;
  background: color-mix(in oklab, var(--gb-shell, #e7ddc4) 88%, transparent);
  border: 3px solid var(--gb-line, #3a4a1e);
  box-shadow: 3px 3px 0 0 #000;
}
.n43-domain-gb-stage[data-tier="DUE"] {
  border-color: #c0392b;
  box-shadow: 3px 3px 0 0 #7a1f18;
  order: -1;
}
.n43-domain-gb-stage[data-tier="MASTERED"] {
  opacity: 0.72;
}
.n43-domain-gb-stage[data-focused="1"] {
  outline: 3px solid var(--gb-amber, #9a6a12);
  outline-offset: 1px;
}
.n43-domain-gb-stage__label {
  flex: 1;
  min-width: 0;
  font-size: 9px;
  line-height: 1.45;
  color: var(--gb-ink, #2e3a14);
  text-align: left;
}
.n43-domain-gb-stage__status {
  flex-shrink: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  line-height: 1.5;
}
.n43-domain-gb-stage__status[data-tier="DUE"] {
  color: #c0392b;
}
.n43-domain-gb-stage__status[data-tier="LEARNING"] {
  color: var(--gb-amber, #9a6a12);
}
.n43-domain-gb-stage__status[data-tier="MASTERED"] {
  color: var(--gb-fill, #5e7a2a);
  letter-spacing: 0.04em;
}

/* Domain empty state */
.n43-domain-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  text-align: center;
}
.n43-domain-empty--gb {
  background: var(--gb-lcd, #a7b56a);
}
.n43-domain-empty__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.n43-domain-empty--gb .n43-domain-empty__title {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
}
.n43-domain-empty__sub {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--ink-mute);
}
.n43-domain-empty--gb .n43-domain-empty__sub {
  font-size: 8px;
  font-family: 'Press Start 2P', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   Auth Gate · Ritual Login (Phase A · Cosmic Plate B)
   ═══════════════════════════════════════════════════════════════ */
.n43-login-root {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  overflow: auto;
  z-index: 1;
}
.login-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255,255,255,.55) 0%, transparent 100%),
    radial-gradient(1px 1px at 28% 72%, rgba(255,255,255,.4) 0%, transparent 100%),
    radial-gradient(1.4px 1.4px at 64% 24%, rgba(255,255,255,.5) 0%, transparent 100%),
    radial-gradient(1px 1px at 78% 58%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(1.2px 1.2px at 88% 12%, rgba(255,255,255,.45) 0%, transparent 100%),
    radial-gradient(1px 1px at 42% 40%, rgba(255,255,255,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 8% 88%, rgba(255,255,255,.35) 0%, transparent 100%),
    radial-gradient(80% 55% at 50% 0%, #1a3350 0%, #0a121c 42%, #07090c 78%);
}
.n43-login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: clamp(28px, 5vw, 40px) clamp(22px, 4vw, 36px) 28px;
  border-radius: 32px;
  background:
    linear-gradient(165deg, rgba(30, 48, 72, 0.92) 0%, rgba(14, 22, 34, 0.96) 55%, rgba(10, 16, 26, 0.98) 100%);
  border: 1px solid rgba(166, 199, 222, 0.14);
  box-shadow:
    0 0 0 1px rgba(79, 182, 196, 0.08),
    0 0 48px rgba(79, 182, 196, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.45);
  color: #ecf3f7;
  font-family: 'Noto Sans TC', 'Space Grotesk', system-ui, sans-serif;
}
.n43-login-masthead {
  text-align: center;
  margin-bottom: 28px;
}
.n43-login-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(14, 24, 32, 0.9);
  border: 1.5px solid rgba(91, 186, 98, 0.55);
  box-shadow: 0 0 18px rgba(91, 186, 98, 0.25);
}
.n43-login-title {
  margin: 0;
  font-family: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
  font-size: clamp(1.45rem, 4.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.n43-login-identity {
  margin: 10px 0 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: #7ec8d4;
  text-transform: uppercase;
}
.n43-login-byline {
  margin: 8px 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #c4894a;
  text-transform: uppercase;
}
.n43-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.n43-login-field-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #7e97a8;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.n43-login-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  border-radius: 14px;
  background: rgba(16, 28, 40, 0.85);
  border: 1px solid rgba(166, 199, 222, 0.12);
}
.n43-login-field__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  opacity: 0.95;
}
.n43-login-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: #ecf3f7;
  font-family: inherit;
  font-size: 0.95rem;
}
.n43-login-field input::placeholder {
  color: #566f80;
}
.n43-login-universe-label {
  margin: 14px 0 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #7e97a8;
  text-transform: uppercase;
}
.n43-login-universe-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}
.universe-door {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1.5px solid rgba(166, 199, 222, 0.14);
  background: rgba(12, 20, 30, 0.9);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: left;
  transition: border-color .2s, box-shadow .2s;
}
.universe-door.is-selected {
  border-color: #4FB6C4;
  box-shadow: 0 0 0 1px rgba(79, 182, 196, 0.35), 0 0 22px rgba(79, 182, 196, 0.28);
}
.universe-door--locked {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.universe-door__visual {
  height: 72px;
  position: relative;
  overflow: hidden;
}
.universe-door__visual--cosmic {
  background:
    radial-gradient(circle at 50% 55%, rgba(224, 169, 78, 0.55) 0%, transparent 42%),
    radial-gradient(1px 1px at 20% 30%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 20%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 70%, rgba(255,255,255,.7) 0%, transparent 100%),
    linear-gradient(180deg, #0a1220 0%, #121c30 100%);
}
.universe-door__orb {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe7a0, #e0a94e 55%, #8a5a18);
  box-shadow: 0 0 16px rgba(224, 169, 78, 0.7);
}
.universe-door__visual--pocket {
  display: grid;
  place-items: center;
  background: #e9e2d0;
}
.universe-door__gb {
  font-size: 1.6rem;
  line-height: 1;
  filter: grayscale(0.2);
}
.universe-door__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 10px 12px;
  background: rgba(10, 16, 26, 0.95);
}
.universe-door__emoji {
  font-size: 0.75rem;
  line-height: 1;
}
.universe-door__name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.universe-door__sub {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.universe-door__sub--cosmic { color: #7ec8d4; }
.universe-door__sub--pocket { color: #e0a94e; }
.universe-door__hint {
  margin-top: 4px;
  font-size: 0.62rem;
  color: #566f80;
}
.universe-door__hint.is-on {
  color: #5bba62;
}
.n43-login-cta {
  margin-top: 8px;
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: 'Space Grotesk', 'Noto Sans TC', system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0a1218;
  background: linear-gradient(90deg, #4FB6C4 0%, #5BBA62 55%, #74D67B 100%);
  box-shadow: 0 0 28px rgba(91, 186, 98, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.n43-login-cta:active {
  transform: scale(0.985);
}

/* Identity Core — callsign primary + orbital subtitle */
.n43-cosmic-orbit-stage__core-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: normal;
}
.n43-cosmic-orbit-stage__core-callsign {
  font-size: clamp(0.72rem, 2.4vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #ecf3f7;
  text-shadow:
    0 0 12px rgba(79, 182, 196, 0.85),
    0 0 28px rgba(91, 186, 98, 0.45);
}
.n43-cosmic-orbit-stage__core-sub {
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
}

/* Settings logout confirm */
.n43-logout-scrim {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim, rgba(8, 14, 20, 0.72));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.n43-logout-modal {
  width: 100%;
  max-width: 340px;
  padding: 22px 20px 18px;
  border-radius: var(--r-md, 18px);
  background: var(--surface, #1B2D3E);
  border: 1px solid var(--hairline);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.n43-logout-modal__title {
  margin: 0;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.n43-logout-modal__body {
  margin: 10px 0 18px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-mute);
}
.n43-logout-modal__actions {
  display: flex;
  gap: 10px;
}
.n43-logout-modal__actions button {
  flex: 1;
  height: 42px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.n43-logout-btn-cancel {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
}
.n43-logout-btn-confirm {
  background: #c0473f;
  border: 1px solid #a03832;
  color: #fff;
}
.n43-settings-logout {
  width: 100%;
  margin-top: 8px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(192, 71, 63, 0.45);
  background: rgba(192, 71, 63, 0.12);
  color: #e07068;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.n43-settings-logout:hover {
  background: rgba(192, 71, 63, 0.2);
}
