/* VISUE - estilos. Diseño de Stitch (negro + morado oscuro), unido en una sola página. */

:root {
  --fondo: #0A0A0F;
  --tarjeta: #1a1a24;
  --tarjeta-2: #151520;
  --morado: #6D28D9;
  --morado-oscuro: #4C1D95;
  --acento: #A78BFA;
  --acento-claro: #C4B5FD;
  --texto: #FFFFFF;
  --texto-2: #E2E8F0;
  --apagado: #94A3B8;
  --tenue: #64748B;
  --borde: rgba(167, 139, 250, 0.2);
  --borde-fuerte: rgba(167, 139, 250, 0.4);
  --ok: #34D399;
  --aviso: #FBBF24;
  --error: #F87171;
  --ar: 1.3333;            /* proporción ancho/alto de la cámara (la fija app.js) */
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--fondo);
  color: var(--texto);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .letter-node:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}
svg { display: block; flex: none; }

/* ---------- Estructura de pantallas ---------- */
.pantalla { display: none; min-height: 100vh; min-height: 100dvh; }
.pantalla.activa { display: block; }

.contenedor {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

/* ---------- Pantalla 1: inicio ---------- */
.contenedor.inicio {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-top: max(32px, env(safe-area-inset-top));
}

.inicio-principal {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-icon-wrapper {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.4), rgba(76, 29, 149, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 25px rgba(109, 40, 217, 0.35);
}
.brand-icon-wrapper svg { width: 32px; height: 32px; color: var(--acento); }

.brand-title {
  font-family: 'Sora', sans-serif;
  font-size: 38px; font-weight: 700; letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.brand-title span { color: var(--acento); }
.brand-subtitle { font-size: 16px; color: var(--apagado); margin-bottom: 16px; }

.badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--acento-claro);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  padding: 5px 14px; border-radius: 9999px;
  margin-bottom: 40px;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }

.cards-container { width: 100%; display: flex; flex-direction: column; gap: 16px; }

.btn-card {
  display: flex; align-items: center; width: 100%;
  background: var(--tarjeta);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 16px;
  padding: 20px;
  text-align: left; cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.btn-card:hover {
  background: #232332;
  border-color: var(--borde-fuerte);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 20px rgba(109, 40, 217, 0.2);
}
.btn-card:active { transform: translateY(0); }

.card-icon-container {
  width: 48px; height: 48px; flex: none;
  border-radius: 12px;
  background: rgba(109, 40, 217, 0.25);
  border: 1px solid rgba(167, 139, 250, 0.25);
  display: flex; align-items: center; justify-content: center;
  margin-right: 16px;
}
.card-icon-container svg { width: 24px; height: 24px; color: var(--acento-claro); }

.card-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.card-header-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.card-title { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.card-header-row .card-title { margin-bottom: 0; }
.card-desc { font-size: 13px; color: var(--apagado); line-height: 1.4; }

.status-tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(109, 40, 217, 0.5); color: #DDD6FE;
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.card-arrow { margin-left: 12px; color: var(--tenue); }
.card-arrow svg { width: 20px; height: 20px; }
.btn-card:hover .card-arrow { color: var(--acento); }

.inicio-pie { text-align: center; padding-top: 24px; }
.footer-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  color: var(--acento); font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.footer-link svg { width: 16px; height: 16px; }
.footer-link:hover { color: #DDD6FE; text-decoration: underline; }
.footer-sub { font-size: 12px; color: var(--tenue); margin-top: 8px; }

/* ---------- Cabecera común de pantallas 2 y 3 ---------- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 20px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.12);
  margin-bottom: 20px;
}
.btn-nav-back {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  color: var(--texto-2);
  padding: 0 14px; height: 40px;
  border-radius: 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-nav-back:hover { background: #232332; border-color: rgba(167, 139, 250, 0.45); color: var(--acento); }
.btn-nav-back svg { width: 18px; height: 18px; }

.header-title-badge {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--acento-claro);
}
.header-status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6);
}
.header-status-dot.cargando { background: var(--aviso); box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.header-status-dot.error { background: var(--error); box-shadow: 0 0 8px rgba(248, 113, 113, 0.6); }

/* ---------- Pantalla 2: seña a voz ---------- */
.cuerpo { display: flex; flex-direction: column; gap: 18px; }

.camera-container {
  position: relative;
  /* El contenedor tiene la MISMA proporción que el video, así el dibujo de la mano
     (canvas) coincide exacto con la imagen. 60vh evita que en celular quede enorme. */
  width: min(100%, calc(60vh * var(--ar)));
  aspect-ratio: var(--ar);
  margin-inline: auto;
  background: #14141d;
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(109, 40, 217, 0.1);
}
#video, #overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: scaleX(-1); -webkit-transform: scaleX(-1);   /* efecto espejo */
}
#video { object-fit: fill; background: #0f0f16; }
#overlay { pointer-events: none; }

.camera-hud-guide {
  position: absolute; inset: 14px;
  border: 2px dashed rgba(167, 139, 250, 0.35);
  border-radius: 14px; pointer-events: none;
  display: flex; align-items: flex-start; justify-content: flex-end; padding: 10px;
}
.cam-tag {
  background: rgba(10, 10, 15, 0.75);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 8px; font-size: 11px; font-weight: 500;
  color: var(--acento); padding: 4px 8px;
  display: flex; align-items: center; gap: 5px;
}
.cam-tag svg { width: 12px; height: 12px; }

#mensaje-camara {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  background: rgba(10, 10, 15, 0.88);
  color: var(--texto-2); font-size: 14px; line-height: 1.5;
}
#mensaje-camara .btn-secondary { padding: 0 20px; }
.spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(167, 139, 250, 0.2); border-top-color: var(--acento);
  animation: girar 0.9s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.detection-panel {
  background: rgba(26, 26, 36, 0.75);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--borde);
  border-radius: 20px; padding: 18px 20px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
#estado { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--apagado); margin-bottom: 4px; }
#estado.confirmando { color: var(--acento-claro); }
#estado.bloqueada { color: var(--aviso); }

#letra {
  font-family: 'Sora', sans-serif; font-size: 72px; line-height: 1.1; font-weight: 700;
  color: var(--acento); text-shadow: 0 0 25px rgba(167, 139, 250, 0.5);
  min-height: 80px; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.15s ease;
}
#letra.dudosa { opacity: 0.4; }
#letra.vacia { color: var(--tenue); text-shadow: none; }
#letra.confirmada { animation: destello 0.45s ease; }
@keyframes destello {
  0% { transform: scale(1); color: #fff; text-shadow: 0 0 40px rgba(167, 139, 250, 0.9); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.progress-wrapper { width: 100%; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.progress-bar-bg {
  width: 100%; height: 8px; background: #111118; border-radius: 9999px; overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.15);
}
#barra-progreso {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--morado), var(--acento));
  border-radius: 9999px; box-shadow: 0 0 10px rgba(167, 139, 250, 0.6);
}
.confidence-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--apagado); padding: 0 2px; }
#confianza { color: var(--acento-claro); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Interruptor "decir cada letra" */
.interruptor {
  margin-top: 14px; display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--apagado); cursor: pointer; user-select: none;
}
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor-pista {
  width: 36px; height: 20px; border-radius: 9999px; position: relative; flex: none;
  background: #111118; border: 1px solid var(--borde); transition: background 0.2s ease;
}
.interruptor-pista::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--apagado); transition: transform 0.2s ease, background 0.2s ease;
}
.interruptor input:checked + .interruptor-pista { background: var(--morado); border-color: var(--acento); }
.interruptor input:checked + .interruptor-pista::after { transform: translateX(16px); background: #fff; }
.interruptor input:focus-visible + .interruptor-pista { outline: 2px solid var(--acento); outline-offset: 2px; }

.phrase-box-container { display: flex; flex-direction: column; gap: 12px; }
#frase {
  width: 100%; min-height: 64px;
  background: var(--tarjeta-2);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 14px; padding: 14px 16px;
  font-size: 18px; line-height: 1.5; letter-spacing: 0.5px;
  display: flex; align-items: center; flex-wrap: wrap;
  overflow-wrap: anywhere;
}
#frase-texto { white-space: pre-wrap; }
#frase-texto:empty::before { content: "Tu frase aparecerá aquí"; color: var(--tenue); font-size: 15px; letter-spacing: 0; }
.cursor-blink {
  display: inline-block; width: 2px; height: 20px; margin-left: 2px;
  background: var(--acento); vertical-align: middle;
  animation: parpadeo 1s step-end infinite;
}
@keyframes parpadeo { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.action-controls-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.35fr; gap: 8px; }

