/* ============================================================
   Primeros Pasos Digitales — JAM STUDIO
   Tema claro, cercano y sin infantilismos. Pensado para
   personas mayores que empiezan desde cero.
   ============================================================ */

:root {
  --fondo: url("../res/fondo-web.jpg") center/cover fixed no-repeat;
  --fondo-solido: #eef3fa;
  --papel: rgba(255, 255, 255, 0.97);
  --papel-2: rgba(247, 250, 253, 0.97);
  --texto: #1b2a41;
  --suave: #56688a;
  --borde: #d3dded;
  --borde-fuerte: #b6c6de;
  --primario: #2b6cb0;
  --primario-osc: #1f4f86;
  --primario-claro: #e2eefc;
  --verde: #2f855a;
  --verde-claro: #e3f5ec;
  --rojo: #c53030;
  --rojo-claro: #fde8e8;
  --ambar: #b7791f;
  --ambar-claro: #fdf2dd;
  --sombra: 0 6px 20px rgba(27, 42, 65, 0.10);
  --sombra-suave: 0 2px 8px rgba(27, 42, 65, 0.08);
  --radio: 18px;
}

html { font-size: 19px; }
html[data-tam="grande"] { font-size: 22px; }
html[data-tam="xl"] { font-size: 26px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fondo);
  color: var(--texto);
  line-height: 1.55;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
  background-attachment: fixed;
}

body[data-contraste="alto"] {
  --fondo: #ffffff;
  --papel: #ffffff;
  --papel-2: #ffffff;
  --texto: #000000;
  --suave: #111111;
  --borde: #000000;
  --borde-fuerte: #000000;
  --primario: #0000cc;
  --primario-osc: #000080;
  --primario-claro: #eaeaff;
  --verde: #006400;
  --verde-claro: #e6ffe6;
  --rojo: #990000;
  --rojo-claro: #ffe6e6;
  --ambar: #7a4d00;
  --ambar-claro: #fff5d6;
  --sombra: none;
  --sombra-suave: none;
}
body[data-contraste="alto"] .tarjeta,
body[data-contraste="alto"] .zona,
body[data-contraste="alto"] .btn,
body[data-contraste="alto"] .tarjeta-ejercicio { border-width: 3px !important; }

h1, h2, h3 { margin: 0 0 0.5rem; line-height: 1.22; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 0.7rem; }

.suave { color: var(--suave); }
.center { text-align: center; }
.pequeno { font-size: 0.88rem; }

/* ---------- Estructura ---------- */

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.8rem 1rem 2.5rem;
}

.cabecera {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.6rem 1rem 0.2rem;
}
.cabecera .logo-jam { height: clamp(88px, 16vh, 150px); width: auto; }

.pie {
  text-align: center;
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  font-size: 0.85rem;
  padding: 1rem;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: var(--primario);
  border: 2px solid var(--primario-osc);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  box-shadow: var(--sombra-suave);
}
.btn:hover { background: var(--primario-osc); }
.btn:active { transform: scale(0.98); }

