/* ════════════════════════════════════════════════
   SparkLlama · Spanish Pathways — plantilla F1
   styles.css — Paleta visual cálida ilustrada (los temas pueden sobrescribir variables en content.json → meta.palette)
════════════════════════════════════════════════ */

/* ── Fuentes de marca alojadas en la propia app (sin Google Fonts) ── */
@font-face { font-family: 'Bitter'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('shared/fonts/bitter-600.woff2') format('woff2'); }
@font-face { font-family: 'Bitter'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('shared/fonts/bitter-700.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('shared/fonts/source-sans-3-400.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('shared/fonts/source-sans-3-600.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url('shared/fonts/source-sans-3-700.woff2') format('woff2'); }

/* ── Variables ── */
/* Paleta de marca SparkLlama. Los nombres antiguos (--teal, --coral…) se conservan para no tocar
   el resto de la hoja: --coral es la terracota (solo botones) y --sun es el oro (solo detalles). */
:root {
  --site-bar-h: 56px;
  --bg: #FFF9F1;          /* crema */
  --bg-alt: #F7EEDD;      /* crema 2 */
  --paper: #FFFDF9;
  --ink: #123B3C;         /* verde tinta */
  --ink-soft: #4B6A69;    /* verde secundario */
  --cream: #F7EEDD;
  --coral: #DE5F41;       /* terracota: solo botones */
  --coral-dark: #C74E33;  /* coral tinta */
  --coral-light: #F2C2B3;
  --sun: #DDAE4E;         /* oro: solo detalles */
  --teal: #0F6D73;        /* verde estructura */
  --teal-dark: #0A4B4F;   /* verde profundo */
  --teal-light: #AFD2D4;  /* verde tarjeta */
  --teal-wash: #E6F1F1;
  --blue-deep: #0A4B4F;
  --manta: #AFD2D4;
  --wood: #4B6A69;
  --sand: #E3D6BF;        /* arena */
  --sand-wash: #FBF4E8;
  --white: #FFFDF9;
  --shadow: rgba(18,59,60,0.10);
  --shadow-md: rgba(18,59,60,0.18);
  --radius: 18px;
  --radius-sm: 10px;
  --font-title: 'Bitter', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --transition: 0.32s cubic-bezier(0.34,1.2,0.64,1);
}

[data-theme="dark"] {
  --bg: #0B2A2C;
  --bg-alt: #103638;
  --paper: #14403F;
  --ink: #FFF9F1;
  --ink-soft: #CFE2E2;
  --cream: #103638;
  --teal: #7FC3C7;
  --teal-dark: #AFD2D4;
  --teal-wash: #18484A;
  --sand-wash: #1A4446;
  --shadow: rgba(0,0,0,0.3);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; scroll-padding-top: 0; }
body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Los botones heredan la tipografía de marca (por defecto el navegador usa la del sistema) */
button, input, select { font-family: var(--font-body); }

/* ── Screen system ── */
.screen {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: flex; }

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

/* ════════════════════════════════
   PANTALLA INICIO
════════════════════════════════ */
#screen-home {
  background: linear-gradient(160deg, var(--bg) 0%, var(--cream) 100%);
  align-items: center;
  padding: 0 1rem 2rem;
  gap: 0;
}

.home-header {
  width: 100%;
  text-align: center;
  padding: 0.9rem 0 0.4rem;
}
/* Lockup: logo circular + texto de marca en línea */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  /* sombra muy suave para separarlo del fondo */
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}
.brand-tag {
  font-family: var(--font-title);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
  max-width: 560px;
  padding: 1rem 0;
}
.home-book-cover {
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px var(--shadow-md);
}
.cover-svg { width: 100%; height: auto; display: block; }
.home-text { text-align: center; }
.home-title {
  font-family: var(--font-title);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.home-subtitle {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0.2rem;
}
.home-title-en {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--ink-soft);
  opacity: 0.65;
}
.home-subtitle-en {
  font-size: 0.95rem;
  color: var(--teal);
  border-left: 3px solid var(--teal-light);
  padding-left: 0.6rem;
  margin-top: 0.15rem;
  font-weight: 500;
  line-height: 1.5;
}

.home-nav {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 400px;
  padding: 0.5rem 0;
}
.btn-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--paper);
  border: 2.5px solid transparent;
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow);
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}
.btn-main:hover, .btn-main:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow-md);
  outline: none;
}
.btn-story { border-color: var(--teal); }
.btn-story:hover { background: var(--teal); color: white; }
/* Botón principal «Empezar · Start»: terracota (color reservado a botones) */
.btn-main.btn-start {
  background: var(--coral); border-color: var(--coral); color: #fff;
  padding: 1.1rem 1.4rem; font-size: 1.3rem;
}
.btn-main.btn-start:hover, .btn-main.btn-start:focus-visible { background: var(--coral-dark); border-color: var(--coral-dark); color: #fff; }
.btn-start .btn-icon { font-size: 1.2rem; }
.btn-start-es { display: block; font-weight: 700; line-height: 1.15; }
.btn-start-en { display: block; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; opacity: 0.9; }
.btn-activities { border-color: var(--coral); }
.btn-activities:hover { background: var(--coral); color: white; }
.btn-guide { border-color: var(--sun); }
.btn-guide:hover { background: var(--sun); color: var(--ink); }
.btn-icon { font-size: 1.4rem; }

/* ══════════════════════════════════════════════
   SISTEMA BILINGÜE ES / EN
   Arquitectura: btn-text-wrap (flex column)
   ══════════════════════════════════════════════ */

/* 1. EN siempre oculto por defecto */
.btn-label-en { display: none !important; }

/* 2. Contenedor de texto: columna vertical para apilar ES ↕ EN */
.btn-text-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

/* 3. Cuando EN activo: mostrar label EN debajo del ES */
.en-active .btn-label-en {
  display: block !important;
  font-size: 0.72em;
  color: var(--teal);
  font-weight: 500;
  opacity: 0.9;
  margin-top: 0.18rem;
  line-height: 1.2;
  font-style: normal;
  letter-spacing: 0.01em;
}

/* 4. ES: siempre display block dentro del wrap para que EN quede abajo */
.btn-text-wrap .btn-label-es {
  display: block;
}

/* 5. h2 bilingüe — ES normal, EN bloque debajo más pequeño */
.en-active h2 .btn-label-es { display: block; }
.en-active h2 .btn-label-en {
  display: block !important;
  font-size: 0.62em;
  color: var(--teal);
  opacity: 0.85;
  margin-top: 0.12rem;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: normal;
}

/* 6. Tarjetas de actividad: título y descripción */
.en-active .act-title .btn-label-es,
.en-active .act-desc .btn-label-es { display: block; }
.en-active .act-title .btn-label-en,
.en-active .act-desc .btn-label-en {
  font-size: 0.82em;
  margin-top: 0.1rem;
}

/* 7. Instrucciones de actividad (act-instruction spans) */
.en-active .act-instruction .btn-label-es { display: block; }
.en-active .act-instruction .btn-label-en {
  font-size: 0.88em;
  margin-top: 0.12rem;
}

/* ── Toggle bilingüe en inicio ── */
.lang-toggle-wrap {
  width: 100%;
  max-width: 400px;
  margin-bottom: 0.5rem;
}
.lang-toggle-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--paper);
  border: 2.5px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
  width: 100%;
}
.lang-toggle-label:hover {
  box-shadow: 0 6px 20px var(--shadow-md);
}
.lang-toggle-flag {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.lang-toggle-text {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--teal);
  font-weight: 600;
  flex: 1;
}