.btn-secondary {
  background: var(--tarjeta); border: 1px solid var(--borde); color: var(--texto-2);
  border-radius: 12px; height: 46px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s ease;
}
.btn-secondary:hover { background: #242434; border-color: var(--borde-fuerte); color: #fff; transform: translateY(-1px); }
.btn-secondary svg { width: 16px; height: 16px; }

.btn-primary-action, #btn-reproducir {
  background: linear-gradient(135deg, var(--morado), #5B21B6);
  border: 1px solid var(--acento); color: #fff;
  border-radius: 12px; height: 46px;
  font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 4px 16px rgba(109, 40, 217, 0.4);
  transition: all 0.2s ease;
}
.btn-primary-action:hover, #btn-reproducir:hover {
  background: linear-gradient(135deg, #7C3AED, var(--morado));
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5); transform: translateY(-1px);
}
.btn-primary-action svg, #btn-reproducir svg { width: 18px; height: 18px; }

/* ---------- Pantalla 3: voz a seña ---------- */
.contenedor--medio { max-width: 560px; }
.cuerpo-v3 { display: flex; flex-direction: column; gap: 20px; }

.input-speech-group { display: flex; gap: 10px; align-items: center; }
#texto-entrada {
  flex: 1; min-width: 0; height: 52px;
  background: var(--tarjeta-2); border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 14px; padding: 0 16px; color: #fff;
  font-family: inherit; font-size: 16px; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#texto-entrada:focus { border-color: var(--acento); box-shadow: 0 0 14px rgba(167, 139, 250, 0.25); }
