/**
 * Buscador de novedades de la RAE y ASALE - Estilos principales
 * Estándares canónicos de fijate.com/tools
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colores tema claro (modo diurno) */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-secondary: #f1f5f9;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Acento académico institucional (tono carmesí / borgoña editorial y dorado) */
  --primary: #991b1b;
  --primary-hover: #7f1d1d;
  --primary-light: #fee2e2;
  --primary-border: #fca5a5;
  --accent-gold: #b45309;
  --accent-gold-light: #fef3c7;
  
  --success: #15803d;
  --success-light: #dcfce7;
  --danger: #b91c1c;
  --danger-light: #fee2e2;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #131b26;
  --bg-card-secondary: #1a2433;
  --border-color: #243042;
  --border-hover: #33445c;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #ef4444;
  --primary-hover: #dc2626;
  --primary-light: rgba(239, 68, 68, 0.15);
  --primary-border: rgba(239, 68, 68, 0.35);
  --accent-gold: #f59e0b;
  --accent-gold-light: rgba(245, 158, 11, 0.15);

  --success: #22c55e;
  --success-light: rgba(34, 197, 94, 0.15);
  --danger: #f87171;
  --danger-light: rgba(248, 113, 113, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.5);
}

/* Reset y layout de contención canónico */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-page);
  color: var(--text-main);
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tool-layout {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  box-sizing: border-box;
  flex: 1 0 auto;
  width: 100%;
}

.tool-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Secciones y tarjetas */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Cabecera descriptiva de la herramienta */
.intro-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}

.intro-hero::after {
  content: "DLE";
  position: absolute;
  right: -10px;
  bottom: -20px;
  font-family: var(--font-heading);
  font-size: 7rem;
  font-weight: 900;
  color: var(--text-main);
  opacity: 0.03;
  pointer-events: none;
  user-select: none;
}

.hero-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.hero-pill-secondary {
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.hero-desc {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 820px;
  margin-bottom: 1.25rem;
}

/* Barra de acciones destacadas (palabra aleatoria y quiz) */
.hero-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  min-height: 42px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  user-select: none;
  text-decoration: none;
}

.btn-hero-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-hero-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-hero-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-hero-secondary:hover {
  background: var(--bg-card-secondary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Panel de búsqueda y filtros */
.search-controls-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon-left {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 3rem 0.75rem 2.85rem;
  font-size: 1rem;
  font-family: var(--font-main);
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-input:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn-clear-search {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 9999px;
  display: none;
  align-items: center;
  justify-content: center;
}

.btn-clear-search:hover {
  color: var(--text-main);
}

.search-input:not(:placeholder-shown) + .btn-clear-search {
  display: flex;
}

/* Filtros secundarios: Años y tipos */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.filter-left-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  flex: 1 1 auto;
}

.filter-select-wrapper {
  position: relative;
  min-width: 190px;
}

.filter-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0.5rem 2.5rem 0.5rem 0.85rem;
  font-family: var(--font-main);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s, background 0.2s;
}

.filter-select:focus {
  border-color: var(--primary);
}

.select-arrow {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* Conmutador de tipo de incorporación */
.type-toggle-group {
  display: flex;
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.type-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.75rem;
  min-height: 36px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.type-toggle-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Píldoras de categorías semánticas */
.categories-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.25rem;
}

.cat-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  min-height: 34px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-secondary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cat-pill-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.cat-pill-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.cat-pill-btn .count-badge {
  font-size: 0.75rem;
  opacity: 0.8;
  font-family: var(--font-mono);
}

/* Barra de estado y recuento de resultados */
.results-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.results-count {
  font-weight: 600;
  color: var(--text-main);
}

.btn-reset-filters {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem;
}

/* Cuadrícula de tarjetas léxicas */
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.word-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.word-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.word-card-top {
  margin-bottom: 1rem;
}

.word-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.word-year-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: var(--accent-gold-light);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.word-cat-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--text-muted);
  background: var(--bg-card-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.word-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.word-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.word-grammar {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-muted);
  font-family: var(--font-main);
}

.word-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.word-type-articulo {
  background: var(--primary-light);
  color: var(--primary);
}

.word-type-acepcion {
  background: var(--bg-card-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.word-definition {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.word-etymology {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 0.5rem 0.65rem;
  background: var(--bg-card-secondary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border-color);
  margin-bottom: 1rem;
}

.word-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-decoration: none;
}

.btn-card-copy {
  background: var(--bg-card-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-card-copy:hover {
  background: var(--border-color);
}

.btn-card-rae {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
}

.btn-card-rae:hover {
  background: var(--primary);
  color: #ffffff;
}

/* Estado vacío (cero resultados) */
.empty-results-box {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.empty-results-icon {
  margin-bottom: 1rem;
  color: var(--text-dim);
}

.empty-results-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.empty-results-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 1.25rem;
}

/* Sección interactiva: Quiz RAE */
.quiz-section {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card-secondary) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin-bottom: 2.5rem;
}

.quiz-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.quiz-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background: var(--accent-gold-light);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 0.5rem;
}

.quiz-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.quiz-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.quiz-container {
  max-width: 580px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
}

.quiz-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-card-secondary);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--primary);
  width: 10%;
  transition: width 0.3s ease;
}

