/* Mode HUD : on laisse voir la scène */
.loading-overlay.hud {
  background: transparent;            /* <-- le plus important */
  backdrop-filter: none;
}

/* On peut aussi réduire le logo/texte si tu veux */
.loading-overlay.hud .loading-logo,
.loading-overlay.hud .loading-text {
  display: none;
}

/* Et mettre la barre en bas */
.loading-overlay.hud .loading-inner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}
    /* ========================================
       RESET & BASE
       ======================================== */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    html, body {
      overflow: hidden;
      background: #0a0a0a;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
      color: #e0e0e0;
    }

    #app {
      position: fixed;
      inset: 0;
    }

    /* ========================================
       CROSSHAIR
       ======================================== */
    #crosshair {
      position: fixed;
      left: 50%;
      top: 50%;
      width: 10px;
      height: 10px;
      transform: translate(-50%, -50%);
      border: 2px solid rgba(255, 255, 255, 0.9);
      border-radius: 50%;
      z-index: 5;
      pointer-events: none;
      mix-blend-mode: difference;
    }

    .hide-crosshair #crosshair {
      display: none;
    }

    /* ========================================
       LOADING OVERLAY
       ======================================== */
    .loading-overlay {
      position: fixed;
      inset: 0;
      background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      z-index: 100;
      transition: opacity 0.5s ease;
    }

    .loading-overlay.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .loading-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 24px;
      max-width: 90vw;
    }

    .loading-logo {
      width: 260px;
      max-width: 60vw;
      opacity: 0;
      transform: translateY(30px) scale(0.9);
      animation: logoIntro 1.1s ease-out forwards,
                 logoFloat 3s ease-in-out 1.1s infinite;
    }

    @keyframes logoIntro {
      from {
        opacity: 0;
        transform: translateY(40px) scale(0.85);
        filter: blur(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
      }
    }

    @keyframes logoFloat {
      0%, 100% {
        transform: translateY(0) scale(1);
      }
      50% {
        transform: translateY(-8px) scale(1.02);
      }
    }

    .loading-text {
      font-family: system-ui, sans-serif;
      letter-spacing: 0.25em;
      font-size: 13px;
      text-transform: uppercase;
      opacity: 0.8;
    }

    /* ========================================
       BARRE DE PROGRESSION
       ======================================== */
    .progress-container {
      width: 400px;
      max-width: 80vw;
      transition: opacity 0.3s ease;
    }

    .progress-container.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .progress-bar {
      width: 100%;
      height: 4px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 2px;
      overflow: hidden;
      margin-bottom: 12px;
    }

    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #4f8bff 0%, #6fa3ff 100%);
      transition: width 0.3s ease;
      box-shadow: 0 0 10px rgba(79, 139, 255, 0.5);
    }

    .progress-text {
      font-size: 14px;
      color: #a0a0a0;
      margin-bottom: 4px;
      text-align: center;
    }

    .progress-detail {
      font-size: 12px;
      color: #707070;
      text-align: center;
      font-family: 'Courier New', monospace;
    }

    /* ========================================
       MENU MODERNE
       ======================================== */
    .menu-toggle {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 25;
      background: rgba(20, 20, 20, 0.85);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: #e0e0e0;
      padding: 10px 18px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s ease;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .menu-toggle:hover {
      background: rgba(30, 30, 30, 0.95);
      border-color: rgba(255, 255, 255, 0.2);
      transform: translateY(-1px);
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    }

    .menu {
      position: fixed;
      top: 0;
      right: 0;
      width: 320px;
      max-width: 90vw;
      height: 100vh;
      background: rgba(20, 20, 20, 0.95);
      backdrop-filter: blur(20px);
      border-left: 1px solid rgba(255, 255, 255, 0.1);
      padding: 80px 24px 24px 24px;
      overflow-y: auto;
      z-index: 20;
      transform: translateX(100%);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .menu.open {
      transform: translateX(0);
    }

    .menu-section {
      margin-bottom: 32px;
    }

    .menu-section-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: #707070;
      margin-bottom: 12px;
      font-weight: 600;
    }

    .menu-item {
      margin-bottom: 12px;
    }

    .menu label {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
      padding: 8px 0;
      color: #c0c0c0;
      font-size: 14px;
      transition: color 0.2s ease;
    }

    .menu label:hover {
      color: #ffffff;
    }

    .menu input[type="checkbox"] {
      width: 18px;
      height: 18px;
      cursor: pointer;
      accent-color: #4f8bff;
    }

    .menu input[type="range"] {
      width: 100%;
      margin: 8px 0;
      accent-color: #4f8bff;
    }

    .menu button {
      width: 100%;
      background: rgba(79, 139, 255, 0.15);
      border: 1px solid rgba(79, 139, 255, 0.3);
      color: #6fa3ff;
      padding: 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      transition: all 0.2s ease;
    }

    .menu button:hover {
      background: rgba(79, 139, 255, 0.25);
      border-color: rgba(79, 139, 255, 0.5);
    }

    .menu input[type="file"] {
      display: none;
    }

    .file-label {
      display: block;
      width: 100%;
      background: rgba(79, 139, 255, 0.15);
      border: 1px solid rgba(79, 139, 255, 0.3);
      color: #6fa3ff;
      padding: 10px;
      border-radius: 6px;
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      text-align: center;
      transition: all 0.2s ease;
    }

    .file-label:hover {
      background: rgba(79, 139, 255, 0.25);
      border-color: rgba(79, 139, 255, 0.5);
    }

    #status {
      display: block;
      margin: 12px 0;
      padding: 8px 12px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
      font-size: 12px;
      color: #909090;
      text-align: center;
    }

    .value-display {
      display: block;
      margin-top: 4px;
      font-size: 12px;
      color: #6fa3ff;
      font-weight: 500;
    }

    /* ========================================
       OVERLAY TOUCHES (coins écran)
       ======================================== */
    .shortcuts-overlay {
      position: fixed;
      bottom: 20px;
      left: 20px;
      background: rgba(20, 20, 20, 0.85);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 8px;
      padding: 16px;
      z-index: 10;
      font-size: 12px;
      color: #a0a0a0;
      line-height: 1.8;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .shortcuts-overlay.hidden {
      display: none;
    }

    .shortcut-line {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 4px;
    }

    .shortcut-key {
      display: inline-block;
      min-width: 60px;
      padding: 2px 8px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      font-family: 'Courier New', monospace;
      font-weight: 600;
      color: #6fa3ff;
      text-align: center;
    }

    .shortcut-desc {
      color: #c0c0c0;
    }

    /* ========================================
       SCROLLBAR CUSTOM
       ======================================== */
    .menu::-webkit-scrollbar {
      width: 8px;
    }

    .menu::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
    }

    .menu::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 4px;
    }

    .menu::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.3);
    }
    /* ========================================
   HUD - TOOLTIP & PANEL
   ======================================== */