/* Switch custom */
.lang-toggle-switch { position: relative; display: flex; align-items: center; }
.lang-toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.lang-switch-track {
  display: block;
  width: 48px;
  height: 26px;
  background: var(--bg);
  border-radius: 26px;
  border: 2px solid var(--teal-light);
  transition: background 0.25s, border-color 0.25s;
  position: relative;
  cursor: pointer;
}
.lang-switch-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--teal-light);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}
.lang-toggle-switch input:checked ~ .lang-switch-track {
  background: var(--teal);
  border-color: var(--teal);
}
.lang-toggle-switch input:checked ~ .lang-switch-track::after {
  transform: translateX(22px);
  background: white;
}

/* Badge EN en header del libro */
.book-lang-badge {
  background: var(--teal);
  color: white;
  font-family: var(--font-title);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Texto EN en páginas del libro — estilo diferenciado */
.text-en, .text-q-en, .text-a-en, .text-intro-en {
  border-left: 3px solid var(--teal-light);
  padding-left: 0.6rem;
  margin-top: 0.15rem;
  opacity: 1 !important; /* override anterior */
}
.text-en { font-size: 0.95rem; color: var(--teal); font-style: normal; font-weight: 500; }
.text-q-en { font-size: 1rem; color: var(--teal); font-style: normal; font-weight: 600; opacity: 0.85 !important; }
.text-a-en { font-size: 0.9rem; color: var(--teal); font-style: normal; }
.text-intro-en { font-size: 0.85rem; color: var(--teal); font-style: normal; }

/* Botones del menú principal: ES en bloque normal, EN ya manejado por regla global */
.en-active .btn-main .btn-label-es { display: block; }
/* Anular el separador "/" en botones principales — EN va en bloque, no inline */
.en-active .btn-main .btn-label-es::after { content: none; }

.home-footer {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.5rem 0.6rem;
  width: 100%;
  max-width: 400px;
}
/* Bloque de texto legal: dos líneas pequeñas, discretas */
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: var(--ink-soft);
  opacity: 0.65;
  line-height: 1.4;
  text-align: left;
}
.btn-theme, .btn-motion {
  background: none;
  border: 1.5px solid var(--ink-soft);
  border-radius: 20px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-theme:hover, .btn-motion:hover { opacity: 0.85; }

/* ════════════════════════════════
   BOOK · FLIPBOOK
════════════════════════════════ */
#screen-book {
  background: var(--bg-alt);
  gap: 0;
}

.book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--paper);
  box-shadow: 0 2px 8px var(--shadow);
  gap: 0.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: var(--site-bar-h);
  z-index: 10;
}
.book-progress {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--teal);
  min-width: 60px;
  text-align: right;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.toggle-label input { accent-color: var(--teal); }

/* Book stage — centrado con ancho máximo para pantallas grandes */
.book-stage {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 24px var(--shadow);
}

.book-page {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  overflow: hidden;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.book-page.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}
.book-page.entering {
  display: flex;
  opacity: 0;
  transform: translateX(30px);
}
.book-page.leaving {
  opacity: 0;
  transform: translateX(-30px);
}

/* Desktop: book-like two-column */
@media (min-width: 760px) {
  .book-stage { min-height: 420px; }
  .book-page {
    flex-direction: row;
    position: static;
    flex: 1;
  }
  .book-page.hidden { display: none; }
  .page-illustration { flex: 1.2; }
  .page-text-area { flex: 0.8; }
}

.page-illustration {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  padding: 0.5rem;
}
.scene-svg { width: 100%; height: auto; max-height: 340px; display: block; }
.scene-img {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;   /* imagen completa, sin recorte */
  object-position: center;
  border-radius: 8px;
  display: block;
}

.page-text-area {
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  background: var(--paper);
  border-top: 2px solid var(--bg);
}
@media (min-width: 760px) {
  .page-text-area {
    border-top: none;
    border-left: 2px solid var(--bg);
    min-width: 220px;
    max-width: 280px;
  }
}

.scene-number {
  font-family: var(--font-title);
  font-size: 0.75rem;
  color: var(--teal);
  opacity: 0.85;
  letter-spacing: 0.05em;
}

/* Texts */
.text-es {
  font-family: var(--font-title);
  font-size: 1.35rem;
  color: var(--ink);
  line-height: 1.45;
}
.text-en {
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0.75;
  font-style: italic;
  line-height: 1.4;
}
.text-intro-es {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
}
.text-intro-en {
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.65;
  font-style: italic;
}
.text-q-es {
  font-family: var(--font-title);
  font-size: 1.4rem;
  color: var(--teal);
  line-height: 1.3;
}
.text-q-en {
  font-size: 0.9rem;
  color: var(--ink-soft);
  opacity: 0.65;
  font-style: italic;
}
.text-a-es {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--teal);
}
.text-a-en {
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.65;
  font-style: italic;
}

/* Answer reveal */
.answer-reveal {
  background: var(--sand-wash);
  border: 2px solid var(--sun);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  animation: popIn 0.4s var(--transition) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Cover text */
.cover-text-area {
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--cream) 100%);
  padding: 1.5rem 1rem;
}
.cover-title-es {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--teal);
  font-weight: 700;
}
.cover-subtitle {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0.4rem 0 0.2rem;
}
.cover-title-en {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink-soft);
  opacity: 0.6;
}
.cover-collection {
  font-size: 0.78rem;
  color: var(--teal);
  opacity: 0.85;
  margin-top: 0.5rem;
  letter-spacing: 0.05em;
}

/* Ending */
.ending-area { justify-content: flex-start; }
.ending-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* Book controls */
.book-controls {
  background: var(--paper);
  border-top: 2px solid var(--bg);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.ctrl-audio-group {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Buttons ── */
.btn-ctrl {
  background: var(--paper);
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn-ctrl:hover, .btn-ctrl:focus-visible {
  background: var(--teal);
  color: white;
  outline: none;
}
.btn-ctrl:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.btn-ctrl.btn-sm { font-size: 0.78rem; padding: 0.4rem 0.7rem; }
.btn-ctrl.btn-listen { border-color: var(--coral); color: var(--coral); }
.btn-ctrl.btn-listen:hover { background: var(--coral); color: white; }

.btn-ctrl.btn-en { border-color: var(--blue-deep); color: var(--blue-deep); }
.btn-ctrl.btn-en:hover { background: var(--blue-deep); color: white; }

.btn-reveal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--teal);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  font-family: var(--font-title);
  font-size: 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.3rem;
}
.btn-reveal:hover { background: var(--teal-dark); transform: scale(1.03); }

.btn-primary {
  background: var(--teal);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-family: var(--font-title);
  font-size: 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary:hover { background: var(--teal-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--paper);
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--teal);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: var(--teal); color: white; }

.btn-back {
  background: none;
  border: 2px solid var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s;
}
.btn-back .btn-text-wrap, .btn-back span { white-space: nowrap; }
.btn-back:hover { background: var(--ink-soft); color: white; }

.en-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.audio-status {
  font-size: 0.78rem;
  color: var(--ink-soft);
  opacity: 0.7;
  text-align: center;
  min-height: 1.2em;
}

/* ════════════════════════════════
   ACTIVIDADES — Headers comunes
════════════════════════════════ */
.act-screen { background: var(--bg); }
.act-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  background: var(--paper);
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: var(--site-bar-h);
  z-index: 10;
}
.act-header h2 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--teal);
}
.act-instruction {
  text-align: center;
  padding: 0.85rem 1.2rem 0.4rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--ink-soft);
}

