:root {
  --fondo: #0b0718; --fondo2: #140c2b; --tarjeta: rgba(255, 255, 255, .06); --borde: rgba(255, 255, 255, .1);
  --texto: #f5f1ff; --suave: #b9b0d6; --tenue: #7d73a3;
  --rosa: #ff2e93; --violeta: #8b2cff; --celeste: #1fd1f9; --lima: #a6ff4d; --ambar: #ffc53d; --rojo: #ff4d6d;
  --grad: linear-gradient(135deg, var(--rosa), var(--violeta) 55%, var(--celeste));
  --grad-boton: linear-gradient(135deg, #ff2e93, #a12cff);
  --radio: 20px; --sombra: 0 10px 40px rgba(0, 0, 0, .45);
  --arriba: env(safe-area-inset-top); --abajo: env(safe-area-inset-bottom);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--celeste); }

/* fondo con luces de neón */
.fondo { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #1a0d3a 0%, var(--fondo) 60%); }
.fondo i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); opacity: .28; animation: flotar 18s ease-in-out infinite alternate; }
.fondo i:nth-child(1) { background: var(--rosa); top: -25vmax; left: -20vmax; }
.fondo i:nth-child(2) { background: var(--violeta); bottom: -30vmax; right: -25vmax; animation-delay: -6s; }
.fondo i:nth-child(3) { background: var(--celeste); top: 40%; left: 50%; width: 35vmax; height: 35vmax; opacity: .14; animation-delay: -12s; }
@keyframes flotar { to { transform: translate(6vmax, 4vmax) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .fondo i, .pulso::before, .pulso::after { animation: none !important; } }

#app { height: 100%; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.pantalla { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: calc(var(--arriba) + 18px) 20px calc(var(--abajo) + 20px); overflow-y: auto; }
.centro { justify-content: center; }

/* marca */
.marca { display: flex; align-items: center; gap: 12px; }
.marca img { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 6px 24px rgba(139, 44, 255, .5); }
.marca b { font-size: 24px; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lema { font-size: 30px; line-height: 1.12; font-weight: 800; letter-spacing: -.03em; margin: 28px 0 10px; }
.lema span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--suave); margin: 0 0 22px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
h2 { font-size: 22px; }
.tenue { color: var(--tenue); font-size: 14px; }

/* radar animado */
.pulso { position: relative; width: 150px; height: 150px; margin: 30px auto; display: grid; place-items: center; }
.pulso::before, .pulso::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--celeste); opacity: 0; animation: onda 2.6s ease-out infinite; }
.pulso::after { animation-delay: 1.3s; border-color: var(--rosa); }
.pulso img { width: 96px; height: 96px; border-radius: 28px; box-shadow: 0 10px 40px rgba(255, 46, 147, .45); }
@keyframes onda { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }

