/*
   LunaWorld — single living scene.
   Modes (controlled by classes on .luna-world-root):
     .mode-dashboard | .mode-creation
   Mood (set by total PnL):
     .mood-good | .mood-poor | .mood-neutral
*/

/* ==========================================================================
   ROOT / BACKDROP LAYERS
   ========================================================================== */

.luna-world-root {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: rgba(255,255,255,0.94);
    perspective: 1400px;
    transform-style: preserve-3d;

    /* ── Luna design tokens — map to theme variables so Luna adapts to all themes ── */
    --luna-accent:       var(--accent-purple, #a78bfa);
    --luna-accent-dim:   var(--accent-purple-dim, rgba(139,92,246,0.15));
    --luna-accent-hover: var(--accent-purple-hover, #c084fc);
    --luna-profit:       var(--color-profit, #10b981);
    --luna-profit-dim:   var(--color-profit-dim, rgba(16,185,129,0.12));
    --luna-loss:         var(--color-loss, #ef4444);
    --luna-loss-dim:     var(--color-loss-dim, rgba(239,68,68,0.12));
    --luna-warning:      var(--accent-amber, #f59e0b);
    --luna-warning-dim:  var(--accent-amber-dim, rgba(245,158,11,0.15));
    --luna-father-color: var(--accent-amber, #f59e0b);
    --luna-father-glow:  var(--accent-amber-hover, #fbbf24);
    --luna-blue:         var(--accent-blue, #3b82f6);

    /* Dimension/body colors consumed by LunaWorld JS and CSS. */
    --luna-dim-solo:     var(--accent-purple-hover, #a78bfa);
    --luna-dim-solo-hi:  color-mix(in srgb, var(--luna-dim-solo) 78%, white);
    --luna-dim-grid:     var(--accent-blue-hover, #60a5fa);
    --luna-dim-grid-hi:  color-mix(in srgb, var(--luna-dim-grid) 78%, white);
    --luna-dim-signal:   var(--accent-amber-hover, #fbbf24);
    --luna-dim-signal-hi: color-mix(in srgb, var(--luna-dim-signal) 72%, white);
    --luna-dim-scanner:  var(--luna-profit);
    --luna-dim-scanner-hi: color-mix(in srgb, var(--luna-profit) 70%, white);
    --luna-dim-latency:  var(--accent-rose, #f43f5e);
    --luna-dim-latency-hi: color-mix(in srgb, var(--luna-dim-latency) 70%, white);
    --luna-moon-crater:  color-mix(in srgb, var(--luna-accent) 34%, var(--text-secondary));
    --luna-moon-crater-soft: color-mix(in srgb, var(--luna-accent) 26%, var(--text-muted));
    --luna-glass-bg:     rgba(16,18,28,0.66);
    --luna-glass-bg-soft: rgba(255,255,255,0.05);
    --luna-glass-bg-hover: rgba(255,255,255,0.08);
    --luna-glass-border: rgba(255,255,255,0.10);
    --luna-glass-border-strong: rgba(255,255,255,0.20);
    --luna-field-bg:     rgba(10,12,22,0.82);
    --luna-focus-ring:   0 0 0 3px color-mix(in srgb, var(--luna-accent) 28%, transparent), 0 0 22px color-mix(in srgb, var(--luna-accent) 18%, transparent);

    /* Derived moon/mood glows — use luna-accent so they shift with dimension */
    --moon-glow:  color-mix(in srgb, var(--luna-accent) 36%, transparent);
    --mood-glow:  color-mix(in srgb, var(--luna-accent) 16%, transparent);

    --luna-scene-x: 51%;
    --luna-scene-y: 47%;
    --luna-dim-radius-x: min(26vw, 360px);
    --luna-dim-radius-y: min(28vh, 300px);
    transition: --moon-glow 600ms ease, --mood-glow 600ms ease;
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.luna-cosmic-deep {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 115%, rgba(88, 40, 140, 0.38), transparent 52%),
        radial-gradient(ellipse at 50% 95%, rgba(30, 12, 60, 0.55), transparent 48%),
        radial-gradient(ellipse at 12% 14%, rgba(16, 58, 110, 0.42), transparent 50%),
        radial-gradient(ellipse at 88% 18%, rgba(140, 48, 100, 0.20), transparent 42%),
        radial-gradient(ellipse at 50% 50%, rgba(12, 8, 32, 0.6), transparent 72%),
        linear-gradient(180deg, #030310 0%, #05061a 28%, #060818 52%, #040612 74%, #020209 100%);
    transition: filter 700ms ease;
}

/* mood tint */
.mood-good .luna-cosmic-deep    { filter: hue-rotate(-8deg) brightness(1.06) saturate(1.04); }
.mood-poor .luna-cosmic-deep    { filter: hue-rotate(10deg) brightness(0.88) saturate(0.92); }

/* Aurora ribbons in upper corners */
.luna-cosmic-aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}

.luna-aurora {
    position: absolute;
    height: 260px;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.30;
}

.luna-aurora-1 {
    top: -100px;
    left: -10%;
    width: 62%;
    background: linear-gradient(125deg, rgba(80,140,240,0.5), rgba(140,100,220,0.35) 40%, rgba(60,180,170,0.15) 75%, transparent);
    animation: luna-aurora-drift-a 100s ease-in-out infinite;
}

.luna-aurora-2 {
    bottom: -110px;
    right: -10%;
    width: 65%;
    background: linear-gradient(285deg, rgba(40,190,140,0.45), rgba(80,200,170,0.3) 40%, rgba(120,100,200,0.12) 75%, transparent);
    animation: luna-aurora-drift-b 120s ease-in-out infinite;
}

@keyframes luna-aurora-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.26; }
    33%      { transform: translate3d(30px, 12px, 0) rotate(5deg); opacity: 0.40; }
    66%      { transform: translate3d(50px, 22px, 0) rotate(10deg); opacity: 0.34; }
}
@keyframes luna-aurora-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0.22; }
    33%      { transform: translate3d(-20px, -14px, 0) rotate(-5deg); opacity: 0.38; }
    66%      { transform: translate3d(-40px, -26px, 0) rotate(-10deg); opacity: 0.30; }
}

/* Distant galaxy spiral (one corner) */
.luna-cosmic-galaxy {
    position: absolute;
    top: 10%;
    right: -200px;
    width: 520px;
    height: 520px;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, rgba(150,120,240,0.30) 0%, rgba(140,110,230,0.14) 18%, transparent 48%),
        conic-gradient(from 0deg at 50% 50%,
            rgba(150,120,240,0.22) 0deg,
            transparent 40deg,
            rgba(80,150,240,0.16) 90deg,
            transparent 140deg,
            rgba(200,140,240,0.12) 200deg,
            transparent 250deg,
            rgba(150,120,240,0.18) 310deg,
            transparent 340deg,
            rgba(150,120,240,0.22) 360deg);
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.36;
    animation: luna-galaxy-spin 300s linear infinite;
}

@keyframes luna-galaxy-spin {
    from { transform: rotate(0deg) scale(1); }
    to   { transform: rotate(360deg) scale(1.03); }
}

/* Deep background orbs */
.luna-deep-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: screen;
}

.luna-deep-orb {
    position: absolute;
    border-radius: 50%;
    opacity: 0.22;
    filter: blur(12px);
    box-shadow:
        inset -30px -38px 90px rgba(0,0,0,0.32),
        inset 20px 16px 32px rgba(255,255,255,0.05),
        0 0 140px rgba(150,120,240,0.06);
}

.luna-deep-orb.orb-a {
    left: calc(var(--luna-scene-x) - min(46vw, 620px));
    top: calc(var(--luna-scene-y) + min(10vh, 100px));
    width: min(40vw, 520px);
    height: min(40vw, 520px);
    background: radial-gradient(circle at 34% 30%, rgba(96,165,250,0.12) 0%, rgba(76,88,180,0.08) 30%, rgba(18,24,54,0.18) 58%, rgba(8,10,20,0.02) 84%, transparent 100%);
    animation: luna-deep-orb-drift-a 120s ease-in-out infinite;
}

.luna-deep-orb.orb-b {
    left: calc(var(--luna-scene-x) + min(28vw, 320px));
    top: calc(var(--luna-scene-y) - min(34vh, 300px));
    width: min(22vw, 250px);
    height: min(22vw, 250px);
    opacity: 0.1;
    background: radial-gradient(circle at 38% 34%, rgba(196,181,253,0.18) 0%, rgba(74,48,122,0.1) 34%, rgba(10,12,22,0.02) 78%, transparent 100%);
    animation: luna-deep-orb-drift-b 150s ease-in-out infinite;
}

@keyframes luna-deep-orb-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(26px, -18px, 0) scale(1.04); }
}

@keyframes luna-deep-orb-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(0.98); }
    50%      { transform: translate3d(-18px, 14px, 0) scale(1.06); }
}

/* Nebula clouds */
.luna-nebula {
    position: absolute;
    inset: -8%;
    pointer-events: none;
    filter: blur(60px);
    opacity: 0.66;
    mix-blend-mode: screen;
}

.luna-neb {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.luna-neb-1 {
    top: -10%; left: -12%;
    width: 64%; height: 64%;
    background: radial-gradient(circle, rgba(130,100,220,0.42), rgba(100,80,200,0.15) 45%, transparent 65%);
    animation: luna-neb-drift-a 80s ease-in-out infinite;
}
.luna-neb-2 {
    bottom: -16%; right: -10%;
    width: 68%; height: 68%;
    background: radial-gradient(circle, rgba(40,180,140,0.34), rgba(30,160,120,0.12) 45%, transparent 65%);
    animation: luna-neb-drift-b 100s ease-in-out infinite;
}
.luna-neb-3 {
    top: 20%; right: 16%;
    width: 42%; height: 42%;
    background: radial-gradient(circle, rgba(220,170,40,0.22), rgba(200,150,30,0.08) 45%, transparent 68%);
    animation: luna-neb-drift-c 120s ease-in-out infinite;
}

@keyframes luna-neb-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(36px, 20px, 0) scale(1.06); }
}
@keyframes luna-neb-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50%      { transform: translate3d(-26px, -18px, 0) scale(1.07); }
}
@keyframes luna-neb-drift-c {
    0%, 100% { transform: translate3d(0, 0, 0) scale(0.97); }
    50%      { transform: translate3d(18px, -14px, 0) scale(1.05); }
}

.luna-reactive-backdrop {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

.luna-reactive-bloom {
    position: absolute;
    border-radius: 50%;
    filter: blur(44px);
    opacity: 0.12;
    transform: scale(1);
    transition: opacity 320ms ease, transform 420ms ease, filter 320ms ease;
    animation: luna-bloom-drift 18s ease-in-out infinite;
}

.luna-reactive-bloom.bloom-a {
    width: 240px;
    height: 240px;
    left: calc(50% - 220px);
    top: calc(47% - 110px);
    background: radial-gradient(circle, rgba(96,165,250,0.2) 0%, rgba(96,165,250,0.05) 46%, transparent 72%);
}

.luna-reactive-bloom.bloom-b {
    width: 320px;
    height: 320px;
    left: calc(50% - 40px);
    top: calc(47% - 180px);
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-accent) 18%, transparent) 0%, color-mix(in srgb, var(--luna-accent) 4%, transparent) 52%, transparent 74%);
    animation-delay: -6s;
}

.luna-reactive-bloom.bloom-c {
    width: 280px;
    height: 280px;
    left: calc(50% + 40px);
    top: calc(47% + 20px);
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-profit) 12%, transparent) 0%, color-mix(in srgb, var(--luna-profit) 3%, transparent) 48%, transparent 74%);
    animation-delay: -12s;
}

@keyframes luna-bloom-drift {
    0%, 100% { transform: scale(1) translate3d(0, 0, 0); }
    50% { transform: scale(1.06) translate3d(10px, -8px, 0); }
}

.scene-profit .luna-reactive-bloom,
.scene-loss .luna-reactive-bloom,
.scene-entry .luna-reactive-bloom {
    opacity: 0.24;
    filter: blur(34px);
}

