/* ============================================
   CRÉATEUR DE FOND D'ÉCRAN — alexandretristan.com
   Réutilise la palette et la police du site principal.
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #1a1410;
  font-family: 'Space Mono', monospace;
  color: #1a1410;
}

#wallpaper-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  cursor: grab;
  touch-action: none;
}
#wallpaper-canvas.grabbing { cursor: grabbing; }

/* ============================================
   RETOUR AU SITE
   ============================================ */
.fe-back {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 50;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.85);
  text-decoration: none;
  background: rgba(26, 20, 16, 0.35);
  padding: 9px 16px;
  border: 1px solid rgba(250, 248, 243, 0.25);
  transition: all 0.2s ease;
}
.fe-back:hover { background: rgba(26, 20, 16, 0.6); color: #FAF8F3; }

/* ============================================
   INDICE D'USAGE (disparaît après la première interaction)
   ============================================ */
.fe-hint {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(250, 248, 243, 0.75);
  background: rgba(26, 20, 16, 0.35);
  padding: 8px 16px;
  border: 1px solid rgba(250, 248, 243, 0.2);
  pointer-events: none;
  transition: opacity 0.5s ease;
  text-align: center;
}
.fe-hint.fe-hidden { opacity: 0; }

/* ============================================
   FLÈCHE DE REPLI / AFFICHAGE DU PANNEAU
   ============================================ */
.fe-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 51;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 20, 16, 0.55);
  color: #FAF8F3;
  border: 1px solid rgba(250, 248, 243, 0.3);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: right 0.28s cubic-bezier(0.22,1,0.36,1), background 0.2s ease;
}
.fe-toggle:hover { background: rgba(26, 20, 16, 0.8); }
.fe-toggle.fe-panel-open { right: 300px; }

/* ============================================
   PANNEAU DE CONTRÔLES
   ============================================ */
.fe-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  width: 260px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: rgba(250, 248, 243, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(26, 20, 16, 0.12);
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  padding: 20px;
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1), opacity 0.28s ease;
}
.fe-panel.fe-collapsed {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   SÉLECTEUR DE MODE HSL / RVB
   ============================================ */
.fe-mode-switch {
  display: flex;
  border: 1px solid rgba(26, 20, 16, 0.25);
  margin-bottom: 16px;
}
.fe-mode-btn {
  flex: 1;
  padding: 8px 0;
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: rgba(26, 20, 16, 0.5);
  cursor: pointer;
  transition: all 0.18s ease;
}
.fe-mode-btn:first-child { border-right: 1px solid rgba(26, 20, 16, 0.25); }
.fe-mode-btn.fe-mode-active { background: #1a1410; color: #FAF8F3; }
.fe-hidden-mode { display: none; }
.fe-panel-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1a1410;
}

.fe-field { margin-bottom: 14px; }
.fe-field label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 20, 16, 0.65);
  margin-bottom: 6px;
}
.fe-value {
  font-variant-numeric: tabular-nums;
  color: rgba(26, 20, 16, 0.45);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(26, 20, 16, 0.15);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1a1410;
  cursor: pointer;
  border: 2px solid #FAF8F3;
  box-shadow: 0 0 0 1px rgba(26,20,16,0.3);
}
input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #1a1410;
  cursor: pointer;
  border: 2px solid #FAF8F3;
  box-shadow: 0 0 0 1px rgba(26,20,16,0.3);
}

.fe-hex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fe-swatch {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(26,20,16,0.2);
  display: block;
}
.fe-hex-input {
  flex: 1;
  min-width: 0;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border: 1px solid rgba(26, 20, 16, 0.25);
  background: #fff;
  color: #1a1410;
}
.fe-hex-input:focus { outline: none; border-color: #1a1410; }

.fe-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}
.fe-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1.5px solid rgba(26,20,16,0.5);
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #1a1410;
  background: none;
  cursor: pointer;
  transition: all 0.22s ease;
}
.fe-btn:hover { background: #1a1410; color: #FAF8F3; }
.fe-btn-ghost { border-color: rgba(26,20,16,0.3); color: rgba(26,20,16,0.6); }
.fe-btn-ghost:hover { border-color: rgba(26,20,16,0.7); color: #1a1410; background: none; }
.fe-btn:disabled { opacity: 0.5; cursor: default; pointer-events: none; }

.fe-note {
  margin-top: 10px;
  font-size: 9px;
  line-height: 1.5;
  color: rgba(26, 20, 16, 0.45);
  text-align: center;
  min-height: 12px;
}

@media (max-width: 560px) {
  .fe-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    max-height: 50dvh;
  }
  .fe-panel.fe-collapsed { transform: translateY(calc(100% + 12px)); }
  .fe-hint { display: none; }
  .fe-back { padding: 7px 12px; font-size: 9px; }
  .fe-toggle { bottom: 12px; right: 12px; }
  .fe-toggle.fe-panel-open { right: 12px; bottom: calc(50dvh + 20px); }
}