.btn-blanco { background: var(--papel); color: var(--primario); border-color: var(--borde-fuerte); }
.btn-blanco:hover { background: var(--primario-claro); }
.btn-verde { background: var(--verde); border-color: #216343; }
.btn-verde:hover { background: #276749; }
.btn-tenue { background: transparent; color: var(--suave); border-color: var(--borde); }
.btn-tenue:hover { background: var(--papel); color: var(--texto); }
.btn-amplio { width: 100%; }

/* ---------- Portada / cabecera de pantalla ---------- */

.jam-hero-caja { display: flex; justify-content: center; margin-top: 0.6rem; }
.jam-hero {
  width: clamp(96px, 16vh, 150px);
  border-radius: 16px;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: var(--sombra);
}

.bienvenida-titulo { text-align: center; margin-top: 0.8rem; }
.bienvenida-titulo h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); color: #ffffff; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); }
.bienvenida-titulo .lema { color: #ffffff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); font-size: 1.05rem; }

.bocadillo {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  box-shadow: var(--sombra-suave);
  margin: 0.9rem auto;
  max-width: 40rem;
}
.bocadillo .jam-cara {
  flex: 0 0 auto;
  width: 3rem; height: 3rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--borde);
  background: #fff;
}
.bocadillo .voz { font-size: 1.08rem; }
.bocadillo b { color: var(--primario-osc); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0.7rem 0 0.5rem; }
.filtros { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; margin: 0.4rem auto 0.9rem; }
.filtro-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 3.2rem; padding: 0.6rem 1.2rem;
  font-family: inherit; font-size: 1.08rem; font-weight: 700;
  color: var(--primario); background: var(--papel);
  border: 2px solid var(--borde-fuerte); border-radius: 999px;
  cursor: pointer; box-shadow: var(--sombra-suave);
  transition: transform 0.08s ease, background 0.15s ease;
}
.filtro-btn:hover { background: var(--primario-claro); }
.filtro-btn:active { transform: scale(0.98); }
.filtro-btn.activo { background: var(--primario); color: #fff; border-color: var(--primario-osc); }
.app[data-filtro="ordenador"] .categoria[data-categoria="movil"] { display: none; }
.app[data-filtro="movil"] .categoria[data-categoria="ordenador"] { display: none; }
.chip {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.92rem;
  color: #1f2937;
  font-weight: 600;
}

/* ---------- Menú de categorías y fichas ---------- */

.categoria { margin-top: 1.6rem; }
.categoria-cab { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.categoria-cab .cat-emoji { font-size: 1.8rem; }
.categoria-cab h2 { margin: 0; color: #ffffff; text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.9); }
.categoria-cab .cat-linea { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.7); }

.rejilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.8rem;
}

.tarjeta-ejercicio {
  position: relative;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  text-align: left;
  background: var(--papel);
  border: 2px solid var(--borde);
  border-left: 8px solid var(--acento, var(--primario));
  border-radius: 16px;
  box-shadow: var(--sombra-suave);
  padding: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--texto);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.tarjeta-ejercicio:hover { transform: translateY(-3px); box-shadow: var(--sombra); }
.tarjeta-ejercicio:active { transform: scale(0.99); }
.te-icono { font-size: 2.1rem; line-height: 1; }
.te-cuerpo b { display: block; font-size: 1.08rem; }
.te-cuerpo span { color: var(--suave); font-size: 0.92rem; }
.te-hecho-icon {
  margin-left: auto;
  align-self: flex-start;
  background: #22c55e;
  color: #ffffff;
  border-radius: 3px;
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1px solid #16a34a;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

/* ---------- Vista de ejercicio ---------- */

.barra-sup { color: #ffffff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); }
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}
.titulo-ejercicio { display: flex; align-items: center; gap: 0.6rem; flex: 1; justify-content: center; text-align: center; }
.titulo-ejercicio .te-icono { font-size: 1.9rem; }
.titulo-ejercicio h1 { font-size: 1.35rem; margin: 0; color: #ffffff; text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.9); }

.instruccion {
  background: rgba(255, 255, 255, 0.97);
  border: 2px solid var(--borde);
  border-radius: 16px;
  padding: 0.8rem 1rem;
  box-shadow: var(--sombra-suave);
  margin: 0.5rem auto 0.8rem;
  max-width: 40rem;
  color: var(--texto);
}
.instruccion .fila { display: flex; gap: 0.8rem; align-items: flex-start; }
.instruccion .texto { font-size: 1.12rem; }
.instruccion .texto b { color: var(--primario-osc); }
.acciones-instruccion { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }

.pista-caja {
  background: var(--ambar-claro);
  border: 2px solid var(--ambar);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  margin-top: 0.6rem;
  font-size: 1rem;
}

.progreso-caja { display: flex; align-items: center; gap: 0.7rem; margin: 0.4rem 0 0.8rem; }
.progreso-barra { flex: 1; height: 14px; background: var(--borde); border-radius: 999px; overflow: hidden; }
.progreso-barra > span { display: block; height: 100%; width: 0%; background: var(--verde); border-radius: 999px; transition: width 0.35s ease; }
.progreso-texto { font-weight: 700; color: #ffffff; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); font-size: 0.95rem; white-space: nowrap; }

.zona {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff 0%, #f2f7fe 100%);
  border: 2px solid var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  min-height: 340px;
  overflow: hidden;
}
.zona .ayuda-zona {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--suave);
  font-size: 1.05rem;
  pointer-events: none;
  padding: 1rem;
  text-align: center;
}

/* --- Juego: mover el ratón --- */
.blanco-mover {
  position: absolute;
  width: 74px; height: 74px;
  border-radius: 50%;
  border: 3px dashed var(--primario);
  background: #fff;
  color: var(--primario);
  font-size: 1.3rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  user-select: none;
}
.blanco-mover.hecho {
  background: var(--verde-claro);
  border-color: var(--verde);
  border-style: solid;
  color: var(--verde);
  transform: scale(0.92);
}
.blanco-mover.hecho::after { content: "✓"; }

/* --- Juego: clic --- */
.objetivo-clic {
  position: absolute;
  min-width: 110px;
  min-height: 62px;
  padding: 0.5rem 1rem;
  border-radius: 14px;
  border: 3px solid var(--primario-osc);
  background: var(--primario);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--sombra);
  transition: transform 0.1s ease;
}
.objetivo-clic:active { transform: scale(0.96); }

/* --- Juego: doble clic (escritorio) --- */
.escritorio-juego {
  position: relative;
  height: 100%;
  min-height: 340px;
  background: linear-gradient(160deg, #3a7bd5 0%, #2b5fa8 100%);
  padding: 1rem;
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
}
.icono-escritorio {
  width: 96px;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  padding: 0.6rem 0.3rem;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
}
.icono-escritorio span { font-size: 2rem; }
.icono-escritorio small { font-size: 0.82rem; }
.icono-escritorio:hover { background: rgba(255, 255, 255, 0.26); }
.icono-escritorio.hecho { border-color: #7ee2a8; background: rgba(126, 226, 168, 0.28); }
.ventana-juego {
  position: absolute;
  right: 1rem; top: 1rem;
  width: min(320px, 80%);
  background: var(--papel);
  border: 2px solid var(--primario-osc);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  overflow: hidden;
}
.ventana-juego .vt-barra { background: var(--primario-osc); color: #fff; padding: 0.4rem 0.7rem; font-size: 0.92rem; font-weight: 600; }
.ventana-juego .vt-cuerpo { padding: 1rem; text-align: center; font-size: 1.05rem; }

/* --- Juego: arrastrar --- */
.piezas-area { position: relative; height: 100%; min-height: 340px; padding: 1rem; }
.pieza {
  position: absolute;
  width: 88px; height: 88px;
  border-radius: 16px;
  border: 3px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  cursor: grab;
  touch-action: none;
  user-select: none;
  background: #fff;
  box-shadow: var(--sombra-suave);
}
.pieza.arrastrando { cursor: grabbing; box-shadow: 0 14px 30px rgba(0,0,0,0.25); }
.cesta {
  position: absolute;
  right: 1.2rem; bottom: 1.2rem;
  width: 190px; height: 150px;
  border: 3px dashed var(--primario);
  border-radius: 18px;
  background: var(--primario-claro);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  color: var(--primario-osc);
  font-weight: 700;
  padding: 0.4rem;
}
.cesta.sobre { background: var(--verde-claro); border-color: var(--verde); }

/* --- Juego: teclado --- */
.teclado-virtual { display: grid; gap: 0.35rem; justify-content: center; margin: 0.5rem auto; }
.teclado-virtual .fila { display: flex; gap: 0.3rem; justify-content: center; flex-wrap: wrap; }
.tk {
  min-width: 2.3rem; height: 2.3rem;
  padding: 0 0.4rem;
  border-radius: 8px;
  border: 2px solid var(--borde-fuerte);
  border-bottom-width: 4px;
  background: var(--papel);
  color: var(--texto);
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.tk.destacada { background: var(--ambar-claro); border-color: var(--ambar); color: #7a4d00; }
.tk.pulsada { background: var(--verde); border-color: var(--verde); color: #fff; }

/* --- Pista visual de combinaciones de teclas --- */
.combo-ayuda { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; margin: 0.8rem auto 0.2rem; }
.combo { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; opacity: 0.5; transition: opacity 0.2s ease; }
.combo.activo { opacity: 1; }
.combo-eti { font-size: 0.9rem; font-weight: 700; color: var(--suave); }
.combo.activo .combo-eti { color: var(--primario-osc); }
.combo-fila { display: inline-flex; align-items: center; gap: 0.35rem; }
.combo-tecla {
  min-width: 2.6rem; padding: 0.35rem 0.6rem;
  border-radius: 8px; border: 2px solid var(--borde-fuerte); border-bottom-width: 4px;
  background: var(--papel); color: var(--texto);
  font-weight: 700; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.combo.activo .combo-tecla { background: var(--ambar-claro); border-color: var(--ambar); color: #7a4d00; box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.28); }
.combo-mas { font-weight: 700; color: var(--suave); }
.tk.tk-ancha { min-width: 7rem; }
.pista-teclado { margin: 0.4rem auto 0.6rem; opacity: 0.92; }

.tecla-objetivo {
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; font-weight: 800;
  color: var(--primario-osc);
  background: var(--papel);
  border: 3px solid var(--primario);
  border-radius: 18px;
  width: 140px; height: 140px;
  margin: 0 auto 0.6rem;
}

.campo-texto {
  width: min(560px, 100%);
  font-size: 1.5rem;
  font-family: inherit;
  letter-spacing: 0.04em;
  padding: 0.7rem 0.9rem;
  border: 3px solid var(--primario);
  border-radius: 14px;
  background: #fff;
  color: var(--texto);
  text-align: center;
}
.palabra-objetivo {
  font-size: 2rem; font-weight: 800; letter-spacing: 0.06em;
  color: var(--primario-osc);
  text-align: center; margin-bottom: 0.5rem;
}

/* --- Ordenador encendiendo / teléfono --- */
.torre {
  position: relative;
  width: min(420px, 92%);
  margin: 1rem auto;
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
}
.monitor {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0b1622;
  border: 6px solid #1f2b3a;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #cfe3ff;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
  transition: background 0.4s ease;
}
.monitor.encendido { background: linear-gradient(160deg, #3a7bd5, #2b5fa8); color: #fff; }
.monitor .login-nombre {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 1.1rem;
}
.monitor .login-nombre:hover { background: rgba(255,255,255,0.3); }
.monitor .esc-juego { display: flex; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }
.monitor .esc-app {
  background: rgba(255,255,255,0.16);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 12px;
  padding: 0.6rem;
  min-width: 84px;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.monitor .esc-app:hover { background: rgba(255,255,255,0.3); }
.torre-caja {
  display: flex; align-items: center; gap: 0.8rem;
  background: #2b3646; color: #dbe6f5;
  border-radius: 12px; padding: 0.8rem 1rem;
}
.boton-energia {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid #8fa5c2; background: #3b4a5f; color: #fff;
  font-size: 1.5rem; cursor: pointer;
}
.boton-energia:hover { background: #4c5f79; }
.boton-energia.listo { border-color: #7ee2a8; box-shadow: 0 0 0 6px rgba(126,226,168,0.25); }

/* teléfono */
.movil {
  width: min(300px, 90%);
  margin: 0 auto;
  background: #16202e;
  border-radius: 30px;
  padding: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.3);
}
.movil-pantalla {
  background: linear-gradient(165deg, #8ec5ff 0%, #4a86e0 100%);
  border-radius: 20px;
  min-height: 380px;
  padding: 1rem;
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  gap: 0.6rem;
  overflow: hidden;
}
.movil-pantalla .pagina-iconos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; width: 100%; }
.movil .m-app {
  background: rgba(255,255,255,0.18);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 14px;
  padding: 0.6rem 0.2rem;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  font-size: 0.82rem;
}
.movil .m-app span { font-size: 1.7rem; }
.movil .m-app:hover { background: rgba(255,255,255,0.32); }
.llamada-caja { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.boton-llamada {
  width: 84px; height: 84px; border-radius: 50%;
  border: none; font-size: 2rem; cursor: pointer; color: #fff;
  box-shadow: var(--sombra);
}
.boton-llamada.contestar { background: var(--verde); }
.boton-llamada.colgar { background: var(--rojo); }
.boton-llamada:hover { filter: brightness(1.1); }

/* ---------- Recompensa ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 32, 52, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; z-index: 50;
}
.overlay[hidden] { display: none; }
.dialogo {
  background: var(--papel);
  border-radius: 22px;
  border: 3px solid var(--verde);
  max-width: 34rem; width: 100%;
  max-height: 92dvh; overflow-y: auto;
  padding: 1.4rem 1.3rem; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.dialogo .emoji { font-size: 3.4rem; animation: pop 0.5s ease; }
.dialogo h2 { color: var(--verde); }
.dialogo .jam-cara { width: 4rem; height: 4rem; border-radius: 50%; border: 3px solid var(--borde); background:#fff; }
.dialogo .fila-botones { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; margin-top: 0.8rem; }
@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }

/* ---------- Ajustes ---------- */
.panel-ajustes {
  background: var(--papel);
  border: 2px solid var(--borde);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--sombra-suave);
}
.ajuste-grupo { margin-bottom: 1rem; }
.ajuste-grupo h3 { margin-bottom: 0.4rem; }
.fila-ajustes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.op-ajuste {
  min-height: 2.8rem; padding: 0.5rem 1rem;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  background: var(--papel); color: var(--texto);
  border: 2px solid var(--borde-fuerte); border-radius: 12px; cursor: pointer;
}
.op-ajuste.activo { background: var(--primario); color: #fff; border-color: var(--primario-osc); }

/* --- Etiqueta de destreza en las fichas --- */
.te-etiqueta {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--suave);
  background: var(--papel-2);
  border: 1px solid var(--borde);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  margin-top: 0.25rem;
}

/* --- Desbloquear (deslizar hacia arriba) --- */
.deslizar-arriba {
  margin-top: 1.2rem;
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.3s ease, background 0.3s ease;
}
.deslizar-arriba.activo { transform: translateY(-10px); background: rgba(255, 255, 255, 0.32); }

/* --- Mensaje (teclado mini + burbuja) --- */
.teclado-mini { margin: 0.4rem 0; }
.teclado-mini .tk { min-width: 1.85rem; height: 1.9rem; font-size: 0.85rem; border-bottom-width: 3px; }
.chat-burbuja {
  min-height: 2.4rem;
  min-width: 8rem;
  max-width: 90%;
  align-self: flex-end;
  background: var(--verde);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 0.5rem 0.9rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0.4rem 0;
  word-break: break-word;
}
.btn-enviar { margin-top: 0.4rem; font-size: 0.98rem; padding: 0.4rem 1rem; min-height: 2.4rem; }

/* --- Cámara --- */
.camara-vista {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: linear-gradient(160deg, #bfe3ff, #8ec5ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.6rem;
  margin: 0.4rem 0;
  transition: filter 0.2s ease;
}
.camara-vista.flash { animation: fogonazo 0.5s ease; }
@keyframes fogonazo { 0% { filter: brightness(6); } 100% { filter: brightness(1); } }
.disparador {
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25);
}
.disparador:hover { background: #eef3fa; }
.miniatura {
  width: 76px; height: 76px;
  border-radius: 12px;
  border: 3px solid #fff;
  background: #cfe3ff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* --- Volumen / tamaño de letra --- */
.volumen-barra {
  width: 100%; height: 18px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.6rem 0 0.2rem;
}
.volumen-barra > span { display: block; height: 100%; width: 40%; background: #fff; border-radius: 999px; transition: width 0.15s ease; }
.volume-bar { background: var(--papel); height: 12px; border-radius: 999px; border: 2px solid var(--borde-fuerte); overflow: hidden; margin: 0.8rem auto; max-width: 320px; }
.volume-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--verde), #68d391); transition: width 0.2s ease; }

.barra-sonido {
  position: relative;
  width: min(380px, 90%);
  height: 44px;
  display: flex;
  align-items: center;
  margin: 0.8rem auto;
}
.bs-altavoz {
  position: absolute;
  left: -2rem;
  font-size: 1.4rem;
}
.barra-sonido .bs-fondo {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.barra-sonido .bs-relleno {
  position: absolute;
  left: 0;
  height: 12px;
  width: 0%;
  background: #fff;
  border-radius: 999px;
  transition: width 0.2s ease;
}
.barra-sonido .bs-asider {
  position: absolute;
  left: -14px;
  width: 28px;
  height: 28px;
  background: #fff;
  border: 2px solid rgba(30, 58, 138, 0.45);
  border-radius: 50%;
  box-shadow: var(--sombra-suave);
  transition: left 0.2s ease;
}
.volumen-botones { display: flex; gap: 1rem; margin-top: 0.6rem; }
.volumen-btn {
  width: 62px; height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}
.volumen-btn:hover { background: rgba(255, 255, 255, 0.34); }
.volumen-btn.grande { width: 74px; height: 74px; font-size: 1.5rem; }
.letra-preview {
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.92);
  color: #16202e;
  border-radius: 12px;
  padding: 1rem;
  width: 100%;
  min-height: 4.5rem;
  display: flex; align-items: center; justify-content: center;
  transition: font-size 0.2s ease;
}

/* --- Listas de ajustes del teléfono --- */
.lista-ajustes { width: 100%; display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.3rem; }
.fila-ajuste {
  display: flex; align-items: center; gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.fila-ajuste:hover { background: rgba(255, 255, 255, 0.32); }
.fila-ajuste .ir { margin-left: auto; opacity: 0.8; }

/* ---------- Utilidades ---------- */
.oculto { display: none !important; }
.skiplink { position: absolute; left: -9999px; }
.skiplink:focus { left: 0.5rem; top: 0.5rem; z-index: 100; background: #fff; color: #000; padding: 0.5rem 1rem; border-radius: 8px; }

@media (max-width: 520px) {
  .app { padding: 0.7rem 0.7rem 2rem; }
  .blanco-mover { width: 60px; height: 60px; }
  .tecla-objetivo { width: 110px; height: 110px; font-size: 3rem; }
}

/* ============================================================
   Componentes de los motores reutilizables (tarjetas nuevas)
   ============================================================ */

/* --- Marco de ordenador (pantalla clara) --- */
.sim-pc {
  width: min(560px, 94%);
  margin: 0 auto;
  background: #0b1622;
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--sombra);
}
.sim-barra {
  background: #1f2b3a;
  color: #cfe3ff;
  border-radius: 10px 10px 0 0;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.sim-cuerpo {
  background: linear-gradient(160deg, #3a7bd5 0%, #2b5fa8 100%);
  color: #fff;
  border-radius: 0 0 12px 12px;
  padding: 1rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.8rem;
  text-align: center;
}
.sim-texto { font-size: 1.12rem; margin: 0.2rem 0; }
.sim-texto b { text-decoration: underline; }
.sim-cuerpo .sim-texto b, .movil-pantalla .sim-texto b { color: #fff; }
.sim-opciones { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; }
.sim-opcion {
  min-height: 3rem;
  padding: 0.6rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.sim-opcion:hover { background: rgba(255, 255, 255, 0.32); }
.sim-opcion-verde { background: #1e9e4c; border-color: #146c34; }
.sim-opcion-verde:hover { background: #178540; }
.sim-opcion-rojo { background: #c8362f; border-color: #8f241e; }
.sim-opcion-rojo:hover { background: #a92c26; }
.sim-grafico { margin: 0.3rem 0; font-size: 1.6rem; }
.wifi-clave { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; align-items: center; margin-top: 0.6rem; }
.wifi-clave-campo {
  font-family: inherit;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 0.7rem 1rem;
  min-width: 12rem;
  color: #1f2937;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}
.wifi-clave-campo:focus { outline: none; border-color: #ffd76a; box-shadow: 0 0 0 3px rgba(255, 215, 106, 0.5); }
.wifi-clave + .sim-nota { margin-top: 0.4rem; }
.sim-nota {
  background: var(--ambar-claro);
  color: #7a4d00;
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
}
.sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; width: 100%; }
.sim-app {
  background: rgba(255, 255, 255, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  padding: 0.7rem 0.3rem;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  font-size: 0.85rem;
}
.sim-app span { font-size: 1.8rem; }
.sim-app:hover { background: rgba(255, 255, 255, 0.3); }

/* --- Teclado numérico del teléfono --- */
.num-visor {
  width: 100%;
  min-height: 2.6rem;
  background: rgba(255, 255, 255, 0.92);
  color: #16202e;
  border-radius: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.6rem;
  text-align: right;
  word-break: break-all;
}
.num-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; width: 100%; margin: 0.4rem 0; }
.num-tecla {
  height: 3rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.num-tecla:hover { background: rgba(255, 255, 255, 0.32); }
.num-borrar { background: rgba(197, 48, 48, 0.85); }

/* --- Calculadora --- */
.calc-visor {
  width: 100%;
  min-height: 2.6rem;
  background: rgba(255, 255, 255, 0.92);
  color: #16202e;
  border-radius: 10px;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0.4rem 0.7rem;
  text-align: right;
}
.calc-resultado {
  width: 100%;
  margin: 0.3rem 0 0;
  padding: 0.5rem 0.7rem;
  text-align: center;
  font-size: 1.15rem;
  color: #fff;
  background: rgba(34, 139, 72, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 10px;
}
.calc-resultado b { color: #d6ffe4; }
.calc-teclas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.45rem; width: 100%; margin-top: 0.4rem; }
.calc-tecla {
  height: 3rem;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}
.calc-tecla:hover { background: rgba(255, 255, 255, 0.32); }
.calc-tecla.igual { background: var(--verde); border-color: #216343; }
.nota-encargo { color: #fff; font-size: 1.1rem; margin: 0.1rem 0 0.5rem; }
.nota-encargo b { color: #ffe9a8; text-decoration: underline; }
.nota-app {
  width: 100%;
  background: #fffdf3;
  color: #2a2a2a;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
  text-align: left;
}
.nota-barra {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  background: #ffd76a;
  color: #5a4300;
  padding: 0.5rem 0.85rem;
  font-weight: 700;
}
.nota-icono { font-weight: 800; opacity: 0.75; }
.nota-hoja { padding: 0.9rem 1rem 1.3rem; }
.nota-titulo { font-weight: 800; font-size: 1.15rem; color: #5a4300; border-bottom: 2px solid #eadfaf; padding-bottom: 0.4rem; margin-bottom: 0.6rem; }
.nota-campo {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: #2a2a2a;
  padding: 0.2rem 0;
}
.nota-campo::placeholder { color: #bdb49c; }
.timer-app { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.timer-cara { position: relative; width: 11rem; height: 11rem; display: flex; align-items: center; justify-content: center; }
.timer-aro { position: absolute; inset: 0; border-radius: 50%; border: 6px solid rgba(255,255,255,0.45); border-top-color: #ffd76a; transform: rotate(-35deg); }
.timer-tiempo { font-size: 2.1rem; font-weight: 800; letter-spacing: 0.05em; }
.timer-selector { display: flex; align-items: center; gap: 0.5rem; }
.timer-campo {
  width: 5.5rem; text-align: center; font-family: inherit;
  font-size: 1.5rem; font-weight: 800; color: #16202e;
  background: #fff; border: 2px solid rgba(255,255,255,0.75); border-radius: 12px; padding: 0.5rem;
}
.timer-campo:focus { outline: none; border-color: #ffd76a; box-shadow: 0 0 0 3px rgba(255,215,106,0.5); }
.timer-unidad { font-weight: 700; }
.movil.movil-h { width: min(560px, 96%); }
.movil.movil-h .movil-pantalla { min-height: 180px; }
.video-paisaje {
  width: 100%; min-height: 96px; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.3); border-radius: 12px;
}

/* --- Rueda del ratón (texto desplazable) --- */
.lienzo-rueda {
  width: min(560px, 100%);
  height: 260px;
  overflow-y: auto;
  background: var(--papel);
  color: var(--texto);
  border: 3px solid var(--borde-fuerte);
  border-radius: 14px;
  padding: 1rem;
  text-align: left;
  margin: 0.6rem auto 0;
}
.lienzo-rueda-inner p { margin: 0 0 0.9rem; }
.lienzo-rueda .aviso-fin { text-align: center; font-weight: 800; color: var(--verde); }

/* --- Flechas del teclado --- */
.cuadricula-flechas { display: grid; gap: 0.4rem; width: min(420px, 100%); margin: 0.6rem auto 0; }
.casilla {
  aspect-ratio: 1 / 1;
  background: var(--papel);
  border: 2px solid var(--borde);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.casilla.jam-aqui { background: var(--primario-claro); border-color: var(--primario); }

/* --- Clic derecho (menú contextual) --- */
.contexto-panel { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; margin-top: 0.8rem; }
.contexto-item {
  position: relative;
  width: 120px;
  padding: 0.8rem 0.4rem;
  border-radius: 14px;
  border: 2px solid var(--borde-fuerte);
  background: var(--papel);
  color: var(--texto);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
}
.contexto-item span { font-size: 2.2rem; }
.contexto-item:hover { background: var(--primario-claro); }
.contexto-menu {
  position: absolute;
  top: 100%; left: 0;
  z-index: 5;
  background: var(--papel);
  border: 2px solid var(--borde-fuerte);
  border-radius: 10px;
  box-shadow: var(--sombra);
  overflow: hidden;
  min-width: 150px;
  text-align: left;
}
.contexto-opcion { padding: 0.5rem 0.8rem; font-size: 0.95rem; color: var(--texto); }
.contexto-opcion:hover { background: var(--primario-claro); }

/* --- Aviso/Diálogo simulado (tecla Intro) --- */
.dialogo-sim {
  background: var(--papel);
  border: 3px solid var(--primario);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  box-shadow: var(--sombra);
  max-width: 26rem;
  margin-top: 0.6rem;
}

/* --- Copiar y pegar --- */
.copiar-caja {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--primario);
  border-radius: 12px;
  padding: 0.6rem 1.2rem;
  margin-top: 0.6rem;
}
.pegar-caja {
  min-width: 12rem;
  min-height: 3rem;
  border: 3px dashed var(--borde-fuerte);
  border-radius: 12px;
  padding: 0.6rem 1rem;
  color: var(--suave);
  margin: 0.6rem auto 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.pegar-caja.lleno {
  border-style: solid;
  border-color: var(--verde);
  color: var(--texto);
  font-weight: 800;
  background: var(--verde-claro);
}

/* --- Ventana movible --- */
.ventana-juego.suelta { position: absolute; right: auto; top: 6%; left: 6%; }
.vt-barra.asible { cursor: grab; touch-action: none; }
.vt-barra.asible:active { cursor: grabbing; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