/* ── Conjunto / modo toggles ── */
.act1-set-toggle, .act2-mode-toggle, .act3-room-toggle {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem 1rem;
  flex-wrap: wrap;
}
.btn-set {
  background: var(--paper);
  border: 2px solid var(--teal);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.9rem;
  color: var(--teal);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font-body);
  font-weight: 700;
}
.btn-set.active, .btn-set[aria-pressed="true"] {
  background: var(--teal);
  color: white;
}
.btn-set:hover { background: var(--teal); color: white; }

/* ════════════════════════════════
   ACTIVIDAD 1 · Flashcards
════════════════════════════════ */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  padding: 1rem 1.2rem;
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
}

.flashcard {
  background: var(--paper);
  border: 3px solid transparent;
  border-radius: var(--radius);
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 3px 12px var(--shadow);
  min-height: 150px;
  position: relative;
}
.flashcard:hover, .flashcard:focus-visible {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 24px var(--shadow-md);
  border-color: var(--teal);
  outline: none;
}
.flashcard.active-card {
  border-color: var(--sun);
  background: var(--sand-wash);
  box-shadow: 0 0 0 4px rgba(221,174,78,0.3);
}
.flashcard-svg-wrap {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flashcard-svg-wrap svg { width: 80px; height: 80px; }
.flashcard-name {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink);
  text-align: center;
  transition: opacity 0.2s;
}
.flashcard-name.hidden-name { opacity: 0; }

.act-adult-note {
  padding: 0.75rem 1.2rem 1.2rem;
  text-align: center;
}
.btn-adult-toggle {
  background: none;
  border: 1.5px solid var(--wood);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  color: var(--wood);
  cursor: pointer;
  transition: all 0.18s;
}
.btn-adult-toggle:hover { background: var(--wood); color: white; }
.adult-reveal {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.5rem;
  background: var(--sand-wash);
  border-radius: var(--radius-sm);
  border: 1px solid var(--sun);
}
.adult-text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding: 0.4rem 0.8rem;
  background: var(--sand-wash);
  border-radius: var(--radius-sm);
  border: 1px solid var(--sun);
  margin-top: 0.5rem;
}

/* ════════════════════════════════
   ACTIVIDAD 2 · Escucha y elige
════════════════════════════════ */
.act2-question-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.2rem;
  gap: 0.5rem;
}
.btn-listen-q {
  font-size: 1.05rem;
  padding: 0.7rem 1.5rem;
}

.choices-grid {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.75rem 1.2rem 1rem;
}
.choice-card {
  background: var(--paper);
  border: 3px solid var(--bg);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 3px 12px var(--shadow);
  min-width: 130px;
  min-height: 150px;
}
.choice-card:hover, .choice-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--teal);
  outline: none;
}
.choice-card.correct {
  border-color: var(--teal);
  background: var(--teal-wash);
  box-shadow: 0 0 0 4px rgba(15,109,115,0.2);
}
.choice-card.incorrect {
  border-color: var(--sand);
  opacity: 0.75;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ════════════════════════════════
   ACTIVIDAD 3 · Sala interactiva
════════════════════════════════ */
.act3-q-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.2rem;
  gap: 0.6rem;
}
/* Pregunta principal Act3 — grande y clara para el niño */
.act3-question-display {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: var(--teal);
  font-weight: 700;
  text-align: center;
  background: var(--teal-wash);
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.2rem;
  min-height: 2.4rem;
  width: 100%;
  max-width: 480px;
  letter-spacing: 0.01em;
}
.room-scene-wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
}
.room-scene-wrap svg { width: 100%; height: auto; display: block; border-radius: var(--radius-sm); }
.room-hotspot { cursor: pointer; transition: opacity 0.2s; }
.room-hotspot:hover { opacity: 0.85; }
.room-hotspot.correct-hs { filter: drop-shadow(0 0 8px rgba(15,109,115,0.8)); }
.room-hotspot.incorrect-hs { filter: none; }

/* ════════════════════════════════
   FEEDBACK AREA
════════════════════════════════ */
.feedback-area {
  min-height: 3rem;
  padding: 0.5rem 1.2rem;
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.05rem;
  color: var(--teal);
}
.feedback-correct { color: var(--teal); }
.feedback-try-again { color: var(--ink-soft); }

/* ════════════════════════════════
   ACTIVIDAD 5 · Rol
════════════════════════════════ */
.act5-cards { max-width: 680px; margin: 0 auto; }
.act5-play {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0.5rem 1.2rem;
  box-shadow: 0 4px 16px var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.selected-card-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.act5-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 300px;
}