.scene-profit .luna-reactive-bloom.bloom-c {
    opacity: 0.34;
    transform: scale(1.14);
}

.scene-loss .luna-reactive-bloom.bloom-a {
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-loss) 22%, transparent) 0%, color-mix(in srgb, var(--luna-loss) 5%, transparent) 46%, transparent 72%);
    opacity: 0.32;
    transform: scale(1.12);
}

.scene-entry .luna-reactive-bloom.bloom-b {
    opacity: 0.32;
    transform: scale(1.12);
}

/* Star fields */
.luna-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    will-change: transform;
}
.luna-stars-far  { animation: luna-parallax-slow 220s linear infinite; }
.luna-stars-mid  { animation: luna-parallax-mid 160s linear infinite; }
.luna-stars-near { animation: luna-parallax-fast 110s linear infinite; }

@keyframes luna-parallax-slow { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-40px, 20px, 0); } }
@keyframes luna-parallax-mid  { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-80px, 40px, 0); } }
@keyframes luna-parallax-fast { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-140px, 70px, 0); } }

.luna-stars span {
    position: absolute;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.8) 40%, transparent 100%);
    box-shadow: 0 0 8px rgba(220,220,255,0.5);
    opacity: 0.2;
    animation: luna-twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes luna-twinkle {
    0%, 100% { opacity: 0.14; transform: scale(0.82); }
    50%      { opacity: var(--max-opacity, 0.9); transform: scale(1.25); }
}

/* Cosmic dust */
.luna-cosmic-dust {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.luna-dust-particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196,181,253,0.65) 0%, transparent 100%);
    box-shadow: 0 0 4px rgba(196,181,253,0.35);
    opacity: 0;
    animation: luna-dust-float var(--duration) linear var(--delay) infinite;
}

@keyframes luna-dust-float {
    0%   { opacity: 0; transform: translate3d(0, 0, 0); }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.4; }
    100% { opacity: 0; transform: translate3d(var(--drift-x), var(--drift-y), 0); }
}

/* Comets / background streaks */
.luna-comets {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    mix-blend-mode: screen;
}

.luna-ambient-comet {
    position: absolute;
    top: var(--top);
    left: -18%;
    width: var(--length);
    height: var(--thickness);
    border-radius: 999px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.01) 15%,
        rgba(180,165,240,0.06) 45%,
        rgba(255,255,255,0.35) 80%,
        rgba(255,255,255,0.90) 100%);
    box-shadow: 0 0 14px rgba(180,165,240,0.12);
    filter: blur(var(--blur));
    transform: rotate(var(--angle));
    transform-origin: 100% 50%;
    opacity: 0;
    animation: luna-comet-fly var(--duration) ease-in var(--delay) infinite;
}

.luna-ambient-comet::before {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    width: var(--head-size);
    height: var(--head-size);
    border-radius: 50%;
    transform: translate(50%, -50%);
    background: radial-gradient(circle, rgba(255,255,255,0.96) 0%, rgba(180,165,240,0.70) 48%, rgba(150,120,240,0.12) 84%, transparent 100%);
    box-shadow: 0 0 18px rgba(255,255,255,0.18);
}

.luna-ambient-comet::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    width: var(--glow-size);
    height: calc(var(--glow-size) * 0.38);
    transform: translate(34%, -50%);
    border-radius: 999px;
    background: radial-gradient(circle, rgba(180,165,240,0.20) 0%, rgba(180,165,240,0.06) 42%, transparent 100%);
    filter: blur(5px);
    opacity: 0.6;
}

@keyframes luna-comet-fly {
    0%   { transform: translate3d(0, 0, 0) rotate(var(--angle)) scaleX(0.96); opacity: 0; }
    12%  { opacity: var(--max-opacity); }
    50%  { opacity: calc(var(--max-opacity) * 0.85); }
    100% { transform: translate3d(var(--travel-x), var(--travel-y), 0) rotate(var(--angle)) scaleX(1.04); opacity: 0; }
}

/* Asteroids in side margins */
.luna-asteroids {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.luna-asteroid {
    position: absolute;
    left: var(--left);
    top: var(--top);
    width: var(--size);
    height: var(--size);
    border-radius: 42%;
    background: radial-gradient(circle at 30% 26%,
        rgba(var(--shade), var(--shade), var(--shade), 0.85) 0%,
        rgba(var(--shade), var(--shade), var(--shade), 0.4) 60%,
        rgba(18, 16, 26, 1) 100%);
    box-shadow:
        inset -1px -1px 3px rgba(0,0,0,0.4),
        0 0 4px rgba(255,255,255,0.04);
    animation: luna-asteroid-drift var(--duration) ease-in-out var(--delay) infinite;
    opacity: 0.55;
}

@keyframes luna-asteroid-drift {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
    50%      { transform: translate3d(-10px, 14px, 0) rotate(120deg); }
}

/* Distant decorative planets */
.luna-distant-planets {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.luna-distant-planet {
    position: absolute;
    border-radius: 50%;
    box-shadow:
        inset -7px -9px 24px rgba(0,0,0,0.65),
        inset 4px 6px 16px rgba(255,255,255,0.08),
        0 0 36px rgba(255,255,255,0.05);
}

.luna-distant-planet::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 28% 22%, rgba(255,255,255,0.25) 0%, transparent 28%);
    pointer-events: none;
}

.luna-planet-a {
    top: 14%;
    left: 7%;
    width: 44px;
    height: 44px;
    background: radial-gradient(circle at 30% 26%, #6c8de0 0%, #2c3a72 55%, #1a214a 100%);
    animation: luna-planet-drift-a 42s ease-in-out infinite;
}
.luna-planet-b {
    bottom: 18%;
    right: 6%;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 28% 26%, #f5b070 0%, #b06a3a 55%, #5a2f18 100%);
    animation: luna-planet-drift-b 52s ease-in-out infinite;
}
.luna-planet-c {
    top: 56%;
    left: 4%;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 28% 26%, #94a3b8 0%, #475569 55%, #1e293b 100%);
    animation: luna-planet-drift-c 68s ease-in-out infinite;
}

@keyframes luna-planet-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33%      { transform: translate3d(10px, -6px, 0); }
    66%      { transform: translate3d(16px, -4px, 0); }
}
@keyframes luna-planet-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33%      { transform: translate3d(-8px, 6px, 0); }
    66%      { transform: translate3d(-14px, 4px, 0); }
}
@keyframes luna-planet-drift-c {
    0%, 100% { transform: translate3d(0, 0, 0); }
    33%      { transform: translate3d(6px, 4px, 0); }
    66%      { transform: translate3d(10px, -3px, 0); }
}

/* Orbital rings */
.luna-orbits {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.luna-ring {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.luna-ring-1 { width: min(34vw, 360px); height: min(34vw, 360px); border: 1px solid rgba(140,110,230,0.14); animation: luna-ring-spin 32s linear infinite; }
.luna-ring-2 { width: min(48vw, 520px); height: min(48vw, 520px); border: 1px solid rgba(80,140,240,0.10); animation: luna-ring-spin-rev 44s linear infinite; }
.luna-ring-3 { width: min(64vw, 720px); height: min(64vw, 720px); border: 1px dashed rgba(170,150,230,0.07); animation: luna-ring-spin 72s linear infinite; }
.luna-ring-4 { width: min(82vw, 940px); height: min(82vw, 940px); border: 1px solid rgba(255,255,255,0.03); animation: luna-ring-spin-rev 110s linear infinite; }

@keyframes luna-ring-spin     { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes luna-ring-spin-rev { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* FX canvas */
.luna-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

/* ==========================================================================
   THE MOON (CENTRAL CORE)
   ========================================================================== */

.luna-core {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    width: 262px;
    height: 262px;
    border: 0;
    background: transparent;
    color: var(--text-primary, #fff);
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 7;
    transition: transform 520ms cubic-bezier(0.16, 0.9, 0.24, 1), filter 520ms ease;
    will-change: transform;
}

.luna-core:hover {
    transform: translate(-50%, -50%) scale(1.05);
    filter: brightness(1.10);
}

.mode-creation .luna-core {
    transform: translate(-50%, -50%) scale(1.22);
    filter: brightness(1.15) saturate(1.10);
}

.luna-core-field,
.luna-core-halo,
.luna-core-corona,
.luna-core-shell,
.luna-core-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.luna-core-field {
    inset: -32%;
    background:
        radial-gradient(circle, rgba(140,110,230,0.18) 0%, rgba(140,110,230,0.08) 22%, transparent 52%),
        radial-gradient(circle, var(--mood-glow) 0%, transparent 62%);
    filter: blur(14px);
    animation: luna-field-breathe 9s ease-in-out infinite;
}

.luna-core-halo {
    inset: -50%;
    background: radial-gradient(circle, rgba(150,120,240,0.30) 0%, rgba(140,110,230,0.10) 34%, transparent 62%);
    filter: blur(8px);
    animation: luna-halo-breathe 7s ease-in-out infinite;
}

.luna-core-corona {
    inset: -24%;
    background:
        radial-gradient(circle, rgba(255,255,255,0.22) 0%, rgba(200,170,255,0.08) 28%, transparent 58%),
        radial-gradient(circle, rgba(140,110,230,0.06) 0%, transparent 72%);
    animation: luna-corona-pulse 6s ease-in-out infinite;
}

.luna-core-shell {
    inset: -8%;
    border-radius: 50%;
    border: 1px solid rgba(180,160,240,0.18);
    box-shadow:
        inset 0 0 34px rgba(180,160,240,0.10),
        0 0 28px rgba(140,110,230,0.12);
    opacity: 0.92;
}

.luna-core-shimmer {
    background: radial-gradient(circle at 34% 28%, rgba(255,255,255,0.45) 0%, transparent 22%);
    mix-blend-mode: screen;
    animation: luna-shimmer-orbit 22s linear infinite;
}

.luna-core-moon {
    position: absolute;
    inset: 3%;
    width: 94%;
    height: 94%;
    filter: drop-shadow(0 12px 38px rgba(167,139,250,0.26));
    animation: luna-moon-breathe 8s ease-in-out infinite;
}

.luna-core-label {
    position: absolute;
    left: 50%;
    bottom: -30px;
    color: color-mix(in srgb, var(--luna-accent-hover) 78%, transparent);
    font-size: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
    transform: translateX(-50%);
    text-shadow: 0 0 12px color-mix(in srgb, var(--luna-accent) 40%, transparent);
}

.luna-core-hint {
    position: absolute;
    left: 50%;
    bottom: -50px;
    width: max-content;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.32);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.luna-core:hover .luna-core-hint {
    opacity: 1;
}

.mode-creation .luna-core-hint,
.mode-creation .luna-core-label {
    opacity: 0;
}

/* PnL mood adjusts scene mood, not Luna's core identity */
.mood-good { --mood-glow: color-mix(in srgb, var(--luna-profit) 18%, transparent); }
.mood-poor { --mood-glow: color-mix(in srgb, var(--luna-loss)   16%, transparent); }

@keyframes luna-field-breathe { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes luna-halo-breathe { 0%, 100% { opacity: 0.65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.10); } }
@keyframes luna-corona-pulse { 0%, 100% { opacity: 0.50; } 50% { opacity: 0.98; } }
@keyframes luna-moon-breathe { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.028) rotate(0.5deg); } }
@keyframes luna-shimmer-orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Trade pulses on moon */
.luna-core.pulse-profit .luna-core-halo {
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-profit) 60%, transparent) 0%, color-mix(in srgb, var(--luna-profit) 18%, transparent) 36%, transparent 64%);
    animation: luna-pulse-flash 1.2s ease-out;
}
.luna-core.pulse-loss .luna-core-halo {
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-loss) 58%, transparent) 0%, color-mix(in srgb, var(--luna-loss) 18%, transparent) 36%, transparent 64%);
    animation: luna-pulse-flash 1.2s ease-out;
}
.luna-core.pulse-entry .luna-core-halo {
    background: radial-gradient(circle, color-mix(in srgb, var(--luna-accent) 68%, transparent) 0%, color-mix(in srgb, var(--luna-accent) 24%, transparent) 36%, transparent 64%);
    animation: luna-pulse-flash 1.2s ease-out;
}
@keyframes luna-pulse-flash {
    0%   { opacity: 0.45; transform: scale(0.94); }
    30%  { opacity: 1;    transform: scale(1.22); }
    100% { opacity: 0.65; transform: scale(1); }
}