.tooltip {
  position: fixed;
  left: 50%;
  top: 60%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(79, 139, 255, 0.3);
  border-radius: 8px;
  padding: 12px 18px;
  z-index: 15;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: opacity 0.2s ease;
}

.tooltip.hidden {
  opacity: 0;
}

.tooltip-icon {
  font-size: 24px;
}

.tooltip-name {
  font-size: 14px;
  font-weight: 600;
  color: #e0e0e0;
}

.tooltip-type {
  font-size: 12px;
  color: #909090;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  max-width: 90vw;
  max-height: 80vh;
  background: rgba(20, 20, 20, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  z-index: 30;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.info-panel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -45%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

/* Header legacy avec icône et titre */
.panel-header-legacy {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

.panel-icon {
  font-size: 32px;
}

.panel-title-group {
  flex: 1;
}

.panel-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.panel-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6fa3ff;
}

.panel-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  color: #e0e0e0;
  cursor: pointer;
  font-size: 18px;
  transition: background 0.2s ease;
}

.panel-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.panel-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.panel-description {
  color: #c0c0c0;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ✅ IMAGE DANS LE PANEL */
.panel-image {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.panel-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 300px;
  object-fit: contain;
}

.panel-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  font-size: 12px;
  color: #909090;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #6fa3ff;
}

.panel-actions {
  display: flex;
  gap: 8px;
}

.panel-btn {
  flex: 1;
  background: rgba(79, 139, 255, 0.15);
  border: 1px solid rgba(79, 139, 255, 0.3);
  color: #6fa3ff;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.panel-btn:hover {
  background: rgba(79, 139, 255, 0.25);
  border-color: rgba(79, 139, 255, 0.5);
}
/* ========================================
   TEXTE FLOTTANT 3D
   ======================================== */
.floating-text {
  position: fixed;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(79, 139, 255, 0.3);
  border-radius: 8px;
  padding: 16px 24px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  animation: floatingTextAppear 0.3s ease-out;
  max-width: 400px;
  text-align: center;
}

@keyframes floatingTextAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
/* ========================================
   UI OVERLAY (BACKDROP)
   ======================================== */
.ui-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  z-index: 28; /* sous info-panel (30), au-dessus du menu */
  transition: opacity 0.25s ease;
}

.ui-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ========================================
   TUTORIAL OVERLAY
   ======================================== */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: tutorialFadeIn 0.3s ease-out;
}

.tutorial-overlay.hidden {
  display: none;
}

@keyframes tutorialFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tutorial-modal {
  width: 600px;
  max-width: 90vw;
  background: rgba(20, 20, 20, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: tutorialSlideUp 0.4s ease-out;
}

@keyframes tutorialSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.tutorial-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.tutorial-skip {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #909090;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.tutorial-skip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #c0c0c0;
}

/* Content */
.tutorial-content {
  padding: 40px 28px;
  text-align: center;
}

.tutorial-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: tutorialBounce 2s ease-in-out infinite;
}

@keyframes tutorialBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.tutorial-text {
  color: #c0c0c0;
  font-size: 16px;
  line-height: 1.6;
  max-width: 500px;
  margin: 0 auto;
}

.tutorial-text p {
  margin: 0 0 16px 0;
}

.tutorial-text p:last-child {
  margin-bottom: 0;
}

.tutorial-text strong {
  color: #ffffff;
  font-weight: 600;
}

.tutorial-text kbd {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(79, 139, 255, 0.2);
  border: 1px solid rgba(79, 139, 255, 0.3);
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #6fa3ff;
  font-weight: 600;
}

/* Footer */
.tutorial-footer {
  padding: 24px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.tutorial-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.tutorial-progress .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.tutorial-progress .dot.active {
  background: #6fa3ff;
  transform: scale(1.2);
}

.tutorial-buttons {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tutorial-btn {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tutorial-btn-primary {
  background: linear-gradient(135deg, #4f8bff 0%, #5a9dff 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 139, 255, 0.4);
}

.tutorial-btn-primary:hover {
  background: linear-gradient(135deg, #5a9dff 0%, #6fabff 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 139, 255, 0.5);
}

.tutorial-btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #c0c0c0;
}

.tutorial-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.tutorial-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========================================
   TUTORIAL TOOLTIP
   ======================================== */
.tutorial-tooltip {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(79, 139, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 400px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: tooltipSlideUp 0.4s ease-out;
}

.tutorial-tooltip.hidden {
  display: none;
}

@keyframes tooltipSlideUp {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.tooltip-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tutorial-tooltip .tooltip-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.tooltip-text {
  flex: 1;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.tooltip-close {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.tooltip-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