/* ════════════════════════════════
   ACTIVIDAD 6 · Buscamos en tu casa
════════════════════════════════ */
.act6-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.75rem 1.2rem;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.act6-section {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: 0 3px 12px var(--shadow);
}
.act6-section h3 {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--teal);
  margin-bottom: 0.4rem;
}
.act6-section p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}
.act6-obj-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.act6-obj-btn {
  background: var(--bg);
  border: 2px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-width: 90px;
}
.act6-obj-btn:hover { background: var(--teal); color: white; transform: translateY(-2px); }
.act6-obj-btn { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.act6-obj-img {
  display: block;
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 6px;
}
.act6-note {
  padding: 0.75rem 1.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.8;
  max-width: 640px;
  margin: 0 auto;
}

/* ════════════════════════════════
   GUÍA PARA FAMILIAS
════════════════════════════════ */
.guide-content {
  padding: 1.2rem;
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.guide-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .guide-intro { grid-template-columns: 1fr; } }
.guide-col {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 3px 10px var(--shadow);
}
.guide-col h3 {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--teal);
  margin-bottom: 0.5rem;
}
.guide-section-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--teal);
}
.guide-tips {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.guide-tip {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--paper);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  box-shadow: 0 2px 6px var(--shadow);
}
.guide-note {
  background: var(--sand-wash);
  border: 1.5px solid var(--sun);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.guide-audio-status {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: 0 3px 10px var(--shadow);
}
.guide-audio-status h3 {
  font-family: var(--font-title);
  color: var(--teal);
  margin-bottom: 0.6rem;
}
.audio-pending-notice {
  background: #FFF3CD;
  border: 1.5px solid #FBBF24;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #92400E;
  margin-bottom: 0.75rem;
}
.manifest-summary {
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
}

/* ════════════════════════════════
   ACTIVIDADES — menú principal
════════════════════════════════ */
#screen-activities {
  background: var(--bg);
}
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 1.2rem;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.act-card {
  background: var(--paper);
  border: 3px solid var(--bg);
  border-radius: var(--radius);
  padding: 1.3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px var(--shadow);
  text-align: center;
}
.act-card:hover, .act-card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--teal);
  box-shadow: 0 8px 24px var(--shadow-md);
  outline: none;
}
.act-number {
  font-family: var(--font-title);
  font-size: 0.72rem;
  color: var(--teal);
  opacity: 0.7;
  letter-spacing: 0.05em;
}
.act-icon { font-size: 2rem; }
.act-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 700;
}
.act-desc {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ════════════════════════════════
   HIGHLIGHT ANIMATIONS
════════════════════════════════ */
.highlight-ring {
  transition: opacity 0.3s ease;
}
.highlight-ring.visible {
  opacity: 1;
  animation: pulseRing 1.5s ease-in-out 2;
}
@keyframes pulseRing {
  0%, 100% { opacity: 1; stroke-width: 3; }
  50%       { opacity: 0.5; stroke-width: 5; }
}

/* ── Object animations ── */
@media (prefers-reduced-motion: no-preference) {
  .anim-tilt    { transform-origin: center; }
  .anim-tilt.animate    { animation: tilt 1.2s ease-in-out; }
  @keyframes tilt {
    0%,100% { transform: rotate(0deg); }
    30%     { transform: rotate(-8deg); }
    70%     { transform: rotate(6deg); }
  }
  .anim-compress.animate { animation: compress 1s ease-in-out; }
  @keyframes compress {
    0%,100% { transform: scaleY(1); }
    40%     { transform: scaleY(0.85); }
    70%     { transform: scaleY(1.05); }
  }
  .anim-wave.animate { animation: wave 1.3s ease-in-out; }
  @keyframes wave {
    0%,100% { transform: skewX(0deg); }
    30%     { transform: skewX(-3deg); }
    70%     { transform: skewX(2deg); }
  }
  .anim-bounce.animate { animation: bounce 0.9s cubic-bezier(0.34,1.5,0.64,1); }
  @keyframes bounce {
    0%,100% { transform: translateY(0); }
    40%     { transform: translateY(-18px); }
    70%     { transform: translateY(-8px); }
  }
  .anim-roll.animate { animation: roll 1.2s ease-in-out; }
  @keyframes roll {
    from { transform: translateX(-30px) rotate(-30deg); }
    to   { transform: translateX(0) rotate(0deg); }
  }
  .anim-glow.animate { animation: glowPulse 1.2s ease-in-out; }
  @keyframes glowPulse {
    0%,100% { filter: brightness(1); }
    50%     { filter: brightness(1.25) drop-shadow(0 0 8px rgba(15,109,115,0.6)); }
  }
  .anim-ripple.animate { animation: rippleAnim 1.4s ease-in-out; }
  @keyframes rippleAnim {
    0%,100% { transform: scaleX(1); }
    30%     { transform: scaleX(1.04); }
    60%     { transform: scaleX(0.97); }
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .anim-tilt.animate,
  .anim-compress.animate,
  .anim-wave.animate,
  .anim-bounce.animate,
  .anim-roll.animate,
  .anim-glow.animate,
  .anim-ripple.animate { animation: none; }
  .book-page { transition: none; }
}

/* ── Utilities ── */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ── Focus visible ── */
*:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--teal-light); border-radius: 3px; }

/* ════════════════════════════════
   RESPONSIVE · MOBILE
════════════════════════════════ */
@media (max-width: 480px) {
  .home-title { font-size: 1.9rem; }
  .btn-main { font-size: 1rem; padding: 0.85rem 1.1rem; }
  .book-header { padding: 0.6rem 0.75rem; }
  .scene-svg { max-height: 220px; }
  .scene-img { max-height: 220px; }
  .text-q-es { font-size: 1.2rem; }
  .text-es { font-size: 1.15rem; }
  .book-controls { padding: 0.6rem 0.75rem; }
  .btn-ctrl { font-size: 0.78rem; padding: 0.42rem 0.7rem; }
  .activities-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 0.85rem; }
  .act-icon { font-size: 1.6rem; }
  .flashcard-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; padding: 0.75rem; }
  .choices-grid { gap: 0.75rem; }
  .choice-card { min-width: 110px; min-height: 130px; }
}


/* ════════════════════════════════════════════════
   PLANTILLA v2 — añadidos para temas dirigidos por datos
════════════════════════════════════════════════ */
[hidden] { display: none !important; }

.app-error {
  margin: 2rem auto; max-width: 560px; padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  background: var(--sand-wash); color: var(--ink); border: 2px solid var(--sand); font-weight: 700;
}

/* Marcador cuando falta una imagen del tema (se ve el nombre del archivo esperado) */
.img-missing {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  background: repeating-linear-gradient(45deg, var(--cream), var(--cream) 10px, var(--bg-alt) 10px, var(--bg-alt) 20px);
  border: 2px dashed var(--teal-light); border-radius: 8px; color: var(--ink-soft);
  text-align: center; min-height: 64px; min-width: 64px;
}
.img-missing .im-emoji { font-size: 2rem; line-height: 1; }
.img-missing small { font-size: 0.7rem; word-break: break-all; padding: 0 0.3rem; }
.page-illustration .img-missing { width: 100%; height: 100%; min-height: 200px; }
.card-img { width: 80px; height: 80px; object-fit: contain; display: block; }
.card-img.img-missing small, .act6-obj-img.img-missing small, .hs .img-missing small { display: none; }
.card-img-sm { width: 40px; height: 40px; }
.hint-card { display: inline-block; vertical-align: middle; width: 40px; height: 40px; }

/* Actividad 3: escenario con zonas interactivas en HTML (coordenadas en % de la imagen) */
.scene-stage { position: relative; width: 100%; line-height: 0; border-radius: var(--radius-sm); overflow: hidden; }
.room-bg { width: 100%; height: auto; display: block; }
.scene-stage .img-missing { width: 100%; aspect-ratio: 3 / 2; border-radius: 0; border-style: solid; }
.hs {
  position: absolute; transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.10); border: 2.5px dashed rgba(255,255,255,0.6); border-radius: 8px;
  padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.hs-ellipse { border-radius: 50%; }
.hs:hover { opacity: 0.85; }
.hs:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.hs .hs-card { width: 36px; max-width: 70%; height: auto; opacity: 0.88; pointer-events: none; }
.hs .img-missing { width: 36px; height: 36px; min-width: 0; min-height: 0; border: none; background: none; }
.hs.correct-hs { box-shadow: 0 0 14px 4px rgba(15,109,115,0.8); }
.hs.incorrect-hs { box-shadow: none; }
.scene-stage.edit { cursor: crosshair; }
.scene-stage.edit .hs { border-color: var(--sun); background: rgba(221,174,78,0.18); }
.hs-tag { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); font-style: normal;
  font: 700 0.7rem/1.2 var(--font-body); background: var(--ink); color: #fff; padding: 1px 5px; border-radius: 4px; }

/* Anillo de resalte opcional al revelar la respuesta (scene.focus) */
.page-illustration { position: relative; }
.focus-ring {
  position: absolute; border: 4px solid var(--sun); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 0 18px 6px rgba(221,174,78,0.7);
}
.focus-ring.pulse { animation: ringPulse 1.2s ease-in-out 3; }
@keyframes ringPulse { 50% { transform: scale(1.12); } }

/* Botón 🔊 junto a la instrucción de cada actividad */
.btn-instr {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 2.4rem; height: 2.4rem; margin-left: 0.5rem; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--teal); background: var(--paper); font-size: 1.1rem; line-height: 1;
  transition: transform 0.15s;
}
.btn-instr:hover { transform: scale(1.08); }
.btn-instr:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.guide-about { margin-top: 1.5rem; padding: 1rem 1.2rem; background: var(--paper); border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--ink-soft); }
.guide-about p { margin: 0.35rem 0; }
.guide-about .guide-section-title { margin-top: 0; }


