.puzzle-wrapper {
  width: 320px;
  margin: 0 auto 20px auto;
}

.puzzle-image {
  position: relative;
  width: 320px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7f0;
  margin-bottom: 10px;
}

/* Conteneur du fond SVG */
#puzzle-bg {
  width: 100%;
  height: 100%;
}

#puzzle-bg svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Conteneur de la pièce SVG */
#puzzle-piece {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
}

/* Le SVG interne suit la taille du conteneur */
#puzzle-piece svg {
  width: 100%;
  height: 100%;
  display: block;
}

.puzzle-instruction {
  margin-top: 10px;
  font-size: 13px;
  color: #555;
  text-align: center;
}

.puzzle-slider {
  margin-top: 10px;
}
.puzzle-slider-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;              /* ← assure un centrage parfait */
    text-align: center;       /* ← centre le texte */
    color: #555;
    font-size: 13px;
    pointer-events: none;
    opacity: 1;
    transition: opacity .25s ease;
    white-space: nowrap;
}

.puzzle-slider-track {
  position: relative;
  height: 32px;
  border-radius: 8px;
  background: #f0f2f7;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.1);
}

.puzzle-slider-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 40px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  user-select: none;
  transition: box-shadow 0.15s ease;
}

.puzzle-slider-thumb:active {
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.puzzle-slider-thumb span {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
/* Bouton refresh intégré dans l'image */
.puzzle-refresh {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.18);
    z-index: 20;
}

.puzzle-refresh:hover {
  opacity: 1;
  transform: none;
}

.puzzle-refresh .material-icons {
    font-size: 18px;
    color: #444;
}
/* Succès : fond vert */
.puzzle-slider-thumb.success {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.9), rgba(34, 197, 94, 0.9)) !important;
  transform: scale(1.05);
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Échec : fond rouge harmonisé */
.puzzle-slider-thumb.error {
  background: linear-gradient(135deg, rgba(244, 114, 114, 0.9), rgba(220, 38, 38, 0.9)) !important;
  transform: scale(1.05);
  transition: background 0.3s ease, transform 0.3s ease;
}

/* Spinner animé en cas de rechargement */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.puzzle-slider-thumb.loading .material-icons {
  animation: spin 1s linear infinite;
}
