/* ===== 7. La lettre ===== */
.cp-letterhead { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.cp-letterhead h2 { margin: 0; font-size: 1.15em; color: var(--cp-accent); }
.cp-counter { margin: 0; font-weight: 800; color: var(--cp-muted); }
.cp-help { margin: 4px 0 8px; color: var(--cp-muted); font-size: 0.92em; }
.cp-paper {
  background: var(--cp-paper); border: 2px solid var(--cp-paper-bd); border-radius: 12px;
  padding: 16px 18px; box-shadow: var(--cp-shadow);
  font-family: Georgia, 'Times New Roman', serif; font-size: 1.12em; line-height: 1.9; text-align: left;
}
.cp-paper p { margin: 0 0 12px; }
.cp-paper .cp-sign { text-align: right; font-style: italic; }
.cp-w {
  display: inline; margin: 0; padding: 1px 2px; border: 0; border-radius: 6px;
  background: transparent; color: inherit; font: inherit; cursor: pointer; text-align: left;
}
.cp-w:hover { background: var(--cp-accent-bg); }
.cp-paper.show-bold .cp-w.is-tw { font-weight: 800; }
.cp-w.is-fixed { background: var(--cp-ok-bg); color: var(--cp-ok); font-weight: 800; }
.cp-w.is-ok { background: var(--cp-ok-bg); }
.cp-punct { line-height: 2.4; }
.cp-slot {
  display: inline-block; min-width: 24px; height: 28px; margin: 0 2px; padding: 0 4px; vertical-align: middle;
  border: 1.5px dashed var(--cp-line); border-radius: 8px; background: transparent; color: var(--cp-muted);
  font: inherit; font-weight: 800; cursor: pointer;
}
.cp-slot.is-mark { border-style: solid; border-color: var(--cp-accent); background: var(--cp-accent-bg); color: var(--cp-accent); }
.cp-w.is-cap { color: var(--cp-accent); font-weight: 800; }
.cp-feedback { min-height: 1.5em; margin: 8px 2px 0; font-weight: 800; color: var(--cp-ok); }
.cp-hint {
  margin: 6px 0; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--cp-gold);
  background: var(--cp-surface);
}

/* ===== 8. Boutons ===== */
.cp-bar, .cp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cp-btn {
  min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 2px solid var(--cp-line);
  background: var(--cp-surface); color: var(--cp-text); font: inherit; font-weight: 800; cursor: pointer;
  box-shadow: var(--cp-shadow); transition: transform var(--cp-transition);
}
.cp-btn:active { transform: translateY(2px); }
.cp-primary { background: var(--cp-accent); border-color: var(--cp-accent); color: #fff; }
.cp-soft { background: var(--cp-accent-bg); border-color: var(--cp-accent); color: var(--cp-text); }
.cp-danger { color: var(--cp-danger); border-color: var(--cp-danger); }
.cp-btn[aria-pressed="true"] { border-color: var(--cp-ok); }

/* ===== 9. Fenêtres (correction d'un mot, réglages) ===== */
.cp-dialog {
  width: min(94vw, 460px); border: 3px solid var(--cp-accent); border-radius: 20px; padding: 18px;
  background: var(--cp-surface); color: var(--cp-text); box-shadow: 0 10px 40px #0005;
  font: inherit;
}
.cp-dialog::backdrop { background: #1d122c99; }
.cp-dialog h2 { margin: 0 0 8px; font-size: 1.15em; color: var(--cp-accent); }
.cp-fixword { margin: 6px 0 12px; text-align: center; font-family: Georgia, serif; font-size: 1.8em; font-weight: 800; }
.cp-opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cp-opt {
  min-width: 96px; min-height: 52px; padding: 8px 16px; border-radius: 14px; border: 2px solid var(--cp-accent);
  background: var(--cp-paper); color: var(--cp-text); font: inherit; font-family: Georgia, serif;
  font-size: 1.25em; font-weight: 800; cursor: pointer;
}
.cp-opt:hover { background: var(--cp-accent-bg); }
.cp-fixtools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; justify-content: center; }
.cp-fixmsg { min-height: 2.6em; margin: 8px 0; color: var(--cp-muted); font-weight: 700; }
.cp-close { width: 100%; margin-top: 6px; }
.cp-dialog .cp-btn { margin-bottom: 8px; display: block; width: 100%; }
.cp-fixtools .cp-btn { width: auto; margin: 0; }

/* ===== 10. Écran final ===== */
.cp-final { text-align: center; }
.cp-stars { font-size: 2.2em; color: var(--cp-gold); letter-spacing: 6px; margin: 4px 0; }
.cp-truc { font-weight: 800; font-style: italic; }
.cp-title-big { font-size: 1.3em; font-weight: 800; color: var(--cp-gold); }
.cp-ps { font-style: italic; }
.cp-final .cp-actions { justify-content: center; }

/* ===== 11. États ===== */
.is-shake { animation: cp-shake 0.35s; }
@keyframes cp-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .is-shake { animation: none; } .cp-env:hover { transform: none; } }

/* ===== 12. Responsive ===== */
@media (max-width: 600px) {
  .cp-paper { padding: 12px 12px; font-size: 1.05em; }
  .cp-grid { grid-template-columns: repeat(2, 1fr); }
  .cp-btn { flex: 1 1 100%; }
  .cp-fixtools .cp-btn { flex: 1 1 100%; }
}
