:root {
  --bg-space: #070B19;
  --surface-space: #111827;
  --surface-variant: #1E293B;
  --cyan: #00E5FF;
  --rose: #F43F5E;
  --gold: #F59E0B;
  --emerald: #10B981;
  --violet: #A855F7;
  --coral: #FF6B4A;
  --star-white: #F8FAFC;
  --nebula-gray: #94A3B8;
  --touch-glow: #38BDF8;
  --touch-shimmer-color: rgba(56, 189, 248, 0.22);
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-space);
  color: var(--star-white);
  font-family: var(--font-body);
  overflow: hidden;
}

#app-shell {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #111B38 0%, var(--bg-space) 70%);
}

@media (min-width: 860px) {
  #app-shell {
    flex-direction: row;
  }
}

/* ============================================================================
   ASTRO TOUCH EFFECT (100% FIDÈLE À AstroTouchEffect.kt)
   1. Respiration continue (scale 1.0 <-> 1.018) & bordure néon pulsante
   2. Balayage diagonal lumineux continu (shimmer sweep)
   3. Points lumineux d'interactivité dans les coins haut-droit (blanc) et bas-gauche (couleur)
   4. Rebond élastique (scale 0.91) + flash radial + onde de choc circulaire au clic
   ============================================================================ */
@keyframes astroIdleBreathe {
  0% {
    transform: scale(1);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.22), inset 0 0 6px rgba(56, 189, 248, 0.10);
  }
  100% {
    transform: scale(1.018);
    box-shadow: 0 0 16px var(--touch-glow, #38BDF8), inset 0 0 12px rgba(255, 255, 255, 0.14);
  }
}

@keyframes astroShimmerSweep {
  0% {
    transform: translateX(-140%) skewX(-24deg);
  }
  100% {
    transform: translateX(240%) skewX(-24deg);
  }
}

@keyframes astroDotsPulse {
  0% {
    opacity: 0.62;
  }
  100% {
    opacity: 1;
  }
}

@keyframes astroShockwaveExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0.92;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.35);
    opacity: 0;
  }
}

/* Pause toutes les animations CSS dans les vues masquées pour économiser le GPU et éviter tout plantage */
.screen-view:not(.active),
.screen-view:not(.active) *,
.screen-view:not(.active) *::before,
.screen-view:not(.active) *::after {
  animation-play-state: paused !important;
}

.astro-touch,
.btn,
.chip-btn,
.nav-item,
.icon-btn,
.export-pill-btn,
.glossary-cta-btn,
.color-card,
.level-card.unlocked,
.level-play-icon,
.virtue-option-btn,
.meditation-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1.5px solid var(--touch-glow, rgba(56, 189, 248, 0.65));
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.2s ease,
              box-shadow 0.2s ease,
              background-color 0.2s ease;
}