/* ==========================================================================
   BOT ORBS (orbital, per-preset shapes)
   ========================================================================== */

.luna-bots {
    position: absolute;
    inset: 0;
    z-index: 6;
    pointer-events: none;
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.18, 0.9, 0.22, 1), filter 600ms ease;
}

.luna-empty-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7;
    pointer-events: none;
    font-size: 14px;
    color: var(--text-tertiary);
    opacity: 0.65;
    text-align: center;
}

/* Scatter outward in creation mode */
.mode-creation .luna-bots {
    opacity: 0;
    transform: scale(1.18);
    filter: blur(2px);
    pointer-events: none;
}

/* Hidden dashboard bots should not keep burning animation frames behind the drawer. */
.mode-creation .luna-bots,
.mode-creation .luna-bots * {
    animation-play-state: paused !important;
}

.mode-creation .luna-bot-label {
    opacity: 0;
}

.luna-orbit-wrap {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.luna-orbit-wrap.lane-mode {
    width: 0;
    height: 0;
}

.luna-bot-lane {
    position: absolute;
    width: var(--lane-track);
    height: 2px;
    transform: translate(-50%, -50%) rotate(var(--lane-angle));
    transform-origin: 0 50%;
    pointer-events: none;
    z-index: 5;
    opacity: 0.8;
}

.luna-bot-lane::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: calc(var(--lane-track) - (var(--lane-ring) * 0.5) - 12px);
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 0%,
        color-mix(in srgb, var(--bot-color) 18%, rgba(255,255,255,0.06)) 26%,
        color-mix(in srgb, var(--bot-color) 48%, rgba(255,255,255,0.14)) 76%,
        transparent 100%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--bot-color) 14%, transparent);
    opacity: 0;
    transition: opacity 220ms ease, box-shadow 220ms ease, height 220ms ease;
}

.luna-bot-lane::after {
    content: '';
    position: absolute;
    left: calc(var(--lane-track) - (var(--lane-ring) * 0.5));
    top: 50%;
    width: var(--lane-ring);
    height: var(--lane-ring);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 20%, rgba(255,255,255,0.08));
    background: radial-gradient(circle,
        color-mix(in srgb, var(--bot-color) 10%, transparent) 0%,
        color-mix(in srgb, var(--bot-accent) 6%, transparent) 34%,
        transparent 74%);
    box-shadow: inset 0 0 26px color-mix(in srgb, var(--bot-color) 8%, transparent);
    opacity: 0;
    transition: opacity 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.luna-bot-lane.health-good::after {
    border-color: color-mix(in srgb, var(--bot-color) 42%, rgba(255,255,255,0.16));
    box-shadow: inset 0 0 34px color-mix(in srgb, var(--bot-color) 16%, transparent), 0 0 24px color-mix(in srgb, var(--bot-color) 10%, transparent);
}

.luna-bot-lane.health-poor::after {
    border-style: dashed;
    border-color: color-mix(in srgb, var(--luna-loss) 26%, transparent);
}

.luna-bot-lane.activity-waiting::before {
    opacity: 0.22;
}

.luna-bot-lane.activity-pending::before,
.luna-bot-lane.activity-live::before {
    height: 1px;
    opacity: 0;
    box-shadow: none;
}

.luna-bot-lane.activity-pending::after,
.luna-bot-lane.activity-live::after {
    opacity: 0;
}

.luna-bot-lane.selected::before {
    height: 1px;
    opacity: 0.34;
    box-shadow: 0 0 18px color-mix(in srgb, var(--bot-color) 14%, transparent);
}

.luna-bot-lane.selected.activity-live::after,
.luna-bot-lane.selected.activity-pending::after {
    opacity: 0;
    border-color: transparent;
    box-shadow: none;
}

.luna-bot-orb {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(112px * var(--bot-scale, 1));
    height: calc(112px * var(--bot-scale, 1));
    border: 0;
    background: transparent;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    cursor: pointer;
    animation: luna-bot-lane-bob var(--drift-duration, 7s) ease-in-out infinite;
    transition: filter 280ms ease, transform 280ms ease;
    will-change: transform, filter;
}

@keyframes luna-bot-lane-bob {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(calc(-50% + var(--drift-x, 0px)), calc(-50% + var(--drift-y, 0px))) scale(1.012); }
}

.luna-bot-orb:hover {
    filter: brightness(1.15) saturate(1.08);
    z-index: 10;
}

.luna-bot-orb:hover .luna-bot-aura {
    transform: scale(1.16);
}

.luna-world-root.has-detail .luna-bot-orb:not(.selected) {
    filter: saturate(0.72) brightness(0.86);
}

.luna-world-root.has-detail .luna-bot-lane::before,
.luna-world-root.has-detail .luna-bot-lane::after {
    opacity: 0 !important;
}

.luna-world-root.has-detail .luna-bot-orb.selected {
    z-index: 9;
}

.luna-bot-orb.activity-live .luna-bot-body {
    filter: drop-shadow(0 0 16px color-mix(in srgb, var(--bot-color) 60%, transparent));
}

.luna-bot-orb.activity-pending::before,
.luna-bot-orb.activity-live::before {
    content: '';
    position: absolute;
    inset: 12%;
    border-radius: 50%;
    pointer-events: none;
}

.luna-bot-orb.activity-pending::before {
    border: 1px dashed color-mix(in srgb, var(--bot-color) 72%, white);
    opacity: 0.75;
    animation: luna-pending-ring 2.1s linear infinite;
}

.luna-bot-orb.activity-live::before {
    border: 1px solid color-mix(in srgb, var(--bot-color) 68%, white);
    box-shadow: 0 0 22px color-mix(in srgb, var(--bot-color) 34%, transparent);
    opacity: 0.8;
}

@keyframes luna-pending-ring {
    from { transform: scale(0.92) rotate(0deg); opacity: 0.72; }
    to { transform: scale(1.08) rotate(360deg); opacity: 0.28; }
}

.luna-bot-aura,
.luna-bot-shield,
.luna-bot-shell,
.luna-bot-link,
.luna-bot-body {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    pointer-events: none;
}

.luna-bot-aura {
    inset: -20%;
    background: radial-gradient(circle, color-mix(in srgb, var(--bot-color) 22%, transparent) 0%, transparent 58%);
    filter: blur(3px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.luna-bot-shell {
    inset: 16%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 30%, rgba(255,255,255,0.10));
    background:
        radial-gradient(circle at 32% 26%, rgba(255,255,255,0.20) 0%, color-mix(in srgb, var(--bot-accent) 22%, transparent) 22%, transparent 52%),
        radial-gradient(circle at 26% 32%, rgba(255,255,255,0.11) 0%, rgba(255,255,255,0.05) 6%, transparent 7%),
        radial-gradient(circle at 56% 60%, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 7%, transparent 8%),
        radial-gradient(circle at 64% 36%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 5%, transparent 6%),
        radial-gradient(circle at 50% 58%, rgba(8,10,20,0.0) 0%, rgba(8,10,20,0.24) 60%, rgba(8,10,20,0.38) 100%),
        color-mix(in srgb, var(--bot-color) 12%, rgba(8,10,20,0.76));
    box-shadow:
        inset 0 0 24px color-mix(in srgb, var(--bot-color) 14%, transparent),
        0 0 18px color-mix(in srgb, var(--bot-color) 10%, transparent);
}

.luna-bot-orb.health-good .luna-bot-aura {
    background: radial-gradient(circle, color-mix(in srgb, var(--bot-color) 38%, transparent) 0%, transparent 60%);
}

.luna-bot-orb.health-poor .luna-bot-aura {
    opacity: 0.22;
    filter: blur(3px) grayscale(0.2);
}

/* Protective shield ring (only when losing) */
.luna-bot-shield {
    inset: -10%;
    border: 1px dashed transparent;
    transition: border-color 360ms ease, opacity 360ms ease;
    animation: luna-shield-spin 18s linear infinite;
    opacity: 0;
}

.luna-bot-orb.health-poor .luna-bot-shield {
    border-color: color-mix(in srgb, var(--bot-color) 24%, transparent);
    opacity: 0;
    box-shadow: none;
}

@keyframes luna-shield-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Internal link removed from the orb surface. World FX handles the real connection. */
.luna-bot-link {
    display: none;
}

/* Body container */
.luna-bot-body {
    inset: 16%;
    display: grid;
    place-items: center;
}

/* Bot name label under the orb */
.luna-bot-label {
    position: absolute;
    left: 50%;
    bottom: -8px;
    transform: translateX(-50%);
    display: block;
    max-width: 120px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.88);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
    pointer-events: none;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(4,6,14,0.55);
    backdrop-filter: blur(4px);
}

.luna-bot-orb.shape-rocket .luna-bot-body {
    inset: 5%;
    transform: rotate(var(--shape-tilt, 0deg));
    transform-origin: 50% 50%;
}

.luna-bot-orb.shape-cluster .luna-bot-body,
.luna-bot-orb.shape-probe .luna-bot-body {
    inset: 14% 16% 18% 16%;
}

.luna-bot-orb.shape-comet .luna-bot-body,
.luna-bot-orb.shape-streak .luna-bot-body {
    inset: 13% 16% 19% 16%;
    transform: rotate(var(--shape-tilt, 0deg));
    transform-origin: 50% 50%;
}

.luna-bot-orb.motion-solo .bot-rocket {
    animation: luna-rocket-hover 5s ease-in-out infinite;
}

.luna-bot-orb.motion-cluster .bot-cluster {
    animation: luna-cluster-gyro 18s linear infinite;
}

.luna-bot-orb.motion-comet .bot-comet {
    animation: luna-comet-sway 5.5s ease-in-out infinite;
}

.luna-bot-orb.motion-streak .bot-streak {
    animation: luna-streak-charge 3s ease-in-out infinite;
}

.luna-bot-orb.motion-probe .bot-probe {
    animation: luna-probe-scan 12s linear infinite;
}

@keyframes luna-rocket-hover {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-1.5deg); }
    50% { transform: translate3d(0, -3px, 0) rotate(1deg); }
}

@keyframes luna-cluster-gyro {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes luna-comet-sway {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); }
    50% { transform: translate3d(-2px, 1.5px, 0) rotate(1.5deg); }
}

@keyframes luna-streak-charge {
    0%, 100% { transform: translate3d(0, 0, 0) scaleX(1); }
    50% { transform: translate3d(3px, 0, 0) scaleX(1.05); }
}

@keyframes luna-probe-scan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Common: profit pulse ring */
.luna-bot-orb.health-good.running .luna-bot-aura {
    animation: luna-bot-profit-breathe 2.6s ease-in-out infinite;
}

@keyframes luna-bot-profit-breathe {
    0%, 100% { transform: scale(1); opacity: 0.80; }
    50%      { transform: scale(1.22); opacity: 1; }
}

/* === SHAPE: ROCKET (Solo) ============================================ */
.bot-rocket {
    overflow: visible;
}

.bot-rocket::before {
    content: '';
    position: absolute;
    inset: 18% 26% 22% 26%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 28%, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 52%, transparent 100%);
    filter: blur(2px);
}

.bot-rocket::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 10%;
    width: 22px;
    height: 34px;
    transform: translateX(-50%);
    border-radius: 50% 50% 32% 32% / 24% 24% 76% 76%;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02) 42%, transparent 100%);
    opacity: 0.46;
}

.bot-rocket svg {
    width: 82%;
    height: 82%;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--bot-color) 65%, transparent));
}

