/* ============================================================================
   Mur collaboratif pixel-art — styles
   ============================================================================ */

/* Couche du mur : position ABSOLUE, ancrée au document (le body défile
   normalement). width/height/left/top sont gérés par wall.js (WALL_W × WALL_H). */
#hlx-wall-layer {
  position: absolute;
  top: 0; left: 0;
  z-index: 0;            /* derrière le contenu (.hub doit être en position relative / z-index >= 1) */
  pointer-events: none;  /* on laisse passer les clics vers la page ; les tuiles réactivent au besoin */
  /* pas d'overflow:hidden : un dessin proche du bord ne doit jamais être rogné */
}

/* Une tuile de dessin posée dans le fond */
.hlx-wall-tile {
  position: absolute;
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.hlx-wall-tile.pending {
  /* Pas d'indicateur visuel : l'auteur voit son pixel comme un dessin normal,
     même s'il est encore en attente de validation côté admin. */
}

/* Tuiles posées sur le logo "Heliox Lab" : transparence légère pour rester
   discrètes et laisser le logo parfaitement lisible. Ajuste l'opacité ici. */
.hlx-wall-tile.over-title {
  opacity: 0.2;
  filter: none;
}

/* Bouton flottant pour ouvrir l'éditeur */
#hlx-wall-fab {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 9000;
  display: inline-flex; align-items: center; gap: 8px;
  background: #ff2e93; color: #fff;
  border: none; border-radius: 30px;
  padding: 12px 18px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,46,147,0.4);
  transform-origin: center;
  animation: hlxFabAttention 3.2s ease-in-out infinite;
}
/* Balancement + pulsation pour attirer l'attention (avec une pause entre cycles) */
@keyframes hlxFabAttention {
  0%   { transform: scale(1) rotate(0deg);   box-shadow: 0 6px 20px rgba(255,46,147,0.4); }
  4%   { transform: scale(1.08) rotate(-6deg); }
  8%   { transform: scale(1.08) rotate(6deg);  box-shadow: 0 8px 28px rgba(255,46,147,0.7); }
  12%  { transform: scale(1.08) rotate(-4deg); }
  16%  { transform: scale(1.08) rotate(4deg); }
  20%  { transform: scale(1) rotate(0deg);    box-shadow: 0 6px 20px rgba(255,46,147,0.4); }
  100% { transform: scale(1) rotate(0deg);    box-shadow: 0 6px 20px rgba(255,46,147,0.4); }
}
#hlx-wall-fab:hover {
  animation: none;       /* on stoppe l'animation au survol, pour le confort */
  transform: translateY(-2px) scale(1.03);
}
/* Respecte les préférences d'accessibilité : pas d'animation si l'utilisateur la refuse */
@media (prefers-reduced-motion: reduce) {
  #hlx-wall-fab { animation: none; }
}
#hlx-wall-fab:hover { transform: translateY(-2px); }
#hlx-wall-fab .hlx-fab-ico { font-size: 18px; line-height: 1; }

/* Modale de l'éditeur */
#hlx-wall-modal {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(20,15,12,0.55);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
#hlx-wall-modal.open { display: flex; }
.hlx-editor {
  background: #fff; border-radius: 18px;
  width: 100%; max-width: 420px;
  padding: 1.3rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  font-family: inherit; color: #2a2018;
  max-height: calc(100vh - 32px); overflow-y: auto;
}
.hlx-editor h3 { margin: 0 0 0.2rem; font-size: 1.15rem; }
.hlx-editor .hlx-sub { margin: 0 0 1rem; font-size: 13px; color: #6b5f51; }

/* Grille de dessin */
.hlx-canvas-wrap {
  display: flex; justify-content: center; margin-bottom: 1rem;
}
#hlx-draw {
  width: 320px; height: 320px;
  image-rendering: pixelated;
  border: 2px solid #e7ded2; border-radius: 8px;
  cursor: crosshair;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fafafa 0% 50%) 50% / 40px 40px;
  touch-action: none;
}

/* Palette de couleurs */
.hlx-palette {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 6px; margin-bottom: 1rem;
}
.hlx-swatch {
  aspect-ratio: 1; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; position: relative;
}
.hlx-swatch.active { border-color: #2a2018; transform: scale(1.08); }
.hlx-swatch.eraser {
  background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 10px 10px;
}
.hlx-swatch.eraser::after { content: '⌫'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:12px; }

.hlx-tools { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.hlx-tools button {
  flex: 1; padding: 0.5rem; border: 1px solid #e7ded2; background: #faf7f2;
  border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 13px;
}

.hlx-step { display: none; }
.hlx-step.active { display: block; }

.hlx-place-hint {
  background: #fff4e0; border: 1px solid #ffd591; color: #b76b00;
  padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 13px; margin-bottom: 1rem;
}

.hlx-actions { display: flex; gap: 0.6rem; }
.hlx-actions button {
  flex: 1; padding: 0.7rem; border: none; border-radius: 10px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.hlx-btn-primary { background: #ff2e93; color: #fff; }
.hlx-btn-ghost { background: #eee7dc; color: #5a4f42; }

.hlx-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: #2a2018; color: #fff; padding: 0.7rem 1.2rem; border-radius: 10px;
  font-size: 14px; z-index: 9999; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; max-width: 90vw; text-align: center;
}
.hlx-toast.show { opacity: 1; }

/* Mode placement : un fantôme suit la souris */
#hlx-place-ghost {
  position: fixed; width: 64px; height: 64px; image-rendering: pixelated;
  pointer-events: none; z-index: 9600; opacity: 0.9; display: none;
  transform: translate(-50%, -50%);
  outline: 2px solid #ff2e93; outline-offset: 1px;
}
body.hlx-placing { cursor: crosshair; }

#hlx-place-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 9650; display: none;
  background: #2a2018; color: #fff; padding: 0.6rem 1.2rem;
  border-radius: 24px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25); white-space: nowrap;
}
#hlx-place-banner.show { display: block; }
#hlx-place-banner button {
  margin-left: 10px; background: rgba(255,255,255,0.2); border: none;
  color: #fff; border-radius: 14px; padding: 2px 10px; cursor: pointer; font-size: 13px;
}