/* Pulsation continue réservée aux boutons d'action principaux et au secteur courant (évite 400+ calques GPU simultanés sur les 135 cartes) */
.btn,
.chip-btn,
.nav-item,
.icon-btn,
.export-pill-btn,
.glossary-cta-btn,
.color-card.selected,
.level-card.current,
.level-play-icon,
.virtue-option-btn,
.level-card.unlocked:hover,
.meditation-card:hover {
  animation: astroIdleBreathe 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* 1. Balayage lumineux diagonal (shimmer) sur les boutons cliquables */
.btn::before,
.chip-btn::before,
.nav-item::before,
.icon-btn::before,
.export-pill-btn::before,
.glossary-cta-btn::before,
.color-card::before,
.level-card.current::before,
.level-play-icon::before,
.virtue-option-btn::before,
.level-card.unlocked:hover::before,
.meditation-card:hover::before {
  content: "";
  position: absolute;
  top: -10%;
  left: 0;
  width: 52%;
  height: 120%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    var(--touch-shimmer-color, rgba(56, 189, 248, 0.20)) 30%,
    rgba(255, 255, 255, 0.30) 50%,
    var(--touch-shimmer-color, rgba(56, 189, 248, 0.20)) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 2;
  animation: astroShimmerSweep 2.4s linear infinite;
}

/* 2. Points lumineux d'angle en haut-droite (blanc) et bas-gauche (glowColor) */
.astro-touch::after,
.btn::after,
.chip-btn::after,
.nav-item::after,
.icon-btn::after,
.export-pill-btn::after,
.glossary-cta-btn::after,
.color-card::after,
.level-card.unlocked::after,
.level-play-icon::after,
.virtue-option-btn::after,
.meditation-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background-image:
    radial-gradient(circle, #FFFFFF 0%, #FFFFFF 46%, rgba(255, 255, 255, 0) 76%),
    radial-gradient(circle, var(--touch-glow, #38BDF8) 0%, var(--touch-glow, #38BDF8) 48%, rgba(0, 0, 0, 0) 78%);
  background-size: 7px 7px, 7px 7px;
  background-position: calc(100% - 5px) 5px, 5px calc(100% - 5px);
  background-repeat: no-repeat;
}

/* 3. Active Press Bounce & Flash when clicked/tapped */
.astro-touch.is-pressed,
.astro-touch:active,
.btn:active:not(:disabled),
.chip-btn:active,
.nav-item:active,
.icon-btn:active,
.export-pill-btn:active,
.glossary-cta-btn:active,
.color-card:active,
.level-card.unlocked:active,
.level-play-icon:active,
.virtue-option-btn:active,
.meditation-card:active {
  animation: none !important;
  transform: scale(0.91) !important;
  border-color: #FFFFFF !important;
  box-shadow: 0 0 22px #FFFFFF, 0 0 32px var(--touch-glow, #00E5FF), inset 0 0 18px rgba(255, 255, 255, 0.45) !important;
}

/* Expanding Shockwave Ring spawned by JS at exact click coordinates */
.astro-press-wave {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.58) 0%,
    var(--touch-glow, rgba(0, 229, 255, 0.38)) 48%,
    rgba(0, 0, 0, 0) 75%
  );
  pointer-events: none;
  z-index: 4;
  animation: astroShockwaveExpand 0.36s ease-out forwards;
}

/* ============================================================================
   NAVIGATION BAR / RAIL (Fidèle aux cartes lumineuses de la barre du bas)
   ============================================================================ */
.nav-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 8px;
  background: rgba(7, 11, 25, 0.96);
  border-top: 1px solid rgba(56, 189, 248, 0.22);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  flex-shrink: 0;
}

@media (min-width: 860px) {
  .nav-bar {
    order: -1;
    flex-direction: column;
    justify-content: flex-start;
    gap: 14px;
    width: 108px;
    height: 100%;
    border-top: none;
    border-right: 1px solid rgba(56, 189, 248, 0.22);
    padding: 20px 10px;
  }
}

.nav-item {
  flex: 1;
  max-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  color: var(--nebula-gray);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 16px;
  cursor: pointer;
}

@media (min-width: 860px) {
  .nav-item {
    flex: 0 0 auto;
    width: 100%;
    padding: 12px 6px;
  }
}

.nav-item .nav-icon {
  position: relative;
  font-size: 19px;
  line-height: 1;
  padding: 4px 14px;
  border-radius: 999px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  position: absolute;
  top: -3px;
  right: 0px;
  background: var(--gold);
  color: #070B19;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.nav-item:hover {
  color: var(--star-white);
  border-color: var(--cyan);
}

.nav-item.active {
  color: var(--cyan);
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgba(14, 42, 68, 0.92) 0%, rgba(15, 23, 42, 0.96) 100%);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.35), inset 0 0 12px rgba(0, 229, 255, 0.16);
}

.nav-item.active .nav-icon {
  background: rgba(0, 229, 255, 0.2);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.35);
}

/* Main Content Area */
.main-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen-view {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.screen-view.active {
  display: flex;
  flex-direction: column;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 11, 25, 0.5);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 255, 0.6);
}

/* Container width constraint for Hangar & Inventory */
.content-column {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 18px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============================================================================
   HANGAR HERO CARD & FOND D'ÉCRAN NÉBULEUSE AVEC BULLES (ic_hero_nebula.xml)
   ============================================================================ */
@keyframes floatBubbleSlow {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  50% {
    transform: translate(8px, -10px) scale(1.08);
  }
  100% {
    transform: translate(-6px, 6px) scale(0.95);
  }
}

@keyframes floatBubbleReverse {
  0% {
    transform: translate(0px, 0px) scale(1);
  }
  50% {
    transform: translate(-10px, 8px) scale(1.1);
  }
  100% {
    transform: translate(7px, -7px) scale(0.94);
  }
}

.hero-card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: #0B1124;
  border: 1.5px solid rgba(0, 229, 255, 0.45);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 229, 255, 0.14);
}

.hero-nebula-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-nebula-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.96;
}