.bot-rocket-flame {
    position: absolute;
    bottom: -4%;
    left: 50%;
    width: 14px;
    height: 24px;
    background: radial-gradient(ellipse at top,
        rgba(255,240,200,0.95) 0%,
        color-mix(in srgb, var(--bot-color) 85%, white) 35%,
        color-mix(in srgb, var(--bot-color) 55%, transparent) 65%,
        transparent 100%);
    border-radius: 50% 50% 34% 34% / 28% 28% 72% 72%;
    transform: translateX(-50%);
    filter: blur(0.5px);
    animation: luna-rocket-flame 280ms ease-in-out infinite;
    transform-origin: top center;
}

.luna-bot-orb.idle .bot-rocket-flame {
    opacity: 0.35;
    transform: translateX(-50%) scaleY(0.35);
}

@keyframes luna-rocket-flame {
    0%, 100% { transform: translateX(-50%) scaleY(1) scaleX(1); }
    50%      { transform: translateX(-50%) scaleY(1.16) scaleX(0.92); }
}

/* === SHAPE: CLUSTER (Grid) =========================================== */
.bot-cluster {
    position: relative;
}

.bot-cluster::before,
.bot-cluster::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.bot-cluster::before {
    inset: 14%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 30%, rgba(255,255,255,0.12));
    box-shadow: inset 0 0 12px color-mix(in srgb, var(--bot-color) 14%, transparent);
}

.bot-cluster::after {
    inset: 30%;
    border: 1px solid color-mix(in srgb, var(--bot-accent) 26%, transparent);
    opacity: 0.55;
}

.bot-cluster-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, transparent 49%, color-mix(in srgb, var(--bot-color) 22%, transparent) 49%, color-mix(in srgb, var(--bot-color) 22%, transparent) 51%, transparent 51%),
        linear-gradient(90deg, transparent 49%, color-mix(in srgb, var(--bot-color) 22%, transparent) 49%, color-mix(in srgb, var(--bot-color) 22%, transparent) 51%, transparent 51%);
    border-radius: 50%;
    opacity: 0.35;
    animation: luna-cluster-pulse 5s ease-in-out infinite;
}

@keyframes luna-cluster-pulse {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.55; }
}

.bot-cluster-axis {
    position: absolute;
    left: 50%;
    top: 50%;
    height: 1px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-accent) 34%, rgba(255,255,255,0.28)), transparent);
    transform: translate(-50%, -50%);
    opacity: 0.55;
}

.bot-cluster-axis.axis-h { width: 58%; }
.bot-cluster-axis.axis-v { width: 58%; transform: translate(-50%, -50%) rotate(90deg); }
.bot-cluster-axis.axis-d1 { width: 64%; transform: translate(-50%, -50%) rotate(45deg); opacity: 0.38; }
.bot-cluster-axis.axis-d2 { width: 64%; transform: translate(-50%, -50%) rotate(-45deg); opacity: 0.38; }

.bot-cluster-node {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        white 0%,
        var(--bot-accent) 55%,
        var(--bot-color) 100%);
    box-shadow: 0 0 10px color-mix(in srgb, var(--bot-color) 50%, transparent);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bot-cluster-node.n-tl { top: 24%;  left: 24%; }
.bot-cluster-node.n-tr { top: 24%;  right: 24%; }
.bot-cluster-node.n-bl { bottom: 24%; left: 24%; }
.bot-cluster-node.n-br { bottom: 24%; right: 24%; }
.bot-cluster-node.n-t  { top: 16%; left: 50%; transform: translateX(-50%); }
.bot-cluster-node.n-b  { bottom: 16%; left: 50%; transform: translateX(-50%); }

.bot-cluster-center {
    position: absolute;
    inset: 34%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%,
        white 0%,
        var(--bot-accent) 45%,
        var(--bot-color) 100%);
    box-shadow:
        0 0 18px color-mix(in srgb, var(--bot-color) 65%, transparent),
        inset 0 0 8px rgba(255,255,255,0.4);
}

.luna-bot-orb.running .bot-cluster-node {
    animation: luna-cluster-node-pulse 2.4s ease-in-out infinite;
}

.luna-bot-orb.running .bot-cluster-node.n-tl { animation-delay: 0s; }
.luna-bot-orb.running .bot-cluster-node.n-tr { animation-delay: 0.5s; }
.luna-bot-orb.running .bot-cluster-node.n-br { animation-delay: 1.0s; }
.luna-bot-orb.running .bot-cluster-node.n-bl { animation-delay: 1.5s; }

@keyframes luna-cluster-node-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 10px color-mix(in srgb, var(--bot-color) 50%, transparent); }
    50%      { transform: scale(1.2); box-shadow: 0 0 18px color-mix(in srgb, var(--bot-color) 80%, transparent); }
}

/* === SHAPE: COMET (Signal-to-Signal) ================================= */
.bot-comet {
    position: relative;
    overflow: visible;
}

.bot-comet::before,
.bot-comet::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.bot-comet::before {
    top: 50%;
    right: 42%;
    width: 68px;
    height: 10px;
    transform: translate(0, -50%);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-accent) 34%, transparent), color-mix(in srgb, var(--bot-color) 26%, transparent));
    filter: blur(2px);
    opacity: 0.48;
}

.bot-comet::after {
    top: 50%;
    right: 16%;
    width: 8px;
    height: 8px;
    transform: translate(0, -50%);
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 0 10px rgba(255,255,255,0.44);
}

.bot-comet-ring {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bot-accent) 30%, rgba(255,255,255,0.22));
    transform: translate(0, -50%) rotate(-18deg);
    opacity: 0.58;
}

.bot-comet-spark {
    position: absolute;
    top: 36%;
    right: 2%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    box-shadow: 0 0 10px rgba(255,255,255,0.45);
}

.bot-comet-tail {
    position: absolute;
    top: 50%;
    right: 50%;
    width: 46px;
    height: 4px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-color) 60%, white));
    transform: translate(0, -50%);
    border-radius: 999px;
    box-shadow: 0 0 16px color-mix(in srgb, var(--bot-color) 60%, transparent);
    filter: blur(0.5px);
    animation: luna-comet-tail-pulse 2.8s ease-in-out infinite;
}

@keyframes luna-comet-tail-pulse {
    0%, 100% { opacity: 0.5; transform: translate(0, -50%) scaleX(1); }
    50%      { opacity: 0.85; transform: translate(0, -50%) scaleX(1.12); }
}

.bot-comet-head {
    position: absolute;
    top: 50%;
    right: 22%;
    width: 22px;
    height: 22px;
    transform: translate(0, -50%);
}

.bot-comet-glow {
    position: absolute;
    inset: -40%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--bot-color) 55%, transparent) 0%, transparent 70%);
    filter: blur(2px);
}

.bot-comet-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        white 0%,
        var(--bot-accent) 45%,
        var(--bot-color) 100%);
    box-shadow:
        0 0 22px color-mix(in srgb, var(--bot-color) 80%, transparent),
        inset 0 0 6px rgba(255,255,255,0.5);
}

/* === SHAPE: STREAK (Latency) ======================================== */
.bot-streak {
    position: relative;
    overflow: visible;
}

.bot-streak::before,
.bot-streak::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.bot-streak::before {
    top: 50%;
    right: 30%;
    width: 60px;
    height: 7px;
    transform: translate(0, -50%);
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-accent) 20%, transparent), color-mix(in srgb, var(--bot-color) 28%, transparent));
    filter: blur(4px);
    opacity: 0.6;
}

.bot-streak::after {
    top: 50%;
    right: 14%;
    width: 20px;
    height: 20px;
    transform: translate(0, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--bot-accent) 24%, white) 0%, transparent 72%);
    filter: blur(5px);
    opacity: 0.6;
}

.bot-streak-trail {
    position: absolute;
    top: 50%;
    right: 34%;
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-color) 60%, white) 65%, white 100%);
    transform: translate(0, -50%);
    border-radius: 999px;
    box-shadow: 0 0 12px color-mix(in srgb, var(--bot-color) 70%, transparent);
}

.bot-streak-head {
    position: absolute;
    top: 50%;
    right: 26%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white 0%, var(--bot-accent) 50%, var(--bot-color) 100%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--bot-color) 80%, transparent);
    transform: translate(0, -50%);
    animation: luna-streak-head 1.8s ease-in-out infinite;
}

.bot-streak-spark {
    position: absolute;
    top: 50%;
    left: 4%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 6px white;
    transform: translate(0, -50%);
    animation: luna-streak-spark 1.8s ease-in-out infinite;
}

@keyframes luna-streak-head {
    0%, 100% { transform: translate(0, -50%) scale(1); }
    50%      { transform: translate(-3px, -50%) scale(1.10); }
}

@keyframes luna-streak-spark {
    0%, 100% { opacity: 0.2; transform: translate(0, -50%) scale(0.5); }
    50%      { opacity: 0.8; transform: translate(0, -50%) scale(1.2); }
}

/* === SHAPE: PROBE (Scanner) ========================================= */
.bot-probe {
    position: relative;
    overflow: visible;
}

.bot-probe::before,
.bot-probe::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.bot-probe::before {
    inset: 16%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 16%, transparent);
    box-shadow: inset 0 0 10px color-mix(in srgb, var(--bot-color) 8%, transparent);
}

.bot-probe::after {
    inset: 12%;
    border-radius: 50%;
    background: conic-gradient(from 180deg, transparent 0deg, color-mix(in srgb, var(--bot-accent) 24%, transparent) 36deg, transparent 84deg, transparent 360deg);
    opacity: 0.78;
}

.bot-probe-arm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54%;
    height: 2px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bot-color) 70%, transparent), transparent);
    transform-origin: 0 50%;
    transform: translate(0, -50%);
}
.bot-probe-arm.a-1 { transform: translate(0, -50%) rotate(0deg); }
.bot-probe-arm.a-2 { transform: translate(0, -50%) rotate(120deg); }
.bot-probe-arm.a-3 { transform: translate(0, -50%) rotate(240deg); }

.bot-probe-core {
    position: absolute;
    inset: 34%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, white 0%, var(--bot-accent) 50%, var(--bot-color) 100%);
    box-shadow: 0 0 18px color-mix(in srgb, var(--bot-color) 70%, transparent);
}

.bot-probe-pulse {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 50%, transparent);
    animation: luna-probe-pulse 3.2s ease-out infinite;
}

@keyframes luna-probe-pulse {
    0%   { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.3); opacity: 0; }
}

/* Default orb */
.bot-orb {
    position: relative;
}
.bot-orb-core {
    position: absolute;
    inset: 18%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, white 0%, var(--bot-accent) 50%, var(--bot-color) 100%);
    box-shadow: 0 0 22px color-mix(in srgb, var(--bot-color) 70%, transparent);
}

/* Selected orb */
.luna-bot-orb.selected .luna-bot-aura {
    transform: scale(1.4);
    opacity: 1;
}

.luna-bot-orb.selected::after {
    content: '';
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--bot-color) 72%, white);
    animation: luna-selected-ping 2.4s ease-out infinite;
    pointer-events: none;
}

.luna-bot-orb.selected.activity-flat::after,
.luna-bot-orb.selected.activity-waiting::after {
    inset: -4%;
    opacity: 0.72;
}

@keyframes luna-selected-ping {
    0%   { transform: scale(0.96); opacity: 0.95; }
    100% { transform: scale(1.28); opacity: 0; }
}

.luna-bot-orb.event-profit,
.luna-bot-orb.event-loss,
.luna-bot-orb.event-entry {
    z-index: 14;
}

.luna-bot-orb.event-profit .luna-bot-aura {
    animation: luna-event-profit 1.1s ease-out;
}

.luna-bot-orb.event-loss .luna-bot-aura {
    animation: luna-event-loss 1.1s ease-out;
}

.luna-bot-orb.event-entry .luna-bot-aura {
    animation: luna-event-entry 1.1s ease-out;
}

@keyframes luna-event-profit {
    0% { transform: scale(1); opacity: 0.9; }
    40% { transform: scale(1.38); opacity: 1; filter: blur(4px); }
    100% { transform: scale(1.06); opacity: 0.82; }
}