#texto-entrada::placeholder { color: var(--tenue); }

#btn-microfono {
  width: 52px; height: 52px; flex: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, rgba(109, 40, 217, 0.3), rgba(76, 29, 149, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.35); color: var(--acento-claro);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
#btn-microfono:hover { background: rgba(109, 40, 217, 0.5); color: #fff; transform: translateY(-1px); box-shadow: 0 0 16px rgba(109, 40, 217, 0.4); }
#btn-microfono svg { width: 22px; height: 22px; }
#btn-microfono.escuchando { background: var(--morado); border-color: var(--acento); color: #fff; animation: pulso 1.2s ease-in-out infinite; }
@keyframes pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(167, 139, 250, 0); } }

/* Caja del avatar. Cuando llegue el .glb se dibuja DENTRO de #avatar. */
#avatar {
  width: 100%; height: 300px; position: relative; overflow: hidden;
  background: var(--tarjeta);
  border: 1px dashed rgba(167, 139, 250, 0.3);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}
#avatar.reproduciendo { border-style: solid; border-color: rgba(167, 139, 250, 0.45); }
.avatar-placeholder-glow {
  position: absolute; width: 220px; height: 220px; pointer-events: none;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.28) 0%, rgba(10, 10, 15, 0) 70%);
}
#avatar-reposo { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.avatar-icon-badge {
  width: 54px; height: 54px; margin-bottom: 12px;
  background: rgba(109, 40, 217, 0.2); border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--acento);
}
.avatar-icon-badge svg { width: 28px; height: 28px; }
.avatar-label-text { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 600; color: var(--texto-2); }
.avatar-sub-text { font-size: 13px; color: var(--apagado); margin-top: 4px; }

#avatar-letra {
  position: relative; z-index: 1;
  font-family: 'Sora', sans-serif; font-size: 150px; font-weight: 700; line-height: 1;
  color: var(--acento); text-shadow: 0 0 40px rgba(167, 139, 250, 0.6);
}
#avatar-letra.cambio { animation: destello 0.35s ease; }
#avatar-letra.pausa { font-size: 40px; color: var(--tenue); text-shadow: none; }