.svg-float-bubble {
  transform-box: fill-box;
  transform-origin: center;
}
.svg-float-bubble.b1 {
  animation: floatBubbleSlow 5.5s ease-in-out infinite alternate;
}
.svg-float-bubble.b2 {
  animation: floatBubbleReverse 6.4s ease-in-out infinite alternate;
}
.svg-float-bubble.b3 {
  animation: floatBubbleSlow 7.2s ease-in-out infinite alternate-reverse;
}
.svg-float-bubble.b4 {
  animation: floatBubbleReverse 5.8s ease-in-out infinite alternate-reverse;
}

/* Bulles cosmiques lumineuses additionnelles derrière L'Étincelle de l'Esprit */
.hero-bubbles-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.hero-bubble {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-bubble.hb-1 {
  width: 88px;
  height: 88px;
  left: 6%;
  top: 22%;
  background: radial-gradient(circle at 35% 35%, rgba(224, 242, 254, 0.55) 0%, rgba(6, 182, 212, 0.35) 45%, rgba(56, 189, 248, 0.05) 75%, transparent 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.35), inset 0 0 14px rgba(255, 255, 255, 0.35);
  animation: floatBubbleSlow 6s ease-in-out infinite alternate;
}

.hero-bubble.hb-2 {
  width: 64px;
  height: 64px;
  right: 8%;
  top: 18%;
  background: radial-gradient(circle at 32% 32%, rgba(254, 243, 199, 0.6) 0%, rgba(251, 191, 36, 0.35) 48%, rgba(245, 158, 11, 0.05) 78%, transparent 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35), inset 0 0 12px rgba(255, 255, 255, 0.35);
  animation: floatBubbleReverse 5.4s ease-in-out infinite alternate;
}

.hero-bubble.hb-3 {
  width: 58px;
  height: 58px;
  right: 24%;
  top: 10%;
  background: radial-gradient(circle at 35% 35%, rgba(243, 232, 255, 0.55) 0%, rgba(168, 85, 247, 0.36) 48%, rgba(168, 85, 247, 0.05) 78%, transparent 100%);
  border: 1.5px solid rgba(192, 132, 252, 0.6);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.3);
  animation: floatBubbleSlow 7.1s ease-in-out infinite alternate-reverse;
}

.hero-bubble.hb-4 {
  width: 50px;
  height: 50px;
  left: 26%;
  top: 12%;
  background: radial-gradient(circle at 35% 35%, rgba(224, 242, 254, 0.55) 0%, rgba(56, 189, 248, 0.35) 50%, transparent 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  animation: floatBubbleReverse 6.8s ease-in-out infinite alternate;
}

.hero-bubble.hb-5 {
  width: 44px;
  height: 44px;
  left: 16%;
  bottom: 34%;
  background: radial-gradient(circle at 32% 32%, rgba(209, 250, 229, 0.55) 0%, rgba(16, 185, 129, 0.32) 50%, transparent 100%);
  border: 1.2px solid rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
  animation: floatBubbleSlow 5.2s ease-in-out infinite alternate;
}

.hero-bubble.hb-6 {
  width: 48px;
  height: 48px;
  right: 15%;
  bottom: 36%;
  background: radial-gradient(circle at 32% 32%, rgba(255, 228, 230, 0.55) 0%, rgba(244, 63, 94, 0.32) 50%, transparent 100%);
  border: 1.2px solid rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.32);
  animation: floatBubbleReverse 6.3s ease-in-out infinite alternate-reverse;
}

.hero-bubble.hb-7 {
  width: 28px;
  height: 28px;
  left: 38%;
  top: 42%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.7) 0%, rgba(56, 189, 248, 0.35) 55%, transparent 100%);
  border: 1px solid rgba(125, 211, 252, 0.65);
  animation: floatBubbleSlow 4.7s ease-in-out infinite alternate;
}

.hero-bubble.hb-8 {
  width: 32px;
  height: 32px;
  right: 36%;
  top: 38%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.68) 0%, rgba(251, 191, 36, 0.35) 55%, transparent 100%);
  border: 1px solid rgba(253, 224, 71, 0.65);
  animation: floatBubbleReverse 5.1s ease-in-out infinite alternate;
}

.hero-nebula-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 10, 18, 0.14) 0%,
    rgba(15, 23, 42, 0.38) 54%,
    rgba(17, 24, 39, 0.84) 100%
  );
  z-index: 1;
}

.hero-card-content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-top-actions {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.hero-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(7, 11, 25, 0.68);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

.export-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.22);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(52, 211, 153, 0.75);
  color: #6EE7B7;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

#btn-export-github-pack {
  --touch-glow: #38BDF8;
  background: rgba(2, 132, 199, 0.26);
  border-color: rgba(56, 189, 248, 0.8);
  color: #7DD3FC;
}