/* ════════════════════════════════
   LECTURA · botones de pregunta y respuesta
════════════════════════════════ */
.qa-stack { display: flex; flex-direction: column; gap: 0.55rem; width: 100%; align-items: stretch; }
.btn-qa {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%; min-height: 52px; padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  font-family: var(--font-title); font-size: 1.2rem; line-height: 1.25;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-qa:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.btn-qa:active { transform: scale(0.98); }
.qa-icon { font-size: 1.15rem; flex-shrink: 0; }
.qa-text { display: flex; flex-direction: column; }
.btn-qa-q { background: var(--teal); color: #fff; border: 2px solid var(--teal); }
.btn-qa-q:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-qa-a { background: var(--paper); color: var(--teal); border: 2px solid var(--teal); }
.btn-qa-a:hover { background: var(--teal-wash); }
.btn-qa.speaking { box-shadow: 0 0 0 4px rgba(221,174,78,0.55); }
[data-theme="dark"] .btn-qa-q { color: #0B2A2C; }
.btn-qa .qa-generic { display: none; }
/* Antes de revelar, el botón de respuesta invita a mirar; después muestra la respuesta */
.btn-qa-a .qa-label { display: none; }
.btn-qa-a.revealed .qa-before { display: none; }
.btn-qa-a.revealed .qa-label { display: inline; }
.btn-qa-a:not(.revealed) { font-family: var(--font-body); font-size: 1rem; font-weight: 600; }
.btn-qa-a.revealed { animation: popIn 0.35s var(--transition) both; }
.answer-reveal-en { padding: 0 0.2rem; }
/* «👁 Texto» apagado: los botones siguen, con una etiqueta neutra */
.text-off .btn-qa .qa-label, .text-off .btn-qa .qa-before { display: none !important; }
.text-off .btn-qa .qa-generic { display: inline; }
.qa-stack .text-q-en, .qa-stack .text-a-en { margin: -0.2rem 0 0.1rem 0.3rem; }

/* Pie de la portada */
.footer-legal a { color: inherit; text-decoration: underline; }
.link-credits {
  background: none; border: none; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}
.about-credits { list-style: none; padding: 0; margin: 0.3rem 0 0.6rem; }
.about-credits li { padding: 0.1rem 0; }
.btn-qa .text-q-es, .btn-qa .text-a-es { color: inherit; font-size: inherit; font-family: inherit; margin: 0; }

/* ── Guía: dos cuadros lado a lado (español | English) en todas las partes ── */
.guide-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
@media (max-width: 560px) { .guide-pair { grid-template-columns: 1fr; } }
.guide-col p { margin: 0.35rem 0; }
.guide-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.guide-list li { line-height: 1.45; }
.guide-list li::marker { color: var(--teal); }
.guide-col-note { background: var(--sand-wash); border: 1.5px solid var(--sun); box-shadow: none; font-size: 0.92rem; color: var(--ink-soft); }
.guide-about { margin-top: 0; padding: 0; background: none; font-size: 0.9rem; color: var(--ink-soft); }
.guide-about .guide-col { font-size: 0.9rem; color: var(--ink-soft); }
#guide-dynamic { display: flex; flex-direction: column; gap: 1rem; }

/* Conocemos los objetos: los seis a la vez, 3 arriba y 3 abajo */
#flashcard-grid { grid-template-columns: repeat(3, 1fr); max-width: 620px; }
@media (max-width: 600px) { #flashcard-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.6rem; } }
/* Escucha y elige: «¿Cuántas imágenes?» */
.act2-mode-toggle { align-items: center; }
.mode-label { width: 100%; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
#act2-q-text:not(.hidden) { font-family: var(--font-title); font-size: 1.25rem; color: var(--ink); text-align: center; margin-top: 0.4rem; }
#flashcard-grid .flashcard { min-height: 0; padding: 0.7rem 0.5rem; }
#flashcard-grid .flashcard-svg-wrap { width: 100%; max-width: 150px; }
#flashcard-grid .flashcard-svg-wrap img { width: 100%; height: auto; }
.act2-mode-toggle .btn-set { font-size: 0.82rem; padding: 0.35rem 0.75rem; }
#guide-about { scroll-margin-top: 90px; }

/* ── Tarjetas en cuadrícula de 3 × 2 (Conocemos los objetos y Ahora tú preguntas) ── */
#flashcard-grid, #act5-card-select { grid-template-columns: repeat(3, 1fr); max-width: 620px; gap: 0.9rem; }
#flashcard-grid .flashcard, #act5-card-select .flashcard { min-height: 0; padding: 0.55rem; gap: 0.35rem; overflow: hidden; }
#flashcard-grid .flashcard-svg-wrap, #act5-card-select .flashcard-svg-wrap { width: 100%; max-width: none; height: auto; aspect-ratio: 1 / 1; }
#flashcard-grid .flashcard-svg-wrap img, #act5-card-select .flashcard-svg-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
#flashcard-grid .flashcard-name.hidden-name { display: none; }
@media (max-width: 600px) {
  #flashcard-grid, #act5-card-select { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.6rem; }
  #act5-card-select .flashcard-name { font-size: 0.85rem; }
}

/* ── Libro: botón de texto dentro de la zona del texto ── */
.page-text-area { position: relative; }
.btn-text-toggle {
  display: block; margin: 0 0 0.5rem auto; padding: 0.25rem 0.75rem; border-radius: 20px; cursor: pointer;
  border: 1.5px solid var(--sand); background: var(--paper); color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 600; line-height: 1.3;
}
.btn-text-toggle:hover { border-color: var(--teal); color: var(--teal); }
.btn-text-toggle:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

/* ── Libro: mano que señala el objeto cuando suena «Aquí está…» ── */
.focus-hand {
  position: absolute; transform: translate(-50%, -100%); font-size: 2.6rem; line-height: 1;
  pointer-events: none; filter: drop-shadow(0 2px 3px rgba(18,59,60,0.35)); z-index: 3;
}
.focus-hand.bounce { animation: handBounce 0.7s ease-in-out 5; }
@keyframes handBounce { 50% { transform: translate(-50%, calc(-100% + 10px)); } }

/* Botones de escuchar con su traducción siempre visible */
.btn-sub-en { display: block; font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; opacity: 0.9; }

/* ── Contraste: textos en inglés y secundarios dentro de botones con fondo oscuro ── */
.btn-primary .btn-label-en, .btn-primary .btn-sub-en,
.btn-start .btn-label-en, .btn-start .btn-sub-en,
.btn-qa-q .btn-label-en, .btn-qa-q small,
.btn-set.active .btn-label-en, .btn-set[aria-pressed="true"] .btn-label-en, .btn-set:hover .btn-label-en,
.btn-reveal .btn-label-en, .btn-ctrl:hover .btn-label-en,
.btn-main:hover .btn-label-en, .btn-main:focus-visible .btn-label-en {
  color: inherit !important; opacity: 0.92;
}
.btn-sub-en { color: inherit; }
.btn-secondary .btn-sub-en { opacity: 0.85; }
.qa-generic small { font-family: var(--font-body); font-size: 0.72em; font-weight: 600; opacity: 0.9; margin-left: 0.35em; }
.ending-buttons .btn-text-wrap { align-items: center; }

/* ── Contraste en modo claro ── */
.btn-ctrl.btn-listen { color: var(--coral-dark); border-color: var(--coral-dark); }
.btn-ctrl.btn-listen:hover { background: var(--coral-dark); color: #fff; }
.btn-adult-toggle { color: var(--ink-soft); border-color: var(--ink-soft); }

/* ── Modo oscuro: el verde de los botones rellenos es claro, así que su texto pasa a ser oscuro ── */
[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-reveal,
[data-theme="dark"] .btn-set.active, [data-theme="dark"] .btn-set[aria-pressed="true"],
[data-theme="dark"] .btn-set:hover, [data-theme="dark"] .btn-qa-q,
[data-theme="dark"] .btn-main:hover, [data-theme="dark"] .btn-ctrl:hover { color: #0B2A2C; }
[data-theme="dark"] .btn-ctrl.btn-listen { color: #F2C2B3; border-color: #F2C2B3; }

/* ════════════════════════════════
   AYUDA EN INGLÉS
   · Botones: siempre bilingües (español arriba, inglés debajo, más pequeño).
   · Contenido (historia, preguntas, títulos, instrucciones): solo con el interruptor «English».
════════════════════════════════ */
/* v2.13: el inglés de los botones solo aparece con «English» encendido */
.en-active button .btn-label-en, .en-active .btn-main .btn-label-en {
  display: block !important; font-size: 0.72em; font-weight: 600; color: inherit !important; opacity: 0.8; margin-top: 0.05rem;
}
button .act-desc .btn-label-en { display: none !important; }
.en-active button .act-desc .btn-label-en { display: block !important; }
.en-active .btn-set .btn-label-en { display: inline !important; margin-left: 0.3em; }
.btn-set .btn-label-en::before { content: '· '; }

/* Interruptor «English» en la barra superior */
.en-switch {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  padding: 0.3rem 0.4rem 0.3rem 0.75rem; border-radius: 999px;
  border: 2px solid var(--teal); background: var(--paper); color: var(--teal);
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 700; line-height: 1;
}
.en-switch:hover { background: var(--teal-wash); }
.en-switch:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.en-switch-track {
  display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; height: 1.5rem;
  border-radius: 999px; background: var(--sand); color: var(--ink); font-size: 0.68rem; letter-spacing: 0.04em;
}
.en-switch[aria-pressed="true"] { background: var(--teal); color: #fff; }
.en-switch[aria-pressed="true"] .en-switch-track { background: #fff; color: var(--teal); }
[data-theme="dark"] .en-switch[aria-pressed="true"] { color: #0B2A2C; }
.book-header .en-switch { margin-left: 0; }
.book-header .book-progress { margin-left: auto; }
@media (max-width: 420px) {
  .en-switch { font-size: 0.78rem; padding-left: 0.6rem; }
  .act-header h2 { font-size: 1.05rem; }
}
[data-theme="dark"] .en-switch[aria-pressed="true"] .en-switch-track { color: #0B2A2C; }

/* «Buscamos en tu casa»: el inglés del contenido, legible (no como etiqueta pequeña) */
.en-active .act6-en { font-size: 0.92rem !important; color: var(--teal) !important; opacity: 1; margin-top: 0.15rem; }
.en-active .act6-en-title { font-size: 0.8em !important; color: var(--teal) !important; font-weight: 600; }
.qa-before small { display: block; font-size: 0.78em; font-weight: 600; opacity: 0.85; }
.about-sub { font-family: var(--font-title); font-size: 0.95rem; color: var(--ink); margin: 0.6rem 0 0.1rem; }
.guide-about a { color: var(--teal); text-decoration: underline; }

/* «Escuchemos otra vez» · «Let's listen again» */
.retry-es { display: block; }
.retry-en { display: block; font-size: 0.8em; font-weight: 600; opacity: 0.85; margin-top: 0.1rem; }
.hint-line { display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin-top: 0.4rem; }

/* ── Llamado a sparkllama.com: siempre visible, mismo aspecto en todas las pantallas ── */
.site-link { text-decoration: none; color: inherit; }
.site-cta-slot { width: 100%; max-width: 560px; margin: 1.4rem auto 0.4rem; }
#screen-activities > .site-cta-slot, .act-screen > .site-cta-slot { padding: 0 1rem; margin-bottom: 2rem; }
.site-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 0.9rem; flex-wrap: wrap;
  background: #0A4B4F; color: #FFF9F1; text-decoration: none;
  border-radius: var(--radius); padding: 1rem 1.1rem 1rem 1.25rem;
  box-shadow: 0 4px 14px var(--shadow-md); border: 2px solid #0A4B4F;
}
.site-cta:hover, .site-cta:focus-visible { border-color: #DDAE4E; }
.site-cta-text { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 200px; }
.site-cta-en { font-family: var(--font-title); font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: #FFF9F1; }
.site-cta-es { font-size: 0.9rem; color: #AFD2D4; }
.site-cta-url {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px;
  background: #DE5F41; color: #FFFFFF; font-weight: 800; font-size: 1.05rem;
  padding: 0.55rem 1.1rem; border-radius: 999px; white-space: nowrap;
}
.site-cta:hover .site-cta-url { background: #C74E33; }
/* En el modo oscuro se mantiene igual: la franja ya es oscura */
.guide-content .site-cta-slot:first-child { margin-top: 0; margin-bottom: 1.2rem; }
.ending-area .site-cta-slot { margin-top: 1.2rem; }

/* ── Barra de marca fija (todas las pantallas) ── */
.site-bar {
  position: sticky; top: 0; z-index: 30; height: var(--site-bar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0 max(0.75rem, calc((100% - 560px) / 2)); background: #0A4B4F; color: #FFF9F1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.site-bar-brand { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.site-bar-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.site-bar-names { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.site-bar-name { font-family: var(--font-title); font-weight: 700; font-size: 1rem; color: #FFF9F1; white-space: nowrap; }
.site-bar-line { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #AFD2D4; white-space: nowrap; }
.site-bar-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px;
  background: #DE5F41; color: #FFFFFF; border-radius: 12px; padding: 0.25rem 0.8rem; text-align: center; flex-shrink: 0;
}
.site-bar-btn:hover, .site-bar-btn:focus-visible { background: #C74E33; }
.site-bar-btn-en { font-weight: 800; font-size: 0.88rem; line-height: 1.15; white-space: nowrap; }
.site-bar-btn-es { font-size: 0.68rem; line-height: 1.15; opacity: 0.95; white-space: nowrap; }
.site-bar a:focus-visible { outline: 3px solid #DDAE4E; outline-offset: 2px; }


/* Pantallas muy estrechas: el interruptor de inglés baja de línea en vez de salirse */
@media (max-width: 360px) { .act-header { flex-wrap: wrap; row-gap: 0.5rem; } }

/* ════════════════════════════════
   v2.12 · Móvil primero: lo que se juega, arriba; las opciones del adulto, abajo
════════════════════════════════ */
/* Barra de marca compacta en el móvil: el nombre nunca se recorta */
.site-bar-brand { flex-shrink: 0; }
@media (max-width: 520px) {
  :root { --site-bar-h: 48px; }
  .site-bar-logo { width: 28px; height: 28px; }
  .site-bar-line, .site-bar-btn-es { display: none; }
  .site-bar-name { font-size: 0.95rem; }
  .site-bar-btn { min-height: 36px; max-width: 7.2rem; padding: 0.2rem 0.6rem; border-radius: 10px; }
  .site-bar-btn-en { white-space: normal; font-size: 0.72rem; line-height: 1.15; }
}

/* Libro: al ocultar el texto, su espacio se recoge y la ilustración crece */
.book-stage.text-off .page-text-area p { display: none; }

/* Encabezados compactos en el móvil: una sola fila */
@media (max-width: 600px) {
  .act-header, .book-header { padding: 0.45rem 0.7rem; gap: 0.5rem; flex-wrap: nowrap; }
  .act-header .btn-back, .book-header .btn-back { padding: 0.3rem 0.55rem; font-size: 0.85rem; flex: none; }
  .act-header h2 { font-size: 1rem; line-height: 1.2; flex: 1; min-width: 0; }
  .act-header h2 .btn-label-en { display: block; font-size: 0.7rem; }
  .en-switch { padding: 0.2rem 0.25rem 0.2rem 0.5rem; font-size: 0.75rem; gap: 0.3rem; }
  .en-switch-track { min-width: 2.1rem; height: 1.25rem; font-size: 0.62rem; }
  .act-instruction { font-size: 0.95rem; padding: 0.5rem 1rem 0.2rem; }
  .btn-instr { width: 2rem; height: 2rem; font-size: 0.95rem; margin-left: 0.35rem; }
}

/* Fila de la pregunta: botón de escuchar + pregunta escrita, juntos */
.q-row { display: flex; align-items: center; justify-content: center; gap: 0.7rem; padding: 0.5rem 1rem; width: 100%; max-width: 640px; margin: 0 auto; }
.q-row .btn-listen-q { flex: none; font-size: 0.95rem; line-height: 1.15; padding: 0.5rem 0.9rem; }
.q-text { font-family: var(--font-title); font-weight: 700; font-size: 1.3rem; line-height: 1.25; color: var(--ink); }
.q-text.hidden { display: none; }
#act2-q-text:not(.hidden) { margin-top: 0; }
@media (max-width: 600px) { .q-text { font-size: 1.15rem; } }

/* Opciones para el adulto, siempre abajo */
.act-options { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; width: 100%; max-width: 640px;
  margin: 0.4rem auto 0; padding: 0.8rem 1rem 1.6rem; border-top: 1px dashed var(--sand); }
.act-options .act2-mode-toggle, .act-options .act3-room-toggle { padding: 0; gap: 0.4rem; }
.act-options .mode-label { font-size: 0.78rem; }
.act-options .btn-set { font-size: 0.8rem; padding: 0.3rem 0.75rem; }

/* Tarjetas para elegir: caben 3 en una fila del móvil */
@media (max-width: 600px) {
  .choices-grid { gap: 0.6rem; padding: 0.5rem 0.8rem 0.6rem; flex-wrap: nowrap; }
  .choice-card { flex: 1 1 0; min-width: 0; max-width: 180px; min-height: 0; padding: 0.6rem; }
  .choice-card .flashcard-svg-wrap { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .choice-card .flashcard-svg-wrap img { width: 100%; height: 100%; object-fit: contain; }
  .feedback-area { min-height: 2.2rem; padding: 0.3rem 1rem; }
}

/* Actividad 3: en el móvil, pregunta → sala → mensaje → opciones; en PC, la sala a la izquierda */
.act3-layout { display: grid; grid-template-areas: "q" "scene" "fb" "opts"; width: 100%; max-width: 640px; margin: 0 auto; }
.act3-q { grid-area: q; } .act3-scene { grid-area: scene; } .act3-fb { grid-area: fb; } .act3-opts { grid-area: opts; }
.act3-layout .act3-scene { max-width: none; padding: 0 0.75rem 0.4rem; }
.act3-q .q-text { color: var(--teal); }
@media (min-width: 960px) {
  .act3-layout { max-width: 1240px; padding: 0.4rem 1.2rem 1.2rem; column-gap: 1.6rem; align-items: start;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr); grid-template-rows: auto auto 1fr;
    grid-template-areas: "scene q" "scene fb" "scene opts"; }
  .act3-layout .act3-scene { padding: 0; }
  .act3-q { flex-direction: column; align-items: stretch; padding: 0.4rem 0 0; }
  .act3-q .q-text { text-align: center; font-size: 1.45rem; }
  .act3-opts { border-top: 1px dashed var(--sand); margin-top: 0; }
}

/* Libro en el móvil: la ilustración arriba, el texto justo debajo (sin franjas vacías) */
@media (max-width: 759px) {
  .book-page .page-illustration { flex: 0 0 auto; }
  .book-page .page-text-area { flex: 1 1 auto; justify-content: flex-start; }
}
/* Libro en PC: la ilustración cabe completa entre la barra y los controles */
@media (min-width: 760px) {
  .scene-img { max-height: min(480px, calc(100vh - 300px)); }
}
/* Escucha y elige / Otra imagen en PC: tarjetas más grandes */
@media (min-width: 601px) {
  .choice-card .flashcard-svg-wrap { width: 150px; height: 150px; }
  .choice-card .flashcard-svg-wrap img { width: 100%; height: 100%; object-fit: contain; }
  .choice-card { min-height: 0; }
}
/* Las pantallas ocupan el alto visible descontando la barra de marca */
.screen { min-height: calc(100vh - var(--site-bar-h)); }
@supports (height: 100dvh) { .screen { min-height: calc(100dvh - var(--site-bar-h)); } }

/* ════════════════════════════════
   v2.13
════════════════════════════════ */
/* Inglés de los botones: oculto mientras «English» está apagado (los textos de contenido no cambian) */
body:not(.en-active) .btn-sub-en, body:not(.en-active) .btn-start-en,
body:not(.en-active) .btn-en-inline, body:not(.en-active) .qa-generic small { display: none !important; }

/* Inicio: interruptor de inglés compacto, debajo de los botones */
.lang-toggle-wrap { width: auto; max-width: none; margin: 1rem auto 0.2rem; }
.lang-toggle-label { width: auto; padding: 0.4rem 0.55rem 0.4rem 1rem; border-width: 2px; border-radius: 999px;
  box-shadow: none; gap: 0.7rem; }
.lang-toggle-text { font-size: 0.92rem; }

/* Libro: botón de texto con icono en el encabezado */
.btn-text-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--teal); background: var(--paper); color: var(--teal);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 0; }
.btn-text-icon .txt-ico { font-size: 1.05rem; line-height: 1; }
.btn-text-icon .txt-lbl { font-size: 0.5rem; font-weight: 800; letter-spacing: 0.03em; line-height: 1; }
.btn-text-icon[aria-pressed="true"] { background: var(--teal); color: #fff; }
[data-theme="dark"] .btn-text-icon[aria-pressed="true"] { color: #0B2A2C; }
.btn-text-icon:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.book-header .book-progress { margin-left: auto; }
#scene-counter { font-size: 0.95rem; }
.btn-text-toggle { display: none !important; }

/* Libro: controles en una sola fila; el aviso de audio solo ocupa sitio si hay algo que decir */
.ctrl-row-main { flex-wrap: nowrap; }
.audio-status:empty { display: none; }
@media (max-width: 759px) {
  /* La página se desplaza; los controles quedan fijos abajo sin tapar el texto */
  #screen-book .book-stage { overflow: visible; flex: none; }
  #screen-book .book-page:not(.hidden) { position: static; width: 100%; }
  #screen-book .page-text-area { padding: 0.8rem 1.1rem calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
  .book-controls { position: fixed; left: 0; right: 0; bottom: 0; padding: 0.45rem 0.7rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(18,59,60,0.12); }
  .book-controls .btn-ctrl { padding: 0.45rem 0.8rem; }
  .btn-qa { min-height: 0; padding: 0.5rem 0.8rem; font-size: 1.05rem; }
  .qa-stack { gap: 0.5rem; }
  .text-es { font-size: 1.2rem; }
}

/* Actividades: título centrado bajo la barra de navegación */
.act-header { justify-content: space-between; }
.act-titlebar { text-align: center; padding: 0.6rem 1rem 0; }
.act-titlebar h2 { font-family: var(--font-title); font-size: 1.3rem; line-height: 1.2; color: var(--teal); margin: 0; }
.act-titlebar h2 .btn-label-en { display: block; font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.act-titlebar + .act-instruction { padding-top: 0.15rem; }
@media (max-width: 600px) { .act-titlebar h2 { font-size: 1.15rem; } }

/* Pie de actividad: «Actividad 1 de 6» + siguiente */
.act-next { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem 0.8rem;
  padding: 0.4rem 1rem 1.6rem; font-size: 0.85rem; color: var(--ink-soft); }
.btn-next-act { background: var(--paper); color: var(--teal); border: 1.5px solid var(--teal); border-radius: 20px;
  padding: 0.35rem 0.95rem; font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: var(--font-body); }
.btn-next-act:hover { background: var(--teal); color: #fff; }
[data-theme="dark"] .btn-next-act:hover { color: #0B2A2C; }
.act-options { padding-bottom: 0.8rem; }
body:not(.en-active) .btn-qa small { display: none !important; }
.act-count .btn-label-en { display: inline; }
@media (max-width: 759px) {
  /* La página del libro llena el alto disponible: sin franjas vacías bajo el texto */
  #screen-book .book-stage { flex: 1 0 auto; }
  #screen-book .book-page:not(.hidden) { flex: 1 0 auto; }
}
.en-active .act-count .btn-label-en { display: inline !important; font-size: inherit; margin: 0; }

/* ════════════════════════════════
   v2.14
════════════════════════════════ */
/* Inicio: el título en inglés va justo debajo del título grande */
.home-title-en { margin-top: 0.15rem; opacity: 0.8; }

/* Buscamos en la sala · Tarjetas: 3 arriba y 3 abajo, como en las demás actividades */
#act3-scene .flashcard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; max-width: 560px; margin: 0 auto; padding: 0; }
#act3-scene .choice-card { min-width: 0; min-height: 0; padding: 0.55rem; }
#act3-scene .choice-card .flashcard-svg-wrap { width: 100%; height: auto; aspect-ratio: 1 / 1; }
#act3-scene .choice-card .flashcard-svg-wrap img { width: 100%; height: 100%; object-fit: contain; border-radius: 10px; }
@media (max-width: 600px) { #act3-scene .flashcard-grid { gap: 0.5rem; } }

/* Buscamos en la sala · Salas: las zonas tocables son invisibles; la ilustración se ve limpia.
   Solo al acertar aparece un halo dorado alrededor del objeto. (El editor ?editar las sigue mostrando.) */
.scene-stage:not(.edit) .hs { background: transparent; border-color: transparent; }
.scene-stage:not(.edit) .hs .hs-card, .scene-stage:not(.edit) .hs .img-missing { display: none; }
.scene-stage:not(.edit) .hs:hover { opacity: 1; }
.scene-stage:not(.edit) .hs.correct-hs { border: 3px solid #DDAE4E;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.75), 0 0 18px 6px rgba(221,174,78,0.75); }
#act3-scene .choice-card.correct-hs { border-color: var(--teal); background: var(--teal-wash); box-shadow: 0 0 0 4px rgba(15,109,115,0.2); }

/* PC: la fila de navegación de cada pantalla (← Inicio / ← Actividades, título, English) queda centrada
   con el contenido, en vez de irse a los bordes de la ventana */
@media (min-width: 761px) {
  .act-header, .book-header { padding-left: max(1.2rem, calc((100% - 560px) / 2)); padding-right: max(1.2rem, calc((100% - 560px) / 2)); }
}

/* ════════════════════════════════
   v2.16
════════════════════════════════ */
/* PC: los controles del libro (Anterior · Repetir · Siguiente) centrados como la barra y el encabezado */
@media (min-width: 761px) {
  .book-controls { padding-left: max(1rem, calc((100% - 560px) / 2)); padding-right: max(1rem, calc((100% - 560px) / 2)); }
}
/* «Repetir» se resalta mientras suena el audio */
.btn-ctrl.btn-listen.is-playing { background: #FBE3DB; box-shadow: 0 0 0 3px rgba(222,95,65,0.25); animation: listenPulse 1.4s ease-in-out infinite; }
@keyframes listenPulse { 50% { box-shadow: 0 0 0 6px rgba(222,95,65,0.12); } }
[data-theme="dark"] .btn-ctrl.btn-listen.is-playing { background: rgba(242,194,179,0.15); }
@media (prefers-reduced-motion: reduce) { .btn-ctrl.btn-listen.is-playing { animation: none; } }
.book-progress:empty, #scene-counter:empty { display: none; }

/* Colores de marca: encabezados, controles y panel del texto en crema (#FFF9F1) con línea arena */
html:not([data-theme="dark"]) .act-header, html:not([data-theme="dark"]) .book-header {
  background: #FFF9F1; box-shadow: none; border-bottom: 1px solid #E3D6BF; }
html:not([data-theme="dark"]) .book-controls { background: #FFF9F1; border-top: 1px solid #E3D6BF; }
html:not([data-theme="dark"]) .page-text-area { background: #FFF9F1; }
@media (min-width: 760px) { html:not([data-theme="dark"]) .page-text-area { border-left: 1px solid #E3D6BF; } }
@media (max-width: 759px) { html:not([data-theme="dark"]) .book-controls { box-shadow: 0 -2px 10px rgba(18,59,60,0.08); } }

/* ════════════════════════════════
   v2.18 · Inicio en inglés + cuaderno de actividades
════════════════════════════════ */
.btn-home { display: block; font-weight: 700; line-height: 1.2; }
a.btn-main { text-decoration: none; color: var(--ink); }
.btn-book { border-color: var(--teal); }
.btn-book:hover, .btn-book:focus-visible { background: var(--teal); color: #fff; }
[data-theme="dark"] .btn-book:hover { color: #0B2A2C; }
.site-bar-btn-es:empty { display: none; }
.site-cta-book { background: var(--teal, #0F6D73); border-color: #0F6D73; }

/* v2.19 · Botón naranja de la barra: una sola línea, texto grande en inglés */
.site-bar-btn { flex-direction: row; padding: 0.35rem 1rem; }
.site-bar-btn-en { font-size: 1rem; white-space: nowrap; }
@media (max-width: 520px) {
  .site-bar { gap: 0.5rem; padding-left: 0.6rem; padding-right: 0.6rem; }
  .site-bar-btn { max-width: none; min-height: 38px; padding: 0.3rem 0.75rem; }
  .site-bar-btn-en { white-space: nowrap; font-size: 0.95rem; }
}
@media (max-width: 380px) {
  .site-bar-logo { width: 26px; height: 26px; }
  .site-bar-name { font-size: 0.88rem; }
  .site-bar-btn { padding: 0.3rem 0.6rem; }
  .site-bar-btn-en { font-size: 0.86rem; }
}
@media (max-width: 340px) {
  .site-bar-name { font-size: 0.8rem; }
  .site-bar-btn-en { font-size: 0.78rem; }
}