.spelling-track-container { display: flex; flex-direction: column; gap: 8px; }
.spelling-track-label { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--apagado); }
#tira-letras {
  display: flex; align-items: center; gap: 10px;
  overflow-x: auto; padding: 12px 6px;
  scrollbar-width: none; min-height: 72px;
}
#tira-letras::-webkit-scrollbar { display: none; }
#tira-letras .vacia { font-size: 13px; color: var(--tenue); padding: 0 4px; }
.letter-node {
  min-width: 44px; height: 48px; flex: none;
  border-radius: 12px; background: #171722; border: 1px solid var(--borde);
  color: #CBD5E1; font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; cursor: pointer;
}
.letter-node.espacio { min-width: 22px; background: transparent; border-style: dashed; color: var(--tenue); font-size: 13px; }
.letter-node.active {
  background: linear-gradient(135deg, var(--morado), var(--morado-oscuro));
  border-color: var(--acento); color: #fff; border-style: solid;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.6); transform: scale(1.08);
}
.letter-node:hover:not(.active) { border-color: var(--borde-fuerte); background: #20202e; }

.playback-controls-row { display: flex; align-items: center; gap: 10px; }
.speed-select-wrapper { position: relative; flex: 1; }
#velocidad {
  width: 100%; height: 46px;
  background: var(--tarjeta); border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 12px; color: #fff; padding: 0 34px 0 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
#velocidad option { background: var(--tarjeta); color: #fff; }
.select-chevron { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--acento); }
.select-chevron svg { width: 16px; height: 16px; }
#btn-reproducir { flex: 1.4; }
#btn-repetir {
  flex: 1; background: var(--tarjeta); border: 1px solid var(--borde); color: var(--texto-2);
  border-radius: 12px; height: 46px; font-size: 13px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s ease;
}
#btn-repetir:hover { background: #242434; border-color: var(--borde-fuerte); color: #fff; transform: translateY(-1px); }
#btn-repetir svg { width: 16px; height: 16px; }

/* ---------- Ayuda y avisos ---------- */
dialog#como-funciona {
  margin: auto; width: min(92vw, 440px);
  background: var(--tarjeta); color: var(--texto-2);
  border: 1px solid var(--borde-fuerte); border-radius: 20px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(109, 40, 217, 0.25);
}
dialog#como-funciona::backdrop { background: rgba(5, 5, 10, 0.75); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog h2 { font-family: 'Sora', sans-serif; font-size: 20px; color: #fff; margin-bottom: 14px; }
dialog ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.55; }
dialog strong { color: var(--acento-claro); }
dialog .nota { margin-top: 16px; font-size: 12px; color: var(--apagado); line-height: 1.5; }
dialog .btn-primary-action { width: 100%; margin-top: 18px; }

#aviso {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 50;
  max-width: min(92vw, 420px);
  background: rgba(26, 26, 36, 0.96); border: 1px solid var(--borde-fuerte);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--texto-2); font-size: 13px; line-height: 1.45; text-align: center;
  padding: 12px 18px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 520px) {
  /* En celular el selector de velocidad ocupa su propia fila para que se lea completo */
  .playback-controls-row { flex-wrap: wrap; }
  .speed-select-wrapper { flex: 1 1 100%; }
  #btn-reproducir, #btn-repetir { flex: 1 1 0; }
}
@media (max-width: 380px) {
  .action-controls-grid { grid-template-columns: 1fr 1fr; }
  #letra { font-size: 60px; }
  #avatar-letra { font-size: 120px; }
}

/* ---------- Computador: seña a voz en dos columnas ---------- */
@media (min-width: 900px) {
  #pantalla-sena-voz .contenedor { max-width: 1040px; }
  #pantalla-sena-voz .cuerpo {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;      /* el panel y la frase quedan pegados, sin hueco */
    column-gap: 24px; row-gap: 18px; align-items: start;
  }
  #pantalla-sena-voz .camera-container { grid-row: 1 / span 2; margin-inline: 0; width: 100%; }
  #avatar { height: 340px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