#hangar-sphere-canvas {
  width: 144px;
  height: 144px;
  margin: 2px 0 4px;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.25));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 7.5vw, 48px);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--star-white);
  margin-bottom: 4px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9), 0 0 22px rgba(56, 189, 248, 0.45);
}

.hero-subtitle {
  font-size: 13.5px;
  color: #CBD5E1;
  margin-bottom: 16px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.85);
}

.stat-badges-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

@media (max-width: 480px) {
  .stat-badges-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-badge {
  background: rgba(15, 23, 42, 0.84);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-badge-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.stat-badge-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--nebula-gray);
}

.hero-cta-row {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 14px;
  flex-wrap: wrap;
}

/* Glossary CTA Banner */
.glossary-cta-btn {
  --touch-glow: #C084FC;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 41, 59, 0.92) 100%);
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  color: var(--star-white);
  cursor: pointer;
  text-align: left;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--star-white);
}

.section-subtitle {
  font-size: 12px;
  color: var(--nebula-gray);
}

/* Color Picker Row */
.color-picker-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 4px 10px;
}

.color-card {
  min-width: 112px;
  flex: 1;
  background: var(--surface-space);
  border: 1.5px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.color-card.selected {
  background: var(--surface-variant);
  border-width: 2px;
}

.color-swatch {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #070B19;
  font-weight: 900;
  font-size: 17px;
}

.color-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--nebula-gray);
  text-align: center;
}

.color-card.selected .color-card-name {
  color: var(--star-white);
  font-weight: 700;
}

/* Level Search / Filter Bar in Hangar */
.hangar-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chip-btn {
  background: var(--surface-space);
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  color: var(--nebula-gray);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip-btn:hover {
  color: var(--star-white);
  border-color: var(--cyan);
}

.chip-btn.active {
  background: rgba(0, 229, 255, 0.18);
  border-color: var(--cyan);
  color: var(--cyan);
}

/* Levels List */
.levels-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  border-radius: 18px;
  background: var(--surface-space);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
}

.level-card.unlocked {
  cursor: pointer;
}

.level-card.current {
  background: var(--surface-variant);
  border-color: var(--cyan);
}

.level-card.completed {
  border-color: rgba(16, 185, 129, 0.65);
  --touch-glow: #34D399;
}

.level-card.locked {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: rgba(148, 163, 184, 0.2);
}

.level-badge {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(0, 229, 255, 0.16);
  border: 1.5px solid var(--cyan);
  color: var(--cyan);
}

.level-card.completed .level-badge {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--emerald);
  color: var(--emerald);
}

.level-card.locked .level-badge {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--nebula-gray);
}

.level-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.level-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.level-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--star-white);
}

.level-sub {
  font-size: 12px;
  color: var(--nebula-gray);
}

.level-fruits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.mini-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--gold);
}

.mini-tag.done {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.6);
  color: var(--emerald);
}

.mini-tag.brain {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
  color: var(--rose);
}

.mini-tag.milestone {
  background: rgba(168, 85, 247, 0.2);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.level-play-icon {
  width: 48px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan);
  color: #070B19;
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}

/* Space Game View */
#view-game {
  position: relative;
  overflow: hidden;
  background: var(--bg-space);
}

#space-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* Game Top HUD */
.game-hud-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  z-index: 15;
}

.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 16px;
  padding: 8px 12px;
  pointer-events: auto;
  gap: 8px;
  flex-wrap: wrap;
}

.hud-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hud-sector-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--cyan);
}

.hud-shields-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.heart-icon {
  font-size: 14px;
  line-height: 1;
}

.hud-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-metric {
  text-align: center;
  padding: 0 4px;
}

.hud-metric-val {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
}

.hud-metric-lbl {
  font-size: 10px;
  color: var(--nebula-gray);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  background: rgba(15, 23, 42, 0.9);
  color: var(--star-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
}

.hud-sub-banner {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}

/* Inventory View */
.progress-card {
  background: var(--surface-space);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-variant);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: var(--surface-space);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  color: var(--star-white);
  padding: 12px 40px 12px 38px;
  border-radius: 14px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--cyan);
}

.search-icon-left {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--nebula-gray);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--nebula-gray);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.meditation-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meditation-card {
  background: var(--surface-space);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}

.meditation-card.brain-card {
  --touch-glow: #F43F5E;
  border-color: rgba(244, 63, 94, 0.5);
}

/* Modals & Overlays */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 11, 25, 0.84);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

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

.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  background: var(--surface-space);
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  border-radius: 24px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 28px rgba(0, 229, 255, 0.16);
}

.modal-card.wide {
  max-width: 680px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--touch-glow, #38BDF8);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
}

