:root {
  --noche: #121a38;
  --noche-2: #1c2752;
  --panel: #222f60;
  --texto: #eef1ff;
  --suave: #aab4dd;
  --luz: #ffd66b;
  --menta: #8fe3b0;
  --azul: #9ec5fe;
  --tinta: #1b2340;
  --radio: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--noche); color: var(--texto);
  font: 17px/1.45 "Atkinson Hyperlegible", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--luz); outline-offset: 2px; }
h1, h2, h3, .marca { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; line-height: 1.1; }
#app { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; }

.barra { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: max(12px, env(safe-area-inset-top)) 0 10px; }
.marca { background: none; border: 0; padding: 0; font-size: 26px; color: var(--luz); }
.pasos { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.pasos li { font-size: 14px; color: var(--suave); padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .05); }
.pasos li.on { background: var(--luz); color: var(--tinta); font-weight: 700; }
.pasos li.hecho { color: var(--texto); }
@media (max-width: 640px) { .pasos li:not(.on) { display: none; } }

.boton { border: 0; border-radius: 999px; padding: 13px 26px; font-weight: 700; font-size: 18px; background: var(--luz); color: var(--tinta);
  box-shadow: 0 4px 0 #b8922f; }
.boton:active { transform: translateY(3px); box-shadow: 0 1px 0 #b8922f; }
.boton:disabled { opacity: .35; cursor: default; }
.boton.sec { background: #2a3870; color: var(--texto); box-shadow: 0 4px 0 #141c40; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.fila.fin { justify-content: flex-end; }
.lead { color: var(--suave); font-size: 19px; max-width: 40em; margin: 4px 0 12px; }
h2 { font-size: 30px; margin: 6px 0 4px; }

/* inicio */
.portada { position: relative; border-radius: 22px; overflow: hidden; margin-top: 6px; }
.portada img { width: 100%; height: auto; display: block; }
.portada .texto { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 24px 22px; background: linear-gradient(180deg, transparent, rgba(10, 14, 36, .92) 40%); }
.portada h1 { font-size: clamp(40px, 7vw, 72px); margin: 0; color: var(--luz); }
@media (max-width: 640px) { .portada .texto { position: static; background: var(--noche-2); } }

/* familia */
.familia { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .familia { grid-template-columns: 1fr; } }
.lista { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; background: var(--noche-2); border-radius: var(--radio); padding: 14px; min-height: 180px; }
.ficha { width: 92px; border: 3px solid transparent; border-radius: 16px; background: var(--panel); padding: 6px 4px 6px; display: grid; justify-items: center; gap: 2px; font-size: 14px; }
.ficha svg { width: 64px; height: 96px; }
.ficha.on { border-color: var(--luz); }
.ficha .nombre { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agregar { width: 92px; min-height: 130px; border: 2px dashed #4a5ba0; border-radius: 16px; background: none; color: var(--suave); font-size: 14px; display: grid; place-items: center; text-align: center; padding: 6px; }
.agregar b { display: block; font-size: 28px; color: var(--luz); line-height: 1; }
.editor { background: var(--noche-2); border-radius: var(--radio); padding: 16px; display: grid; grid-template-columns: 170px 1fr; gap: 16px; }
@media (max-width: 520px) { .editor { grid-template-columns: 1fr; } .editor .vista-grande { justify-self: center; } }
.vista-grande { background: radial-gradient(circle at 50% 70%, #3a4a8a, #222f60 70%); border-radius: 16px; display: grid; place-items: end center; height: 280px; padding-bottom: 10px; }
.vista-grande svg { width: 150px; height: 260px; }
.campo { margin-bottom: 12px; }
.campo > span { display: block; font-size: 14px; color: var(--suave); margin-bottom: 5px; font-weight: 700; }
.opciones { display: flex; flex-wrap: wrap; gap: 6px; }
.op { border: 2px solid #3a4a88; background: var(--panel); border-radius: 99px; padding: 5px 12px; font-size: 15px; }
.op[aria-pressed="true"] { background: var(--luz); color: var(--tinta); border-color: var(--luz); font-weight: 700; }
.color { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); padding: 0; }
.color[aria-pressed="true"] { border-color: var(--luz); transform: scale(1.12); }
.entrada { width: 100%; max-width: 260px; border-radius: 12px; border: 2px solid #3a4a88; background: #151d44; color: var(--texto); font: inherit; padding: 8px 12px; }
.borrar { background: none; border: 0; color: #f28b9b; font-size: 14px; text-decoration: underline; padding: 0; }

/* casa */
.escenario { position: relative; border-radius: 18px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: #0b1230;
  /* la casa cabe en la ventana junto con la bandeja de personas: se arrastra de una a la otra sin desplazar la página */
  width: min(100%, max(360px, calc((100svh - 340px) * 1.75))); margin: 0 auto; }
.escenario > img { width: 100%; height: auto; display: block; pointer-events: none; }
.lejos { position: absolute; right: 0; top: 0; bottom: 0; width: 12%; background: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px); border-left: 2px dashed rgba(255,255,255,.25);
  display: grid; place-items: start center; padding-top: 10px; font: 700 13px "Atkinson Hyperlegible", sans-serif; color: var(--suave); }
.persona { position: absolute; transform: translate(-50%, -100%); touch-action: none; cursor: grab; filter: drop-shadow(0 3px 2px rgba(0,0,0,.35)); }
.persona svg { display: block; width: 100%; height: 100%; }
.persona.sel { filter: drop-shadow(0 0 6px var(--luz)) drop-shadow(0 0 2px var(--luz)); }
.persona .burbuja { position: absolute; left: 62%; top: -14%; width: 62%; aspect-ratio: 1; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.persona .burbuja svg { width: 100%; height: 100%; }
.persona .rotulo { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); white-space: nowrap; font: 700 12px "Atkinson Hyperlegible", sans-serif;
  background: rgba(10, 14, 36, .78); color: var(--texto); border-radius: 99px; padding: 1px 8px; margin-top: 2px; pointer-events: none; }
.bandeja { width: min(100%, max(360px, calc((100svh - 340px) * 1.75))); margin-inline: auto; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; background: var(--noche-2); border-radius: var(--radio); padding: 10px; min-height: 120px; align-items: flex-end; }
.bandeja .vacio { color: var(--suave); font-size: 15px; align-self: center; }
.bandeja .persona-b { width: 64px; height: 104px; touch-action: none; cursor: grab; display: grid; justify-items: center; font-size: 12px; }
.bandeja .persona-b svg { width: 56px; height: 86px; pointer-events: none; }
.fantasma { position: fixed; pointer-events: none; z-index: 50; transform: translate(-50%, -85%); opacity: .9; }
svg.lineas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* sentir */
.caras { width: min(100%, max(360px, calc((100svh - 340px) * 1.75))); margin-inline: auto; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
@media (max-width: 720px) { .caras { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cara { border: 3px solid transparent; border-radius: 14px; background: var(--panel); padding: 6px 2px 4px; display: grid; justify-items: center; font-size: 13px; }
.cara svg { width: 46px; height: 46px; }
.cara[aria-pressed="true"] { border-color: var(--luz); background: #2e3d7a; }
.cara:disabled { opacity: .4; }
.estado { min-height: 1.5em; color: var(--luz); font-weight: 700; margin-top: 8px; }

/* retrato */
.retrato-img { width: 100%; height: auto; border-radius: 16px; display: block; }
.resumen { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 16px; }
.resumen th, .resumen td { text-align: left; padding: 8px; border-bottom: 1px solid #2f3d73; vertical-align: top; }
.resumen th { color: var(--suave); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.nota { color: var(--suave); font-size: 14px; }

#aviso { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: rgba(10, 14, 36, .92); border: 1px solid #3a4a88;
  border-radius: 14px; padding: 10px 18px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; max-width: 90vw; text-align: center; z-index: 60; }
#aviso.ver { opacity: 1; transform: translate(-50%, 0); }

@media print {
  body { background: #fff; color: #000; }
  .barra, .fila, .no-imprimir, #aviso { display: none !important; }
  .resumen th, .resumen td { border-bottom: 1px solid #bbb; color: #000; }
}
