* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #0f0c1f 0%, #1a1b2f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  max-width: 800px;
  width: 100%;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  padding: 40px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

h1 {
  font-size: 2.5rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  color: #a0a0b0;
  font-size: 1rem;
  margin-bottom: 32px;
}

textarea {
  width: 100%;
  height: 250px;
  padding: 20px;
  font-family: 'Inter', monospace;
  font-size: 1rem;
  line-height: 1.6;
  border: 2px solid #2a2a3a;
  border-radius: 16px;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #1e1e2a;
  color: #e0e0e0;
}

textarea:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

/* Options de comptage */
.options {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0 30px;
  flex-wrap: wrap;
}

.option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e0;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.option input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2d2d3a;
  border: 2px solid #4a4a5e;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.option input[type="checkbox"]:checked {
  background: #8b5cf6;
  border-color: #8b5cf6;
}

.option input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.option input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.counters {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0 20px;
}

.counter-card {
  background: #262636;
  padding: 24px 32px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 150px;
  border: 1px solid #3a3a4e;
}

.counter-value {
  display: block;
  font-size: 3rem;
  font-weight: 600;
  color: #a78bfa;
  line-height: 1.2;
  text-shadow: 0 0 8px rgba(167, 139, 250, 0.3);
}

.counter-label {
  color: #9ca3af;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

footer {
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 20px;
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .options {
    gap: 15px;
    flex-direction: column;
    align-items: center;
  }
  
  .counters {
    flex-direction: column;
    gap: 16px;
  }
  
  .counter-card {
    padding: 16px;
  }
  
  .counter-value {
    font-size: 2.5rem;
  }
}


/* Conteneur du TTS */
.tts-container {
  margin: 30px 0 20px;
  text-align: center;
}

.tts-button {
  background: #8b5cf6;
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.tts-button:hover {
  background: #7c3aed;
}

.tts-button:active {
  transform: scale(0.98);
}

.tts-button:disabled {
  background: #4a4a5e;
  cursor: not-allowed;
  box-shadow: none;
}

/* Spinner de chargement */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tts-status {
  margin-top: 8px;
  font-size: 0.9rem;
  color: #a0a0b0;
  min-height: 1.5em;
}