dialog#guia-alfabeto { margin:auto; width:min(94vw,520px); max-height:92vh; overflow-y:auto; background:var(--tarjeta); color:var(--texto-2); border:1px solid var(--borde-fuerte); border-radius:20px; padding:20px; box-shadow:0 20px 60px rgba(0,0,0,.7),0 0 30px rgba(109,40,217,.25); }
dialog#guia-alfabeto::backdrop { background:rgba(5,5,10,.75); -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
dialog#guia-alfabeto h2 { margin-bottom:6px; }
dialog#guia-alfabeto .nota { margin:8px 0 14px; }
.guia-imagen { background:#fff; border-radius:14px; padding:10px; }
.guia-imagen img { display:block; width:100%; height:auto; }
/* ---------- Acerca de (equipo) ---------- */
dialog#acerca {
  margin: auto; width: min(94vw, 480px); max-height: 92vh; overflow-y: auto;
  background: var(--tarjeta); color: var(--texto-2);
  border: 1px solid var(--borde-fuerte); border-radius: 20px; padding: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(109, 40, 217, 0.25);
}
/* ---------- Acerca de (equipo) · estructura Thefacebook, colores de VISUE ---------- */
dialog#acerca {
  margin: auto; width: min(94vw, 560px); max-height: 92vh; overflow-y: auto; padding: 0;
  background: var(--tarjeta); color: var(--texto-2);
  border: 1px solid var(--borde-fuerte); border-radius: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(109, 40, 217, 0.25);
}
dialog#acerca::backdrop { background: rgba(5, 5, 10, 0.75); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

dialog#acerca .fb-cabecera {
  background: linear-gradient(90deg, var(--fondo) 0%, var(--morado-oscuro) 55%, var(--morado) 100%);
  padding: 14px 16px 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  border-bottom: 2px solid var(--borde-fuerte);
}
dialog#acerca .fb-logo { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 30px; letter-spacing: 1px; color: var(--acento-claro); text-shadow: 0 2px 12px rgba(109, 40, 217, 0.6); }
dialog#acerca .fb-nav { font-size: 12px; color: var(--texto-2); }
dialog#acerca .fb-franja { background: var(--morado-oscuro); color: #fff; font-size: 14px; padding: 5px 10px; border-bottom: 1px solid var(--borde); }

dialog#acerca .fb-contenido { padding: 14px 18px 22px; }
dialog#acerca h2 { font-family: 'Sora', sans-serif; font-size: 22px; font-weight: 700; color: #fff; text-align: center; margin: 6px 0 18px; }

.acerca-bloque { border: 1px solid var(--borde-fuerte); border-radius: 0; overflow: hidden; margin-bottom: 16px; background: var(--tarjeta-2); }
.acerca-bloque h3 { background: var(--morado-oscuro); color: #fff; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500; padding: 4px 8px; }
.acerca-bloque p { padding: 14px 18px; font-size: 13px; line-height: 1.55; color: var(--texto-2); }

.acerca-gente { list-style: none; padding: 14px 18px 6px; display: flex; flex-direction: column; gap: 10px; }
.acerca-gente li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; font-size: 13px; line-height: 1.45; border: 0; padding: 0; }
.acerca-gente strong { color: var(--acento); font-weight: 500; }
.acerca-gente span { color: var(--texto-2); }

.acerca-contacto { padding: 14px 18px 18px; font-size: 13px; }
.acerca-contacto a { color: var(--acento); text-decoration: none; }
.acerca-contacto a:hover { color: #DDD6FE; text-decoration: underline; }

dialog#acerca .btn-primary-action {
  display: block; width: auto; margin: 4px auto 0; padding: 6px 18px; border-radius: 0;
  font-size: 14px;
}
dialog#acerca .btn-primary-action:hover { transform: none; }

@media (max-width: 480px) {
  .acerca-gente li { grid-template-columns: 1fr; gap: 2px; }
  dialog#acerca .fb-logo { font-size: 24px; }
}
/* Avatar 3D */
#avatar.con-3d { position: relative; overflow: hidden; min-height: min(60vh, 420px); }
#avatar canvas.avatar3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
#avatar.con-3d #avatar-reposo { display: none; }
#avatar.con-3d #avatar-letra { position: absolute; left: 14px; top: 10px; z-index: 2; font-size: 2.2rem; line-height: 1; pointer-events: none; }
/* Avatar 3D */
#avatar.con-3d { position: relative; overflow: hidden; min-height: min(60vh, 420px); }
#avatar canvas.avatar3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; display: block; }
#avatar.con-3d #avatar-reposo { display: none; }
#avatar.con-3d #avatar-letra { position: absolute; left: 14px; top: 10px; z-index: 2; font-size: 2.2rem; line-height: 1; pointer-events: none; }