/* === LAYOUT & COMPOSANTS === */

* {
  box-sizing: border-box;
}

#app {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* --- Views --- */
.view {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.view.hidden {
  display: none;
}

/* --- Titres --- */
.page-title {
  font-size: 36px;
  color: var(--pen-blue);
  margin: 16px 0 24px;
  text-align: center;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 22px;
  color: var(--pen-blue-light);
  margin: 0 0 20px;
  text-align: center;
}

/* --- Boutons --- */
.btn {
  font-family: 'Patrick Hand', cursive;
  font-size: 22px;
  padding: 14px 32px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: scale(0.95);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--btn-primary);
  color: white;
  box-shadow: 0 3px 8px rgba(25, 118, 210, 0.3);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.btn-success {
  background: var(--btn-success);
  color: white;
  box-shadow: 0 3px 8px rgba(56, 142, 60, 0.3);
}

.btn-danger {
  background: var(--btn-danger);
  color: white;
  box-shadow: 0 3px 8px rgba(211, 47, 47, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--pen-blue);
  border: 2px solid var(--pen-blue);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(26, 58, 107, 0.05);
}

.btn-icon {
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  min-height: unset;
}

.btn-icon-sm {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.btn-speaker {
  background: var(--btn-primary);
  color: white;
  width: 80px;
  height: 80px;
  font-size: 40px;
  box-shadow: 0 4px 16px rgba(25, 118, 210, 0.3);
}

/* --- Cartes dictées --- */
.dictee-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  margin: 16px 0;
}

@media (min-width: 500px) {
  .dictee-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dictee-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  text-align: center;
}

.dictee-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.dictee-card:active {
  transform: scale(0.97);
}

.dictee-card-name {
  font-size: 24px;
  color: var(--pen-blue);
  margin: 0 0 8px;
}

.dictee-card-info {
  font-size: 18px;
  color: #666;
  margin: 4px 0;
}

.dictee-card-stars {
  font-size: 28px;
  margin-top: 8px;
}

/* --- Barre de progression --- */
.progress-bar {
  width: 100%;
  max-width: 500px;
  height: 16px;
  background: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--btn-primary), var(--btn-success));
  border-radius: 8px;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 20px;
  color: #666;
  margin: 4px 0 16px;
}

/* --- Zone exercice --- */
.exercise-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
}

.word-number {
  font-size: 22px;
  color: #999;
}

.feedback-area {
  min-height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.correction-text {
  font-size: 22px;
  color: var(--pen-blue);
  text-align: center;
}

.correct-word {
  color: var(--correct-green);
  font-weight: bold;
}

.feedback-text {
  font-size: 26px;
  font-weight: bold;
}

.feedback-text.correct {
  color: var(--correct-green);
}

.feedback-text.incorrect {
  color: var(--incorrect-red);
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}

/* --- Résultats --- */
.stars-container {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}

.star {
  font-size: 64px;
  opacity: 0;
  transform: scale(0);
}

.star.earned {
  color: var(--star-gold);
  text-shadow: 0 2px 8px rgba(255, 193, 7, 0.4);
}

.star.empty {
  color: #ddd;
}

.star.visible {
  opacity: 1;
  transform: scale(1);
  animation: star-bounce 0.5s ease forwards;
}

.score-text {
  font-size: 48px;
  color: var(--pen-blue);
  margin: 16px 0;
}

.message-text {
  font-size: 26px;
  color: var(--pen-blue-light);
  text-align: center;
  margin: 8px 16px;
}

.errors-list {
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
}

.error-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(211, 47, 47, 0.06);
  border-radius: 10px;
  margin: 8px 0;
  font-size: 20px;
}

.error-typed {
  color: var(--incorrect-red);
  text-decoration: line-through;
}

.error-correct {
  color: var(--correct-green);
  font-weight: bold;
}

/* --- Parent mode --- */
.parent-section {
  width: 100%;
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin: 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.parent-section h2 {
  font-size: 24px;
  color: var(--pen-blue);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--paper-line);
}

.parent-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.parent-list-item:last-child {
  border-bottom: none;
}

.parent-list-name {
  font-size: 20px;
  color: var(--pen-blue);
}

.parent-list-meta {
  font-size: 16px;
  color: #999;
}

.parent-actions {
  display: flex;
  gap: 8px;
}

/* --- PIN --- */
.pin-display {
  display: flex;
  gap: 12px;
  margin: 24px 0;
}

.pin-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--pen-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--pen-blue);
  transition: background 0.2s;
}

.pin-dot.filled {
  background: var(--pen-blue);
  color: white;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 16px 0;
}