@keyframes luna-event-loss {
    0% { transform: scale(1); opacity: 0.9; }
    30% { transform: scale(0.88); opacity: 0.95; filter: blur(5px) grayscale(0.15); }
    100% { transform: scale(1.02); opacity: 0.68; }
}

@keyframes luna-event-entry {
    0% { transform: scale(1); opacity: 0.9; }
    40% { transform: scale(1.32); opacity: 1; }
    100% { transform: scale(1.08); opacity: 0.80; }
}

.luna-bot-label {
    --label-shift-x: 0px;
    --label-shift-y: 0px;
    position: absolute;
    left: 50%;
    bottom: -28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    max-width: 140px;
    padding: 5px 10px;
    border: 1px solid color-mix(in srgb, var(--bot-color) 26%, var(--border-default));
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-deepest) 80%, transparent);
    backdrop-filter: blur(12px);
    color: color-mix(in srgb, var(--text-primary) 88%, var(--bot-accent));
    font-size: 10px;
    line-height: 1.1;
    font-weight: 740;
    letter-spacing: 0.2px;
    text-align: center;
    transform: translate(calc(-50% + var(--label-shift-x)), var(--label-shift-y));
    text-shadow: 0 0 10px color-mix(in srgb, var(--bg-deepest) 90%, transparent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--bg-deepest) 46%, transparent);
}

.luna-bot-orb.label-top .luna-bot-label {
    top: -28px;
    bottom: auto;
}

.luna-bot-orb.label-left .luna-bot-label { --label-shift-x: -4px; }
.luna-bot-orb.label-right .luna-bot-label { --label-shift-x: 4px; }

.luna-bot-orb.activity-live .luna-bot-label {
    border-color: color-mix(in srgb, var(--bot-color) 48%, var(--border-strong));
    box-shadow:
        0 8px 22px color-mix(in srgb, var(--bg-deepest) 44%, transparent),
        0 0 18px color-mix(in srgb, var(--bot-color) 16%, transparent);
}

.luna-bot-orb.activity-pending .luna-bot-label {
    border-style: dashed;
}

/* ==========================================================================
   FATHER (sun-like)
   ========================================================================== */

.luna-father {
    position: absolute;
    top: 56px;
    right: 28px;
    z-index: 12;
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 10px 18px 10px 8px;
    border: 1px solid rgba(240,180,30,0.24);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(44,32,10,0.82), rgba(22,16,32,0.74));
    backdrop-filter: blur(16px);
    color: rgba(255,255,255,0.88);
    cursor: pointer;
    transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.luna-father:hover {
    transform: translateY(-2px);
    border-color: rgba(240,180,30,0.52);
    box-shadow: 0 14px 32px rgba(0,0,0,0.44), 0 0 32px rgba(240,180,30,0.20);
}

.luna-father.active {
    border-color: rgba(240,180,30,0.65);
    box-shadow: 0 0 28px rgba(240,180,30,0.32);
}

.luna-father-orb {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.luna-father-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--luna-father-glow) 50%, transparent));
    animation: luna-father-spin 36s linear infinite;
}

.luna-father.active .luna-father-svg {
    animation: luna-father-spin 16s linear infinite, luna-father-pulse 2.4s ease-in-out infinite;
}

.father-corona {
    transform-origin: 50% 50%;
    animation: luna-father-corona-pulse 5s ease-in-out infinite;
}

@keyframes luna-father-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes luna-father-pulse {
    0%, 100% { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--luna-father-glow) 50%, transparent)); }
    50%      { filter: drop-shadow(0 0 22px color-mix(in srgb, var(--luna-father-glow) 85%, transparent)); }
}
@keyframes luna-father-corona-pulse {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50%      { transform: scale(1.12); opacity: 0.95; }
}

/* Solar flares around FATHER */
.luna-father-flare {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-father-glow) 70%, transparent), transparent);
    box-shadow: 0 0 10px color-mix(in srgb, var(--luna-father-color) 50%, transparent);
    transform-origin: 50% 50%;
    pointer-events: none;
    opacity: 0.7;
}

.luna-father-flare-1 { transform: translate(-50%, -50%) rotate(0deg);   animation: luna-flare-pulse 2.6s ease-in-out infinite; }
.luna-father-flare-2 { transform: translate(-50%, -50%) rotate(45deg);  animation: luna-flare-pulse 2.4s ease-in-out 200ms infinite; }
.luna-father-flare-3 { transform: translate(-50%, -50%) rotate(90deg);  animation: luna-flare-pulse 2.8s ease-in-out 400ms infinite; }
.luna-father-flare-4 { transform: translate(-50%, -50%) rotate(135deg); animation: luna-flare-pulse 2.2s ease-in-out 600ms infinite; }

@keyframes luna-flare-pulse {
    0%, 100% { opacity: 0.2; transform-origin: 50% 50%; }
    50%      { opacity: 0.95; }
}

.luna-father-text {
    display: grid;
    line-height: 1.1;
}

.luna-father-text strong {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--luna-father-glow) 86%, transparent);
}

.luna-father-text em {
    font-size: 10px;
    font-style: normal;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ==========================================================================
   HUD (BOTTOM)
   ========================================================================== */

.luna-hud {
    position: absolute;
    left: 50%;
    bottom: 18px;
    z-index: 12;
    display: flex;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--bg-surface) 88%, transparent),
        color-mix(in srgb, var(--bg-deepest) 82%, transparent));
    backdrop-filter: blur(22px);
    box-shadow:
        0 20px 52px color-mix(in srgb, var(--bg-deepest) 58%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.04);
    transform: translateX(-50%);
    transition: opacity 360ms ease, transform 360ms ease;
}

.mode-creation .luna-hud {
    opacity: 0;
    transform: translateX(-50%) translateY(40px);
    pointer-events: none;
}

.luna-hud-cell {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 136px;
    padding: 9px 20px;
    color: color-mix(in srgb, var(--text-primary) 88%, var(--text-secondary));
    font-size: 13px;
    position: relative;
}

.luna-hud-stack {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.luna-hud-stack span {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.luna-hud-cell + .luna-hud-cell::before {
    content: '';
    position: absolute;
    left: 0;
    top: 22%;
    height: 56%;
    width: 1px;
    background: rgba(255,255,255,0.08);
}

.luna-hud-cell i {
    color: color-mix(in srgb, var(--accent-purple-hover) 72%, var(--text-secondary));
    font-size: 13px;
    filter: drop-shadow(0 0 8px color-mix(in srgb, currentColor 32%, transparent));
}

.luna-hud-cell:nth-child(1) i { color: var(--accent-purple-hover); }
.luna-hud-cell:nth-child(2) i { color: var(--accent-blue-hover); }
.luna-hud-cell:nth-child(3) i { color: var(--accent-rose-hover); }
.luna-hud-cell:nth-child(4) i { color: var(--accent-cyan-hover); }
.luna-hud-cell:nth-child(5) i { color: var(--accent-amber-hover); }

.luna-hud-cell label {
    color: color-mix(in srgb, var(--text-secondary) 72%, transparent);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.6px;
}

.luna-hud-cell .pnl-positive { color: var(--luna-profit); }
.luna-hud-cell .pnl-negative { color: var(--luna-loss); }

/* Running bots: pulse the Running cell icon */
.luna-hud.has-running .luna-hud-cell:nth-child(4) i {
    animation: luna-hud-running-pulse 2.2s ease-in-out infinite;
}

@keyframes luna-hud-running-pulse {
    0%, 100% { opacity: 0.72; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent-cyan) 30%, transparent)); }
    50%      { opacity: 1;    filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent-cyan) 70%, transparent)); }
}

.luna-event-badge {
    position: absolute;
    left: var(--luna-scene-x);
    top: calc(var(--luna-scene-y) - 148px);
    z-index: 13;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(7, 10, 20, 0.78);
    backdrop-filter: blur(16px);
    color: rgba(255,255,255,0.94);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    transform: translate(-50%, 16px) scale(0.92);
    opacity: 0;
    pointer-events: none;
}

.luna-event-badge.show {
    animation: luna-event-badge-pop 1.15s ease-out forwards;
}

.luna-event-badge.profit {
    color: color-mix(in srgb, var(--luna-profit) 90%, white);
    border-color: color-mix(in srgb, var(--luna-profit) 45%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--luna-profit) 20%, transparent);
}
.luna-event-badge.loss {
    color: color-mix(in srgb, var(--luna-loss) 80%, white);
    border-color: color-mix(in srgb, var(--luna-loss) 45%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--luna-loss) 18%, transparent);
}
.luna-event-badge.entry {
    color: color-mix(in srgb, var(--luna-accent-hover) 90%, white);
    border-color: color-mix(in srgb, var(--luna-accent) 45%, transparent);
    box-shadow: 0 0 28px color-mix(in srgb, var(--luna-accent) 18%, transparent);
}

@keyframes luna-event-badge-pop {
    0% { opacity: 0; transform: translate(-50%, 22px) scale(0.86); }
    16% { opacity: 1; transform: translate(-50%, 0) scale(1.02); }
    70% { opacity: 1; transform: translate(-50%, -10px) scale(1.03); }
    100% { opacity: 0; transform: translate(-50%, -22px) scale(0.94); }
}

/* ==========================================================================
   DETAIL DOCK
   ========================================================================== */

.luna-detail {
    position: absolute;
    left: 50%;
    bottom: 112px;
    z-index: 18;
    width: min(880px, calc(100vw - 64px));
    padding: 20px 22px;
    border: 1px solid color-mix(in srgb, var(--bot-accent, var(--accent-purple-hover)) 20%, var(--border-default));
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 6%, color-mix(in srgb, var(--bot-color, var(--accent-purple)) 16%, transparent), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--bg-surface) 90%, transparent), color-mix(in srgb, var(--bg-deepest) 88%, transparent));
    backdrop-filter: blur(22px);
    box-shadow:
        0 28px 68px color-mix(in srgb, var(--bg-deepest) 62%, transparent),
        inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
    display: none;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: opacity 280ms ease, transform 280ms cubic-bezier(0.16, 0.9, 0.24, 1);
}

.luna-detail.open {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mode-creation .luna-detail {
    opacity: 0;
    pointer-events: none;
}

.luna-detail header {
    display: flex;
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.luna-detail-emblem {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
}

.luna-emblem {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
}

.luna-emblem .luna-bot-aura,
.luna-emblem .luna-bot-shield,
.luna-emblem .luna-bot-link {
    display: none;
}

.luna-emblem .luna-bot-shell {
    inset: 8%;
}

.luna-emblem .luna-bot-body {
    inset: 10%;
    transform: none !important;
    animation: none !important;
}

.luna-emblem .bot-streak,
.luna-emblem .bot-comet {
    overflow: hidden;
}

.luna-emblem .bot-streak-trail,
.luna-emblem .bot-comet-tail,
.luna-emblem .bot-streak::before,
.luna-emblem .bot-comet::before {
    width: 32px;
}

.luna-emblem .bot-rocket-flame {
    display: none;
}

.luna-detail header div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.luna-detail-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.luna-detail header strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luna-symbol-link {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-full);
    border: 1px solid color-mix(in srgb, var(--bot-accent) 34%, var(--border-default));
    background: color-mix(in srgb, var(--bot-color) 10%, transparent);
    color: color-mix(in srgb, var(--bot-accent) 84%, var(--text-primary));
    text-decoration: none;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.luna-symbol-link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--bot-accent) 64%, var(--border-focus));
    background: color-mix(in srgb, var(--bot-color) 18%, transparent);
}

.luna-detail-state {
    display: inline-flex;
    gap: 6px;
    align-items: flex-start;
    min-width: 0;
    font-size: 10px;
    line-height: 1.45;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.66);
}

.luna-detail-state .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}

.luna-detail-state.state-live { color: var(--luna-profit); }
.luna-detail-state.state-live .dot {
    background: var(--luna-profit);
    box-shadow: 0 0 10px var(--luna-profit);
    animation: luna-state-pulse 1.6s ease-in-out infinite;
}

@keyframes luna-state-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.4); opacity: 0.6; }
}

