/* ════════════════════════════════════════════════════════════════
   PALETA DE MARCA — Universidad ESAN (guinda)
   El tema completo usa estas variables. Cuando tengas el código de
   color OFICIAL de ESAN, cámbialo AQUÍ y se actualiza todo el sitio.
   (Antes el tema era morado.)
   ════════════════════════════════════════════════════════════════ */
:root {
  --brand:        #9e1b32;  /* guinda principal */
  --brand-strong: #7a1428;  /* guinda oscuro / texto destacado */
  --brand-2:      #b5253f;  /* guinda claro / 2do color del degradado */
  --brand-dark:   #6e1023;  /* guinda muy oscuro */
  --brand-deep:   #5e0f1f;  /* guinda profundo */
  --brand-soft:   #d98a99;  /* guinda apagado / acento suave */
  --brand-100:    #f7e7ea;  /* tinte claro de fondo */
  --brand-150:    #f0d6dc;  /* borde suave */
  --brand-200:    #e8c3cb;  /* borde / hover claro */
  --brand-50:     #fcf4f6;  /* fondo casi blanco */
  --splash-1:     #2a0810;  /* degradado del splash (oscuro) */
  --splash-2:     #5e0f1f;  /* degradado del splash (medio) */
  --splash-3:     #1a0509;  /* degradado del splash (oscuro) */
}

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

body {
  min-height: 100vh;
  font-family: 'Inter', Arial, sans-serif;
  background: linear-gradient(135deg, var(--splash-1) 0%, var(--splash-2) 50%, var(--splash-3) 100%);
  color: #27303f;
}

/* ── ONBOARDING ── */
.onboarding-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.onboarding-card {
  position: relative;
  background: #ffffff;
  border-radius: 28px;
  width: min(500px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
.onboarding-back {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: inherit;
}
.onboarding-back:hover { background: rgba(255, 255, 255, 0.32); }

.onboarding-hero {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  padding: 40px 36px 32px;
  text-align: center;
  color: white;
}

.hero-avatar {
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.hero-avatar-img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.3));
}

.onboarding-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 0.92rem;
  opacity: 0.88;
  line-height: 1.5;
  margin-bottom: 16px;
}

.idioma-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  color: white;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 16px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.3);
}

.form-section { padding: 28px 32px 36px; }

.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.text-input, select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Inter', Arial, sans-serif;
  background: #fafafa;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.chip {
  font-size: 0.83rem;
  padding: 9px 12px;
  border-radius: 16px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  font-family: 'Inter', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover { border-color: var(--brand-200); color: var(--brand-deep); }

.chip.selected {
  background: var(--brand-100);
  border-color: var(--brand);
  color: var(--brand-deep);
  font-weight: 600;
}
/* Categoría activa (Games/Vocabulario): guinda sólido para que se note claramente */
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
  font-weight: 600;
}

.chips-error { color: #ef4444; font-size: 0.82rem; margin-top: 8px; }

.start-btn {
  margin-top: 28px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: 'Inter', Arial, sans-serif;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

.start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(124,58,237,0.5);
}

.start-btn:active { transform: translateY(0); }

/* ── CHAT ── */
.chat-shell {
  width: min(880px, calc(100% - 32px));
  margin: 32px auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
}

.chat-header {
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.header-left { display: flex; align-items: center; gap: 14px; }

.flow-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.flow-avatar {
  font-size: 1.8rem;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
}
/* Logo FLOW! como avatar del header (imagen propia) */
.flow-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.45);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid var(--brand-strong);
}

.header-text { min-width: 0; flex: 1; }
.header-text h1 { font-size: 1.2rem; font-weight: 700; }
.header-sub {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.reset-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.15s;
}

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

/* El botón de ayuda lleva fondo blanco; el icono va en guinda para resaltar sobre él */
#help-btn { background: white; border-color: white; color: var(--brand-strong); }
#help-btn:hover { background: #f1f1f1; }
/* Iconos SVG dentro de los botones del header: algo más chicos que en el drawer */
.header-actions .nav-ic { width: 20px; height: 20px; }
#nav-toggle .nav-ic { width: 22px; height: 22px; }

/* Toggle de ayuda en español: resaltado (blanco) cuando está activo */
.es-toggle { font-weight: 800; letter-spacing: 0.5px; }
.es-toggle.active { background: #fff; color: var(--brand-strong); border-color: #fff; }
.es-toggle.active:hover { background: #f1f1f1; }

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  background: #f8f9fc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message {
  max-width: 72%;
  padding: 12px 16px;
  border-radius: 20px;
  line-height: 1.5;
  word-wrap: break-word;
  font-size: 0.94rem;
  animation: fadeIn 0.2s ease;
}

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

.message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 12px rgba(124,58,237,0.3);
}

.message.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.message.correction {
  align-self: flex-start;
  max-width: 72%;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  color: #78350f;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 10px 16px;
  font-size: 0.87rem;
  line-height: 1.55;
}

.message.error {
  align-self: flex-start;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #7f1d1d;
  border-radius: 14px;
}

.message.typing {
  align-self: flex-start;
  background: #f3f4f6;
  color: #9ca3af;
  font-style: italic;
  font-size: 0.88rem;
  animation: pulse 1.2s infinite;
  border-radius: 20px;
  border-bottom-left-radius: 4px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* ── FORM ── */
.chat-form-wrap {
  padding: 16px 20px 20px;
  background: white;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0;
}

.chat-form {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 16px;
  padding: 6px 6px 6px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

.chat-form input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-family: 'Inter', Arial, sans-serif;
  color: #111827;
  outline: none;
  padding: 6px 0;
}

.chat-form input::placeholder { color: #9ca3af; }

.chat-form button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(124,58,237,0.4);
}

.chat-form button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(124,58,237,0.5);
}

/* ── Burbuja verde: versión correcta ── */
.message.corrected {
  align-self: flex-start;
  max-width: 72%;
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  color: #065f46;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 10px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  font-weight: 500;
}

/* ── Header actions / modos ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;   /* nunca recortar el chip de XP / ES / ayuda (clave en móvil) */
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.4) transparent;
}
.header-actions::-webkit-scrollbar { height: 6px; }
.header-actions::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.35); border-radius: 3px; }
.header-actions::-webkit-scrollbar-track { background: transparent; }
.mode-btn { flex-shrink: 0; white-space: nowrap; }
.reset-btn { flex-shrink: 0; }

.mode-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: background 0.15s;
  white-space: nowrap;
}

.mode-btn:hover { background: rgba(255,255,255,0.2); }
.mode-btn.active { background: white; color: var(--brand-strong); font-weight: 600; }