/* tarjetas y formularios */
.tarjeta { background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.tarjeta + .tarjeta { margin-top: 14px; }
.reglas { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 9px; }
.reglas li { display: flex; gap: 10px; align-items: flex-start; color: var(--suave); font-size: 15px; }
.reglas li::before { content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #0b0718; background: var(--grad); margin-top: 1px; }
.check { display: flex; gap: 12px; align-items: center; padding: 12px 2px; font-weight: 600; }
.check input { width: 24px; height: 24px; accent-color: var(--rosa); flex: none; }
label.campo { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--suave); font-weight: 600; }
.entrada { width: 100%; background: rgba(255, 255, 255, .07); border: 1px solid var(--borde); border-radius: 14px; padding: 13px 15px; outline: none; transition: border-color .2s, box-shadow .2s; }
.entrada:focus { border-color: var(--violeta); box-shadow: 0 0 0 4px rgba(139, 44, 255, .25); }
.entrada::placeholder { color: var(--tenue); }
.codigo { font-size: 34px; letter-spacing: .5em; text-align: center; font-weight: 800; padding: 12px 0 12px .5em; }

.boton { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 16px; font-weight: 800; font-size: 17px;
  background: var(--grad-boton); color: white; box-shadow: 0 10px 30px rgba(255, 46, 147, .35); transition: transform .12s, opacity .2s, filter .2s; }
.boton:active { transform: scale(.98); }
.boton:disabled { opacity: .45; box-shadow: none; filter: grayscale(.4); }
.boton.sec { background: rgba(255, 255, 255, .08); box-shadow: none; border: 1px solid var(--borde); font-weight: 700; }
.boton.peligro { background: linear-gradient(135deg, #ff4d6d, #ff2e93); }
.boton.chico { width: auto; padding: 10px 14px; font-size: 15px; border-radius: 12px; }
.fila { display: flex; gap: 10px; }
.fila > * { flex: 1; }
.espacio { flex: 1; }
.error { color: #ffb3c1; background: rgba(255, 77, 109, .12); border: 1px solid rgba(255, 77, 109, .35); padding: 12px 14px; border-radius: 14px; margin: 12px 0; font-size: 15px; }

/* emojis */
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.emojis button { font-size: 28px; height: 52px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 2px solid transparent; transition: transform .1s; }
.emojis button.si { border-color: var(--rosa); background: rgba(255, 46, 147, .15); transform: scale(1.06); }

/* cabecera del local */
.cabeza { padding: calc(var(--arriba) + 12px) 18px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--borde);
  background: rgba(11, 7, 24, .65); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.cabeza .icono-local { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; background: var(--grad); flex: none; }
.cabeza h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cabeza .vivo { font-size: 13px; color: var(--lima); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.cabeza .vivo::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lima); box-shadow: 0 0 10px var(--lima); }
.cabeza .info { flex: 1; min-width: 0; }
.redondo { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .07); font-size: 20px; flex: none; }
.aviso-fuera { background: rgba(255, 197, 61, .14); color: var(--ambar); font-size: 14px; padding: 9px 18px; text-align: center; border-bottom: 1px solid rgba(255, 197, 61, .3); }

.cuerpo { flex: 1; overflow-y: auto; min-height: 0; padding: 16px 16px 8px; overscroll-behavior: contain; }

/* radar de presentes */
.presentes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.persona { text-align: left; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .12s, border-color .2s; position: relative; overflow: hidden; }
.persona:active { transform: scale(.97); }
.persona::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 120px; height: 120px; border-radius: 50%; background: var(--c, var(--violeta)); opacity: .18; filter: blur(30px); }
.persona .nom { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.persona .desc { color: var(--suave); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.4em; }
.persona.yo { border-color: rgba(166, 255, 77, .4); }
.avatar { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; flex: none;
  background: linear-gradient(135deg, hsl(var(--h, 300) 90% 60%), hsl(calc(var(--h, 300) + 60) 90% 55%)); box-shadow: 0 6px 18px hsla(var(--h, 300), 90%, 50%, .35); }
.avatar.chico { width: 40px; height: 40px; border-radius: 13px; font-size: 22px; }
.avatar.grande { width: 84px; height: 84px; border-radius: 26px; font-size: 46px; }
.vacio { text-align: center; color: var(--suave); padding: 40px 20px; }
.vacio .grande { font-size: 46px; margin-bottom: 10px; }

/* mensajes */
.mensajes { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 88%; }
.msg .burbuja { background: rgba(255, 255, 255, .08); border: 1px solid var(--borde); border-radius: 18px 18px 18px 6px; padding: 9px 13px; word-wrap: break-word; white-space: pre-wrap; }
.msg .autor { font-size: 12px; font-weight: 800; color: var(--celeste); margin-bottom: 2px; }
.msg .hora { font-size: 11px; color: var(--tenue); margin-top: 3px; }
.msg.mio { align-self: flex-end; flex-direction: row-reverse; }
.msg.mio .burbuja { background: var(--grad-boton); border: 0; border-radius: 18px 18px 6px 18px; }
.msg.mio .hora { color: rgba(255, 255, 255, .7); }
.msg.aviso { align-self: center; max-width: 95%; }
.msg.aviso .burbuja { background: linear-gradient(135deg, rgba(255, 197, 61, .18), rgba(255, 46, 147, .18)); border: 1px solid rgba(255, 197, 61, .45); border-radius: 16px; text-align: center; font-weight: 600; }
.msg.aviso .autor { color: var(--ambar); }
.sistema { align-self: center; font-size: 13px; color: var(--tenue); padding: 4px 10px; }

.escribir { display: flex; gap: 10px; padding: 10px 14px calc(var(--abajo) + 10px); border-top: 1px solid var(--borde); background: rgba(11, 7, 24, .8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.escribir textarea { flex: 1; resize: none; max-height: 120px; border-radius: 22px; padding: 11px 16px; }
.enviar { width: 46px; height: 46px; border-radius: 50%; background: var(--grad-boton); color: white; display: grid; place-items: center; flex: none; box-shadow: 0 6px 20px rgba(255, 46, 147, .4); }
.enviar:disabled { opacity: .4; }
.enviar svg { width: 22px; height: 22px; }

/* pestañas */
.pestanas { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 10px calc(var(--abajo) + 6px); border-top: 1px solid var(--borde); background: rgba(11, 7, 24, .85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.pestanas button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0; color: var(--tenue); font-size: 12px; font-weight: 700; position: relative; border-radius: 14px; }
.pestanas button svg { width: 24px; height: 24px; }
.pestanas button.si { color: var(--texto); }
.pestanas button.si svg { stroke: url(#gradiente); }
.pestanas button.si::before { content: ""; position: absolute; top: -7px; width: 28px; height: 3px; border-radius: 3px; background: var(--grad); }
.globo { position: absolute; top: 3px; left: calc(50% + 8px); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--rosa); color: white; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--fondo); }

/* chats y solicitudes */
.lista { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.item { display: flex; gap: 12px; align-items: center; background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 18px; padding: 12px 14px; text-align: left; width: 100%; }
.item .txt { flex: 1; min-width: 0; }
.item .txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .txt span { color: var(--suave); font-size: 14px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.solicitud { border-color: rgba(255, 46, 147, .45); background: linear-gradient(135deg, rgba(255, 46, 147, .12), rgba(139, 44, 255, .1)); flex-wrap: wrap; }
.solicitud .cita { width: 100%; font-size: 15px; background: rgba(0, 0, 0, .25); border-radius: 12px; padding: 10px 12px; }
.solicitud .fila { width: 100%; }
.titulo-seccion { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); font-weight: 800; margin: 18px 4px 10px; }
.titulo-seccion:first-child { margin-top: 2px; }
.reloj { font-size: 12px; color: var(--ambar); font-weight: 700; }

/* hoja inferior (perfil de otra persona, menús) */
.hoja[hidden] { display: none; }
.hoja { position: fixed; inset: 0; z-index: 20; background: rgba(5, 2, 14, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: aparecer .2s; }
.hoja > div { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, #1b1038, #120a26); border: 1px solid var(--borde); border-bottom: 0;
  border-radius: 26px 26px 0 0; padding: 10px 20px calc(var(--abajo) + 22px); box-shadow: var(--sombra); animation: subir .25s cubic-bezier(.2, .9, .3, 1.1); }
.hoja .asa { width: 42px; height: 5px; border-radius: 5px; background: var(--borde); margin: 4px auto 16px; }
.hoja .perfil { text-align: center; margin-bottom: 16px; }
.hoja .perfil .avatar { margin: 0 auto 10px; }
.hoja .acciones { display: grid; gap: 10px; margin-top: 14px; }
.hoja .opciones { display: grid; gap: 4px; margin-top: 8px; }
.hoja .opciones button { text-align: left; padding: 14px 12px; border-radius: 14px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.hoja .opciones button:active { background: rgba(255, 255, 255, .06); }
.hoja .opciones .rojo { color: #ff8fa3; }
.contador { text-align: right; font-size: 12px; color: var(--tenue); margin-top: 4px; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } }

/* avisos flotantes */
.avisos { position: fixed; top: calc(var(--arriba) + 12px); left: 50%; transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(92vw, 480px); pointer-events: none; }
.toast { background: #22164a; border: 1px solid var(--borde); border-radius: 16px; padding: 12px 16px; box-shadow: var(--sombra); font-weight: 600; animation: bajar .25s; pointer-events: auto; }
.toast.rosa { border-color: rgba(255, 46, 147, .6); background: linear-gradient(135deg, #3a1046, #24124d); }
@keyframes bajar { from { transform: translateY(-14px); opacity: 0; } }

.cargando { display: grid; place-items: center; flex: 1; }
.giro { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .12); border-top-color: var(--rosa); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.pildora { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .08); border: 1px solid var(--borde); }
.pildora.ligar { background: rgba(255, 46, 147, .15); border-color: rgba(255, 46, 147, .4); color: #ff8cc4; }
.pildora.social { background: rgba(31, 209, 249, .12); border-color: rgba(31, 209, 249, .4); color: #8be8ff; }

/* fotos */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fila-foto { display: flex; gap: 14px; align-items: center; }
.msg .foto { display: block; width: 220px; max-width: 62vw; max-height: 300px; object-fit: cover; border-radius: 14px; margin: 2px 0 4px; cursor: zoom-in;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.foto-grande { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 16px; -webkit-touch-callout: none; user-select: none; -webkit-user-drag: none; }
.adjuntar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); border: 1px solid var(--borde); flex: none; cursor: pointer; color: var(--suave); }
.adjuntar svg { width: 22px; height: 22px; }
/* traducir */
.trad { color: var(--celeste); font-size: 11px; font-weight: 700; padding: 0; }
.msg.mio .trad { color: white; }
.traduccion { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--borde); color: #c9f3ff; font-size: 15px; }
/* avisos push */
.aviso-push { display: grid; gap: 6px; margin-bottom: 14px; border-color: rgba(31, 209, 249, .35); background: linear-gradient(135deg, rgba(31, 209, 249, .1), rgba(139, 44, 255, .1)); }
.aviso-push .fila { margin-top: 6px; }
/* tragos */
.carta { display: grid; gap: 8px; }
.carta button { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 2px solid transparent; font-weight: 600; text-align: left; }
.carta button.si { border-color: var(--rosa); background: rgba(255, 46, 147, .14); }
.carta button b { color: var(--ambar); }
.trago { border-color: rgba(255, 197, 61, .5); background: linear-gradient(135deg, rgba(255, 197, 61, .14), rgba(255, 46, 147, .1)); }
.legal { text-align: center; margin-top: 22px; }
.legal a, .check a { color: var(--celeste); }

/* personal del local */
.personal-local { display: grid; gap: 10px; margin-bottom: 14px; border-color: rgba(166, 255, 77, .3); background: linear-gradient(135deg, rgba(166, 255, 77, .08), rgba(31, 209, 249, .08)); }
.fila-personal { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid var(--borde); flex: none; text-align: left; }
.chip span { display: grid; line-height: 1.15; font-weight: 700; font-size: 14px; } .chip small { color: var(--lima); font-weight: 600; font-size: 11px; }
.avatar.mini { width: 30px; height: 30px; border-radius: 50%; font-size: 17px; }
.mi-pedido { font-size: 14px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .2); }
.puesto { display: grid; gap: 6px; margin-bottom: 4px; border-color: rgba(166, 255, 77, .35); }
.codigo-dia { font-size: 20px; letter-spacing: .2em; color: var(--lima); }
.alerta { border-color: rgba(255, 77, 109, .7); background: linear-gradient(135deg, rgba(255, 77, 109, .25), rgba(255, 46, 147, .12)); animation: latir 1.2s ease-in-out infinite alternate; }
@keyframes latir { to { box-shadow: 0 0 0 4px rgba(255, 77, 109, .25); } }
.item .txt span b { display: inline; }
.item .fila.acc { flex: none; width: auto; }
.trabajo .item .txt b, .trabajo .item .txt span { white-space: normal; }
