/* Dizque Monstruos en el celular: la misma noche de la app del computador */
:root {
  --noche: #15112a; --noche-2: #1e1938; --noche-3: #2b2452;
  --tinta: #f1ecff; --tinta-2: #b4abd8; --luna: #ffd27a; --musgo: #c3dd4f; --brasa: #ff8a4c; --hielo: #8fdcec;
  --linea: rgba(241, 236, 255, .12);
  --f-texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "DynaPuff", "Trebuchet MS", system-ui, sans-serif;
  --f-dato: "Azeret Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--noche); color: var(--tinta); font: 16px/1.45 var(--f-texto); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--luna); }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--f-display); font-weight: 600; margin: 0; }
h2 { font-size: 22px; }

/* entrar */
.entrar { min-height: 100dvh; display: grid; align-content: center; gap: 14px; padding: max(24px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); text-align: center; max-width: 460px; margin: 0 auto; }
.entrar-img { width: 170px; height: 170px; object-fit: contain; justify-self: center; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .5)); }
.entrar h1 { font-size: 26px; }
.entrar p { margin: 0; color: var(--tinta-2); }
.instalar-cel { display: grid; gap: 10px; justify-items: center; padding: 12px 14px; border: 1px dashed var(--linea); border-radius: 14px; }
.instalar-cel[hidden] { display: none; }
#codigo { text-transform: uppercase; letter-spacing: .08em; font: 500 18px/1 var(--f-dato); text-align: center; }
.aviso { color: var(--luna) !important; }

/* piezas comunes */
.fila { display: flex; gap: 8px; align-items: stretch; }
.fila > input, .fila > select { flex: 1; min-width: 0; }
input, select, textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--linea); background: var(--noche-2); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--luna); }
.boton { border: 1px solid var(--linea); border-radius: 14px; padding: 12px 16px; background: var(--noche-3); font-weight: 600; cursor: pointer; white-space: nowrap; }
.boton.principal { background: var(--luna); color: var(--noche); border-color: transparent; }
.enlace { border: 0; background: none; color: var(--luna); padding: 6px 0; text-decoration: underline; cursor: pointer; justify-self: start; text-align: left; }
.enlace.peligro { color: var(--brasa); }
.nota { color: var(--tinta-2); font-size: 14px; margin: 0; }
.subtitulo { margin: 8px 0 0; font: 600 12px/1 var(--f-dato); letter-spacing: .14em; text-transform: uppercase; color: var(--luna); }
.tarjeta { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--noche-2); border: 1px solid var(--linea); }
.tarjeta summary { font-weight: 600; cursor: pointer; }
.formulario .fila > * { flex: 1; }
.foto { display: inline-flex; justify-content: center; align-items: center; }
.nota:empty { display: none; }

/* la app */
.app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: env(safe-area-inset-top); }
.cabeza { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--linea); background: var(--noche-2); position: sticky; top: 0; z-index: 3; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: var(--noche-3); }
.cabeza b { display: block; font-family: var(--f-display); font-weight: 600; }
.cabeza small { color: var(--tinta-2); font-size: 12px; }
.hoja { display: grid; gap: 12px; align-content: start; padding: 14px 16px 24px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
#hoja-hablar { grid-template-rows: auto minmax(0, 1fr) auto auto; align-content: stretch; overflow: hidden; padding-bottom: 10px; }

.escena { position: relative; display: grid; justify-items: center; padding-top: 6px; }
.criatura { height: min(30dvh, 260px); max-width: 80%; object-fit: contain; transform-origin: 50% 100%; animation: respirar 3.6s ease-in-out infinite; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .55)); }
.criatura.hablando { animation: hablar .32s ease-in-out infinite alternate; }
@keyframes respirar { 50% { transform: scale(1.02, .985); } }
@keyframes hablar { from { transform: scale(1, 1); } to { transform: scale(1.035, .97); } }
.criatura.bailando { animation: bailar .5s ease-in-out infinite alternate; }
@keyframes bailar { from { transform: rotate(-7deg) translateY(0); } to { transform: rotate(7deg) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .criatura, .criatura.hablando, .criatura.bailando { animation-duration: 1.6s; } }
.globo { position: fixed; z-index: 6; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 66px); margin: 0 auto; max-width: 440px; padding: 12px 40px 12px 14px; border-radius: 16px; background: var(--tinta); color: var(--noche); font-size: 15px; box-shadow: 0 16px 32px -12px rgba(0, 0, 0, .7); animation: entrar-globo .25s ease-out; }
@keyframes entrar-globo { from { opacity: 0; transform: translateY(-8px); } }
.globo small { display: block; opacity: .75; margin-top: 4px; font-size: 13.5px; }
.globo .acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.globo .acciones button { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--noche); color: var(--tinta); font-weight: 600; font-size: 14px; }
.cerrar-globo { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border: 0; background: none; color: var(--noche); font-size: 22px; opacity: .6; }