.quiz-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 1.25rem;
}

.quiz-word-display {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-card-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.quiz-prompt-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.quiz-word-text {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.quiz-buttons-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.btn-quiz-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem 0.5rem;
  min-height: 64px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-quiz-choice:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-quiz-yes {
  border-color: rgba(22, 163, 74, 0.3);
}

.btn-quiz-no {
  border-color: rgba(220, 38, 38, 0.3);
}

.quiz-feedback-box {
  display: none;
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fadeIn 0.25s ease-out;
}

.quiz-feedback-box.correct {
  display: block;
  background: var(--success-light);
  border: 1px solid rgba(22, 163, 74, 0.4);
  color: var(--text-main);
}

.quiz-feedback-box.incorrect {
  display: block;
  background: var(--danger-light);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: var(--text-main);
}

.quiz-verdict-title {
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.btn-quiz-next {
  width: 100%;
  min-height: 44px;
  padding: 0.75rem;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-quiz-next:hover {
  background: var(--primary-hover);
}

/* Pantalla final de resultados del Quiz */
.quiz-summary-box {
  display: none;
  text-align: center;
  padding: 1rem 0;
}

.quiz-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary);
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
  border: 2px solid var(--primary-border);
}

.quiz-summary-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.quiz-summary-msg {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.btn-quiz-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
}

/* Guía didáctica / Acordeón SEO */
.educational-guide-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

.section-heading-row {
  margin-bottom: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  min-height: 48px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.faq-chevron {
  transition: transform 0.2s ease;
  color: var(--text-dim);
  flex-shrink: 0;
}

.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid transparent;
}

.faq-item.active .faq-answer {
  display: block;
}

.faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.faq-answer li {
  margin-bottom: 0.35rem;
}

/* Modales accesibles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem;
  min-width: 40px;
  min-height: 40px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-secondary);
}

/* Toast de notificación de copiado */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-main);
  color: var(--bg-card);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  align-items: center;
  gap: 0.5rem;
  z-index: 1100;
  animation: slideUp 0.2s ease-out;
}

.toast-notice.show {
  display: flex;
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Adaptación responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.45rem;
  }

  .words-grid {
    grid-template-columns: 1fr;
  }

  .quiz-buttons-group {
    grid-template-columns: 1fr;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-left-group {
    flex-direction: column;
    align-items: stretch;
  }

  .type-toggle-group {
    width: 100%;
    justify-content: stretch;
  }

  .type-toggle-btn {
    flex: 1 1 0%;
    text-align: center;
  }

  .btn-hero {
    width: 100%;
    justify-content: center;
  }
}