.luna-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.luna-detail-grid .luna-detail-metric {
    display: grid;
    gap: 5px;
    min-width: 0;
    min-height: 60px;
    padding: 10px 12px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--bg-surface) 72%, transparent);
    border: 1px solid color-mix(in srgb, var(--bot-accent, var(--accent-purple-hover)) 14%, var(--border-subtle));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
}

.luna-detail-grid .luna-detail-pnl {
    min-width: 92px;
}

.luna-detail-grid label {
    color: rgba(255,255,255,0.50);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    font-weight: 500;
}

.luna-detail-grid strong {
    color: rgba(255,255,255,0.96);
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luna-detail-grid strong i {
    margin-right: 4px;
}

.luna-detail-grid .luna-engine-chip {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    color: color-mix(in srgb, var(--bot-accent) 90%, var(--text-primary));
    text-shadow: 0 0 14px color-mix(in srgb, var(--bot-color) 72%, transparent);
}

.luna-detail-grid .luna-engine-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luna-detail-grid strong.pnl-positive { color: var(--luna-profit); }
.luna-detail-grid strong.pnl-negative { color: var(--luna-loss); }

.luna-detail-note {
    padding: 12px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-surface) 62%, transparent);
    border: 1px solid color-mix(in srgb, var(--bot-accent, var(--accent-purple-hover)) 12%, var(--border-subtle));
    color: color-mix(in srgb, var(--text-primary) 78%, var(--text-secondary));
    font-size: 11.5px;
    line-height: 1.5;
}

.luna-detail footer {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.luna-detail footer button {
    min-height: 44px;
    border: 1px solid var(--luna-glass-border);
    border-radius: 999px;
    background: var(--luna-glass-bg-soft);
    color: rgba(255,255,255,0.80);
    cursor: pointer;
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.luna-detail footer button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--luna-glass-border-strong);
    background: var(--luna-glass-bg-hover);
}

.luna-detail footer button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.luna-detail footer .primary {
    border-color: color-mix(in srgb, var(--luna-profit) 55%, transparent);
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--luna-profit) 30%, rgba(16,18,28,0.92)),
        rgba(18,20,28,0.92));
    color: color-mix(in srgb, var(--luna-profit) 90%, white);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.luna-detail footer .primary:hover {
    box-shadow: 0 0 26px color-mix(in srgb, var(--luna-profit) 38%, transparent);
}

/* Shared keyboard focus for Luna's non-native visual controls. */
.luna-core:focus-visible,
.luna-father:focus-visible,
.luna-bot-orb:focus-visible,
.luna-dim-orb:focus-visible,
.luna-detail footer button:focus-visible,
.luna-drawer-close:focus-visible,
.luna-inline button:focus-visible,
.luna-candidate:focus-visible,
.luna-scan-segment button:focus-visible,
.luna-scan-run:focus-visible,
.luna-actions button:focus-visible,
.luna-adv-toggle:focus-visible,
.luna-perspective-card:focus-visible {
    outline: none;
    box-shadow: var(--luna-focus-ring);
}

/* ==========================================================================
   CREATION MODE: rail (dimension orbiters), scene, drawer
   ========================================================================== */

.luna-creation-rail,
.luna-creation-scene,
.luna-drawer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 360ms ease;
}

.mode-creation .luna-creation-rail,
.mode-creation .luna-creation-scene,
.mode-creation .luna-drawer {
    opacity: 1;
    pointer-events: auto;
}

.luna-creation-rail { z-index: 8; }
.luna-creation-scene { z-index: 5; pointer-events: none; }
.luna-drawer { z-index: 14; }

/* Dimension orbiters around the moon */
.luna-dim-orb {
    position: absolute;
    width: 140px;
    height: 140px;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    color: rgba(255,255,255,0.90);
    transform: translate(-50%, -50%);
    transition: transform 400ms cubic-bezier(0.16, 0.9, 0.24, 1), filter 400ms ease;
    animation: luna-dim-arrive 700ms cubic-bezier(0.16, 0.9, 0.24, 1) both;
}

.luna-dim-orb.pos-solo             { left: var(--luna-scene-x); top: calc(var(--luna-scene-y) - var(--luna-dim-radius-y)); }
.luna-dim-orb.pos-grid             { left: calc(var(--luna-scene-x) + var(--luna-dim-radius-x)); top: var(--luna-scene-y); }
.luna-dim-orb.pos-signal_to_signal { left: var(--luna-scene-x); top: calc(var(--luna-scene-y) + var(--luna-dim-radius-y)); }
.luna-dim-orb.pos-latency          { left: calc(var(--luna-scene-x) - var(--luna-dim-radius-x)); top: var(--luna-scene-y); }

.luna-dim-orb:hover {
    filter: brightness(1.18);
    transform: translate(-50%, -50%) scale(1.10);
}

.luna-dim-orb.active {
    transform: translate(-50%, -50%) scale(1.10);
    filter: brightness(1.18);
}

@keyframes luna-dim-arrive {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.3); filter: blur(4px); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: blur(0); }
}

.luna-dim-orb::before {
    content: '';
    position: absolute;
    inset: -14%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--d-color) 20%, transparent), transparent 58%);
    filter: blur(6px);
    pointer-events: none;
    animation: luna-dim-glow-breathe 4s ease-in-out infinite;
}

@keyframes luna-dim-glow-breathe {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.06); }
}

.luna-dim-shell {
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--d-color) 34%, rgba(255,255,255,0.14));
    background:
        radial-gradient(circle at 30% 24%, rgba(255,255,255,0.24) 0%, color-mix(in srgb, var(--d-color) 26%, transparent) 20%, transparent 48%),
        radial-gradient(circle at 50% 55%, rgba(8,10,20,0) 0%, rgba(8,10,20,0.28) 58%, rgba(8,10,20,0.42) 100%),
        color-mix(in srgb, var(--d-color) 14%, rgba(8,10,20,0.82));
    box-shadow:
        inset 0 0 26px color-mix(in srgb, var(--d-color) 14%, transparent),
        0 0 22px color-mix(in srgb, var(--d-color) 12%, transparent);
    pointer-events: none;
}

.luna-dim-orb.active::after {
    content: '';
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--d-color) 48%, white);
    animation: luna-dim-active-ping 2.8s ease-out infinite;
    pointer-events: none;
}

@keyframes luna-dim-active-ping {
    0%   { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.luna-dim-svg {
    position: absolute;
    left: 50%;
    top: 48%;
    z-index: 1;
    width: 52%;
    height: 52%;
    margin: 0;
    transform: translate(-50%, -50%);
    display: block;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--d-color) 58%, transparent));
}

.luna-dim-label {
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: max-content;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.96);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.9);
    text-align: center;
}

.luna-dim-tone {
    position: absolute;
    left: 50%;
    bottom: -22px;
    width: max-content;
    transform: translateX(-50%);
    color: var(--d-color);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.9);
    text-align: center;
    opacity: 0.85;
}

/* === Active dimension scene (orbital paths around moon) ============== */

.luna-creation-scene {
    inset: 0;
}

.luna-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Solo: arc + traveler */
.scene-solo .luna-orbit-arc {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    width: min(38vw, 400px);
    height: min(38vw, 400px);
    border: 1px solid color-mix(in srgb, var(--luna-accent) 18%, transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 0 0 48px color-mix(in srgb, var(--luna-accent) 8%, transparent);
    opacity: 0.72;
}

.scene-solo .luna-traveler {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    width: min(38vw, 400px);
    height: min(38vw, 400px);
    transform: translate(-50%, -50%);
    animation: luna-orbit-cycle-2d 22s linear infinite;
    opacity: 0.82;
}

.scene-solo .luna-traveler-trail {
    position: absolute;
    top: 0;
    left: 50%;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-accent) 72%, white));
    border-radius: 999px;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: 100% 50%;
    box-shadow: 0 0 18px color-mix(in srgb, var(--luna-accent) 60%, transparent);
}

.scene-solo .luna-traveler-body {
    position: absolute;
    top: 0;
    left: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--luna-accent) 80%, white) 50%, color-mix(in srgb, var(--luna-accent) 60%, #000));
    box-shadow: 0 0 18px color-mix(in srgb, var(--luna-accent) 80%, transparent);
    transform: translate(-50%, -50%);
}

@keyframes luna-orbit-cycle-2d {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Grid: orbital lattice with nodes */
.scene-grid .luna-grid-orbit {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 26%, transparent);
    transform: translate(-50%, -50%);
}

.scene-grid .g-1 { width: min(36vw, 380px); height: min(36vw, 380px); animation: luna-orbit-cycle-2d 32s linear infinite; }
.scene-grid .g-2 { width: min(54vw, 580px); height: min(54vw, 580px); animation: luna-orbit-cycle-2d-rev 46s linear infinite; }

.scene-grid .luna-grid-nodes {
    position: absolute;
    left: var(--luna-scene-x);
    top: var(--luna-scene-y);
    width: min(54vw, 580px);
    height: min(54vw, 580px);
    transform: translate(-50%, -50%);
    animation: luna-orbit-cycle-2d-rev 46s linear infinite;
}

.scene-grid .luna-grid-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--luna-accent) 70%, white) 50%, color-mix(in srgb, var(--luna-accent) 70%, #000));
    box-shadow: 0 0 14px color-mix(in srgb, var(--luna-accent) 70%, transparent);
}

.scene-grid .luna-grid-node.n-0 { left: 50%; top: 0; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-1 { left: 85.36%; top: 14.64%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-2 { left: 100%; top: 50%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-3 { left: 85.36%; top: 85.36%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-4 { left: 50%; top: 100%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-5 { left: 14.64%; top: 85.36%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-6 { left: 0%; top: 50%; transform: translate(-50%, -50%); }
.scene-grid .luna-grid-node.n-7 { left: 14.64%; top: 14.64%; transform: translate(-50%, -50%); }

@keyframes luna-orbit-cycle-2d-rev {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Signal-to-Signal: comet flipping */
.scene-signal .luna-signal-path {
    position: absolute;
    left: 8%;
    top: var(--luna-scene-y);
    width: 84%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--luna-accent) 22%, transparent) 12%,
        color-mix(in srgb, var(--luna-accent) 56%, transparent) 50%,
        color-mix(in srgb, var(--luna-accent) 22%, transparent) 88%,
        transparent 100%);
    transform: translateY(-50%);
    box-shadow: 0 0 16px color-mix(in srgb, var(--luna-accent) 40%, transparent);
}

.scene-signal .luna-signal-comet {
    position: absolute;
    left: 0;
    top: var(--luna-scene-y);
    width: 80px;
    height: 8px;
    transform: translateY(-50%);
    animation: luna-signal-flight 6s ease-in-out infinite;
}

.scene-signal .luna-signal-trail {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--luna-accent) 50%, transparent) 50%, color-mix(in srgb, var(--luna-accent) 90%, white) 100%);
    border-radius: 999px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--luna-accent) 70%, transparent);
}

.scene-signal .luna-signal-head {
    position: absolute;
    right: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--luna-accent) 80%, white) 50%, color-mix(in srgb, var(--luna-accent) 60%, #000));
    box-shadow: 0 0 22px color-mix(in srgb, var(--luna-accent) 80%, transparent);
    transform: translate(50%, -50%);
}