.chat { list-style: none; margin: 0; padding: 0 2px; display: grid; gap: 8px; align-content: start; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.chat li.aviso-chat { justify-self: center; max-width: 92%; background: none; border: 1px dashed var(--linea); color: var(--tinta-2); font-size: 13.5px; text-align: center; }
.chat li { max-width: 86%; padding: 10px 13px; border-radius: 16px; background: var(--noche-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.chat li.yo { justify-self: end; background: var(--noche-3); }
.chat li small { display: block; color: var(--tinta-2); margin-top: 4px; }
.chat li .escrito { margin-top: 8px; padding: 10px; border-radius: 12px; background: var(--noche); font-size: 14px; max-height: 260px; overflow: auto; }
.chat li .acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat li .acciones a, .chat li .acciones button { border: 1px solid var(--linea); border-radius: 999px; padding: 6px 12px; background: var(--noche-3); color: var(--tinta); text-decoration: none; font-size: 14px; }
.chat li.pensando span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--tinta-2); animation: punto 1s infinite; }
.chat li.pensando span:nth-child(2) { animation-delay: .15s; } .chat li.pensando span:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 50% { opacity: .2; } }
.atajos { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.atajos button { flex: none; border: 1px solid var(--linea); border-radius: 999px; padding: 7px 12px; background: var(--noche-2); font-size: 14px; }
.escribir { display: grid; grid-template-columns: auto auto 1fr auto; gap: 8px; }
.microfono.foto { display: grid; place-items: center; cursor: pointer; }
.microfono.con-archivo { background: var(--luna); }
.microfono, .enviar { width: 48px; border-radius: 14px; border: 1px solid var(--linea); background: var(--noche-3); font-size: 20px; }
.microfono.escuchando { background: var(--brasa); animation: latir 1s infinite; }
@keyframes latir { 50% { transform: scale(1.06); } }

.lista { display: grid; gap: 6px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--noche-2); }
.item .cuando { font: 500 11.5px/1.3 var(--f-dato); color: var(--tinta-2); width: 6.9em; white-space: nowrap; }
.item small { display: block; color: var(--tinta-2); font-size: 12.5px; }
.item.hecho label { text-decoration: line-through; opacity: .6; }
.item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--musgo); }
.quitar { border: 0; background: none; color: var(--tinta-2); font-size: 22px; line-height: 1; padding: 2px 6px; }
.vacio { color: var(--tinta-2); font-size: 14px; margin: 0; }

.ideal { background: linear-gradient(160deg, rgba(255, 210, 122, .14), rgba(195, 221, 79, .08)); border-color: rgba(255, 210, 122, .35); }
.ideal h3 { margin: 0; font: 600 18px/1.2 var(--f-display); color: var(--luna); }
.ideal label { display: grid; grid-template-columns: auto 4.8em 1fr; gap: 8px; align-items: start; }
.ideal label .cuando { font: 500 12px/1.6 var(--f-dato); color: var(--tinta-2); }
.ideal label b { display: block; font-size: 15px; }
.ideal label small { color: var(--tinta-2); font-size: 13px; }

.total { display: flex; justify-content: space-between; align-items: baseline; }
.total b { font: 600 26px/1 var(--f-display); color: var(--luna); }
.riel { height: 9px; border-radius: 999px; background: var(--noche); overflow: hidden; }
.riel i { display: block; height: 100%; background: var(--musgo); }
.riel.alto i { background: var(--brasa); }
.cat { display: grid; grid-template-columns: 6.5em 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; color: var(--tinta-2); }
.cat .barra { height: 7px; border-radius: 999px; background: var(--noche); overflow: hidden; }
.cat .barra i { display: block; height: 100%; background: var(--hielo); }
.cat span:last-child { font: 500 12.5px/1 var(--f-dato); color: var(--tinta); }

.pandilla { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pandilla button { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--linea); background: var(--noche-2); font-size: 12.5px; }
.pandilla button[aria-pressed="true"] { border-color: var(--luna); background: var(--noche-3); }
.pandilla img { width: 54px; height: 64px; object-fit: contain; }
.ajuste { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ajuste small { display: block; color: var(--tinta-2); font-size: 13px; }
.interruptor { flex: none; width: 48px; height: 28px; border-radius: 999px; border: 0; background: var(--noche-3); position: relative; }
.interruptor::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--tinta-2); transition: left .2s; }
.interruptor[aria-checked="true"] { background: var(--musgo); }
.interruptor[aria-checked="true"]::after { left: 23px; background: var(--noche); }
.horas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.horas label { display: grid; gap: 4px; font-size: 13px; color: var(--tinta-2); }

.pestanas { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--linea); background: var(--noche-2); padding-bottom: env(safe-area-inset-bottom); position: sticky; bottom: 0; z-index: 3; }
.pestanas button { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 9px; border: 0; background: none; color: var(--tinta-2); font-size: 11.5px; font-weight: 600; }
.pestanas button span { font-size: 19px; line-height: 1.1; }
.pestanas button[aria-current="page"] { color: var(--luna); }
.pestanas button { position: relative; }
.pestanas button.nuevo::after { content: ""; position: absolute; top: 7px; left: calc(50% + 10px); width: 9px; height: 9px; border-radius: 50%; background: var(--brasa); }
.mensaje { display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--noche-2); }
.mensaje small { color: var(--tinta-2); font-size: 12.5px; }
.mensaje p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.foto-buzon img { display: block; width: 100%; border-radius: 12px; }
.foto-buzon small { display: block; margin-top: 4px; }
.ideal input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--musgo); }
.ideal .fila > * { flex: 1; }
.item label { min-width: 0; overflow-wrap: anywhere; }
#info-licencia b { font-family: var(--f-dato); font-weight: 500; }