.pin-key {
  font-family: 'Patrick Hand', cursive;
  font-size: 28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--pen-blue);
  background: white;
  color: var(--pen-blue);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.pin-key:active {
  background: var(--pen-blue);
  color: white;
  transform: scale(0.9);
}

.pin-key.backspace {
  font-size: 22px;
}

.pin-message {
  font-size: 18px;
  text-align: center;
  min-height: 24px;
  margin: 8px 0;
}

.pin-message.error {
  color: var(--incorrect-red);
}

/* --- Éditeur --- */
.editor-form {
  width: 100%;
  max-width: 600px;
}

.editor-name-input {
  font-family: 'Patrick Hand', cursive;
  font-size: 24px;
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--paper-line);
  border-radius: 12px;
  color: var(--pen-blue);
  background: white;
  outline: none;
  margin-bottom: 20px;
}

.editor-name-input:focus {
  border-color: var(--btn-primary);
}

.word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.word-row-input {
  font-family: 'Patrick Hand', cursive;
  font-size: 20px;
  flex: 1;
  padding: 10px 12px;
  border: 2px solid var(--paper-line);
  border-radius: 10px;
  color: var(--pen-blue);
  background: white;
  outline: none;
  min-width: 0;
}

.word-row-input:focus {
  border-color: var(--btn-primary);
}

.word-row .btn-icon-sm {
  flex-shrink: 0;
}

.add-word-btn {
  width: 100%;
  margin: 16px 0;
  border-style: dashed;
}

/* --- Historique --- */
.history-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
  gap: 8px;
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  font-size: 16px;
  color: #999;
}

.history-name {
  font-size: 18px;
  color: var(--pen-blue);
}

.history-score {
  font-size: 18px;
  font-weight: bold;
}

.history-stars {
  font-size: 20px;
}

.history-item-expandable {
  cursor: pointer;
}

.history-item-expandable:active {
  background: rgba(0, 0, 0, 0.03);
}

.history-expand-icon {
  font-size: 14px;
  color: #999;
  margin-left: 4px;
}

.history-errors {
  padding: 4px 0 12px;
  border-bottom: 1px solid #eee;
}

.history-error-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 16px;
}

/* --- Storage indicator --- */
.storage-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.storage-fill {
  height: 100%;
  background: var(--btn-primary);
  border-radius: 4px;
  transition: width 0.3s;
}

.storage-fill.warning {
  background: var(--star-gold);
}

.storage-fill.danger {
  background: var(--btn-danger);
}

.storage-text {
  font-size: 14px;
  color: #999;
  text-align: right;
}

/* --- Settings dans parent --- */
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 18px;
  color: var(--pen-blue);
  flex: 1;
}

.settings-input {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  padding: 8px 12px;
  border: 2px solid var(--paper-line);
  border-radius: 8px;
  color: var(--pen-blue);
  background: white;
  outline: none;
  width: 200px;
}

.settings-input:focus {
  border-color: var(--btn-primary);
}

/* --- Utilitaires --- */
.text-center {
  text-align: center;
}

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }

.empty-state {
  font-size: 22px;
  color: #999;
  text-align: center;
  padding: 40px 20px;
}

.back-btn {
  align-self: flex-start;
  margin-bottom: 8px;
}

/* --- Gear icon (accès parent) --- */
.gear-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
  touch-action: manipulation;
}

.gear-btn:active {
  background: rgba(0, 0, 0, 0.15);
}

/* --- Confettis --- */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  opacity: 0;
}

/* --- Overlay enregistrement --- */
.record-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.record-modal {
  background: white;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  max-width: 350px;
  width: 90%;
}

.record-word {
  font-size: 32px;
  color: var(--pen-blue);
  margin: 12px 0 24px;
}

.record-btn-mic {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  font-size: 48px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  touch-action: manipulation;
}

.record-btn-mic.idle {
  background: #e0e0e0;
  color: #666;
}

.record-btn-mic.recording {
  background: var(--btn-danger);
  color: white;
  animation: pulse 1s infinite;
}

.record-btn-mic.has-audio {
  background: var(--btn-success);
  color: white;
}