/* ── Pantalla de Login / Registro ── */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  background: white;
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-card .text-input { width: 100%; margin-bottom: 10px; }
.auth-hero { text-align: center; margin-bottom: 20px; }
.auth-wave { font-size: 2.6rem; }
.auth-hero h1 { color: var(--brand-strong); font-size: 1.5rem; margin-top: 4px; }
.auth-sub { color: #6b7280; font-size: 0.9rem; margin-top: 6px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; padding: 10px; border: none; border-radius: 10px; cursor: pointer;
  background: #f3f4f6; color: #6b7280; font-weight: 600; font-family: 'Inter', Arial, sans-serif;
}
.auth-tab.active { background: var(--brand); color: white; }
.auth-error { color: #dc2626; font-size: 0.85rem; margin: 4px 0; text-align: center; }
.auth-divider { display: flex; align-items: center; text-align: center; color: #9ca3af; margin: 16px 0; font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #e5e7eb; }
.auth-divider span { padding: 0 12px; }
.auth-guest-btn {
  width: 100%; padding: 12px; border: 1.5px solid var(--brand-150); border-radius: 12px;
  background: white; color: var(--brand-strong); font-weight: 600; cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
}
.auth-guest-btn:hover { border-color: var(--brand); }
.auth-guest-btn small { display: block; font-size: 0.72rem; color: #9ca3af; font-weight: 500; margin-top: 2px; }
.auth-hint { margin-top: 14px; text-align: center; font-size: 0.82rem; color: #6b7280; line-height: 1.4; }
.auth-demos { margin-top: 20px; text-align: center; }
.auth-demos-title { font-size: 0.8rem; color: #9ca3af; }
.auth-demos-row { display: flex; gap: 8px; margin-top: 8px; }
.auth-demo-btn {
  flex: 1; padding: 10px; border: 1px dashed var(--brand-200); border-radius: 10px;
  background: var(--brand-50); color: var(--brand-strong); font-weight: 600; cursor: pointer;
  font-size: 0.85rem; font-family: 'Inter', Arial, sans-serif;
}
.auth-demo-btn:hover { border-style: solid; border-color: var(--brand); }

/* Chip de XP / racha en el header */
.xp-chip {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Pill de acceso rápido a las misiones diarias (junto al chip de XP en el header) */
.daily-pill {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: background .15s, transform .15s;
}
.daily-pill:hover { background: rgba(255,255,255,0.3); transform: translateY(-1px); }
/* Resalte dorado y pulso cuando hay recompensa por reclamar */
.daily-pill.claim {
  background: #fbbf24; color: #7c2d12; border-color: #fbbf24;
  animation: dailyPulse 1.6s ease-in-out infinite;
}
@keyframes dailyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
}

/* ── Navegación: botón hamburguesa + menú lateral (drawer) ── */
.nav-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-toggle:hover { background: rgba(255,255,255,0.15); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 90;
}
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 264px;
  max-width: 82vw;
  background: white;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  display: flex;
  flex-direction: column;
  padding: 12px;
  overflow-y: auto;
}
.nav-drawer.open { transform: translateX(0); }
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px 14px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 8px;
}
.nav-drawer-title { font-weight: 700; color: var(--brand-strong); font-size: 1.1rem; }
/* El icono de cuadrícula que inyecta el JS va separado del texto "Modes" */
.nav-drawer-title .nav-ic { width: 22px; height: 22px; margin-right: 8px; vertical-align: -5px; }
.nav-close {
  background: none;
  border: none;
  color: #6b7280;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}
.nav-close:hover { background: #f3f4f6; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  margin-bottom: 2px;
  border: none;
  background: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  transition: background 0.12s;
}
.nav-item:hover { background: var(--brand-50); }
.nav-item.active { background: var(--brand); color: white; }
/* Iconos SVG del menú (reemplazan los emoji): un solo trazo, heredan el color del item
   (gris normal, blanco en el activo, gracias a stroke:currentColor). */
.nav-ic { width: 24px; height: 24px; flex: none; display: inline-flex; vertical-align: middle; color: inherit; }
.nav-ic svg { width: 100%; height: 100%; display: block; }

/* Indicación de la estrella en la cabecera del drawer */
.nav-hint { margin: 2px 6px 10px; font-size: 0.78rem; color: #9aa0a6; display: block; line-height: 1.3; }
.nav-hint .es-hint { display: none; }
body.show-es .nav-hint .es-hint { display: block; margin-top: 1px; }
.nav-hint-star { color: #f5b301; font-size: 0.9rem; }

/* Estrella "pantalla de inicio" en cada modo del menú */
.nav-star {
  margin-left: auto; flex: none; width: 30px; height: 30px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 8px; color: inherit;
  opacity: 0.38; cursor: pointer; transition: opacity 0.12s, background 0.12s, transform 0.1s;
}
.nav-star:hover { opacity: 0.85; background: rgba(0,0,0,0.06); }
.nav-star:active { transform: scale(0.88); }
.nav-item.active .nav-star:hover { background: rgba(255,255,255,0.18); }
.nav-star svg { width: 19px; height: 19px; }
.nav-star.on { opacity: 1; color: #f5b301; }                 /* estrella dorada = tu inicio */
.nav-item.active .nav-star.on { color: #ffdf7e; }
.nav-star.on svg { fill: currentColor; }

/* Banner ilustrado del modo Reading (rincón de lectura, gpt-image-1) */
.reading-banner {
  height: 132px; border-radius: 16px; margin: 0 0 14px;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0) 45%),
    url('/static/img/reading_bg.jpg') center 42% / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 4px 14px rgba(60,30,10,0.12);
}

/* Banners ilustrados del resto de modos (gpt-image-1): base + un modificador por modo */
.mode-banner {
  height: 126px; border-radius: 16px; margin: 0 0 14px; position: relative;
  background-position: center 42%; background-size: cover; background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 4px 14px rgba(60,30,10,0.12);
}
.mode-banner::after {
  content: ''; position: absolute; inset: 0; border-radius: 16px; pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,0.14) 0%, rgba(0,0,0,0) 45%);
}
.mode-banner--exercise  { background-image: url('/static/img/exercise_bg.jpg'); }
.mode-banner--guide     { background-image: url('/static/img/guide_bg.jpg'); }
.mode-banner--roleplay  { background-image: url('/static/img/roleplay_bg.jpg'); }
.mode-banner--vocab     { background-image: url('/static/img/vocab_bg.jpg'); }
.mode-banner--listening { background-image: url('/static/img/listening_bg.jpg'); }
.mode-banner--speaking  { background-image: url('/static/img/speaking_bg.jpg'); }
.mode-banner--present   { background-image: url('/static/img/present_bg.jpg'); }
.mode-banner--games     { background-image: url('/static/img/games_bg.jpg'); }

/* ── Emociones del pet (animación, sin tocar los sprites) ── */
#pet-art .pet-img { transform-origin: center bottom; animation: petBreathe 3.4s ease-in-out infinite; }
@keyframes petBreathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.015); } }
.pet-happy { animation: petHappy 0.9s ease-out !important; transform-origin: center bottom; }
@keyframes petHappy {
  0%   { transform: translateY(0) scale(1,1); }
  22%  { transform: translateY(-20px) scale(1.06,0.94); }
  44%  { transform: translateY(0) scale(1.03,0.97); }
  62%  { transform: translateY(-10px) scale(1.04,0.96); }
  100% { transform: translateY(0) scale(1,1); }
}
.pet-sad { animation: petSad 1s ease-in-out !important; transform-origin: center bottom; filter: grayscale(0.5) brightness(0.92); }
@keyframes petSad {
  0%   { transform: translateY(0) rotate(0); }
  20%  { transform: translateY(3px) rotate(-5deg); }
  50%  { transform: translateY(5px) rotate(4deg); }
  80%  { transform: translateY(4px) rotate(-2deg); }
  100% { transform: translateY(4px) rotate(0); }
}
/* "Pop" al cambiar de especie o postura: el nuevo fighter entra con un rebote elástico */
.pet-pop { animation: petPop 0.5s cubic-bezier(.34,1.56,.64,1) !important; transform-origin: center bottom; }
@keyframes petPop {
  0%   { transform: scale(0.55) rotate(-9deg); opacity: 0.35; }
  60%  { transform: scale(1.12) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  #pet-art .pet-img, .pet-happy, .pet-sad, .pet-pop { animation: none !important; }
}
/* Pista en español dentro de un modo: línea secundaria bajo el nombre en inglés.
   El <span> queda como columna para apilar inglés (arriba) y español (abajo). */
.nav-item span { display: flex; flex-direction: column; line-height: 1.2; }
.nav-item .es-hint { margin-top: 1px; font-size: 0.74rem; font-weight: 600; }
/* En el modo activo (fondo guinda) el gris pierde contraste: lo aclaramos. */
.nav-item.active .es-hint { color: rgba(255,255,255,0.85); }
/* Separador entre los modos y la acción de salir */
.nav-drawer-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 10px 6px;
}
/* "Salir / nueva sesión": acción de cuenta, visualmente distinta de los modos */
.nav-item-exit { color: #6b7280; font-weight: 600; }
.nav-item-exit:hover { background: #fdecee; color: var(--brand-strong); }
.nav-item-pet { font-weight: 700; }

/* ── Mi panda (mascota evolutiva) ── */
.pet-card {
  max-width: 420px;
  margin: 18px auto;
  padding: 22px 22px 26px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.pet-stage-badge {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.pet-art {
  width: 200px;
  height: 200px;
  margin: 10px auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pet-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.pet-species-label {
  margin-top: 18px;
  font-weight: 700;
  color: #4b5563;
  font-size: 0.9rem;
}
/* Línea de contexto bajo un panel (para que no "aparezca de golpe" sin explicación) */
.pet-hint { font-size: 0.8rem; color: #6b7280; margin: 2px 0 8px; line-height: 1.4; }
/* Aviso de progressive disclosure: dice al novato que hay más al subir de nivel */
.pet-disclosure { font-size: 0.85rem; color: #6b7280; margin: 14px 0 4px; padding: 10px 14px;
  background: var(--brand-50, #f0fdf4); border: 1px dashed var(--brand-200, #bbf7d0); border-radius: 12px; line-height: 1.45; }
.pet-species {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.species-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 66px;
  padding: 6px 4px;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7280;
  transition: border-color 0.12s, background 0.12s;
}
.species-btn img { width: 40px; height: 40px; object-fit: contain; }
.species-btn:hover { border-color: var(--brand); }
.species-btn.active {
  border-color: var(--brand);
  background: var(--brand-50);
  color: var(--brand-strong);
}
/* Ficha del fighter (rol, pasiva, significado, descripción) */
.pet-info {
  margin-top: 14px;
  background: var(--brand-50);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
}
.pet-info-name { font-weight: 800; color: var(--brand-strong); }
.pet-info-meaning { display: block; font-weight: 600; color: #6b7280; font-size: 0.78rem; }
.pet-info-role { font-weight: 700; color: #374151; font-size: 0.85rem; margin: 4px 0; }
.pet-info-desc { color: #4b5563; font-size: 0.86rem; line-height: 1.5; }
/* Especie de edición especial (Samurai Blue) */
.species-btn { position: relative; }
.species-special {
  border-color: #2b3a8f;
  background: linear-gradient(180deg, #eef2ff, #fff);
}
.species-special.active { border-color: #1e2a6b; background: #e6ebff; color: #1e2a6b; }
.species-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  font-size: 0.7rem;
}
/* Botón demo especial en el login */
.auth-demo-special {
  background: linear-gradient(90deg, #1e2a6b, #2b3a8f) !important;
  color: #fff !important;
  border-color: #1e2a6b !important;
}

/* Línea de evolución (recorrido completo de la especie) */
.pet-evo { margin-top: 18px; }
.pet-evo-title {
  font-weight: 700;
  color: #4b5563;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.pet-evo-track {
  display: flex;
  gap: 6px;
  justify-content: center;
  overflow-x: auto;
  padding: 4px 2px;
}
.evo-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  width: 56px;
  cursor: pointer;
}
.evo-cell .evo-art { transition: outline 0.12s, transform 0.12s; }
.evo-cell:hover .evo-art { transform: translateY(-2px); }
.evo-cell.viewing .evo-art { outline: 3px solid var(--brand); outline-offset: 1px; }
.evo-art {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #f7f7fa;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.evo-art .pet-img { width: 100%; height: 100%; }
.evo-name { font-size: 0.62rem; font-weight: 600; color: #9ca3af; }
.evo-cell.current .evo-art {
  border-color: var(--brand);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(158, 27, 50, 0.12);
}
.evo-cell.current .evo-name { color: var(--brand-strong); font-weight: 700; }
.evo-cell.locked .evo-art { filter: grayscale(1); opacity: 0.4; }

/* ── Postura de combate (Fase 4) ── */
.pet-stance-wrap { margin-top: 14px; }
.pet-stance { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.stance-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 96px;
  padding: 8px 10px;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}
.stance-btn:hover { border-color: var(--brand); }
.stance-btn.active { border-color: var(--brand); background: var(--brand-50); }
/* Postura seleccionada para PREVISUALIZAR (aún no aplicada) */
.stance-btn.pending { border-color: #f59e0b; border-style: dashed; background: #fffbeb; }
.stance-btn.pending .stance-name { color: #b45309; }
.stance-apply { margin-top: 10px; }
.stance-name { font-weight: 700; font-size: 0.9rem; color: #374151; }
.stance-btn.active .stance-name { color: var(--brand-strong); }
.stance-eff { font-size: 0.7rem; color: #9ca3af; }

/* ── Perks / loadout (Pilar 2) ── */
.pet-perks-wrap { margin-top: 14px; }
.perk-locked { font-size: 0.85rem; color: #9ca3af; padding: 10px; }
.perk-slots { font-size: 0.85rem; color: #374151; margin-top: 6px; }
.perk-slots b { color: var(--brand-strong); }
.perk-note { font-size: 0.72rem; color: #9ca3af; margin: 4px 0 10px; line-height: 1.3; }
.perk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.perk-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 1.5px solid #e5e7eb; border-radius: 12px; background: #fff; cursor: pointer; font-family: 'Inter', Arial, sans-serif; transition: all .15s; text-align: center; }
.perk-card:hover { border-color: var(--brand); }
.perk-card.on { border-color: var(--brand); background: var(--brand-50); }
.perk-emoji { font-size: 1.4rem; line-height: 1; }
.perk-name { font-weight: 800; font-size: 0.85rem; color: #374151; }
.perk-card.on .perk-name { color: var(--brand-strong); }
.perk-desc { font-size: 0.7rem; color: #9ca3af; }
.perk-on { font-size: 0.68rem; font-weight: 800; color: #166534; margin-top: 2px; }

/* ── Panel de stats del pet (preview de postura/perks) ── */
.pet-stats-wrap { margin-top: 14px; }
.pet-stats-wrap #pet-stats { max-width: 320px; margin: 8px auto 0; }
.stat-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #eef2f7; }
.stat-row:last-child { border-bottom: none; }
.stat-ico { width: 22px; text-align: center; }
.stat-lbl { flex: 1; text-align: left; color: #374151; font-size: 0.9rem; }
.stat-val { font-weight: 800; color: #1f2937; min-width: 38px; text-align: right; }
.stat-delta { min-width: 56px; text-align: right; font-size: 0.78rem; font-weight: 800; }
.stat-delta.up { color: #16a34a; }
.stat-delta.down { color: #dc2626; }
.stat-delta.same { color: #cbd5e1; }

/* ── Tabla comparativa entre especies (barras + número, scroll horizontal) ── */
.pet-compare-btn { margin-top: 8px; }
.pet-compare { margin-top: 10px; }
.cmp-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #eef2f7; border-radius: 12px; }
.cmp-table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 0.8rem; }
.cmp-table th, .cmp-table td { padding: 6px 8px; text-align: center; white-space: nowrap; }
.cmp-table thead th { color: #6b7280; font-weight: 700; border-bottom: 1px solid #e5e7eb; }
.cmp-table th small { display: block; font-size: 0.62rem; color: #9ca3af; font-weight: 600; }
.cmp-table tbody tr:nth-child(even) td { background: #f9fafb; }
.cmp-th-name, .cmp-name { text-align: left !important; font-weight: 800; color: #1f2937; position: sticky; left: 0; background: #fff; z-index: 1; }
.cmp-table tbody tr:nth-child(even) .cmp-name { background: #f9fafb; }
.cmp-bar { position: relative; width: 70px; height: 18px; background: #eef2f7; border-radius: 5px; overflow: hidden; margin: 0 auto; }
.cmp-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 5px; }
.cmp-fill.hp { background: #fca5a5; }
.cmp-fill.atk { background: #fdba74; }
.cmp-fill.def { background: #93c5fd; }
.cmp-fill.spd { background: #fde047; }
.cmp-fill.crit { background: #f9a8d4; }
.cmp-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; font-size: 0.72rem; font-weight: 800; color: #1f2937; }
.cmp-hint { font-size: 0.7rem; color: #9ca3af; margin-top: 6px; text-align: center; line-height: 1.3; }

/* ── Battle Arena (Fase 4) ── */
.arena { max-width: 560px; margin: 0 auto; padding: 8px; }
.arena-you { margin: 14px 0 8px; }
.arena-you-title, .arena-pick-label {
  font-weight: 700; color: #4b5563; font-size: 0.9rem; text-align: center; margin-bottom: 8px;
}
.fighter-card {
  background: #fff; border: 1px solid #eee; border-radius: 14px; padding: 12px;
  text-align: center; box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}
.fighter-card.you { border-color: var(--brand); }
.fighter-art { width: 96px; height: 96px; margin: 0 auto; }
.fighter-art.small { width: 64px; height: 64px; }
.fighter-art .pet-img { width: 100%; height: 100%; object-fit: contain; }
.fighter-name { font-weight: 800; color: #111827; margin-top: 4px; }
.fighter-role { font-size: 0.82rem; color: #6b7280; }
.fighter-trait { font-size: 0.74rem; color: var(--brand-strong); font-weight: 700; margin-top: 2px; }
.fighter-stats { font-size: 0.8rem; color: #4b5563; margin-top: 4px; }
.arena-rivals { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.rival-card {
  position: relative; width: 120px; padding: 10px 8px; border: 2px solid #eee;
  border-radius: 14px; background: #fff; cursor: pointer; font-family: inherit; text-align: center;
  transition: border-color 0.12s, transform 0.12s;
}
.rival-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.rival-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.arena-fighters {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-around; gap: 8px;
  margin: 8px 0 14px; padding: 26px 12px 16px; border-radius: 16px;
  overflow: hidden;
  /* Coliseo al atardecer: backdrop pintado (gpt-image-1) + overlays para asentar a los
     luchadores (refuerzo de spotlight en el piso + profundidad arriba/abajo + viñeta). */
  background:
    radial-gradient(64% 40% at 50% 95%, rgba(255,244,214,.30) 0%, rgba(255,244,214,0) 62%),
    linear-gradient(180deg, rgba(22,13,32,.16) 0%, rgba(22,13,32,0) 28%, rgba(30,16,10,.20) 100%),
    url('/static/img/arena_bg.jpg') center bottom / cover no-repeat;
  box-shadow: inset 0 0 42px rgba(30,15,8,.34);
}
/* Nombres/roles legibles sobre el fondo del coliseo */
.arena-fighters .fighter-name { text-shadow: 0 1px 2px rgba(255,250,240,.55); }
.arena-fighters .fighter-role,
.arena-fighters .fighter-trait { text-shadow: 0 1px 1px rgba(255,250,240,.5); }
.arena-side { flex: 1; text-align: center; position: relative; }
.arena-vs { font-size: 1.6rem; align-self: center; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }

/* Números de daño flotantes (dmg / CRIT / MISS / quemadura) sobre el rival */
.dmg-pop {
  position: absolute; top: 20%; transform: translate(-50%, 0);
  font-weight: 900; font-size: 1.15rem; white-space: nowrap; pointer-events: none; z-index: 5;
  color: #fff; text-shadow: 0 1px 0 #000, 0 0 4px rgba(0,0,0,.6);
  animation: dmgFloat 1.5s ease-out forwards;
}
.dmg-pop.crit  { font-size: 1.75rem; color: #fde047; text-shadow: 0 0 6px #f59e0b, 0 1px 0 #000; }
.dmg-pop.block { color: #cbd5e1; }
.dmg-pop.miss  { color: #e5e7eb; font-style: italic; font-weight: 800; }
.dmg-pop.burn  { color: #fb923c; }
.dmg-pop.heal  { color: #4ade80; }
@keyframes dmgFloat {
  0%   { opacity: 0; transform: translate(-50%, 8px)  scale(.7); }
  18%  { opacity: 1; transform: translate(-50%, -2px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(1); }
}
.hp-bar { height: 12px; background: #eee; border-radius: 999px; overflow: hidden; margin: 6px 4px 2px; }
.hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width 0.4s ease; }
.hp-fill.low { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.hp-num { font-size: 0.75rem; color: #6b7280; font-weight: 600; }
.arena-log {
  max-height: 200px; overflow-y: auto; background: #faf7f8; border-radius: 12px;
  padding: 10px 12px; font-size: 0.88rem; color: #374151;
}
.arena-log-line { padding: 2px 0; }
.arena-log-line.crit { color: var(--brand-strong); font-weight: 600; }
.arena-log-line.heal { color: #16a34a; }
.arena-log-line.xp { color: #16a34a; font-weight: 800; margin-top: 4px; }
.arena-result { text-align: center; font-size: 1.4rem; font-weight: 800; margin: 14px 0; min-height: 1.4em; }
.arena-result.win { color: #16a34a; }
.arena-result.lose { color: var(--brand-strong); }
.arena-log-line.heal { color: #16a34a; }
.arena-log-line.quiz-ok { color: #16a34a; font-weight: 700; }
.arena-log-line.quiz-bad { color: var(--brand-strong); font-weight: 700; }
/* ULTIMATE: línea destacada (dorada) cuando se descarga el golpe especial */
.arena-log-line.ult {
  color: #b45309; font-weight: 800; margin: 3px 0;
  background: linear-gradient(90deg, rgba(251,191,36,0.22), rgba(251,191,36,0));
  border-left: 3px solid #f59e0b; padding-left: 8px; border-radius: 4px;
}
.arena-log-line.burn { color: #ea580c; font-weight: 600; }

/* Panel de ejercicio en combate */
.arena-quiz {
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 14px;
  padding: 14px;
  margin: 8px 0 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  /* Altura reservada: así el panel no colapsa entre preguntas y el historial de
     daño de abajo NO salta cada vez que carga una pregunta nueva. */
  min-height: 290px;
  box-sizing: border-box;
}
.quiz-who { font-size: 0.8rem; font-weight: 700; color: var(--brand-strong); text-align: center; }
.quiz-q { font-size: 1.1rem; font-weight: 700; color: #111827; text-align: center; margin: 8px 0 12px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt {
  border: 2px solid #eee;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.quiz-opt:hover { border-color: var(--brand); background: var(--brand-50); }
.quiz-opt.right { border-color: #16a34a; background: #dcfce7; color: #166534; }
.quiz-opt.wrong { border-color: #ef4444; background: #fee2e2; color: #991b1b; }
.quiz-timer-bar { height: 6px; background: #eee; border-radius: 999px; margin-top: 12px; overflow: hidden; }
.quiz-timer { height: 100%; width: 100%; background: var(--brand); transition: width 0.1s linear; }
#arena-again { display: block; margin: 0 auto; }

/* ── Leaderboard (Fase 4) ── */
.leaderboard { max-width: 520px; margin: 0 auto; padding: 8px; }
.lb-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.lb-loading { text-align: center; color: #9ca3af; padding: 20px; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 8px 12px;
}
.lb-row.top { border-color: #f3d99b; background: linear-gradient(90deg, #fffdf5, #fff); }
.lb-row.me { border-color: var(--brand); background: var(--brand-50); }
.lb-rank { font-size: 1.1rem; font-weight: 800; width: 38px; text-align: center; color: #6b7280; }
.lb-art { width: 44px; height: 44px; flex: 0 0 auto; }
.lb-art .pet-img { width: 100%; height: 100%; object-fit: contain; }
.lb-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lb-name { font-weight: 800; color: #111827; }
.lb-name em { color: var(--brand-strong); font-style: normal; font-weight: 700; }
.lb-sub { font-size: 0.76rem; color: #6b7280; }
.lb-xp { font-weight: 800; color: var(--brand-strong); text-align: right; white-space: nowrap; }
.lb-xp small { display: block; font-size: 0.72rem; color: #9ca3af; font-weight: 600; }
.lb-guest-note {
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  background: var(--brand-50);
  padding: 12px;
  border-radius: 12px;
  margin-top: 6px;
}
.lb-challenge {
  flex: 0 0 auto;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
}
.lb-challenge:hover { filter: brightness(1.08); }

/* ── Arena: pestañas PvE / Hot-seat ── */
.arena-mode-tabs { display: flex; gap: 8px; justify-content: center; margin: 10px 0; }
.arena-tab {
  border: 2px solid #eee;
  background: #fff;
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #6b7280;
}
.arena-tab.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand-strong); }
.hs-pickers { display: flex; align-items: flex-start; justify-content: center; gap: 8px; margin: 8px 0; }
.hs-side { flex: 1; }
.hs-title { text-align: center; font-weight: 800; color: var(--brand-strong); margin-bottom: 6px; }
.hs-vs { align-self: center; font-size: 1.5rem; }
.hs-pick { display: flex; flex-direction: column; gap: 6px; }
.hs-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #eee;
  background: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-family: inherit;
}
.hs-opt:hover { border-color: var(--brand); }
.hs-opt.active { border-color: var(--brand); background: var(--brand-50); }
.hs-emoji { font-size: 1.1rem; }
.hs-name { font-weight: 700; font-size: 0.82rem; color: #374151; }
#hs-fight { display: block; margin: 6px auto 0; }
.pet-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  min-height: 38px;
}
.pet-name { font-size: 1.4rem; font-weight: 800; color: var(--brand-strong); }
.pet-name-edit {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.12s;
}
.pet-name-edit:hover { opacity: 1; }
.pet-name-input {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--brand);
  border-radius: 10px;
  padding: 6px 10px;
  width: 180px;
  font-family: inherit;
}
.pet-name-save {
  border: none;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.pet-level { margin-top: 6px; color: #6b7280; font-weight: 600; }
.pet-bar {
  height: 14px;
  background: #f1f1f4;
  border-radius: 999px;
  margin: 16px auto 8px;
  overflow: hidden;
  max-width: 320px;
}
.pet-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  border-radius: 999px;
  transition: width 0.5s ease;
}
.pet-bar-label { font-size: 0.9rem; color: #4b5563; font-weight: 600; }
.pet-flavor {
  margin: 14px auto 0;
  color: #6b7280;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 320px;
}
.pet-guest-note {
  margin-top: 14px;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.5;
  background: var(--brand-50);
  padding: 14px;
  border-radius: 12px;
}
/* Aviso flotante cuando el panda evoluciona */
.pet-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--brand-strong);
  color: #fff;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
}
.pet-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Botón "Ver mi diploma" en la tarjeta del pet (solo al graduarse) */
.pet-diploma-btn {
  margin-top: 14px;
  border: none;
  background: linear-gradient(90deg, var(--brand), var(--brand-strong));
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.pet-diploma-btn:hover { filter: brightness(1.06); }

/* Confeti de celebración (sin librerías) */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1200;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.92;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0); }
  100% { transform: translateY(106vh) rotate(720deg); }
}

/* Diploma de graduación */
.diploma-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
  padding: 20px;
}
.diploma {
  position: relative;
  background: #fffdf7;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.diploma-inner {
  border: 3px double var(--brand);
  border-radius: 12px;
  margin: 12px;
  padding: 24px 22px 26px;
  text-align: center;
}
.diploma-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #9ca3af;
}
.diploma-seal { font-size: 2.6rem; }
.diploma-title { color: var(--brand-strong); font-size: 1.5rem; margin: 4px 0 0; }
.diploma-sub {
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.8rem;
  margin: 2px 0 6px;
}
.diploma-pet { width: 130px; height: 130px; margin: 4px auto; }
.diploma-line { color: #4b5563; font-size: 0.95rem; margin: 6px 0; line-height: 1.5; }
.diploma-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
  margin: 6px 0;
  font-family: Georgia, 'Times New Roman', serif;
}
.diploma-date { color: #6b7280; font-size: 0.85rem; margin-top: 10px; }
.diploma-print {
  margin-top: 16px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
@media print {
  body * { visibility: hidden; }
  #diploma, #diploma * { visibility: visible; }
  #diploma { position: absolute; left: 0; top: 0; box-shadow: none; }
  .diploma-close, .diploma-print { display: none !important; }
}

/* ── Vista de ejercicios ── */
.exercise-view {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: #f8f9fc;
}

.ex-loading, .ex-error {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
  font-size: 0.95rem;
}
.ex-loading::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid var(--brand-100);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ex-error { color: #dc2626; }

.ex-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 8px;
}
/* Icono de modo inyectado al inicio del título de sección (applyTitleIcons) */
.ex-title .nav-ic { width: 24px; height: 24px; vertical-align: -5px; margin-right: 8px; }

.ex-intro {
  font-size: 0.9rem;
  color: #6b7280;
  background: var(--brand-100);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Crédito de fotos (cumple los términos de uso de Pexels/Pixabay) */
.img-credit {
  margin-top: 14px;
  text-align: center;
  font-size: 0.75rem;
  color: #9ca3af;
}
.img-credit a { color: #9ca3af; text-decoration: underline; }
.img-credit a:hover { color: var(--brand-600, #16a34a); }

.ex-text {
  font-size: 1.05rem;
  line-height: 2.4;
  color: #1f2937;
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
}

.ex-gap {
  display: inline-block;
  width: auto;
  min-width: 90px;
  padding: 5px 12px;
  margin: 0 4px;
  border: 1.5px solid var(--brand-200);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--brand-50);
  color: var(--brand-strong);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}

.ex-gap:hover { border-color: var(--brand); background: var(--brand-50); }
.ex-gap.chosen { background: var(--brand-100); border-color: var(--brand); color: var(--brand-deep); font-weight: 600; }

.ex-gap.gap-correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
}

.ex-gap.gap-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.ex-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: transform 0.15s;
}

.ex-btn:hover { transform: translateY(-1px); }

.ex-btn-secondary {
  background: white;
  color: var(--brand-strong);
  border: 1.5px solid var(--brand-200);
  margin-top: 10px;
}

.ex-result {
  display: none;
  margin-top: 20px;
  padding: 16px 20px;
  background: white;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  font-size: 0.95rem;
  color: #1f2937;
  line-height: 1.6;
  text-align: center;
}

/* ── Feedback de ejercicios ── */
.ex-score {
  font-size: 1.05rem;
  color: #1f2937;
  text-align: center;
  margin-bottom: 18px;
}

.ex-feedback-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 16px;
  text-align: left;
}

.fb-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  text-align: left;
}

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

.fb-num {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  color: white;
  white-space: nowrap;
}

.fb-ok  { background: #10b981; }
.fb-bad { background: #ef4444; }

.fb-body { font-size: 0.9rem; line-height: 1.6; color: #374151; }
.fb-answer { color: #059669; }
.fb-yours  { color: #dc2626; font-size: 0.85rem; }
.fb-rule   { color: #6b7280; font-size: 0.85rem; font-style: italic; }

/* ── Vista de lectura (Reading) ── */
.reading-passage {
  background: white;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  margin-bottom: 24px;
}

.reading-passage-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 14px;
}

.reading-passage p {
  font-size: 0.98rem;
  line-height: 1.7;
  color: #1f2937;
  margin-bottom: 14px;
}

.reading-passage p:last-child { margin-bottom: 0; }

.reading-questions-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1f2937;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 18px;
}

.rq {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
}

.rq-question {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 14px;
  line-height: 1.5;
}

.rq-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #374151;
  color: white;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 8px;
}

.rq-options { display: flex; flex-direction: column; gap: 8px; }

.rq-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.93rem;
  color: #374151;
}

.rq-option:hover { border-color: var(--brand-200); background: var(--brand-50); }
.rq-option input { accent-color: var(--brand); cursor: pointer; }

.rq-option.opt-correct {
  border-color: #10b981;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 600;
}

.rq-option.opt-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  color: #991b1b;
}

.rq-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  background: #f9fafb;
  border-left: 3px solid #9ca3af;
  border-radius: 0 8px 8px 0;
  font-size: 0.87rem;
  color: #4b5563;
  line-height: 1.6;
}

/* ── Guía de estudio ── */
.guide-picker { margin-bottom: 8px; }
.guide-search {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.guide-search input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Inter', Arial, sans-serif;
}
.guide-search input:focus { outline: none; border-color: var(--brand); }
.guide-search button {
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
}

.guide-result { margin-top: 22px; }

/* pestañas */
.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0;
}
.guide-tab {
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-family: 'Inter', Arial, sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.guide-tab:hover { color: var(--brand-strong); background: var(--brand-50); }
.guide-tab.active { color: var(--brand-strong); border-bottom-color: var(--brand-strong); }

.guide-panel { display: none; animation: fadeIn 0.2s ease; }
.guide-panel.active { display: block; }

/* reglas */
.guide-rule {
  background: white;
  border: 1px solid #e5e7eb;
  border-left: 3px solid var(--brand);
  border-radius: 0 12px 12px 0;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.guide-rule-text { font-size: 0.95rem; color: #1f2937; margin-bottom: 8px; }
.guide-rule-ex {
  font-size: 0.92rem;
  color: #065f46;
  background: #ecfdf5;
  padding: 8px 12px;
  border-radius: 8px;
  font-style: italic;
}

/* tareas / textos */
.guide-task { font-size: 0.96rem; color: #1f2937; margin: 8px 0 12px; line-height: 1.6; }
.guide-passage {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: #1f2937;
  margin-bottom: 12px;
}
.guide-tip { font-size: 0.9rem; color: #92400e; background: #fffbeb; padding: 10px 14px; border-radius: 10px; margin-top: 12px; }

.guide-reveal { margin-top: 8px; }
.guide-reveal summary {
  cursor: pointer;
  color: var(--brand-strong);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 0;
}
.guide-model {
  background: var(--brand-50);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.93rem;
  color: var(--brand-deep);
  margin-top: 6px;
  line-height: 1.6;
}

/* listening */
.guide-listen {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: #1f2937;
}
.guide-play {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: 'Inter', Arial, sans-serif;
}

/* ejercicios de la guía */
.guide-ex {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.guide-ex-q { font-weight: 600; color: #1f2937; margin-bottom: 12px; }
.guide-ex-opts { display: flex; flex-direction: column; gap: 8px; }
.guide-ex-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
}
.guide-ex-opt:hover { border-color: var(--brand-200); }
.guide-ex-opt input { accent-color: var(--brand); }
.guide-ex-opt.opt-correct { border-color: #10b981; background: #ecfdf5; color: #065f46; font-weight: 600; }
.guide-ex-opt.opt-wrong { border-color: #ef4444; background: #fef2f2; color: #991b1b; }
.guide-ex-fb {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  background: #f9fafb;
  border-left: 3px solid #9ca3af;
  border-radius: 0 8px 8px 0;
  font-size: 0.87rem;
  color: #4b5563;
}

/* ── Roleplay ── */
.role-prep { margin-top: 22px; }
.role-prep-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-strong);
  margin-bottom: 12px;
}
.role-block {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.role-block-title {
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 10px;
  font-size: 0.95rem;
}
.role-tips { margin: 0; padding-left: 20px; }
.role-tips li { font-size: 0.92rem; color: #374151; margin-bottom: 6px; line-height: 1.5; }

.role-phrase {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px solid #f3f4f6;
}
.role-phrase:last-child { border-bottom: none; }
.role-phrase-en { font-weight: 600; color: var(--brand-deep); }
.role-phrase-es { color: #6b7280; font-size: 0.88rem; }
.role-phrase .guide-play { padding: 4px 10px; font-size: 0.8rem; }

.role-scene-banner {
  background: var(--brand-100);
  color: var(--brand-deep);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-align: center;
}
.role-chat { margin-top: 18px; }
.role-messages {
  height: 320px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #f8f9fc;
}

/* hint del roleplay */
.role-hint {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--brand-50);
  border-radius: 10px;
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.6;
}
.role-hint strong { color: var(--brand-strong); }

.role-place {
  display: inline-block;
  background: var(--brand-100);
  color: var(--brand-deep);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ── Ruta de estudio (roadmap) en la guía ── */
.roadmap {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  margin: 18px 0;
}
.roadmap-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 16px;
}
.roadmap-track {
  position: relative;
  padding-left: 8px;
}
.roadmap-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  padding-bottom: 18px;
}
.roadmap-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -2px;
  width: 2px;
  background: #e5e7eb;
}
.roadmap-step.done:not(:last-child)::before { background: var(--brand-soft); }
.roadmap-dot {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 1;
}
.roadmap-step.done .roadmap-dot { background: var(--brand-100); color: var(--brand-strong); border: 2px solid var(--brand-soft); }
.roadmap-step.current .roadmap-dot {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  box-shadow: 0 0 0 4px rgba(124,58,237,0.18);
}
.roadmap-step.next .roadmap-dot { background: #f3f4f6; color: #9ca3af; border: 2px solid #e5e7eb; }
.roadmap-name { font-weight: 600; color: #1f2937; font-size: 0.95rem; }
.roadmap-step.current .roadmap-name { color: var(--brand-strong); }
.roadmap-step.next .roadmap-name { color: #9ca3af; }
.roadmap-why { font-size: 0.85rem; color: #6b7280; margin-top: 2px; line-height: 1.4; }

/* ── Vocabulario con imágenes ── */
.vocab-result { margin-top: 22px; }
.vocab-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
}
.vocab-q {
  font-size: 1rem;
  color: #1f2937;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vocab-num {
  background: #374151;
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.vocab-q strong { color: var(--brand-strong); }
/* La traducción al español se oculta durante la práctica y se revela al responder,
   para que el ejercicio se practique en inglés. */
.vocab-trans { color: #6b7280; font-size: 0.9rem; display: none; }
.vocab-item.answered .vocab-trans { display: inline; }
.vocab-q .guide-play { padding: 4px 10px; font-size: 0.8rem; }

.vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.vocab-card {
  padding: 0;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.15s;
}
.vocab-card { -webkit-tap-highlight-color: transparent; }
.vocab-card:hover { border-color: var(--brand-200); transform: translateY(-2px); }
/* Tras responder: no mostrar sombreado/elevación al tocar las demás imágenes (feedback QA).
   Se conservan los marcadores correcto/incorrecto; el resto deja de reaccionar al toque. */
.vocab-item.answered .vocab-card { cursor: default; }
.vocab-item.answered .vocab-card:hover { transform: none; }
.vocab-item.answered .vocab-card:not(.card-correct):not(.card-wrong):hover { border-color: #e5e7eb; }
.vocab-img {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #f3f4f6;
  overflow: hidden;
}
/* Sello de procedencia "Generado con IA" (solo en ilustraciones del banco IA) */
.vocab-photo { position: relative; }
.ai-badge {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  display: inline-flex; align-items: center; gap: 1px;
  padding: 2px 6px 2px 4px; border-radius: 999px;
  background: rgba(20,10,25,0.60); color: #fff;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.4px;
  line-height: 1; backdrop-filter: blur(2px); pointer-events: none;
}
.ai-badge .stat-ic { width: 0.9em; height: 0.9em; }
.vocab-img.noimg .ai-badge, .vocab-photo.noimg .ai-badge { display: none; }
/* Pie discreto "arte generado con IA" bajo el sprite del pet (una sola instancia) */
.pet-ai-credit { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 0.7rem; color: #9aa0a6; font-style: italic; margin: 2px 0 8px; }
.pet-ai-credit .stat-ic { width: 0.95em; height: 0.95em; font-style: normal; color: #b58900; }
/* Loader "la IA trabajando": sparkle animado + acción + subtexto "Generando en vivo con IA" */
.ai-loading { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; text-align: center; }
.ai-loading-spark { color: #d4a017; }
.ai-loading-spark .stat-ic { width: 38px; height: 38px; animation: aiSpark 1.15s ease-in-out infinite; }
@keyframes aiSpark { 0%,100% { transform: scale(0.9) rotate(-8deg); opacity: 0.65; } 50% { transform: scale(1.2) rotate(12deg); opacity: 1; } }
.ai-loading-txt { font-weight: 800; font-size: 1rem; color: var(--brand-strong); }
.ai-loading-sub { font-size: 0.78rem; font-weight: 700; color: #9aa0a6; letter-spacing: 0.2px; }
.ai-dots::after { content: '…'; animation: aiDots 1.4s steps(4, end) infinite; }
@keyframes aiDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '…'; } }
/* Panel "Powered by AI" (dentro del modal de ayuda): qué modelo usa cada feature */
.ai-stack { margin-top: 16px; border-top: 1px solid var(--brand-100, #f0e6e6); padding-top: 12px; }
.ai-stack-head { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--brand-strong); font-size: 0.95rem; margin-bottom: 8px; }
.ai-stack-head .stat-ic { width: 1.05em; height: 1.05em; color: #d4a017; }
.ai-stack-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 0.82rem; color: #374151; line-height: 1.35; border-top: 1px solid rgba(0,0,0,0.04); }
.ai-stack-row:first-of-type { border-top: none; }
.ai-stack-row .nav-ic { width: 22px; height: 22px; flex: none; color: var(--brand); margin-top: 1px; }
.ai-stack-row code { background: var(--brand-50, #f6eef0); color: var(--brand-strong); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; font-weight: 700; }
.ai-stack-note { font-size: 0.75rem; color: #9aa0a6; font-style: italic; margin-top: 8px; }
/* ── Juego "Story Sparks" (imágenes IA → narrar → la IA califica) ── */
.story-game { padding: 4px 2px 8px; }
.story-game .ex-title .nav-ic { width: 24px; height: 24px; vertical-align: -5px; margin-right: 6px; }
.story-game .ex-btn { margin-top: 8px; }
.story-imgs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.story-imgs.small { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.story-img { position: relative; border-radius: 14px; overflow: hidden; background: #f3f4f6; aspect-ratio: 1 / 1; box-shadow: 0 2px 8px rgba(60,30,10,.1); display: flex; align-items: center; justify-content: center; }
.story-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-img--gen .ai-loading { padding: 8px; }
.story-img--gen .ai-loading-spark .stat-ic { width: 22px; height: 22px; }
.story-img--gen .ai-loading-txt, .story-img--gen .ai-loading-sub { display: none; }
.story-word { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(20,10,25,.62); color: #fff; font-size: .8rem; font-weight: 700; text-align: center; padding: 3px 4px; text-transform: capitalize; }
.story-imgs.small .story-word { font-size: .62rem; }
.story-live, .story-result { text-align: center; }
.story-timer { font-size: 3rem; font-weight: 900; color: var(--brand-strong); line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.story-rec { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; color: #c0392b; margin-bottom: 8px; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: #e11d48; animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
.story-score-big { font-size: 3.4rem; font-weight: 900; color: var(--brand-strong); line-height: 1; }
.story-score-big span { font-size: 1.1rem; color: #9aa0a6; font-weight: 700; }
.story-stars { font-size: 1.8rem; color: #f5b301; letter-spacing: 3px; margin: 4px 0 10px; }
.story-feedback { font-size: .92rem; color: #374151; background: var(--brand-50, #f6eef0); border-radius: 12px; padding: 12px 14px; line-height: 1.4; }
.story-transcript { font-size: .82rem; color: #4b5563; margin: 10px 0; text-align: left; }
.story-transcript.muted { color: #9aa0a6; font-style: italic; text-align: center; }
.game-card--ai { border-color: var(--brand, #9e1b32); background: linear-gradient(180deg, rgba(158,27,50,.05), rgba(158,27,50,.01)); }
/* ── Listen & Pick: escucha (TTS) y toca la imagen ── */
.lp-listen { text-align: center; margin: 10px 0 2px; }
.lp-replay { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: auto; padding: 10px 20px; }
.lp-replay .nav-ic { width: 22px; height: 22px; }
.lp-hint { font-size: .82rem; color: #9aa0a6; margin-top: 6px; }
.lp-stage { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.lp-card { position: relative; border: 2.5px solid var(--brand-150, #e5e7eb); border-radius: 14px; overflow: hidden; background: #f3f4f6; aspect-ratio: 1 / 1; padding: 0; cursor: pointer; transition: transform .1s, box-shadow .12s, border-color .12s; }
.lp-card:active { transform: scale(.97); }
.lp-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-card.lp-ok { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.25); }
.lp-card.lp-bad { border-color: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.25); }
/* Odd One Out: prompt sobre las 4 imágenes */
.oo-prompt { text-align: center; font-size: .95rem; color: #374151; margin: 12px 0 2px; line-height: 1.35; }
.oo-prompt .oo-cat { display: block; font-size: .8rem; color: #9aa0a6; margin-top: 2px; }
/* ── Say the Word: ves la imagen, la dices, el STT comprueba ── */
.stw-game { text-align: center; }
.stw-photo { position: relative; width: 210px; max-width: 72%; margin: 12px auto; border-radius: 16px; overflow: hidden; aspect-ratio: 1 / 1; background: #f3f4f6; box-shadow: 0 3px 12px rgba(60,30,10,.12); }
.stw-photo img { width: 100%; height: 100%; object-fit: cover; }
.stw-ask { font-size: 1rem; font-weight: 700; color: var(--brand-strong); margin-bottom: 10px; }
.stw-mic { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto; padding: 12px 24px; }
.stw-mic .nav-ic { width: 22px; height: 22px; }
.stw-mic.recording { background: #c0392b; }
.stw-result { margin-top: 14px; }
.stw-verdict { font-size: 1.3rem; font-weight: 800; }
.stw-verdict.ok { color: #16a34a; }
.stw-verdict.bad { color: #e11d48; }
.stw-word { font-size: .9rem; color: #4b5563; margin: 6px 0 10px; }
.stw-checking { color: #9aa0a6; font-style: italic; }
/* ── What am I?: pistas de la IA + opciones ── */
.wai-head { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; color: var(--brand-strong); font-size: 1.05rem; margin: 6px 0 10px; }
.wai-head .stat-ic { width: 1.1em; height: 1.1em; color: #d4a017; }
.wai-clues { margin-bottom: 12px; }
.wai-clue { display: flex; align-items: flex-start; gap: 8px; background: var(--brand-50, #f6eef0); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .92rem; color: #374151; text-align: left; }
.wai-clue-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.wai-more { width: auto; padding: 8px 18px; display: block; margin: 0 auto 12px; }
.wai-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.wai-opt { padding: 12px 8px; border: 1.5px solid var(--brand-150, #e5e7eb); border-radius: 12px; background: #fff; font-weight: 700; font-size: .92rem; color: #374151; cursor: pointer; text-transform: capitalize; font-family: 'Inter', Arial, sans-serif; transition: all .12s; }
.wai-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50, #f6eef0); }
.wai-opt.wai-ok { border-color: #16a34a; background: rgba(22,163,74,.1); color: #15803d; }
.wai-opt.wai-bad { border-color: #e11d48; background: rgba(225,29,72,.1); color: #be123c; }
.wai-reveal { text-align: center; margin: 14px 0 4px; }
.wai-pic { position: relative; width: 150px; margin: 0 auto 8px; border-radius: 14px; overflow: hidden; aspect-ratio: 1 / 1; }
.wai-pic img { width: 100%; height: 100%; object-fit: cover; }
.wai-answer { font-size: 1.2rem; font-weight: 800; color: var(--brand-strong); text-transform: capitalize; margin-bottom: 10px; }
/* ── Corrección única de nivel (bajar CEFR) ── */
.leveldown-wrap { text-align: center; margin: 8px 0 2px; }
.leveldown-link { background: none; border: none; color: #9aa0a6; font-size: .8rem; text-decoration: underline; cursor: pointer; font-family: inherit; padding: 4px; }
.leveldown-link:hover { color: var(--brand-strong); }
.leveldown-box { background: #fff; border: 1px solid var(--brand-150, #e5e7eb); border-radius: 12px; padding: 12px; margin-top: 4px; }
.leveldown-title { font-weight: 700; font-size: .88rem; color: var(--brand-strong); margin-bottom: 8px; }
.leveldown-opts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.leveldown-opt { width: auto; padding: 8px 16px; }
.leveldown-note { font-size: .74rem; color: #9aa0a6; margin-top: 8px; }
.vocab-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* llena la casilla (antes 'contain' dejaba franjas blancas vacías) */
}
.vocab-fallback {
  display: none;
  font-size: 0.9rem;
  color: #6b7280;
  padding: 10px;
  text-align: center;
}
.vocab-img.noimg .vocab-fallback,
.vocab-card .vocab-img:not(:has(img)) .vocab-fallback { display: block; }

.vocab-card.card-correct {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}
.vocab-card.card-correct::after {
  content: "✓ correct";
  display: block;
  background: #10b981;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px;
}
.vocab-card.card-wrong {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}
.vocab-card.card-wrong::after {
  content: "✗";
  display: block;
  background: #ef4444;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px;
}

/* ── Pestañas de Vocabulario (palabra→imagen / imagen→palabra) ── */
.vocab-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.vocab-tab {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--brand-150);
  border-radius: 12px;
  background: white;
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.92rem;
  transition: all 0.15s;
}
.vocab-tab:hover { border-color: var(--brand); }
.vocab-tab.active {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border-color: transparent;
}

/* ── Selector de estilo de imagen del vocabulario (tierno / realista) ── */
.vocab-style { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.vocab-style-label { font-size: 0.82rem; font-weight: 600; color: var(--brand-strong); }
.vocab-style-btns { display: flex; gap: 6px; }
.vstyle-btn {
  padding: 6px 14px; border: 1.5px solid var(--brand-150); border-radius: 999px;
  background: #fff; color: var(--brand-strong); font-weight: 600; cursor: pointer;
  font-family: 'Inter', Arial, sans-serif; font-size: 0.82rem; transition: all .15s;
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15;
}
.vstyle-btn small { font-size: 0.66rem; opacity: .85; }
.vstyle-btn:hover { border-color: var(--brand); }
.vstyle-btn.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }

/* ── #8: pestañas de tipo de ejercicio + Write + Match ── */
.ex-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.ex-tab { flex: 1; padding: 9px 6px; border: 1.5px solid var(--brand-150); border-radius: 12px; background: #fff; color: var(--brand-strong); font-weight: 700; cursor: pointer; font-family: 'Inter', Arial, sans-serif; font-size: 0.86rem; transition: all .15s; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.ex-tab .es-hint { font-size: 0.66rem; opacity: .8; }
.ex-tab:hover { border-color: var(--brand); }
.ex-tab.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }
.wr-focus { font-size: 0.85rem; color: #6b7280; margin-bottom: 10px; }
.wr-text { width: 100%; box-sizing: border-box; border: 1.5px solid #e5e7eb; border-radius: 12px; padding: 12px; font-family: 'Inter', Arial, sans-serif; font-size: 1rem; resize: vertical; margin-bottom: 10px; }
.wr-text:focus { outline: none; border-color: var(--brand); }
.wr-comment { background: var(--brand-100); border-radius: 10px; padding: 10px 12px; margin: 8px 0; color: #374151; font-size: 0.92rem; }
.wr-corrected { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 12px; margin: 8px 0; color: #065f46; font-size: 0.92rem; line-height: 1.5; }
.match-grid { display: flex; gap: 12px; }
.match-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.match-cell { padding: 12px 8px; border: 1.5px solid #e5e7eb; border-radius: 12px; background: #fff; cursor: pointer; font-weight: 700; font-size: 0.92rem; color: #1f2937; font-family: 'Inter', Arial, sans-serif; transition: all .15s; }
.match-cell:hover { border-color: var(--brand); }
.match-cell.sel { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }
.match-cell.matched { background: #dcfce7; color: #166534; border-color: #86efac; cursor: default; opacity: .85; }
.match-cell.wrong { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; animation: shake .3s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* ── Modo imagen→palabra: foto grande + opciones de texto ── */
.vocab-photo {
  width: 100%;
  max-width: 320px;
  height: 200px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 12px;
  overflow: hidden;
}
.vocab-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* llena la tarjeta (antes 'contain' dejaba franjas blancas vacías) */
}
.vocab-photo .vocab-fallback { font-size: 2rem; }
.vocab-photo:not(:has(img)) .vocab-fallback,
.vocab-photo.noimg .vocab-fallback { display: block; }
.vocab-word-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.vocab-wordbtn {
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  color: #1f2937;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: all 0.15s;
}
.vocab-wordbtn:hover { border-color: var(--brand-200); transform: translateY(-2px); }
.vocab-wordbtn.word-correct {
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 0 0 3px rgba(16,185,129,0.2);
}
.vocab-wordbtn.word-wrong {
  border-color: #ef4444;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.2);
}

/* ── Etiqueta secundaria en español (chips y pestañas bilingües) ──
   Solo se muestra en nivel A1 (body.show-es); en niveles superiores la
   interfaz queda en inglés para fomentar la inmersión. */
.chip small, .vocab-tab small, .field-label small {
  display: none;
  font-size: 0.72rem;
  font-weight: 500;
  font-style: italic;   /* español en itálica: se distingue del inglés de un vistazo */
  opacity: 0.7;
  margin-top: 2px;
}
body.show-es .chip small,
body.show-es .vocab-tab small,
body.show-es .field-label small { display: block; }

/* Pista en español reutilizable (UI dinámica): inglés primario siempre,
   español visible SOLO en A1 (body.show-es). Mantiene la inmersión en niveles altos. */
.es-hint { display: none; color: #aab1bd; font-weight: 500; font-style: italic; font-size: 0.76em; line-height: 1.2; margin-top: 1px; }
body.show-es .es-hint { display: block; }

/* ── Modo Juegos: hub de minijuegos ── */
.games-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px;
  border: 1.5px solid var(--brand-150);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: 'Inter', Arial, sans-serif;
}
.game-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(124,58,237,0.12); }
.game-emoji { font-size: 1.8rem; color: var(--brand-strong); }
.game-emoji .nav-ic { width: 30px; height: 30px; }
.game-name { font-weight: 700; color: var(--brand-strong); font-size: 1.05rem; }
.game-desc { font-size: 0.85rem; color: #6b7280; }

.game-hud {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 18px 0;
  flex-wrap: wrap;
}
.hud-item {
  background: #f3f4f6;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.95rem;
  color: #374151;
}
.hud-item strong { color: var(--brand-strong); }

/* Time Attack */
.ta-photo {
  width: 100%;
  max-width: 300px;
  height: 200px;
  margin: 0 auto 16px;
  background: #f3f4f6;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ta-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ta-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.ta-opt {
  padding: 14px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: all 0.12s;
}
.ta-opt:hover { border-color: var(--brand-200); }
.ta-opt.ta-ok { border-color: #10b981; background: #ecfdf5; }
.ta-opt.ta-bad { border-color: #ef4444; background: #fef2f2; }

/* Memory Match */
.mem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}
.mem-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.mem-back, .mem-front {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  overflow: hidden;
}
.mem-back {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}
.mem-front {
  background: #fff;
  border: 2px solid #e5e7eb;
  display: none;
  padding: 4px;
}
.mem-front img { width: 100%; height: 100%; object-fit: contain; }
.mem-word { font-weight: 700; color: #374151; font-size: 0.9rem; text-align: center; padding: 2px; }
.mem-card.flipped .mem-back,
.mem-card.done .mem-back { display: none; }
.mem-card.flipped .mem-front { display: flex; }
.mem-card.done .mem-front { display: flex; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.2); }

/* Pantalla de fin de juego */
.game-over { text-align: center; padding: 30px 16px; }
.go-emoji { font-size: 3rem; }
.go-title { font-size: 1.3rem; font-weight: 700; color: var(--brand-strong); margin: 6px 0; }
.go-score { color: #374151; margin-bottom: 18px; }

/* Hangman */
.hm-hint { width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 12px; overflow: hidden; background: #f3f4f6; }
.hm-hint img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.hm-word { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 20px; }
.hm-slot { width: 30px; height: 40px; border-bottom: 3px solid var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; color: var(--brand-strong); }
.hm-space { width: 18px; display: inline-block; }
.hm-keys { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 360px; margin: 0 auto; }
.hm-key { padding: 10px 0; border: 1.5px solid var(--brand-150); border-radius: 8px; background: white; font-weight: 700; cursor: pointer; font-family: 'Inter', Arial, sans-serif; }
.hm-key:hover:not(:disabled) { border-color: var(--brand); }
.hm-key:disabled { opacity: 0.35; cursor: default; }

/* Word Scramble */
.sc-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.sc-slot { width: 38px; height: 44px; border: 2px dashed var(--brand-200); border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; color: var(--brand-strong); }
.sc-tiles { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.sc-tile { width: 44px; height: 44px; border: 2px solid var(--brand-150); border-radius: 10px; background: var(--brand-50); font-size: 1.2rem; font-weight: 700; color: var(--brand-strong); cursor: pointer; font-family: 'Inter', Arial, sans-serif; }
.sc-tile:hover:not(:disabled) { border-color: var(--brand); }
.sc-tile:disabled { opacity: 0.3; cursor: default; }
.sc-actions { text-align: center; margin: 10px 0; }
.sc-msg { text-align: center; color: #dc2626; font-weight: 600; min-height: 22px; }

/* Numbers */
.nm-word { text-align: center; font-size: 1.6rem; font-weight: 700; color: var(--brand-strong); margin: 18px 0; text-transform: capitalize; }
.nm-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.nm-opt { padding: 18px 8px; border: 2px solid #e5e7eb; border-radius: 12px; background: #f9fafb; font-size: 1.2rem; font-weight: 700; cursor: pointer; font-family: 'Inter', Arial, sans-serif; }
.nm-opt:hover { border-color: var(--brand-200); }

/* Time Attack: elegir duración */
.ta-setup { text-align: center; padding: 24px 12px; }
.ta-setup-title { font-size: 1.2rem; font-weight: 700; color: var(--brand-strong); margin-bottom: 16px; }
.ta-time-options { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ta-time-btn { padding: 16px 28px; border: 2px solid var(--brand-150); border-radius: 12px; background: white; font-size: 1.1rem; font-weight: 700; color: var(--brand-strong); cursor: pointer; font-family: 'Inter', Arial, sans-serif; transition: all 0.15s; }
.ta-time-btn:hover { border-color: var(--brand); transform: translateY(-2px); }

/* ── Roadmap previo en la guía ── */
.roadmap-preview {
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  border: 1px solid var(--brand-150);
  border-radius: 16px;
  padding: 18px;
  margin: 16px 0;
}
.roadmap-preview-title {
  font-weight: 700;
  color: var(--brand-dark);
  margin-bottom: 14px;
  font-size: 0.98rem;
}
.roadmap-preview-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rp-step {
  background: white;
  border: 1.5px solid var(--brand-150);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--brand-deep);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.rp-step:hover { border-color: var(--brand); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.18); }
.rp-step small { font-size: 0.7rem; color: #9ca3af; }
.rp-start {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border-color: transparent;
}
.rp-start small { color: rgba(255,255,255,0.85); }
.roadmap-preview-hint {
  margin-top: 12px;
  font-size: 0.82rem;
  color: #6b7280;
}

/* ── Selector de tamaño de texto ── */
.size-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.size-label { font-size: 0.85rem; color: #6b7280; font-weight: 600; }
.size-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--brand-150);
  border-radius: 99px;
  background: white;
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: all 0.15s;
}
.size-btn:hover { border-color: var(--brand); }
.size-btn.active {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border-color: transparent;
}

/* ── Cuentos ── */
.reading-type { margin-top: 12px; }
.story-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--brand-200);
  border-radius: 12px;
  background: var(--brand-50);
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.92rem;
  transition: all 0.15s;
}
.story-btn:hover { background: var(--brand-50); border-color: var(--brand); }

.story-result { margin-top: 22px; }
.story-body {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  margin: 14px 0;
}
.story-body p {
  font-size: 1rem;
  line-height: 1.8;
  color: #1f2937;
  margin: 0 0 14px;
}
.story-body p:last-child { margin-bottom: 0; }
.story-moral {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #92400e;
  margin-bottom: 14px;
}
.story-glossary {
  background: var(--brand-50);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.story-glossary-title { font-weight: 700; color: var(--brand-dark); margin-bottom: 10px; }
.story-gloss-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--brand-100);
}
.story-gloss-item:last-child { border-bottom: none; }
.gloss-en { font-weight: 600; color: var(--brand-deep); }
.gloss-es { color: #6b7280; font-size: 0.9rem; }
.story-gloss-item .guide-play { padding: 3px 9px; font-size: 0.78rem; }

/* botón volver al texto en lectura */
.reading-back {
  background: none;
  border: none;
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 0;
  margin-bottom: 8px;
  font-family: 'Inter', Arial, sans-serif;
}
.reading-back:hover { text-decoration: underline; }

/* ── Listening ── */
.listen-tabs {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.listen-tab {
  flex: 1;
  padding: 12px;
  border: 1.5px solid var(--brand-150);
  border-radius: 12px;
  background: white;
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.92rem;
  transition: all 0.15s;
}
.listen-tab:hover { border-color: var(--brand); }
.listen-tab.active {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  border-color: transparent;
}

.listen-result { margin-top: 22px; }
.listen-player {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  align-items: center;
}
.listen-play-big {
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
}
.listen-replay, .listen-show {
  padding: 12px 16px;
  border: 1.5px solid var(--brand-200);
  border-radius: 12px;
  background: white;
  color: var(--brand-strong);
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.88rem;
}
.listen-transcript {
  background: white;
  border: 1px dashed var(--brand-200);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.96rem;
  line-height: 1.7;
  color: var(--brand-deep);
  font-style: italic;
}

/* Dictado */
.dictation-item {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.dictation-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.dictation-num {
  background: #374151;
  color: white;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.listen-play-small {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.85rem;
}
.dictation-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--brand-150);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Inter', Arial, sans-serif;
}
.dictation-input:focus { outline: none; border-color: var(--brand); }
.dictation-input.dictation-ok { border-color: #10b981; background: #ecfdf5; }
.dictation-input.dictation-bad { border-color: #ef4444; background: #fef2f2; }
.dictation-feedback {
  display: none;
  margin-top: 8px;
  font-size: 0.88rem;
}
.dictation-correct { color: #059669; font-weight: 600; }
.dictation-wrong { color: #dc2626; font-weight: 600; }

/* ── Modal de ayuda ── */
.help-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 21, 48, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.help-modal-content {
  background: white;
  border-radius: 20px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.help-close {
  position: absolute;
  top: 16px; right: 16px;
  background: #f3f4f6;
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: #6b7280;
}
.help-close:hover { background: #e5e7eb; }
.help-modal-content h2 {
  color: var(--brand-strong);
  margin: 0 0 12px;
  font-size: 1.4rem;
}
.help-intro { color: #4b5563; margin-bottom: 18px; font-size: 0.95rem; }
.help-modes { display: flex; flex-direction: column; gap: 12px; }
.help-mode {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  border-radius: 12px;
  padding: 12px 14px;
}
.help-emoji { font-size: 1.5rem; flex-shrink: 0; color: var(--brand-strong); }
.help-emoji .nav-ic { width: 26px; height: 26px; }
.help-mode strong { color: var(--brand-deep); }
.help-mode div { font-size: 0.9rem; color: #4b5563; line-height: 1.4; }
.help-mode { cursor: pointer; border-radius: 10px; padding: 6px; transition: background .12s; }
.help-mode:hover { background: #f3f4f6; }
/* Rework de la guía: "empieza aquí" + modos recomendados + resto colapsado */
.help-start { font-size: 0.85rem; color: #14532d; margin: 2px 0 8px; font-weight: 800; }
.help-rec { background: #f0fdf4; border: 1.5px solid #86efac; }
.help-rec:hover { background: #dcfce7; }
.help-badge { display: inline-block; font-size: 0.66rem; font-weight: 800; background: #16a34a; color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 4px; vertical-align: middle; text-transform: uppercase; letter-spacing: .3px; }
.help-more { margin-top: 14px; }
.help-more > summary { cursor: pointer; font-weight: 700; color: var(--brand-strong, #16a34a); font-size: 0.9rem; padding: 6px 0; list-style: none; }
.help-more > summary::-webkit-details-marker { display: none; }
.help-more[open] > summary { margin-bottom: 8px; }
/* Selector de pantalla de inicio (en la guía de bienvenida) */
.help-home { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 10px 14px; background: var(--brand-100, #ecfdf5); border: 1px solid var(--brand-150, #d1fae5); border-radius: 12px; font-weight: 700; color: #374151; font-size: 0.92rem; }
.help-home label { display: flex; flex-direction: column; }
.help-home select { flex: 1; min-width: 150px; padding: 8px 10px; border: 1.5px solid #e5e7eb; border-radius: 10px; font-family: 'Inter', Arial, sans-serif; font-size: 0.9rem; background: #fff; cursor: pointer; }
.help-tip {
  margin-top: 18px;
  padding: 12px 16px;
  background: #fffbeb;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #92400e;
  text-align: center;
}

/* ── Reproductor de audio completo ── */
.audio-player {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--brand-50), var(--brand-100));
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 8px;
}
.audio-play-btn {
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.audio-play-btn:hover { transform: scale(1.05); }
.audio-play-btn:active { transform: scale(0.97); }
.audio-bar-wrap { flex: 1; min-width: 0; }
.audio-bar {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--brand-150);
  cursor: pointer;
  outline: none;
}
.audio-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand-strong);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.audio-bar::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--brand-strong);
  cursor: pointer;
}
.audio-times {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 5px;
}
.audio-extra {
  width: 42px; height: 42px;
  border: 1.5px solid var(--brand-200);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}
.audio-extra:hover { background: var(--brand-50); }
.audio-status {
  font-size: 0.82rem;
  color: var(--brand);
  margin-bottom: 16px;
  min-height: 18px;
  padding-left: 4px;
}

/* ── Panel de progreso de la sesión ── */
.progress-panel {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  background: var(--brand-50);
  border-bottom: 1px solid var(--brand-100);
  font-size: 0.85rem;
  color: #4b5563;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.progress-panel:not(:empty) {
  max-height: 60px;
  padding: 10px 20px;
}
.prog-item { white-space: nowrap; }
.prog-item strong { color: var(--brand-strong); }

/* ── Speaking (conversación por voz) ── */
.speak-messages {
  min-height: 240px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 16px;
  background: var(--brand-50);
  border-radius: 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.speak-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.speak-mic {
  padding: 18px 32px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  transition: all 0.15s;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 6px 18px rgba(124,58,237,0.3);
}
.speak-mic:hover { transform: translateY(-1px); }
.speak-mic:active { transform: scale(0.97); }
.speak-mic.recording {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  animation: pulse-rec 1s infinite;
}
@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}
.speak-status {
  font-size: 0.9rem;
  color: #6b7280;
  text-align: center;
  min-height: 20px;
  padding: 0 12px;
}
.speak-thinking { color: var(--brand); font-weight: 600; }
.message.pron-tip {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  color: #1e40af;
  font-size: 0.9rem;
  align-self: flex-start;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
}

/* ── Portada / Pantalla de bienvenida ── */
.splash-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  /* Backdrop pintado (gpt-image-1) con lavado guinda encima para que el texto se lea */
  background:
    linear-gradient(150deg, rgba(158,27,50,0.80) 0%, rgba(158,27,50,0.62) 45%, rgba(125,20,39,0.88) 100%),
    url('/static/img/splash_bg.jpg') center / cover no-repeat;
  text-align: center;
}
.splash-content {
  max-width: 600px;
  color: white;
  animation: splash-in 0.7s ease;
}
@keyframes splash-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.splash-wave {
  font-size: 5rem;
  animation: float 3s ease-in-out infinite;
}
.splash-hero {
  position: relative;
  display: inline-block;
}
.splash-hero-img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
  animation: float 3s ease-in-out infinite;
}
/* Logo de marca FLOW! (imagen propia) */
.splash-logo-img {
  width: 220px;
  max-width: 78vw;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(94, 15, 31, 0.35);
  display: block;
}
.auth-logo-img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(94, 15, 31, 0.3);
}
.splash-hero .splash-wave {
  position: absolute;
  right: -2px;
  bottom: 4px;
  font-size: 2.4rem;
  animation: float 3s ease-in-out infinite 0.4s;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.splash-title {
  font-family: 'Fredoka', 'Inter', system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  margin: 8px 0 0;
  letter-spacing: -1px;
}
/* Wordmark de marca "Speakuy" (Fredoka; la sílaba "uy" en naranja-cuy = el cuy dentro del nombre) */
.wordmark { font-family: 'Fredoka', 'Inter', system-ui, sans-serif; font-weight: 700; }
.wm-uy { color: #E8912E; }               /* naranja del cuy */
.splash-title .wm-uy { color: #F4A63C; } /* naranja más claro sobre el guinda del splash */
/* Botones de acción de Vocabulary (Generar / Aleatorio / Quiz largo) */
.vocab-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.vocab-actions .ex-btn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; padding: 8px 16px; }
.vocab-actions .ex-btn small { font-weight: 400; opacity: .75; font-size: .7rem; }
/* Pantalla de "finish" del quiz de vocabulario (nota + cuy reaccionando) */
.vocab-finish { text-align: center; margin: 18px auto 6px; padding: 16px; max-width: 340px;
  background: linear-gradient(135deg, #ffffff, #fdf1f3); border: 1.5px solid var(--brand-150);
  border-radius: 16px; box-shadow: 0 8px 24px rgba(94,15,31,.12); animation: splash-in .5s ease; }
.vocab-finish-cuy { width: 104px; height: 104px; object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(94,15,31,.18)); }
.vocab-finish-msg { font-family: 'Fredoka','Inter',sans-serif; font-weight: 700; font-size: 1.45rem;
  color: var(--brand-strong); margin-top: 2px; }
.vocab-finish-msg .es-hint { display: block; font-family: 'Inter',sans-serif; font-weight: 400; font-size: .8rem; }
.vocab-finish-score { font-size: 1.15rem; color: #6b7280; margin-top: 4px; font-weight: 600; }
.pf-label { display: block; font-weight: 700; font-size: .85rem; color: var(--brand-strong); margin: 6px 0 4px; }
.pf-label .es-hint { font-weight: 400; }
.vocab-finish-xp { color: #b58900; font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
/* Resultado del reto ghost del leaderboard */
.ghost-elo { font-size: 1.5rem; font-weight: 800; margin: 8px 0 2px; }
.ghost-elo.up { color: #10b981; } .ghost-elo.down { color: #ef4444; }
.ghost-rewards { color: #b58900; font-weight: 700; }
/* Íconos propios de los temas de interés (reemplazan los emojis) */
.topic-ic { display: inline-flex; vertical-align: -0.16em; margin-right: 2px; }
.topic-ic svg { width: 1.2em; height: 1.2em; }
.splash-tagline {
  font-size: 1.2rem;
  opacity: 0.92;
  margin: 16px auto 0;
  max-width: 480px;
  line-height: 1.5;
}
.splash-tagline em { font-style: italic; font-weight: 600; }
.splash-features {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 36px 0;
}
.splash-feat {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 16px;
  padding: 20px 18px;
  width: 165px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.35;
  backdrop-filter: blur(4px);
}
.sf-icon { font-size: 2rem; color: #fff; }
.sf-icon .nav-ic { width: 30px; height: 30px; }
.splash-btn {
  padding: 16px 48px;
  border: none;
  border-radius: 50px;
  background: white;
  color: var(--brand-strong);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', Arial, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.splash-btn:hover { transform: translateY(-2px) scale(1.02); }
.splash-btn:active { transform: scale(0.98); }
.splash-credit {
  margin-top: 28px;
  font-size: 0.82rem;
  opacity: 0.75;
}

/* ── Micrófono en Roleplay ── */
.role-mic-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s;
}
.role-mic-btn:hover { transform: scale(1.05); }
.role-mic-btn:active { transform: scale(0.95); }
.role-mic-btn.recording {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  animation: pulse-rec 1s infinite;
}
.role-mic-status {
  font-size: 0.82rem;
  color: var(--brand);
  text-align: center;
  min-height: 18px;
  margin-top: 6px;
}

/* ── Botón repetir en mensajes de Flow (roleplay) ── */
.message.bot { position: relative; }
.role-replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.12);
  color: var(--brand-strong);
  font-size: 0.8rem;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s;
}
.role-replay-btn:hover { background: rgba(124, 58, 237, 0.25); }

/* ── Berserker · PvE en tiempo real ── */
.bsk-toggle { display: flex; gap: 8px; justify-content: center; margin: 10px 0 6px; }
.bsk-mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 18px; border: 2px solid #e5e7eb; border-radius: 12px;
  background: #fff; cursor: pointer; font-weight: 800; font-size: 0.98rem; color: #374151;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.bsk-mode-btn small { font-weight: 500; opacity: 0.85; }
.bsk-mode-btn.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand-strong); }
.bsk-mode-btn[data-bsk="berserker"].active { border-color: #ef4444; background: #fee2e2; color: #b91c1c; }
.bsk-mode-btn.locked { opacity: 0.55; border-style: dashed; color: #9ca3af; }
.bsk-mode-btn.locked:hover { border-color: #e5e7eb; }
.bsk-lock-tag {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; color: #b45309;
  background: #fef3c7; border-radius: 999px; padding: 1px 6px; margin-left: 2px;
}
.bsk-desc { text-align: center; font-size: 0.85rem; color: #6b7280; margin: 0 0 12px; min-height: 1.2em; }
.bsk-desc .es-hint { display: block; }

.bsk-hud { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 8px 0 2px; flex-wrap: wrap; }
.bsk-combo { font-weight: 800; color: #b91c1c; }
.bsk-ult-bar { width: 160px; height: 9px; background: #eee; border-radius: 999px; overflow: hidden; }
.bsk-ult-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #ef4444); transition: width 0.15s ease; }
.bsk-ult-label { font-size: 0.74rem; color: #9ca3af; font-weight: 800; letter-spacing: 0.06em; }

.arena-quiz.berserk { border: 2px solid #ef4444; box-shadow: 0 0 0 2px #fecaca, 0 0 16px rgba(239, 68, 68, 0.22); animation: bskPulse 1.3s ease-in-out infinite; }
@keyframes bskPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fecaca, 0 0 14px rgba(239, 68, 68, 0.16); }
  50%      { box-shadow: 0 0 0 2px #fca5a5, 0 0 22px rgba(239, 68, 68, 0.34); }
}
.arena-quiz.berserk .quiz-who { color: #b91c1c; font-weight: 800; }
.arena-quiz.berserk .quiz-timer { background: #ef4444; }

/* ── Cosméticos del fighter (paleta = filtro en el img, aura = glow, accesorio = emoji) ── */
/* position:relative en TODO contenedor de avatar para que el aura (absolute) NO se escape
   y tiña la página (pasaba en el leaderboard, que no estaba posicionado). */
.pet-art, .fighter-art, .lb-art, .duel-ava { position: relative; }
.pet-img { position: relative; z-index: 1; }
.cos-aura {
  position: absolute; top: 50%; left: 50%; width: 84%; height: 84%;
  transform: translate(-50%, -50%); border-radius: 50%; z-index: 0; pointer-events: none;
  background: radial-gradient(circle, var(--aura) 0%, transparent 68%);
  filter: blur(3px); opacity: 0.75; animation: cosAura 2.4s ease-in-out infinite;
}
@keyframes cosAura { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.9; } }
.cos-acc {
  position: absolute; top: -6%; left: 50%; transform: translateX(-50%);
  font-size: 1.5rem; z-index: 3; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4));
}
.fighter-art .cos-acc { font-size: 1.05rem; top: -10%; }
.cos-title {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 800; color: #fff; vertical-align: middle;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

/* ── Tienda / Vestuario ── */
.pet-customize-btn.open { background: var(--brand-50); border-color: var(--brand); }
.pet-shop { margin: 10px 0 4px; text-align: left; }

/* ── Vestidor (customizer modal): pet siempre visible + probar sin mantener apretado ── */
.cz-modal { position: fixed; inset: 0; background: rgba(26, 21, 48, 0.6); display: flex;
  align-items: center; justify-content: center; z-index: 1000; padding: 14px; }
.cz-box { background: #fff; border-radius: 20px; width: 100%; max-width: 720px; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.cz-head { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid var(--brand-100); }
.cz-title { font-weight: 800; color: var(--brand-strong); font-size: 1.08rem; }
.cz-head .cz-close { position: static; }
.cz-body { display: flex; gap: 16px; padding: 16px; min-height: 0; overflow: hidden; }
.cz-pet-panel { flex: 0 0 42%; display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: sticky; top: 0; align-self: flex-start; }
.cz-pet-panel .pet-art { width: 100%; max-width: 220px; }
.cz-pet-panel .pet-art img { width: 100%; height: auto; }
.cz-revert { background: var(--brand-50); border: 1px solid var(--brand-150); color: var(--brand-strong);
  border-radius: 10px; padding: 7px 13px; font-weight: 800; font-size: .82rem; cursor: pointer; }
.cz-revert:disabled { opacity: .4; cursor: default; }
.cz-options { flex: 1 1 auto; overflow-y: auto; min-height: 0; text-align: left; }
.cz-options .shop-item { cursor: pointer; }
.cz-options .shop-item.pv-on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-150); }
@media (max-width: 640px) {
  .cz-body { flex-direction: column; overflow-y: auto; gap: 10px; }
  .cz-pet-panel { flex: none; width: 100%; position: sticky; top: 0; z-index: 2;
    background: #fff; padding-bottom: 6px; }
  .cz-pet-panel .pet-art { max-width: 148px; }
  .cz-options { overflow: visible; }
}
.shop-head { text-align: center; font-weight: 800; color: #b45309; margin-bottom: 8px; }
.shop-slot { margin-bottom: 12px; }
.shop-slot-title { font-weight: 800; font-size: 0.85rem; color: #374151; margin: 6px 0 4px; }
.shop-items { display: flex; flex-direction: column; gap: 6px; }
.shop-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border: 1px solid #e5e7eb; border-radius: 10px; background: #fff;
}
.shop-item.eq { border-color: var(--brand); background: var(--brand-50); }
.shop-hint { width: 22px; text-align: center; flex: 0 0 auto; font-size: 1.1rem; }
.shop-hint.dot { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.shop-name { flex: 1; font-size: 0.9rem; font-weight: 600; color: #1f2937; }
.shop-btn { flex: 0 0 auto; padding: 5px 12px; border-radius: 8px; border: none; cursor: pointer; font-weight: 800; font-size: 0.82rem; }
.shop-btn.buy { background: #f59e0b; color: #fff; }
.shop-btn.buy:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }
.shop-btn.equip { background: var(--brand); color: #fff; }
.shop-btn.equipped { background: #dcfce7; color: #166534; }
.shop-btn.locked { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.shop-btn.buy.prestige { background: linear-gradient(135deg, #f59e0b, #d97706); }
/* Cosméticos de prestigio (desbloqueo por ELO) */
.shop-item.prestige { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fcd34d; border-radius: 10px; }
.shop-prestige { display: inline-block; margin-left: 6px; font-size: 0.66rem; font-weight: 800; color: #b45309; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 6px; padding: 1px 5px; vertical-align: middle; }

/* ── Amigos & Duelos (Fase 2: social) ── */
.social { text-align: left; }
.social-tabs { display: flex; gap: 8px; margin: 8px 0 14px; }
.social-id-card {
  background: linear-gradient(135deg, #ecfeff, #eef2ff);
  border: 1px solid #c7d2fe; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px;
}
.social-id-label { font-size: 0.78rem; font-weight: 700; color: #4f46e5; text-transform: uppercase; letter-spacing: .04em; }
.social-id-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.social-id { font-size: 1.5rem; font-weight: 900; letter-spacing: .06em; color: #1e1b4b; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.social-id-hint { font-size: 0.78rem; color: #64748b; }
.social-stats { background: #f1f5f9; border-radius: 10px; padding: 8px 12px; font-size: 0.85rem; font-weight: 700; color: #475569; text-align: center; margin-bottom: 10px; }
.social-stats b { color: #1e293b; }
.social-add { display: flex; gap: 8px; margin-bottom: 6px; }
.social-input {
  flex: 1; padding: 9px 12px; border: 1px solid #cbd5e1; border-radius: 10px;
  font-size: 1rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.social-input:focus { outline: none; border-color: var(--brand); }
.social-msg { min-height: 18px; font-size: 0.82rem; font-weight: 700; margin: 2px 0 6px; }
.social-msg.ok { color: #166534; }
.social-msg.err { color: #b91c1c; }
.social-section-title { font-weight: 800; font-size: 0.9rem; color: #374151; margin: 14px 0 6px; }
.social-empty { font-size: 0.85rem; color: #94a3b8; padding: 6px 2px; }
.friend-row {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; margin-bottom: 7px;
}
.friend-row.dim { opacity: .6; }
.duel-ava {
  position: relative; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
}
.duel-ava img.pet-img { width: 100%; height: 100%; object-fit: contain; }
.friend-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friend-name { font-weight: 800; color: #1f2937; }
.friend-sub { font-size: 0.78rem; color: #64748b; }
/* Nombres en una sola línea con elipsis (evita que "Demo · Pro" se parta en móvil). */
.friend-name, .lb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.friend-actions { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.duel-won { font-weight: 900; color: #166534; font-size: 0.82rem; }
.duel-lost { font-weight: 900; color: #b91c1c; font-size: 0.82rem; }
.duel-draw { font-weight: 900; color: #b45309; font-size: 0.82rem; }
.arena-result.draw { color: #b45309; }
.duel-note { font-size: 0.82rem; font-weight: 800; color: #b45309; margin: 1px 0; }
/* En la lista social, el badge de título no debe estirarse a lo ancho de la columna flex. */
.friend-meta .cos-title { align-self: flex-start; }
.tab-badge {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  background: #dc2626; color: #fff; border-radius: 9px; font-size: 0.72rem; font-weight: 900; line-height: 18px;
}

/* ── Leaderboard Fase 3: tabs CEFR + banner "tu posición" ── */
.lb-cefr-tabs { display: flex; gap: 6px; margin: 8px 0 10px; }
.lb-cefr-tab {
  flex: 1; padding: 7px 4px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff;
  font-weight: 800; font-size: 0.9rem; color: #475569; cursor: pointer;
}
.lb-cefr-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.lb-you-dot { color: #22c55e; font-weight: 900; }
.lb-cefr-tab.active .lb-you-dot { color: #fff; }
.lb-me { margin-bottom: 8px; }
.lb-me-card {
  background: linear-gradient(135deg, #fef3c7, #fde68a); border: 1px solid #fcd34d;
  border-radius: 10px; padding: 8px 12px; font-size: 0.9rem; font-weight: 700; color: #92400e; text-align: center;
}
.lb-me-card.muted { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }
.lb-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* no partir "B1 · Lv N" */
/* Tarjeta de ascenso de nivel CEFR */
.levelup-card { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 1px solid #6ee7b7; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; text-align: center; }
.levelup-card .lu-txt { font-size: 0.88rem; color: #065f46; margin-bottom: 8px; }
.levelup-card.max { color: #92400e; font-weight: 800; background: linear-gradient(135deg, #fef9c3, #fde68a); border-color: #fcd34d; }

/* ── Misiones diarias + racha ── */
.nav-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #dc2626; margin-left: 6px; vertical-align: middle; }
.daily { text-align: left; }
.daily-streak { background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa; border-radius: 12px; padding: 12px 14px; font-size: 1rem; color: #9a3412; text-align: center; margin-bottom: 12px; }
.daily-sec { font-weight: 800; font-size: 0.9rem; color: #374151; margin: 14px 0 8px; }
.quest-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; margin-bottom: 7px; }
.quest-meta { flex: 1; min-width: 0; }
.quest-name { font-weight: 700; color: #1f2937; font-size: 0.9rem; margin-bottom: 6px; }
.q-bar { height: 8px; background: #e5e7eb; border-radius: 5px; overflow: hidden; }
.q-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 5px; transition: width .4s ease; }
.quest-act { flex: 0 0 auto; }
.q-prog { font-size: 0.82rem; font-weight: 800; color: #94a3b8; }
.q-claimed { font-size: 0.82rem; font-weight: 800; color: #166534; }
.lb-info .cos-title { align-self: flex-start; margin-top: 2px; }

/* ── Logros (Pilar 3) ── */
.achv-head { text-align: center; font-size: 1.05rem; color: #374151; margin-bottom: 14px; }
.achv-head b { color: #d97706; }
.achv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.achv-card { position: relative; border: 1px solid #e5e7eb; border-radius: 14px; background: #f9fafb; padding: 12px 10px 10px; text-align: center; opacity: .7; }
.achv-card.earned { opacity: 1; background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #fcd34d; }
.achv-emoji { font-size: 2rem; line-height: 1; filter: grayscale(1); }
.achv-card.earned .achv-emoji { filter: none; }
.achv-name { font-weight: 800; font-size: 0.9rem; color: #1f2937; margin-top: 6px; }
.achv-desc { font-size: 0.76rem; color: #6b7280; margin: 3px 0 8px; line-height: 1.3; }
.achv-bar { height: 7px; background: #e5e7eb; border-radius: 5px; overflow: hidden; }
.achv-fill { height: 100%; background: linear-gradient(90deg, #f59e0b, #d97706); border-radius: 5px; transition: width .4s ease; }
.achv-prog { font-size: 0.74rem; font-weight: 800; color: #94a3b8; margin-top: 3px; }
.achv-done { font-size: 0.8rem; font-weight: 800; color: #166534; }
.achv-reward { margin-top: 6px; font-size: 0.78rem; font-weight: 800; color: #b45309; }

/* ── Home / dashboard de progreso (gancho de entrada) ── */
.home-hero { background: linear-gradient(135deg, var(--brand-100, #ecfdf5), #eef2ff); border: 1px solid var(--brand-150, #d1fae5); border-radius: 18px; padding: 18px 16px; text-align: center; max-width: 420px; margin: 0 auto; }
.home-pet .pet-img { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.18)); }
.home-petname { font-size: 1.5rem; font-weight: 800; color: var(--brand-strong, #9d174d); margin-top: 4px; }
.home-sub { font-size: 0.9rem; color: #6b7280; margin: 2px 0 12px; }
.home-evo { height: 14px; background: #e5e7eb; border-radius: 8px; overflow: hidden; max-width: 300px; margin: 0 auto; }
.home-evo-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 8px; transition: width .5s ease; }
.home-evo-label { font-size: 0.9rem; color: #374151; font-weight: 700; margin-top: 6px; }
.home-stats { font-size: 0.9rem; color: #4b5563; margin-top: 10px; }
/* CTA principal del Home: verde "seguir/acción" estilo Duolingo (antes salía guinda del .ex-btn,
   que el usuario encontró feo/agresivo). Coherente con la barra de evolución verde. */
.home-continue {
  display: block; max-width: 440px; margin: 18px auto 0; padding: 15px 20px;
  font-size: 1.05rem; font-weight: 800; border-radius: 16px;
  background: linear-gradient(135deg, #34d399, #16a34a);
  color: #fff; box-shadow: 0 6px 16px rgba(22,163,74,0.28);
  transition: transform .15s, box-shadow .15s;
}
.home-continue:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(22,163,74,0.34); }
/* Tarjeta de sugerencia inteligente del Home (Paso 2) */
.home-suggest {
  max-width: 440px; margin: 18px auto 0; padding: 14px 16px 16px;
  border-radius: 18px; background: #f0fdf4; border: 1.5px solid #bbf7d0; text-align: center;
}
.home-suggest-label { font-size: .72rem; font-weight: 800; color: #16a34a; letter-spacing: .5px; text-transform: uppercase; }
.home-suggest-main { font-size: 1.08rem; font-weight: 800; color: #14532d; margin: 5px 0 2px; }
.home-suggest-why { font-size: .82rem; color: #4b5563; }
.home-suggest .home-continue { max-width: none; width: 100%; margin: 12px auto 0; }
.home-quick-label { text-align: center; font-size: 0.8rem; color: #9ca3af; margin: 16px 0 8px; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 420px; margin: 0 auto; }
.home-chip { flex: 1 1 28%; min-width: 90px; padding: 12px 8px; border: 1.5px solid var(--brand-150, #e5e7eb); border-radius: 12px; background: #fff; font-weight: 700; font-size: 0.9rem; color: #374151; cursor: pointer; font-family: 'Inter', Arial, sans-serif; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
/* Iconos SVG del set del menú, ahora también en los chips de la home y el botón de recordatorios */
.home-chip .nav-ic, .home-bell .nav-ic { width: 20px; height: 20px; }
.home-bell .nav-ic { vertical-align: -5px; margin-right: 5px; }
/* Iconos de línea "en tamaño texto" para las estadísticas del home-hero (XP, racha, evolución,
   diarias, candado de invitado): escalan con la tipografía y heredan el color del texto. */
.stat-ic { display: inline-flex; width: 1.05em; height: 1.05em; vertical-align: -0.16em; color: inherit; flex: none; }
.stat-ic svg { width: 100%; height: 100%; display: block; }
.home-chip:hover { border-color: var(--brand, #16a34a); background: var(--brand-50, #f0fdf4); }
.home-chip-hero { border-color: var(--brand, #16a34a); background: var(--brand-50, #f0fdf4); }
.home-chip-hero .home-chip-star { color: #f59e0b; margin-left: 1px; }
.home-bell { display: block; width: 100%; margin-top: 10px; padding: 10px; border: 1.5px dashed var(--brand-150, #e5e7eb); border-radius: 12px; background: #fff; color: var(--brand-strong); font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: 'Inter', Arial, sans-serif; transition: all .15s; }
.home-bell:hover { border-color: var(--brand); background: var(--brand-50, #f0fdf4); }
.home-bell .es-hint { font-weight: 600; }

/* ── Exposiciones / Presentations ── */
.present-head { position: relative; margin-bottom: 12px; }
.present-exit { position: absolute; right: 0; top: 0; background: none; border: none; font-size: 1.1rem; color: #94a3b8; cursor: pointer; }
.present-title { font-weight: 800; color: var(--brand-strong); font-size: 1.05rem; padding-right: 28px; }
.present-progress { font-size: 0.8rem; color: #64748b; margin-top: 2px; }
.present-bar { height: 6px; background: var(--brand-100, #f1e4e7); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.present-bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); transition: width .3s; }
.present-slide { background: #fff; border: 1.5px solid var(--brand-150, #e5e7eb); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.present-slide-heading { font-weight: 800; color: var(--brand-strong); margin-bottom: 8px; }
.present-points { margin: 0 0 10px; padding-left: 20px; }
.present-points li { margin: 4px 0; }
.present-vocab-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.present-vocab { background: var(--brand-50, #f7eef0); border: 1px solid var(--brand-150, #e5e7eb); border-radius: 999px; padding: 3px 10px; font-size: 0.82rem; }
.present-script { background: var(--brand-50, #f7eef0); border-radius: 10px; padding: 10px 12px; }
.present-script-label { font-size: 0.82rem; color: #64748b; font-weight: 700; margin-bottom: 4px; }
.present-script p { margin: 0; font-style: italic; color: #334155; }
.present-stage { text-align: center; margin-bottom: 12px; }
.present-cam { width: 100%; max-width: 360px; border-radius: 14px; background: #000; margin: 0 auto 10px; transform: scaleX(-1); }
.present-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.present-cam-btn { padding: 10px 16px; border: 1.5px solid var(--brand-150, #e5e7eb); border-radius: 999px; background: #fff; color: var(--brand-strong); font-weight: 700; cursor: pointer; font-family: 'Inter', Arial, sans-serif; }
.present-cam-btn.on { background: var(--brand-50, #f7eef0); border-color: var(--brand); }
.present-mic { padding: 10px 20px; border: none; border-radius: 999px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 800; cursor: pointer; font-family: 'Inter', Arial, sans-serif; }
.present-mic.recording { background: #dc2626; animation: presentPulse 1.2s infinite; }
@keyframes presentPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); } }
.present-status { font-size: 0.86rem; color: #64748b; margin-top: 8px; min-height: 18px; }
.present-feedback { margin-top: 10px; text-align: left; }
.present-fb-card { background: #fff; border: 1.5px solid var(--brand-150, #e5e7eb); border-radius: 14px; padding: 12px 14px; }
.present-score { font-size: 2rem; font-weight: 900; text-align: center; }
.present-score span { font-size: 0.9rem; color: #94a3b8; font-weight: 700; }
.present-transcript { font-size: 0.82rem; color: #64748b; font-style: italic; margin: 6px 0; }
.present-fb-sec { margin: 8px 0; font-size: 0.9rem; }
.present-fb-sec ul { margin: 4px 0; padding-left: 20px; }
.present-fb-sec li { margin: 3px 0; }
.present-why { color: #94a3b8; font-size: 0.85em; }
.present-tip { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 0.88rem; }
.present-encourage { margin-top: 8px; font-weight: 700; color: var(--brand-strong); }
.present-nav { display: flex; gap: 8px; }
.present-nav .ex-btn { flex: 1; }
.present-msg { color: #dc2626; font-size: 0.85rem; margin-top: 8px; }
.present-or { text-align: center; color: #94a3b8; font-size: 0.85rem; font-weight: 600; margin: 14px 0 8px; }
.present-loading { text-align: center; padding: 24px; color: #64748b; }
.qa-question { font-weight: 800; color: var(--brand-strong); font-size: 1.02rem; line-height: 1.35; }
.qa-focus { color: #94a3b8; font-size: 0.82rem; margin-top: 4px; }
.qa-model { margin: 4px 0 0; font-style: italic; color: #334155; background: var(--brand-50, #f7eef0); border-radius: 8px; padding: 8px 10px; }
.present-qa-btn small { display: block; font-weight: 600; opacity: 0.9; }
.present-done { text-align: center; padding: 20px 10px; }
.present-done-emoji { font-size: 3rem; }
.present-done-tip { color: #64748b; font-size: 0.88rem; }

/* ── Pulido: refresh, acciones de leaderboard, quitar amigo, salir del duelo ── */
.social-refresh {
  flex: 0 0 auto; width: 40px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff;
  font-size: 1rem; cursor: pointer; color: #475569;
}
.social-refresh:hover { background: #f1f5f9; }
.social-refresh.spin { animation: spin360 0.6s ease; }
@keyframes spin360 { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.lb-actions { display: inline-flex; gap: 4px; margin-left: 6px; align-items: center; }
.lb-actions .shop-btn { padding: 4px 8px; display: inline-flex; align-items: center; }
.lb-actions .stat-ic, .friend-actions .stat-ic { width: 16px; height: 16px; }
.friend-actions .shop-btn { display: inline-flex; align-items: center; }
.social-refresh .stat-ic, #copy-pid .stat-ic { vertical-align: -2px; }
#add-friend-btn .stat-ic { width: 1em; height: 1em; vertical-align: -2px; margin-right: 3px; }
/* Botón ✕ discreto (quitar amigo / cancelar / acciones secundarias) */
.shop-btn.lb-x { background: #f1f5f9; color: #94a3b8; padding: 4px 9px; }
.shop-btn.lb-x:hover { background: #fee2e2; color: #dc2626; }
.duel-quiz-close {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: #f1f5f9; color: #64748b; font-size: 1rem; font-weight: 800; cursor: pointer; z-index: 2;
}
.duel-quiz-close:hover { background: #fee2e2; color: #dc2626; }
.duel-quiz-card { position: relative; }

/* Overlay del duelo (quiz + replay) */
.duel-overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .72);
  display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px);
}
.duel-pre, .duel-quiz-card, .duel-result-card, .duel-stage {
  background: #fff; border-radius: 18px; padding: 18px 18px 16px; width: min(560px, 100%);
  max-height: 92vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.35); text-align: center;
}
.duel-pre { font-size: 1.25rem; font-weight: 800; color: #1e293b; }
.duel-pre small { display: block; font-size: 0.85rem; color: #64748b; margin-top: 6px; font-weight: 600; }
.duel-quiz-top { font-weight: 800; color: #4f46e5; margin-bottom: 8px; }
.duel-result-card .duel-big { font-size: 1.6rem; font-weight: 900; color: #1e293b; margin-bottom: 8px; }
.duel-result-card .duel-sub { font-size: 0.9rem; color: #475569; margin-bottom: 14px; }
.duel-elo { font-size: 0.9rem; font-weight: 900; color: #c2410c; margin-left: 6px; }
.duel-stage .arena-result { margin-top: 10px; }
/* Espera en vivo (Fase 2b) */
.duel-ava-lg { width: 84px; height: 84px; margin: 0 auto 6px; }
.wait-prog { margin: 10px 0; }
.wait-prog-label { font-size: 0.82rem; font-weight: 800; color: #475569; margin-bottom: 4px; }
.wait-bar { height: 12px; background: #e5e7eb; border-radius: 7px; overflow: hidden; }
.wait-bar-fill { height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 7px; transition: width .4s ease; }
.duel-livedot { font-size: 0.78rem; font-weight: 900; color: #16a34a; letter-spacing: .06em; margin-bottom: 4px; animation: livePulse 1.2s ease-in-out infinite; }
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* Guía de combate */
.guide-card { position: relative; background: #fff; border-radius: 18px; padding: 18px 16px; width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.guide-title { font-size: 1.25rem; font-weight: 900; color: #1e293b; text-align: center; margin-bottom: 8px; }
.guide-rule { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 9px 12px; font-size: 0.9rem; color: #9a3412; text-align: center; margin-bottom: 12px; }
.guide-row { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid #e5e7eb; border-radius: 12px; margin-bottom: 7px; }
.guide-spr { width: 52px; height: 52px; flex: 0 0 auto; }
.guide-spr img.pet-img { width: 100%; height: 100%; object-fit: contain; }
.guide-meta { flex: 1; min-width: 0; }
.guide-name { font-weight: 900; color: #1f2937; }
.guide-role { font-size: 0.75rem; font-weight: 700; color: #6366f1; margin-left: 4px; }
.guide-line { font-size: 0.82rem; color: #374151; margin-top: 2px; }
.guide-line b { color: #1f2937; }

/* ── Móvil: que el encabezado quepa sin recortar ni encimar (XP/ES/ayuda visibles) ── */
@media (max-width: 560px) {
  .chat-header { padding: 10px 10px; gap: 6px; }
  .header-left { gap: 8px; }
  .header-text { display: none; }                /* en celular ocultamos el wordmark "Flow" (el
                                                    avatar ya identifica la app) para que quepan
                                                    el chip de XP + ES + ayuda sin encimarse */
  .xp-chip { font-size: 0.62rem; padding: 3px 6px; }
  .daily-pill { font-size: 0.62rem; padding: 3px 7px; }
  .header-actions { gap: 5px; }
  .reset-btn { padding: 5px 8px; font-size: 0.8rem; }   /* ES y ❓ más compactos en móvil */
  /* App a pantalla completa en celular (sin marco/tarjeta flotante) */
  .chat-shell { width: 100%; margin: 0; height: 100vh; border-radius: 0; box-shadow: none; }
}