.scene-signal .luna-signal-node {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white 0%, color-mix(in srgb, var(--luna-accent) 76%, white) 45%, color-mix(in srgb, var(--luna-accent) 72%, #000) 100%);
    box-shadow: 0 0 16px color-mix(in srgb, var(--luna-accent) 50%, transparent);
    animation: luna-signal-node-pulse 2.2s ease-in-out infinite;
}

.scene-signal .luna-signal-node.s-a { top: 31%; left: 20%; }
.scene-signal .luna-signal-node.s-b { top: 64%; right: 20%; animation-delay: 1.1s; }

@keyframes luna-signal-node-pulse {
    0%, 100% { transform: scale(0.85); opacity: 0.5; }
    50% { transform: scale(1.25); opacity: 1; }
}

@keyframes luna-signal-flight {
    0%   { left: 6%;  transform: translateY(-50%) scaleX(1); }
    45%  { left: 90%; transform: translateY(-50%) scaleX(1); }
    50%  { left: 90%; transform: translateY(-50%) scaleX(-1); }
    95%  { left: 6%;  transform: translateY(-50%) scaleX(-1); }
    100% { left: 6%;  transform: translateY(-50%) scaleX(1); }
}

/* Latency: nodes + beams */
.scene-latency .luna-latency-grid {
    position: absolute;
    inset: 0;
}

.scene-latency .luna-latency-node {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, white, color-mix(in srgb, var(--luna-accent) 70%, white) 50%, color-mix(in srgb, var(--luna-accent) 60%, #000));
    box-shadow: 0 0 14px color-mix(in srgb, var(--luna-accent) 60%, transparent);
}

.scene-latency .luna-latency-node.n-0 { top: 18%; left: 14%; }
.scene-latency .luna-latency-node.n-1 { top: 12%; right: 22%; }
.scene-latency .luna-latency-node.n-2 { top: 42%; left: 8%;  }
.scene-latency .luna-latency-node.n-3 { top: 50%; right: 12%; }
.scene-latency .luna-latency-node.n-4 { bottom: 22%; left: 24%; }
.scene-latency .luna-latency-node.n-5 { bottom: 18%; right: 28%; }

.scene-latency .luna-latency-beams {
    position: absolute;
    inset: 0;
}

.scene-latency .luna-beam {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-accent) 70%, white), transparent);
    box-shadow: 0 0 12px color-mix(in srgb, var(--luna-accent) 70%, transparent);
    transform-origin: 0 50%;
    opacity: 0.6;
}

.scene-latency .luna-beam-1 {
    top: 24%; left: 14%;
    width: 280px;
    transform: rotate(8deg);
    animation: luna-beam-pulse 1.6s ease-in-out infinite;
}
.scene-latency .luna-beam-2 {
    top: 50%; left: 12%;
    width: 320px;
    transform: rotate(-6deg);
    animation: luna-beam-pulse 1.4s ease-in-out 200ms infinite;
}
.scene-latency .luna-beam-3 {
    bottom: 25%; left: 24%;
    width: 240px;
    transform: rotate(4deg);
    animation: luna-beam-pulse 1.8s ease-in-out 400ms infinite;
}

@keyframes luna-beam-pulse {
    0%, 100% { opacity: 0.2; }
    50%      { opacity: 0.85; }
}

/* === Drawer (right-side glassy form, transparent so scene shows) ===== */

.luna-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(396px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 28px 24px 96px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(160deg,
        rgba(8,10,20,0.88) 0%,
        rgba(10,12,24,0.82) 40%,
        rgba(8,10,20,0.78) 100%);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid rgba(255,255,255,0.08);
    box-shadow: -12px 0 48px rgba(0,0,0,0.38);
    transform: translateX(100%);
    transition: transform 520ms cubic-bezier(0.16, 0.9, 0.24, 1);
    opacity: 0;
    pointer-events: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.luna-drawer::-webkit-scrollbar { width: 6px; }
.luna-drawer::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 999px; }

.mode-creation .luna-drawer {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.luna-drawer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.78);
    cursor: pointer;
    transition: transform 200ms ease, border-color 200ms ease;
}

.luna-drawer-close:hover {
    transform: scale(1.08);
    border-color: rgba(255,255,255,0.32);
}

.luna-drawer-header {
    margin-bottom: 22px;
    padding-right: 48px;
}

.luna-drawer-tone {
    display: block;
    color: var(--luna-accent);
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.luna-drawer-header h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
}

.luna-drawer-header p {
    margin: 0;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Form fields */
.luna-fields {
    display: grid;
    gap: 14px;
    margin-bottom: 14px;
}

.luna-field-label {
    color: rgba(255,255,255,0.55);
    font-size: 9px;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    margin-bottom: 7px;
    display: block;
    font-weight: 500;
}

.luna-field input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--luna-glass-border);
    border-radius: 14px;
    background: var(--luna-field-bg);
    color: rgba(255,255,255,0.95);
    padding: 0 14px;
    font-size: 14px;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}

.luna-field input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--luna-accent) 64%, var(--luna-glass-border));
    box-shadow: var(--luna-focus-ring);
}

.luna-field input::placeholder {
    color: rgba(255,255,255,0.28);
}

.luna-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.luna-inline {
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 8px;
}

.luna-inline button {
    border: 1px solid var(--luna-glass-border);
    border-radius: 14px;
    background: var(--luna-glass-bg);
    color: var(--luna-accent);
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.luna-inline button:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--luna-accent) 60%, var(--luna-glass-border));
    background: color-mix(in srgb, var(--luna-accent) 14%, var(--luna-glass-bg));
}

.luna-inline button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

/* Rotation basket */
.luna-symbol-basket {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 14%, rgba(255,255,255,0.08));
    border-radius: 14px;
    background: rgba(16,18,28,0.34);
}

.luna-symbol-basket-head {
    display: flex;
    gap: 7px;
    align-items: center;
    color: rgba(255,255,255,0.56);
    font-size: 9px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.luna-symbol-basket-head i {
    color: var(--luna-accent);
}

.luna-symbol-basket-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.luna-detail-basket {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.luna-detail-basket-label {
    color: rgba(255,255,255,0.5);
    font-size: 9px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.luna-symbol-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(14,16,26,0.60);
    color: rgba(255,255,255,0.75);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: border-color 180ms ease, background 180ms ease;
}

.luna-symbol-chip.active {
    border-color: color-mix(in srgb, var(--luna-accent) 62%, rgba(255,255,255,0.10));
    background: color-mix(in srgb, var(--luna-accent) 18%, rgba(14,16,26,0.60));
    color: rgba(255,255,255,0.96);
    box-shadow: 0 0 12px color-mix(in srgb, var(--luna-accent) 20%, transparent);
}

/* Scanner controls */
.luna-scanner-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 20%, rgba(255,255,255,0.08));
    border-radius: 16px;
    background: rgba(14,16,26,0.48);
}

.luna-scanner-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    color: rgba(255,255,255,0.48);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.luna-scanner-head strong {
    color: rgba(255,255,255,0.74);
    font-size: 10px;
    letter-spacing: 1.4px;
    text-align: right;
}

.luna-scan-segment {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.luna-scan-segment button {
    min-width: 0;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    background: rgba(16,18,28,0.56);
    color: rgba(255,255,255,0.62);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.luna-scan-segment button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--luna-accent) 40%, rgba(255,255,255,0.08));
    color: rgba(255,255,255,0.86);
}

.luna-scan-segment button.active {
    border-color: color-mix(in srgb, var(--luna-accent) 62%, rgba(255,255,255,0.08));
    background: color-mix(in srgb, var(--luna-accent) 18%, rgba(16,18,28,0.56));
    color: rgba(255,255,255,0.94);
}

.luna-scan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.luna-scan-grid label {
    min-width: 0;
}

.luna-scan-grid span {
    display: block;
    margin-bottom: 5px;
    color: rgba(255,255,255,0.44);
    font-size: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.luna-scan-grid input {
    width: 100%;
    height: 34px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(16,18,28,0.58);
    color: rgba(255,255,255,0.9);
    padding: 0 10px;
    font-size: 12px;
}

.luna-scan-grid input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--luna-accent) 58%, rgba(255,255,255,0.08));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--luna-accent) 12%, transparent);
}

.luna-scan-run {
    width: 100%;
    height: 36px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 44%, var(--border-default));
    border-radius: 12px;
    background: color-mix(in srgb, var(--luna-accent) 16%, var(--bg-card));
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
}

.luna-scan-run:disabled {
    cursor: wait;
    opacity: 0.72;
}

/* Candidates */
.luna-candidates {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}

.luna-candidates-title {
    display: flex;
    gap: 6px;
    align-items: center;
    color: rgba(255,255,255,0.5);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.luna-candidates-title i { color: var(--luna-accent); }

.luna-candidate {
    position: relative;
    display: grid;
    gap: 3px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(16,18,28,0.5);
    color: rgba(255,255,255,0.78);
    text-align: left;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
    overflow: hidden;
}

.luna-candidate-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-accent) 14%, transparent), transparent);
    transform: translateX(-100%);
    transition: transform 360ms ease;
    pointer-events: none;
}

.luna-candidate:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--luna-accent) 38%, rgba(255,255,255,0.08));
}

.luna-candidate:hover .luna-candidate-glow { transform: translateX(100%); }

.luna-candidate.active {
    border-color: color-mix(in srgb, var(--luna-accent) 70%, rgba(255,255,255,0.08));
    background: color-mix(in srgb, var(--luna-accent) 16%, rgba(16,18,28,0.5));
    color: rgba(255,255,255,0.95);
}

.luna-candidate strong {
    font-size: 13px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
}

.luna-candidate span {
    color: rgba(255,255,255,0.5);
    font-size: 10px;
}

/* Fit / flight check */
.luna-fit {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    background: rgba(16,18,28,0.5);
}

.luna-fit-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.7);
}

.luna-fit-ok      { border-color: color-mix(in srgb, var(--luna-profit) 42%, transparent); }
.luna-fit-ok .luna-fit-head i { color: var(--luna-profit); }
.luna-fit-blocked { border-color: color-mix(in srgb, var(--luna-warning) 50%, transparent); }
.luna-fit-blocked .luna-fit-head i { color: var(--luna-warning); }
.luna-fit-pending .luna-fit-head i { color: rgba(255,255,255,0.4); }

.luna-fit p {
    margin: 4px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.78);
    line-height: 1.4;
}

/* Actions */
.luna-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 0 4px;
    background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--luna-accent) 10%, transparent), transparent 62%);
    border-radius: 999px;
}

.luna-actions button {
    width: 100%;
    box-sizing: border-box;
    min-height: 50px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 28%, var(--luna-glass-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--luna-accent) 8%, var(--luna-glass-bg));
    color: rgba(255,255,255,0.84);
    cursor: pointer;
    position: relative;
    overflow: clip;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    isolation: isolate;
}

.luna-actions button:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.22);
}

.luna-actions button:disabled {
    opacity: 1;
    cursor: not-allowed;
    color: color-mix(in srgb, var(--text-primary) 68%, var(--text-secondary));
    border-color: color-mix(in srgb, var(--luna-accent) 34%, var(--border-default));
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--luna-accent) 12%, transparent), transparent 58%),
        color-mix(in srgb, var(--bg-surface) 82%, transparent);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent),
        0 0 18px color-mix(in srgb, var(--luna-accent) 8%, transparent);
}

.luna-actions .primary {
    border-color: color-mix(in srgb, var(--luna-accent) 60%, rgba(255,255,255,0.08));
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--luna-accent) 38%, rgba(16,18,28,0.92)),
        rgba(18,20,28,0.92));
    color: rgba(255,255,255,0.95);
    font-weight: 600;
}

.luna-actions .primary:hover:not(:disabled) {
    box-shadow: 0 0 28px color-mix(in srgb, var(--luna-accent) 38%, transparent);
}

.luna-action-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-accent) 28%, transparent), transparent);
    transform: translateX(-100%);
    transition: transform 720ms ease;
    pointer-events: none;
}

.luna-actions .primary:hover:not(:disabled) .luna-action-glow {
    transform: translateX(100%);
}

.luna-actions button:disabled .luna-action-glow {
    display: none;
}

/* Advanced */
.luna-advanced {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    overflow: hidden;
    transition: grid-template-rows 280ms ease, opacity 220ms ease, margin 220ms ease;
}

.luna-advanced.open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-bottom: 14px;
}

.luna-advanced > * { min-height: 0; }

.luna-advanced header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
    color: rgba(255,255,255,0.45);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.luna-advanced header strong { color: rgba(255,255,255,0.7); }

.luna-module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.luna-module-grid div {
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 18%, rgba(255,255,255,0.06));
    border-radius: 12px;
    background: rgba(16,18,28,0.5);
}