/* --- Modal import dictée --- */
.import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.import-modal {
  background: white;
  border-radius: 20px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.import-textarea {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  width: 100%;
  padding: 12px;
  border: 2px solid var(--paper-line);
  border-radius: 12px;
  color: var(--pen-blue);
  background: white;
  outline: none;
  resize: vertical;
  min-height: 120px;
}

.import-textarea:focus {
  border-color: var(--btn-primary);
}

.import-textarea::placeholder {
  color: #bbb;
  font-size: 15px;
}

.import-prompt-text {
  font-family: monospace;
  font-size: 12px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #333;
  max-height: 200px;
  overflow-y: auto;
  margin: 0;
  line-height: 1.4;
}

.import-error {
  color: var(--incorrect-red);
  font-size: 16px;
  text-align: center;
  padding: 8px;
  background: rgba(211, 47, 47, 0.08);
  border-radius: 8px;
  margin-top: 8px;
}

/* --- Dialog confirmation --- */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.dialog-box {
  background: white;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  max-width: 350px;
  width: 90%;
}

.dialog-box p {
  font-size: 20px;
  margin: 0 0 24px;
  color: var(--pen-blue);
}

.dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .page-title {
    font-size: 28px;
  }

  .btn {
    font-size: 20px;
    padding: 12px 24px;
    min-height: 50px;
  }

  .btn-speaker {
    width: 70px;
    height: 70px;
    font-size: 36px;
  }

  .word-input {
    font-size: 28px;
  }

  .star {
    font-size: 52px;
  }

  .score-text {
    font-size: 40px;
  }

  .pin-key {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }
}

/* === SCRAMBLE GAME === */

.scramble-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
}

.scramble-listen {
  display: flex;
  gap: 12px;
  align-items: center;
}

.scramble-prefix {
  font-size: 32px;
  color: #999;
  font-style: italic;
}

/* Zone réponse */
.scramble-answer-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 60px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 3px dashed var(--paper-line);
  border-radius: 16px;
  width: 100%;
}

.scramble-slot {
  width: 48px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-family: 'Patrick Hand', cursive;
  color: var(--pen-blue);
  border-radius: 8px;
}

.scramble-slot-empty {
  border: 2px dashed #ccc;
  background: rgba(255, 255, 255, 0.4);
}

.scramble-slot-active {
  border-color: var(--btn-primary);
  border-style: solid;
  background: rgba(25, 118, 210, 0.08);
}

.scramble-slot-filled {
  background: white;
  border: 2px solid var(--correct-green);
  color: var(--pen-blue);
  font-weight: bold;
}

.scramble-slot-undoable {
  cursor: pointer;
  border-style: dashed;
  border-color: var(--btn-primary);
  position: relative;
}

.scramble-slot-undoable:active {
  transform: scale(0.9);
}

.scramble-slot-space {
  width: 20px;
  border: none;
  background: transparent;
}

.scramble-slot-separator {
  width: 16px;
  border: none;
  background: transparent;
  font-weight: bold;
  color: #999;
}

/* Pool de tuiles */
.scramble-tile-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 12px;
  width: 100%;
}

