/* ============================================================
   COMPLETER.CSS — Styles spécifiques au jeu Compléter
   ------------------------------------------------------------
   Ce fichier définit :
   - La carte affichant le verset troué
   - Les trous cliquables (___)
   - La zone des mots à placer (boutons)
   - La barre chrono + boutons d'action

   Doit être chargé APRÈS base.css, composants.css et nav.css.
   ============================================================ */

/* ------------------------------------------------------------
   1. CARTE DU VERSET TROUÉ
   ------------------------------------------------------------ */
.completer-zone {
  background: linear-gradient(160deg, var(--gold-soft), var(--bg-soft));
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
  animation: fadeUp .5s ease both .1s;
}

.completer-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  padding: .35rem .9rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.completer-texte {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.2rem, 4.5vw, 1.5rem);
  font-weight: 500;
  line-height: 2.2;
  color: var(--text);
  margin: 0;
}

/* ------------------------------------------------------------
   2. LES TROUS (___)
   ------------------------------------------------------------
   Un trou = un mot à placer. État vide, rempli, actif.
   ------------------------------------------------------------ */
.completer-trou {
  display: inline-block;
  min-width: 80px;
  padding: .1rem .55rem;
  margin: 0 .15rem;
  border-bottom: 2.5px solid var(--gold-dark);
  background: rgba(201, 162, 39, .08);
  border-radius: 4px 4px 0 0;
  font-style: normal;
  font-weight: 700;
  color: var(--gold-dark);
  text-align: center;
  vertical-align: baseline;
  transition: all .2s;
  cursor: pointer;
}

/* Trou rempli : fond plus marqué */
.completer-trou.rempli {
  background: rgba(201, 162, 39, .22);
}

/* Trou actif (le prochain à remplir) : légère pulsation */
.completer-trou.actif {
  background: rgba(201, 162, 39, .35);
  animation: pulseTrou 1s ease-in-out infinite;
}

@keyframes pulseTrou {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, .4); }
  50%      { box-shadow: 0 0 0 6px rgba(201, 162, 39, 0); }
}

/* Trou en erreur (après validation) */
.completer-trou.erreur {
  background: var(--danger-soft);
  border-bottom-color: var(--danger);
  color: var(--danger);
  animation: shake .4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* ------------------------------------------------------------
   3. ZONE DES MOTS À PLACER
   ------------------------------------------------------------ */
.completer-mots {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  min-height: 60px;
  animation: fadeUp .5s ease both .15s;
}

.completer-mot {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  transition: all .2s cubic-bezier(.34, 1.56, .64, 1);
  outline: none;
}

.completer-mot:hover:not(:disabled) {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-dark);
  transform: translateY(-2px);
}

.completer-mot:active:not(:disabled) {
  transform: scale(.94);
}

.completer-mot:disabled {
  opacity: .25;
  cursor: not-allowed;
}

/* Mot utilisé (placé dans un trou) : disparition animée */
.completer-mot.utilise {
  opacity: 0;
  pointer-events: none;
  transform: scale(.5);
}

/* ------------------------------------------------------------
   4. BARRE CHRONO + BOUTONS
   ------------------------------------------------------------ */
.completer-barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.completer-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   5. RESPONSIVE — ajustements sur très petit écran
   ------------------------------------------------------------ */
@media (max-width: 400px) {
  .completer-zone {
    padding: 1.25rem 1rem;
  }

  .completer-actions {
    width: 100%;
  }

  .completer-actions .btn {
    flex: 1;
  }

  .completer-trou {
    min-width: 60px;
  }

  .completer-mot {
    font-size: .88rem;
    padding: .5rem .85rem;
  }
}