.luna-module-grid span {
    color: rgba(255,255,255,0.45);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.luna-module-grid strong {
    color: rgba(255,255,255,0.78);
    font-size: 12px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 2px;
}

.luna-adv-controls {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.luna-adv-section {
    padding: 11px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 18%, var(--border-subtle));
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--bg-card) 72%, transparent);
}

.luna-adv-section > strong {
    display: block;
    margin-bottom: 9px;
    color: color-mix(in srgb, var(--text-primary) 72%, var(--luna-accent));
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.luna-adv-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: color-mix(in srgb, var(--text-primary) 72%, var(--luna-accent));
    cursor: pointer;
}

.luna-adv-toggle strong {
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.luna-adv-toggle i {
    color: var(--text-muted);
    font-size: 10px;
}

.luna-adv-section.open .luna-adv-toggle {
    margin-bottom: 9px;
}

.luna-adv-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.luna-adv-field {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.luna-adv-field.wide {
    grid-column: span 1;
}

.luna-adv-field span {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.luna-adv-field input,
.luna-adv-field select {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-base) 86%, transparent);
    color: var(--text-primary);
    font: 700 11px var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    outline: none;
}

.luna-adv-field input:focus,
.luna-adv-field select:focus {
    border-color: color-mix(in srgb, var(--luna-accent) 68%, var(--border-focus));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--luna-accent) 18%, transparent);
}

.luna-adv-locked strong {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--bg-base) 86%, transparent);
    color: color-mix(in srgb, var(--text-primary) 80%, var(--luna-accent));
    font: 800 11px var(--font-mono, ui-monospace, SFMono-Regular, monospace);
    text-transform: uppercase;
}

/* Messages */
.luna-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(16,18,28,0.66);
    color: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.06);
}

.luna-message.error {
    color: color-mix(in srgb, var(--luna-loss) 80%, white);
    border-color: color-mix(in srgb, var(--luna-loss) 32%, transparent);
    background: rgba(40,16,28,0.72);
}

.luna-message.success {
    color: color-mix(in srgb, var(--luna-profit) 90%, white);
    border-color: color-mix(in srgb, var(--luna-profit) 32%, transparent);
    background: rgba(8,32,24,0.72);
}

.luna-message.info {
    color: color-mix(in srgb, var(--luna-accent-hover) 85%, transparent);
    border-color: color-mix(in srgb, var(--luna-accent) 28%, transparent);
}

/* Creation entry/exit transitions */
.creation-entering .luna-bots,
.creation-exiting .luna-bots {
    transition: opacity 600ms ease, transform 600ms cubic-bezier(0.18, 0.9, 0.22, 1);
}

.creation-igniting .luna-core {
    animation: luna-ignite 800ms cubic-bezier(0.18, 0.9, 0.22, 1);
}

@keyframes luna-ignite {
    0%   { transform: translate(-50%, -50%) scale(1.22); filter: brightness(1.15); }
    35%  { transform: translate(-50%, -50%) scale(1.52); filter: brightness(1.7) saturate(1.5); }
    100% { transform: translate(-50%, -50%) scale(1.22); filter: brightness(1.15); }
}

/* ==========================================================================
   PERFORMANCE BASELINE
   Static ambience by default. Motion is reserved for meaningful bot/trade/FATHER
   states, not decorative meteors/rocks/background drift.
   ========================================================================== */

.luna-comets,
.luna-asteroids,
.luna-cosmic-dust,
.luna-distant-planets {
    display: none !important;
}

.luna-stars-far,
.luna-stars-mid,
.luna-stars-near,
.luna-stars span,
.luna-aurora-1,
.luna-aurora-2,
.luna-cosmic-galaxy,
.luna-deep-orb,
.luna-neb-1,
.luna-neb-2,
.luna-neb-3,
.luna-reactive-bloom,
.luna-ring-1,
.luna-ring-2,
.luna-ring-3,
.luna-ring-4 {
    animation: none !important;
}

.luna-aurora { filter: blur(44px); opacity: 0.18; }
.luna-nebula { filter: blur(42px); opacity: 0.48; }
.luna-reactive-bloom { filter: blur(28px); opacity: 0.08; }
.luna-stars { will-change: auto; }
.luna-stars span { opacity: var(--max-opacity, 0.34); transform: none; }

@media (max-width: 760px) {
    .luna-cosmic-galaxy,
    .luna-deep-orbs,
    .luna-neb-3,
    .luna-stars-near {
        display: none !important;
    }
    .luna-aurora { filter: blur(32px); opacity: 0.14; }
    .luna-nebula { filter: blur(30px); opacity: 0.36; }
    .luna-reactive-backdrop { display: none; }
}

/* ==========================================================================
   REDUCED MOTION + MOBILE
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .luna-stars span,
    .luna-stars-far,
    .luna-stars-mid,
    .luna-stars-near,
    .luna-neb-1, .luna-neb-2, .luna-neb-3,
    .luna-aurora-1, .luna-aurora-2,
    .luna-cosmic-galaxy,
    .luna-deep-orb,
    .luna-ring-1, .luna-ring-2, .luna-ring-3, .luna-ring-4,
    .luna-core-halo, .luna-core-corona, .luna-core-shimmer, .luna-core-moon,
    .luna-orbit-wrap, .luna-bot-orb,
    .luna-bot-orb.health-good.running .luna-bot-aura,
    .luna-bot-orb.motion-solo .bot-rocket,
    .luna-bot-orb.motion-cluster .bot-cluster,
    .luna-bot-orb.motion-comet .bot-comet,
    .luna-bot-orb.motion-streak .bot-streak,
    .luna-bot-orb.motion-probe .bot-probe,
    .bot-rocket-flame, .bot-cluster-grid, .bot-cluster-node,
    .bot-comet-tail, .bot-streak-head, .bot-streak-spark, .bot-probe-pulse,
    .luna-bot-orb.selected::after,
    .luna-ambient-comet, .luna-distant-planet, .luna-asteroid, .luna-dust-particle,
    .luna-father-svg, .father-corona, .luna-father-flare,
    .luna-hud.has-running .luna-hud-cell:nth-child(4) i,
    .luna-dim-orb,
    .scene-solo .luna-traveler,
    .scene-grid .g-1, .scene-grid .g-2, .scene-grid .luna-grid-nodes,
    .scene-signal .luna-signal-comet,
    .scene-latency .luna-beam {
        animation: none !important;
    }
}

@media (max-width: 900px) {
    .luna-detail.open {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .luna-detail-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .luna-core { width: 192px; height: 192px; }
    .luna-bot-orb { width: 76px; height: 76px; }
    .luna-father { top: 56px; right: 12px; padding: 6px 10px 6px 6px; }
    .luna-father-orb { width: 36px; height: 36px; }
    .luna-father-text { display: none; }
    .luna-hud {
        width: calc(100vw - 24px);
        justify-content: center;
        flex-wrap: wrap;
        border-radius: 24px;
    }
    .luna-hud-cell {
        min-width: calc(50% - 12px);
        justify-content: center;
    }
    .luna-hud-cell label { display: none; }
    .luna-detail.open {
        width: calc(100vw - 24px);
        max-height: calc(100vh - var(--header-height, 56px) - var(--mobile-nav-height, 60px) - 28px);
        bottom: calc(var(--mobile-nav-height, 60px) + 12px);
        padding: 14px;
        overflow-y: auto;
        border-radius: 20px;
    }
    .luna-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .luna-drawer {
        width: 100vw;
        max-height: calc(100vh - var(--header-height, 56px) - var(--mobile-nav-height, 60px));
        top: var(--header-height, 56px);
        bottom: var(--mobile-nav-height, 60px);
        padding: 18px 16px 80px;
    }
    .luna-dim-orb { width: 96px; height: 96px; }
    .luna-dim-label { font-size: 11px; }
    .luna-dim-tone  { display: none; }
    /* Prevent signal_to_signal bottom label from overlapping the HUD */
    .luna-dim-orb.pos-signal_to_signal .luna-dim-label {
        bottom: -2px;
    }
    .luna-cosmic-galaxy { display: none; }
}

/* ── Perspective Cards (Solo/Grid flight posture) ─────────────────── */
.luna-perspective-strip {
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--luna-accent) 18%, var(--luna-glass-border));
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--luna-accent) 10%, transparent), transparent 58%),
        color-mix(in srgb, var(--bg-surface) 58%, transparent);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 4%, transparent);
}
.luna-perspective-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: color-mix(in srgb, var(--text-primary) 64%, var(--text-secondary));
    margin-bottom: 10px;
}
.luna-perspective-head::before,
.luna-perspective-head::after {
    content: '';
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--luna-accent) 34%, transparent));
}
.luna-perspective-head::after { transform: scaleX(-1); }
.luna-perspective-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.luna-perspective-card {
    min-height: 92px;
    background: color-mix(in srgb, var(--bg-surface) 74%, transparent);
    border: 1px solid color-mix(in srgb, var(--luna-accent) 12%, var(--border-default));
    border-radius: 18px;
    padding: 11px 9px;
    cursor: pointer;
    text-align: center;
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease, color 220ms ease;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    align-items: center;
    justify-items: center;
    gap: 5px;
    color: color-mix(in srgb, var(--text-primary) 58%, var(--text-secondary));
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 5%, transparent);
}
.luna-perspective-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 8%, color-mix(in srgb, var(--luna-accent) 12%, transparent), transparent 54%);
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}
.luna-perspective-card:hover {
    background: color-mix(in srgb, var(--bg-surface) 84%, transparent);
    border-color: color-mix(in srgb, var(--luna-accent) 34%, var(--border-default));
    color: var(--text-primary);
    transform: translateY(-2px);
}
.luna-perspective-card:hover::before { opacity: 0.8; }
.luna-perspective-card.active {
    background:
        radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--luna-accent) 30%, transparent), transparent 60%),
        color-mix(in srgb, var(--luna-accent) 18%, var(--bg-surface));
    border-color: color-mix(in srgb, var(--luna-accent) 58%, var(--border-strong));
    color: color-mix(in srgb, var(--luna-accent) 86%, white);
    box-shadow: 0 0 22px color-mix(in srgb, var(--luna-accent) 22%, transparent), inset 0 1px 0 color-mix(in srgb, white 8%, transparent);
    transform: translateY(-2px);
}
.luna-perspective-orb {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    color: color-mix(in srgb, var(--luna-accent) 76%, var(--text-primary));
    background: color-mix(in srgb, var(--luna-accent) 12%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--luna-accent) 14%, transparent);
    font-size: 16px;
    position: relative;
    z-index: 1;
}
.luna-perspective-card.active .luna-perspective-orb {
    color: color-mix(in srgb, var(--luna-accent) 80%, white);
    background: color-mix(in srgb, var(--luna-accent) 22%, transparent);
    box-shadow: 0 0 22px color-mix(in srgb, var(--luna-accent) 32%, transparent);
}
.luna-perspective-copy,
.luna-perspective-desc,
.luna-perspective-thumbs { position: relative; z-index: 1; }
.luna-perspective-copy { display: grid; gap: 2px; }
.luna-perspective-label {
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}
.luna-perspective-tone {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.62;
}
.luna-perspective-desc {
    max-width: 100%;
    font-size: 8.5px;
    line-height: 1.25;
    color: color-mix(in srgb, currentColor 68%, transparent);
    min-height: 22px;
    overflow: hidden;
}
.luna-perspective-thumbs {
    display: flex;
    gap: 4px;
    width: 100%;
    justify-content: center;
}
.luna-perspective-thumbs span {
    max-width: 48%;
    padding: 2px 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--luna-accent) 14%, transparent);
    font-size: 7px;
    opacity: 0.72;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Entry Health Badge ──────────────────────────────────────────── */
.luna-world-hidden { display: none !important; }

.luna-health-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1.3;
}
.luna-health-badge.luna-health-clean {
    color: var(--luna-profit);
    background: var(--luna-profit-dim);
}
.luna-health-badge.luna-health-ok {
    color: var(--luna-accent);
    background: var(--luna-accent-dim);
}
.luna-health-badge.luna-health-warn {
    color: var(--luna-warning);
    background: var(--luna-warning-dim);
}