.scramble-tile {
  width: 52px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 28px;
  font-weight: bold;
  color: var(--pen-blue);
  background: linear-gradient(145deg, #fff9e6, #f5edd6);
  border: 2px solid #d4c8a8;
  border-radius: 10px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.scramble-tile:active {
  transform: scale(0.92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.scramble-tile-used {
  width: 52px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Patrick Hand', cursive;
  font-size: 28px;
  color: transparent;
  background: rgba(0, 0, 0, 0.04);
  border: 2px dashed #ddd;
  border-radius: 10px;
  cursor: default;
}

/* Popup de choix mode */
.mode-choice-dialog {
  padding: 28px 20px;
}

.mode-choice-title {
  font-size: 24px !important;
  margin-bottom: 20px !important;
}

.mode-choice-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.mode-choice-btn {
  width: 100%;
  justify-content: center;
  font-size: 22px;
  padding: 16px 24px;
}

/* Responsive scramble */
@media (max-width: 480px) {
  .scramble-slot {
    width: 40px;
    height: 44px;
    font-size: 24px;
  }

  .scramble-tile, .scramble-tile-used {
    width: 44px;
    height: 48px;
    font-size: 24px;
  }

  .scramble-prefix {
    font-size: 26px;
  }
}

/* === LE PENDU === */

.hangman-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
}

.hangman-listen {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hangman-drawing {
  width: 180px;
  height: 180px;
}

.hangman-svg {
  width: 100%;
  height: 100%;
}

.hangman-word {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 12px;
}

.hangman-letter {
  width: 36px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-family: 'Patrick Hand', cursive;
  color: var(--pen-blue);
  border-bottom: 3px solid var(--pen-blue);
}

.hangman-letter.revealed {
  font-weight: bold;
}

.hangman-letter.missed {
  color: var(--incorrect-red);
  border-bottom-color: var(--incorrect-red);
}

.hangman-space {
  width: 20px;
  border: none;
}

.hangman-sep {
  width: 16px;
  border: none;
  font-weight: bold;
  color: #999;
}

.hangman-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.hangman-kb-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
}

.hangman-key {
  font-family: 'Patrick Hand', cursive;
  font-size: 22px;
  width: 38px;
  height: 42px;
  border-radius: 8px;
  border: 2px solid var(--paper-line);
  background: white;
  color: var(--pen-blue);
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hangman-key:active:not(:disabled) {
  transform: scale(0.9);
}

.hangman-key:disabled {
  cursor: default;
}

.hangman-key.key-correct {
  background: var(--correct-green);
  color: white;
  border-color: var(--correct-green);
}

.hangman-key.key-wrong {
  background: #eee;
  color: #bbb;
  border-color: #ddd;
}

/* === MOTS À TROUS === */

.fillin-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 500px;
  margin: 20px 0;
}

.fillin-word {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  padding: 16px;
  min-height: 60px;
}

.fillin-slot {
  width: 36px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-family: 'Patrick Hand', cursive;
  color: var(--pen-blue);
  border-radius: 6px;
}

.fillin-visible {
  font-weight: bold;
}

.fillin-hidden {
  color: #bbb;
  border: 2px dashed #ccc;
  background: rgba(255, 255, 255, 0.4);
}

.fillin-active {
  border-color: var(--btn-primary);
  border-style: solid;
  background: rgba(25, 118, 210, 0.08);
  color: var(--btn-primary);
  font-weight: bold;
}

.fillin-filled {
  background: rgba(56, 142, 60, 0.1);
  border: 2px solid var(--correct-green);
  color: var(--correct-green);
  font-weight: bold;
}

.fillin-space {
  width: 20px;
}

.fillin-sep {
  width: 16px;
  font-weight: bold;
  color: #999;
}

.fillin-hint {
  font-size: 18px;
  color: #999;
  text-align: center;
}

/* Responsive hangman + fillin */
@media (max-width: 480px) {
  .hangman-drawing {
    width: 150px;
    height: 150px;
  }

  .hangman-letter {
    width: 30px;
    height: 38px;
    font-size: 24px;
  }

  .hangman-key {
    width: 32px;
    height: 36px;
    font-size: 18px;
  }

  .fillin-slot {
    width: 30px;
    height: 40px;
    font-size: 24px;
  }
}

/* === DICTÉE CAHIER === */

.cahier-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 500px;
  margin-top: 16px;
}

.cahier-phase-label {
  font-size: 24px;
  color: var(--pen-blue);
  font-weight: bold;
  text-align: center;
}

.cahier-listen {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cahier-speaker {
  font-size: 48px !important;
  width: 90px !important;
  height: 90px !important;
}

.cahier-word-number {
  font-size: 20px;
  color: #666;
  font-style: italic;
}

.cahier-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.cahier-next-btn {
  font-size: 22px !important;
  padding: 16px 32px !important;
  width: 100%;
  max-width: 350px;
}

/* Phase correction */
.cahier-correction-word {
  font-size: 42px;
  font-weight: bold;
  color: var(--pen-blue);
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 3px solid var(--pen-blue);
  text-align: center;
  min-width: 200px;
  transition: all 0.3s ease;
}

.cahier-correction-word.cahier-word-correct {
  border-color: var(--correct-green);
  background: rgba(46, 125, 50, 0.1);
  color: var(--correct-green);
}

.cahier-correction-word.cahier-word-wrong {
  border-color: var(--incorrect-red);
  background: rgba(211, 47, 47, 0.1);
  color: var(--incorrect-red);
}

.cahier-question {
  font-size: 22px;
  color: #555;
}

.cahier-correction-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 350px;
}

.cahier-btn-correct {
  font-size: 22px !important;
  padding: 16px 24px !important;
  background: var(--correct-green) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.cahier-btn-correct:active {
  transform: scale(0.97);
}

.cahier-btn-correct:disabled {
  opacity: 0.5;
  cursor: default;
}

.cahier-btn-wrong {
  font-size: 22px !important;
  padding: 16px 24px !important;
  background: var(--incorrect-red) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.cahier-btn-wrong:active {
  transform: scale(0.97);
}

.cahier-btn-wrong:disabled {
  opacity: 0.5;
  cursor: default;
}

.correction-fill {
  background: #9c27b0 !important;
}

@media (max-width: 480px) {
  .cahier-correction-word {
    font-size: 32px;
    padding: 16px 24px;
  }

  .cahier-phase-label {
    font-size: 20px;
  }

  .cahier-speaker {
    font-size: 40px !important;
    width: 75px !important;
    height: 75px !important;
  }
}

/* Input font-size 16px minimum pour éviter le zoom iOS */
input, textarea, select {
  font-size: 16px;
}