.btn-primary {
  --touch-glow: #00E5FF;
  background: var(--cyan);
  color: #070B19;
  border-color: #E0F2FE;
}

.btn-emerald {
  --touch-glow: #34D399;
  background: var(--emerald);
  color: #070B19;
  border-color: #A7F3D0;
}

.btn-gold {
  --touch-glow: #FBBF24;
  background: var(--gold);
  color: #070B19;
  border-color: #FDE68A;
}

.btn-rose {
  --touch-glow: #FB7185;
  background: var(--rose);
  color: var(--star-white);
  border-color: #FECDD3;
}

.btn-outline {
  --touch-glow: #38BDF8;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  color: var(--star-white);
}

/* Glossary Entries */
.glossary-item-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-variant);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glossary-preview-box {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--bg-space);
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toggle Switch row in Settings */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.switch-input {
  appearance: none;
  width: 46px;
  height: 26px;
  background: #334155;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.switch-input::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #F8FAFC;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.switch-input:checked {
  background: var(--cyan);
}

.switch-input:checked::after {
  transform: translateX(20px);
  background: #070B19;
}

/* Circular Virtue Remedy Wheel (Roue des Vertus en cercle, simple et épurée) */
.modal-card.virtue-wheel-modal-card,
.virtue-wheel-modal-card {
  position: relative;
  width: 348px;
  max-width: 94vw;
  height: 348px;
  max-height: 94vw;
  padding: 14px;
  background: radial-gradient(circle at 50% 50%, rgba(17, 24, 39, 0.96) 0%, rgba(7, 11, 25, 0.98) 100%);
  border: 2px solid rgba(0, 229, 255, 0.55);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.88), 0 0 38px rgba(0, 229, 255, 0.25);
}

.virtue-wheel-close-btn {
  position: absolute !important;
  top: 6px;
  right: 6px;
  z-index: 40;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.virtue-wheel-container {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.virtue-wheel-orbit-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 224px;
  height: 224px;
  margin-left: -112px;
  margin-top: -112px;
  border-radius: 50%;
  border: 2px dashed rgba(56, 189, 248, 0.45);
  box-shadow: inset 0 0 24px rgba(0, 229, 255, 0.12);
  pointer-events: none;
  z-index: 4;
}

.virtue-wheel-hub {
  position: relative;
  z-index: 10;
  width: 98px;
  height: 98px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.96);
  border: 1.8px solid rgba(56, 189, 248, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px;
  gap: 2px;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.8);
}

.virtue-wheel-ring {
  position: absolute;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  overflow: visible;
}

.virtue-option-btn {
  position: absolute !important;
  z-index: 30;
  width: 72px;
  height: 72px;
  margin-left: -36px;
  margin-top: -36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.96);
  border: 2px solid rgba(56, 189, 248, 0.85);
  color: var(--star-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  cursor: pointer;
  pointer-events: auto;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75), 0 0 12px rgba(56, 189, 248, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.virtue-option-btn.compact-orb {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
}

.virtue-orb-emoji {
  font-size: 20px;
  line-height: 1;
}

.virtue-option-btn.compact-orb .virtue-orb-emoji {
  font-size: 17px;
}

.virtue-orb-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Toast Notification */
#toast-container {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-msg {
  background: rgba(17, 24, 39, 0.96);
  border: 1.5px solid var(--cyan);
  color: var(--star-white);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 14px rgba(0, 229, 255, 0.3);
}

/* Écran de Lancement Initial (Bouton Démarrer + Plein écran) */
.launch-backdrop {
  background: radial-gradient(circle at 50% 38%, rgba(21, 28, 54, 0.94) 0%, rgba(7, 10, 18, 0.98) 100%);
  backdrop-filter: blur(10px);
  z-index: 150;
}

.launch-modal-card {
  text-align: center;
  align-items: center;
  padding: 28px 22px;
  max-width: 440px;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(26, 16, 52, 0.96) 100%);
  border: 2px solid var(--cyan);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 36px rgba(0, 229, 255, 0.28);
}

.launch-sphere-orb {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 4px auto 6px;
  background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #00E5FF 48%, rgba(0, 229, 255, 0) 76%);
  box-shadow: 0 0 32px #00E5FF, 0 0 64px rgba(0, 229, 255, 0.45);
  animation: heroBubbleFloat 4s ease-in-out infinite alternate;
}

.btn-launch-main {
  width: 100%;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 15px 24px;
  margin-top: 6px;
  box-shadow: 0 0 26px rgba(0, 229, 255, 0.55);
}

