/* ==========================================================================
   EL GRAN VIAJE DE MIGUEL - ESTILOS
   Tipografía principal: Lexend 14pt
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Lexend', sans-serif;
  --font-size-base: 14pt;
  --line-height-base: 1.75;
  
  /* Paleta cromática aventurera */
  --color-bg: #f3f7fb;
  --color-card-bg: #ffffff;
  --color-text-main: #2b2d42;
  --color-text-muted: #5c677d;
  --color-primary: #3a86ff;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-accent: #ff006e;
  --color-gold: #ffbe0b;
  --color-success: #38b000;
  --color-danger: #d90429;
  
  --color-border: #e2e8f0;
  --color-border-dashed: #cbd5e1;
  --color-shadow: rgba(30, 41, 59, 0.08);
  --color-shadow-hover: rgba(30, 41, 59, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --transition: all 0.2s ease-in-out;
}

/* Reglas generales */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-main);
  background-color: var(--color-bg);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(58, 134, 255, 0.04) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(255, 190, 11, 0.05) 0%, transparent 25%),
    linear-gradient(rgba(226, 232, 240, 0.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 232, 240, 0.25) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Encabezado Principal */
.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 20px rgba(30, 58, 138, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  font-size: 2.2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.brand-subtitle {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.9;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-control {
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}

.btn-control:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.font-size-picker {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 4px;
}

.font-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.font-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.font-current-indicator {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.4rem;
  color: #ffbe0b;
}

/* Barra de Navegación del Pasaporte (Destinos) */
.passport-nav-wrapper {
  background: #ffffff;
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 2px 8px var(--color-shadow);
  position: sticky;
  top: 68px;
  z-index: 90;
}

.passport-nav {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.passport-nav::-webkit-scrollbar {
  height: 6px;
}
.passport-nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.nav-stamp {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  background: var(--color-primary-light);
  color: var(--color-text-main);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  text-decoration: none;
}

.nav-stamp .stamp-badge {
  font-size: 1.25rem;
}

.nav-stamp:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

.nav-stamp.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  border-color: #1d4ed8;
}

.nav-stamp.active .stamp-progress {
  background: #ffffff;
  color: #2563eb;
}

.stamp-progress {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
}

/* Contenedor Principal */
.main-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
  flex: 1;
  width: 100%;
}

/* Vista de Portada e Introducción */
.cover-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cover-hero-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  border: 3px dashed #3a86ff;
  box-shadow: 0 10px 30px var(--color-shadow);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cover-hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(90deg, #e63946, #ffb703, #2a9d8f, #3a86ff, #9d4edd);
}

.cover-badge-top {
  display: inline-block;
  background: #e0f2fe;
  color: #0284c7;
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.cover-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.cover-subtitle {
  font-size: 1.15rem;
  color: #475569;
  max-width: 800px;
  margin: 0 auto 2rem;
  font-weight: 500;
}

.cover-image-container {
  max-width: 480px;
  margin: 0 auto 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border: 4px solid #ffffff;
  outline: 2px dashed #93c5fd;
}

.cover-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.cover-credits {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 1rem;
  font-style: italic;
}

.cover-credits span {
  font-weight: 600;
  color: #3b82f6;
  margin: 0 0.3rem;
}

/* Card de Introducción */
.intro-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 6px 24px var(--color-shadow);
}

.intro-card h2 {
  font-size: 1.8rem;
  color: #1e3a8a;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.intro-paragraph {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  margin-bottom: 1.25rem;
  color: #334155;
}

.intro-que-haremos {
  background: #f8fafc;
  border-left: 6px solid #ffbe0b;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
}

.intro-que-haremos h3 {
  font-size: 1.25rem;
  color: #b45309;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.intro-que-haremos ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.intro-que-haremos li {
  position: relative;
  padding-left: 1.8rem;
  font-size: var(--font-size-base);
}

.intro-que-haremos li::before {
  content: "✈️";
  position: absolute;
  left: 0;
  top: 0;
}

.destinations-grid-preview {
  margin-top: 2.5rem;
}

.destinations-grid-preview h3 {
  font-size: 1.4rem;
  color: #1e293b;
  text-align: center;
  margin-bottom: 1.5rem;
}

.country-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.country-card-item {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 12px var(--color-shadow);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.country-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--color-shadow-hover);
  border-color: #3b82f6;
}

.country-card-flag {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.country-card-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.country-card-pages {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 1rem;
}

.btn-start-country {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.btn-start-country:hover {
  background: #1d4ed8;
}

/* ==========================================================================
   VISTA DEL DESTINO (PAÍS SELECCIONADO)
   ========================================================================== */

.destination-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.destination-header-banner {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: 0 4px 16px var(--color-shadow);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 8px solid var(--dest-color, #2563eb);
}

.dest-meta-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dest-flag-large {
  font-size: 3.5rem;
  line-height: 1;
}

.dest-titles h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
}

.dest-titles p {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

.dest-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Tabs de Actividades */
.activity-tabs-bar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 0.5rem;
  background: #ffffff;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: 0 2px 8px var(--color-shadow);
}

.activity-tab-btn {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.activity-tab-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.activity-tab-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Contenido de la Actividad */
.activity-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.2rem;
  box-shadow: 0 6px 20px var(--color-shadow);
  border: 1px solid var(--color-border);
}

.activity-card-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px dashed #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.activity-card-title {
  font-size: 1.65rem;
  font-weight: 800;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.activity-card-prompt {
  font-size: var(--font-size-base);
  color: #334155;
  background: #f8fafc;
  border-left: 4px solid #3b82f6;
  padding: 0.9rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.75rem;
  line-height: var(--line-height-base);
}

/* 1. SECCIÓN LECTURA */
.reading-text-body {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: #1e293b;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.reading-paragraph {
  background: #fafafa;
  padding: 1.15rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid #f1f5f9;
  transition: var(--transition);
  position: relative;
}

.reading-paragraph:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.reading-paragraph.speaking {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.reading-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-tts {
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-tts:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-tts.active {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
}

/* 2. SECCIÓN PREGUNTAS */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.question-block {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: var(--transition);
}

.question-block:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.question-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.question-number {
  background: #3b82f6;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.question-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #0f172a;
  line-height: 1.5;
}

.question-textarea {
  width: 100%;
  min-height: 90px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  padding: 0.85rem 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: #1e293b;
  resize: vertical;
  transition: var(--transition);
}

.question-textarea:focus {
  outline: none;
  background: #ffffff;
  border-color: #3b82f6;
  border-style: solid;
}

.question-footer {
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-hint-toggle {
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-hint-toggle:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.question-hint-box {
  margin-top: 0.85rem;
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.95rem;
  color: #78350f;
  display: none;
}

.question-hint-box.show {
  display: block;
}

/* 3. SECCIÓN SOPA DE LETRAS (14x14) */
.wordsearch-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .wordsearch-layout {
    grid-template-columns: 1fr;
  }
}

.wordsearch-grid-wrapper {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 14px var(--color-shadow);
  overflow-x: auto;
  display: flex;
  justify-content: center;
  user-select: none;
}

.wordsearch-grid {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1 / 1;
}

.ws-cell {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  user-select: none;
}

.ws-cell:hover {
  background: #e2e8f0;
  transform: scale(1.05);
}

.ws-cell.selected {
  background: #fed7aa;
  border-color: #ea580c;
  color: #9a3412;
}

.ws-cell.found {
  background: #bbf7d0;
  border-color: #16a34a;
  color: #14532d;
}

.wordsearch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.word-list-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}

.word-list-box h4 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.word-tag {
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  color: #334155;
  transition: var(--transition);
}

.word-tag.found {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
  text-decoration: line-through;
}

.wordsearch-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* 4. SECCIÓN EXPRESIÓN ESCRITA Y DIBUJO */
.expression-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.expression-field {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.expression-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.lined-textarea {
  width: 100%;
  min-height: 180px;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 2.2rem;
  padding: 0.5rem 1.2rem;
  border: 2px dashed #93c5fd;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(2.2rem - 1px),
    #e2e8f0 calc(2.2rem - 1px),
    #e2e8f0 2.2rem
  );
  color: #1e293b;
  resize: vertical;
}

.lined-textarea:focus {
  outline: none;
  border-color: #2563eb;
}

.canvas-drawing-wrapper {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border: 2px solid #e2e8f0;
}

.canvas-drawing-wrapper h4 {
  font-size: 1.15rem;
  color: #0f172a;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  background: #ffffff;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
}

.canvas-tools-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.color-palette {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  border: 2px solid #ffffff;
  outline: 1px solid #cbd5e1;
  cursor: pointer;
  transition: transform 0.15s;
}

.color-swatch.active {
  transform: scale(1.2);
  outline: 2px solid #2563eb;
}

.drawing-canvas {
  width: 100%;
  height: 380px;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
}

/* 5. SECCIÓN UNIR IMÁGENES CON SU NOMBRE */
.matching-game-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.matching-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.matching-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 12px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.matching-card:hover {
  border-color: #93c5fd;
  transform: translateY(-2px);
}

.matching-image-box {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
}

.matching-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.matching-select {
  width: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 2px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
}

.matching-card.correct {
  border-color: #22c55e;
  background: #f0fdf4;
}

.matching-card.correct .matching-select {
  border-color: #22c55e;
  background: #ffffff;
  color: #166534;
  font-weight: 700;
}

.matching-card.incorrect {
  border-color: #ef4444;
  background: #fef2f2;
}

.matching-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

/* 6. SECCIÓN RECONOCER Y COLOREAR LETRAS */
.letter-activity-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.letter-rules-bar {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 8px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.letter-rules-bar h4 {
  font-size: 1.1rem;
  color: #0f172a;
}

.letter-rules-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.letter-chip-rule {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 700;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.15s;
  user-select: none;
}

.letter-chip-rule:hover {
  transform: scale(1.05);
}

.letter-chip-rule.selected {
  outline: 3px solid #0f172a;
}

.letter-words-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  background: #f8fafc;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 2px dashed #cbd5e1;
}

.letter-word-badge {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  color: #1e293b;
  display: inline-flex;
  gap: 1px;
  box-shadow: 0 2px 4px var(--color-shadow);
}

.letter-span {
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-block;
}

.letter-span:hover {
  background: #e2e8f0;
}

/* Botones genéricos de acción */
.btn-primary {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 700;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

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

.btn-secondary {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.activity-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

/* Pie de Página */
.app-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  margin-top: auto;
}

.app-footer p {
  margin-bottom: 0.5rem;
}

.app-footer .footer-badges {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.footer-badge {
  background: #334155;
  color: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

/* Modal de Información / Ayuda */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

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

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e3a8a;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN (MODO FICHA IMPRIMIBLE)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt !important;
    line-height: 1.5 !important;
  }

  .app-header,
  .passport-nav-wrapper,
  .activity-tabs-bar,
  .activity-nav-footer,
  .btn-tts,
  .btn-control,
  .matching-score-bar,
  .canvas-toolbar,
  .app-footer,
  .no-print {
    display: none !important;
  }

  .main-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .activity-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    page-break-after: always;
  }

  .reading-paragraph {
    background: transparent !important;
    border: none !important;
    padding: 0.5rem 0 !important;
  }

  .question-block {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }

  .question-textarea {
    border: 1px solid #888 !important;
    min-height: 70px !important;
  }
}

/* ==========================================================================
   ESTILOS PARA LA SECCIÓN DE MAPAS INTERACTIVOS
   ========================================================================== */

/* Mapamundi en la Portada / Introducción */
.world-map-section {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 16px var(--color-shadow);
  margin: 2rem 0;
}

.world-map-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.world-map-header h3 {
  font-size: 1.6rem;
  color: #1e3a8a;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.world-map-header p {
  font-size: 1rem;
  color: #475569;
}

.world-map-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 480px;
  background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
  border-radius: var(--radius-md);
  border: 2px solid #93c5fd;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.world-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.world-route-line {
  stroke: #e63946;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
  animation: dashMove 25s linear infinite;
  filter: drop-shadow(0 2px 4px rgba(230, 57, 70, 0.4));
}

@keyframes dashMove {
  to {
    stroke-dashoffset: -1000;
  }
}

.world-pin {
  cursor: pointer;
  transition: filter 0.2s ease;
}

.world-pin:hover {
  filter: drop-shadow(0 0 8px rgba(255, 190, 11, 0.95)) brightness(1.15);
}

.world-pin circle {
  transition: stroke-width 0.2s ease, stroke 0.2s ease;
}

.world-pin:hover circle:nth-of-type(2) {
  stroke-width: 3.5px;
  stroke: #ffbe0b;
}

/* Sección de Mapa del País */
.country-map-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(300px, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 950px) {
  .country-map-layout {
    grid-template-columns: 1fr;
  }
}

.map-viewport-wrapper {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 14px var(--color-shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.map-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at center, #ffffff 40%, #f0f7ff 100%);
  border-radius: var(--radius-sm);
  border: 2px solid #cbd5e1;
  overflow: hidden;
  box-shadow: inset 0 0 16px rgba(58, 134, 255, 0.08);
}

.map-svg-element {
  width: 100%;
  height: 100%;
  display: block;
}

/* Marcadores interactivos en el mapa del país */
.map-marker {
  cursor: pointer;
  transition: filter 0.2s ease;
}

.map-marker:hover,
.map-marker.active {
  filter: drop-shadow(0 0 8px rgba(255, 190, 11, 0.95)) brightness(1.15);
}

.map-marker circle:nth-of-type(2) {
  transition: stroke-width 0.2s ease, stroke 0.2s ease;
}

.map-marker:hover circle:nth-of-type(2),
.map-marker.active circle:nth-of-type(2) {
  stroke-width: 3.5px;
  stroke: #ffbe0b;
}

.map-marker-pulse {
  pointer-events: none;
  animation: pinPulse 2.5s infinite ease-out;
  transform-origin: center center;
}

@keyframes pinPulse {
  0% { r: 12; opacity: 0.8; }
  50% { r: 24; opacity: 0.2; }
  100% { r: 12; opacity: 0.8; }
}

.map-marker-badge {
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 800;
  fill: #ffffff;
  text-anchor: middle;
  dominant-baseline: central;
}

.map-marker-label {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  fill: #0f172a;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tarjeta de Detalle del Lugar */
.place-detail-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 16px var(--color-shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 140px;
}

.place-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.place-order-tag {
  background: #e0f2fe;
  color: #0284c7;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.place-detail-image-box {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  border: 2px solid #e2e8f0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.place-detail-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.place-detail-image-box:hover img {
  transform: scale(1.04);
}

.place-detail-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #1e3a8a;
  line-height: 1.3;
}

.place-detail-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 0.15rem;
}

.place-detail-text {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: #334155;
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.place-nav-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Lista de paradas de la ruta */
.places-list-strip {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.5rem 0.2rem;
  scrollbar-width: thin;
}

.place-pill-item {
  font-family: var(--font-family);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.place-pill-item:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
}

.place-pill-item.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.place-pill-badge {
  background: rgba(0, 0, 0, 0.15);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mini desafío del mapa */
.map-challenge-box {
  background: #fffbeb;
  border: 2px dashed #f59e0b;
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.map-challenge-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.map-challenge-text {
  font-size: 0.98rem;
  color: #92400e;
  font-weight: 600;
}

/* ==========================================================================
   AJUSTES DE VISIBILIDAD DE MAPAS (Evitar que los textos tapen los países)
   ========================================================================== */

/* Tooltips dinámicos para los marcadores del Mapamundi */
.world-pin {
  cursor: pointer;
}

.world-pin-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(4px);
  transform-origin: center bottom;
}

.world-pin:hover .world-pin-tooltip,
.world-pin:focus .world-pin-tooltip,
.world-pin.active .world-pin-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Cinta de navegación con botones de países bajo el Mapamundi */
.world-countries-ribbon {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.85rem 0.5rem 0.25rem;
  scrollbar-width: thin;
}

.world-country-chip {
  font-family: var(--font-family);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.world-country-chip:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.chip-step {
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.world-country-chip:hover .chip-step {
  background: #ffffff;
  color: #2563eb;
}

/* Tooltips para marcadores en mapas de países */
.country-pin-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(4px);
  transform-origin: center bottom;
}

.map-marker.active .country-pin-tooltip,
.map-marker:hover .country-pin-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   CONTROLES DE ZOOM Y PANORÁMICA PARA MAPAS
   ========================================================================== */

.map-zoom-toolbar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 25;
  flex-wrap: wrap;
}

.btn-zoom {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.btn-zoom:hover {
  background: #2563eb;
  border-color: #60a5fa;
  transform: translateY(-1px);
}

.btn-zoom.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
}

.zoom-level-text {
  color: #ffbe0b;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0 5px;
  min-width: 44px;
  text-align: center;
}

.world-map-container,
.map-canvas-container {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.world-map-container.is-dragging,
.map-canvas-container.is-dragging {
  cursor: grabbing;
}

/* ==========================================================================
   ESTILOS PARA EL ITINERARIO Y MAPA DE ESPAÑA
   ========================================================================== */

.spain-itinerary-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
}

.itinerary-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 2px solid #fecdd3;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.itinerary-header-bar h3 {
  font-size: 1.4rem;
  color: #9f1239;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.itinerary-header-bar p {
  font-size: 0.95rem;
  color: #4c0519;
}

.tour-player-button {
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  background: #e11d48;
  color: #ffffff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.3);
  transition: var(--transition);
}

.tour-player-button:hover {
  background: #be123c;
  transform: translateY(-2px);
}

.tour-player-button.playing {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

/* Línea de tiempo cronológica */
.itinerary-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
  padding-left: 2rem;
}

.itinerary-timeline::before {
  content: "";
  position: absolute;
  top: 15px;
  bottom: 15px;
  left: 24px;
  width: 4px;
  background: linear-gradient(180deg, #e11d48 0%, #f59e0b 50%, #2563eb 100%);
  border-radius: 4px;
}

.timeline-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  box-shadow: 0 4px 14px var(--color-shadow);
  padding: 1.5rem;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.timeline-card::before {
  content: attr(data-step);
  position: absolute;
  left: -2.35rem;
  top: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #e11d48;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-card:hover,
.timeline-card.active {
  border-color: #e11d48;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.15);
  transform: translateX(4px);
}

.timeline-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.timeline-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.timeline-region-badge {
  font-size: 0.85rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.timeline-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.timeline-photo-box {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid #cbd5e1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.timeline-photo-box img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.timeline-photo-caption {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  padding: 0.45rem 0.6rem;
  text-align: center;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.timeline-description {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: #334155;
  background: #fafafa;
  border-left: 4px solid #e11d48;
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.timeline-curiosity {
  font-size: 0.92rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px dashed #f59e0b;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   ESTILOS PARA SITIOS Y ENLACES OFICIALES
   ========================================================================== */
.country-card-badge-official {
  font-size: 0.78rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 0.5rem;
  border: 1px solid #bae6fd;
}

/* Caja de enlace oficial en tarjeta de detalle del mapa */
.place-official-box {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1.5px solid #7dd3fc;
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

.place-official-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.place-official-badge {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #0284c7;
  color: #ffffff;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.place-official-entity {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0369a1;
}

.place-official-title {
  font-size: 1.08rem;
  font-weight: 800;
  color: #0c4a6e;
  margin: 0.2rem 0 0.35rem 0;
  line-height: 1.3;
}

.place-official-note {
  font-size: 0.88rem;
  line-height: 1.45;
  color: #334155;
  margin-bottom: 0.85rem;
}

.btn-official-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: #0284c7;
  color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-official-site:hover {
  background: #0369a1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
  color: #ffffff !important;
}

.btn-official-site .official-arrow-icon {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}

.btn-official-site:hover .official-arrow-icon {
  transform: translate(2px, -2px);
}

/* Enlaces oficiales dentro del itinerario de España */
.timeline-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-timeline-official {
  font-size: 0.85rem !important;
  padding: 0.35rem 0.75rem !important;
  font-weight: 600;
}

.timeline-official-banner {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.timeline-official-banner-info {
  flex: 1 1 260px;
}

.timeline-official-banner-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0c4a6e;
  margin: 0.15rem 0;
}

.timeline-official-banner-note {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
}

.official-inline-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

/* Banner de acceso a sitios oficiales en la vista del mapa */
.map-official-links-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 2px solid #93c5fd;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.map-official-banner-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1 1 300px;
}

.map-official-banner-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.map-official-banner-left h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 0.25rem;
}

.map-official-banner-left p {
  font-size: 0.9rem;
  color: #334155;
  margin: 0;
  line-height: 1.4;
}

/* Pestaña: Directorio Completo de Sitios Oficiales */
.official-section-intro {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.official-intro-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.official-intro-content p {
  font-size: 1rem;
  color: #1e293b;
  line-height: 1.5;
  margin: 0;
}

.official-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.official-directory-card {
  background: #ffffff;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px var(--color-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.official-directory-card:hover {
  transform: translateY(-4px);
  border-color: #0284c7;
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.16);
}

.official-dir-img-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  background: #f1f5f9;
  overflow: hidden;
}

.official-dir-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.official-directory-card:hover .official-dir-img-wrap img {
  transform: scale(1.05);
}

.official-dir-pill {
  position: absolute;
  bottom: 0.6rem;
  left: 0.6rem;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

.official-dir-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.official-dir-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.official-dir-category {
  font-size: 0.75rem;
  font-weight: 800;
  color: #0284c7;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.official-dir-entity {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.official-dir-title {
  font-size: 1.22rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0.2rem 0 0.4rem 0;
  line-height: 1.3;
}

.official-dir-note {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #334155;
  margin-bottom: 0.85rem;
}

.official-dir-visited {
  background: #f8fafc;
  border-left: 3px solid #0284c7;
  padding: 0.55rem 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 1.1rem;
}

.official-visited-tag {
  font-weight: 700;
  color: #0369a1;
  display: block;
  margin-bottom: 0.15rem;
}

.official-dir-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn-locate-map {
  font-size: 0.88rem !important;
  padding: 0.5rem 0.9rem !important;
}

.official-safety-notice {
  background: #ecfdf5;
  border: 1px dashed #10b981;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  color: #065f46;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

@media (max-width: 640px) {
  .official-directory-grid {
    grid-template-columns: 1fr;
  }
  .map-official-links-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .place-official-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

