/* Mi Abrazo · estilos de la pantalla de la familia y de la página de mensajes */

:root {
  --tela: #1A0A0B;
  --tinta: #F7EDD9;
  --tinta-suave: rgba(247, 237, 217, 0.82);
  --acento: #E8C878;
  --linea: rgba(232, 200, 120, 0.62);
  --sello: rgba(0, 0, 0, 0.16);
  --caja: rgba(0, 0, 0, 0.18);
  --vineta: radial-gradient(120% 80% at 50% 36%, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0) 48%, rgba(0,0,0,0.42) 100%);
  --boton: linear-gradient(180deg, #F3DA95, #C0913C);
  --boton-texto: #4A0D10;
  --f-fam: 'Cormorant Garamond', serif;
  --f-fam-st: italic;
  --f-fam-w: 500;
  --f-fam-s: 30px;
  --f-fam-sp: 0;
  --f-fam-tr: none;
  --f-ape: 'Cormorant Garamond', serif;
  --f-ape-w: 600;
  --f-ape-s: 60px;
  --f-ape-sp: 0;
  --f-num: 'Cormorant Garamond', serif;
  --f-texto: 'Cormorant Garamond', serif;
  --f-ui: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--tela);
  color: var(--tinta);
  font-family: var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

button { font-family: var(--f-ui); color: inherit; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }
[hidden] { display: none !important; }

/* ---------- la tela ---------- */
.fondo { position: fixed; inset: 0; background: var(--tela); opacity: 0; transition: opacity 0.5s ease; }
body.listo .fondo { opacity: 1; }
.fondo::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('/assets/tela.jpg');
  background-size: 256px 256px;
  mix-blend-mode: overlay;
  opacity: 0.85;
}
.fondo::after { content: ''; position: absolute; inset: 0; background: var(--vineta); }

/* ---------- escenario de 390×844 ---------- */
#escenario {
  position: fixed;
  left: 50%; top: 50%;
  width: 390px; height: 844px;
  transform-origin: center center;
  transform: translate(-50%, -50%);
}
.vista {
  position: absolute; inset: 0;
  padding: 46px 28px 18px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  animation: aparecer 0.6s ease both;
}
@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.crece { flex-grow: 1; }

/* ---------- textos ---------- */
.etiqueta {
  margin: 0;
  font-size: 11px; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--tinta-suave);
}
.titulo { margin: 12px 0 0; font-weight: 400; line-height: 1; width: 100%; }
.titulo-fam {
  display: block;
  font-family: var(--f-fam); font-style: var(--f-fam-st); font-weight: var(--f-fam-w);
  font-size: var(--f-fam-s); letter-spacing: var(--f-fam-sp); text-transform: var(--f-fam-tr);
  color: var(--tinta-suave);
}
.titulo-ape {
  display: block; margin-top: 4px; white-space: nowrap;
  font-family: var(--f-ape); font-weight: var(--f-ape-w); font-size: var(--f-ape-s); letter-spacing: var(--f-ape-sp);
  color: var(--tinta); line-height: 1.12;
}
.italico { margin: 0; font-family: var(--f-texto); font-style: italic; font-size: 18px; color: var(--tinta-suave); }
.adorno { margin-top: 16px; color: var(--acento); }

/* ---------- botones ---------- */
.boton-linea {
  height: 44px; padding: 0 20px; border-radius: 22px;
  border: 1px solid var(--linea); background: rgba(0, 0, 0, 0.08);
  color: var(--tinta); font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}
.boton-linea:active { transform: scale(0.98); }
.boton-principal {
  height: 50px; padding: 0 22px; border-radius: 25px; border: none;
  background: var(--boton); color: var(--boton-texto);
  font-size: 14px; font-weight: 600; letter-spacing: 0.03em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.boton-principal:disabled { opacity: 0.5; cursor: default; }
.boton-circulo {
  width: 80px; height: 80px; border-radius: 50%; border: none;
  background: var(--boton); color: var(--boton-texto);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.boton-circulo:active { transform: scale(0.96); }
.boton-texto {
  height: 44px; padding: 0 14px; border: none; background: transparent;
  color: var(--tinta-suave); font-size: 12px; letter-spacing: 0.08em; cursor: pointer;
}

/* ---------- sello y cuenta regresiva ---------- */
.sello {
  position: relative; margin-top: 26px; width: 172px; height: 172px; border-radius: 50%;
  border: 1.5px dashed var(--linea); background: var(--sello);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sello::after { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 1px dashed var(--linea); }
.sello-numero { font-family: var(--f-num); font-size: 66px; font-weight: 600; line-height: 1; color: var(--acento); }
.sello-texto { margin-top: 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--tinta-suave); line-height: 1.5; }

.cuenta { margin-top: 12px; display: flex; gap: 10px; }
.cuenta-caja {
  width: 66px; height: 64px; border-radius: 10px; border: 1px dashed var(--linea); background: var(--caja);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cuenta-num { font-family: var(--f-num); font-size: 30px; font-weight: 600; line-height: 1; color: var(--acento); font-variant-numeric: tabular-nums; }
.cuenta-txt { margin-top: 4px; font-size: 10px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tinta-suave); }

.estado { margin: 12px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--tinta-suave); min-height: 18px; }
.estado.error { color: var(--acento); }

.bordado { width: 300px; height: 100px; flex-shrink: 0; }
.bordado svg { display: block; overflow: visible; }

/* ---------- carrusel del show ---------- */
.escena { position: relative; margin-top: 18px; width: 342px; height: 384px; flex-shrink: 0; }
.tarjeta {
  position: absolute; left: 34px; top: 44px; width: 230px; height: 330px;
  border-radius: 18px; overflow: hidden; background: #2b2324;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.75s ease, filter 0.75s ease;
  will-change: transform, opacity;
}
.tarjeta img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tarjeta-marco { position: absolute; inset: 8px; border-radius: 12px; border: 1.5px dashed var(--linea); pointer-events: none; }
.tarjeta-pie {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 54px 18px 20px;
  background: linear-gradient(to top, rgba(14, 4, 5, 0.8), rgba(14, 4, 5, 0)); text-align: center;
}
.tarjeta-nombre { margin: 0; font-family: var(--f-texto); font-weight: 600; font-size: 27px; line-height: 1.1; color: #FBF3E2; overflow-wrap: anywhere; }
.tarjeta-lugar { margin: 6px 0 0; font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: #F0D58E; }

.controles { height: 132px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.onda { height: 46px; display: flex; align-items: center; gap: 3px; }
.onda span { display: block; width: 3px; border-radius: 2px; background: var(--acento); animation: onda 0.9s ease-in-out infinite; }
@keyframes onda { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.progreso { margin-top: 10px; width: 220px; height: 2px; border-radius: 1px; background: rgba(127, 127, 127, 0.35); overflow: hidden; }
.progreso div { height: 100%; width: 0; background: var(--acento); }

/* ---------- formulario de mensaje ---------- */
.foto-boton {
  position: relative; margin-top: 16px; width: 100px; height: 100px; padding: 0; border-radius: 50%;
  border: 1.5px dashed var(--linea); background: var(--sello); color: var(--acento);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; overflow: hidden;
}
.foto-boton img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-boton span { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; }
.campos { margin-top: 14px; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.campo { display: flex; flex-direction: column; gap: 2px; }
.campo span { font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--tinta-suave); }
.campo input {
  height: 40px; padding: 0 2px; border: none; border-bottom: 1px solid var(--linea); border-radius: 0;
  background: transparent; color: var(--tinta); font-family: var(--f-texto); font-size: 21px;
}
.campo input::placeholder { color: var(--tinta-suave); opacity: 0.6; }
.campo input:focus { outline: none; border-bottom-color: var(--acento); }
.zona-grabar { margin-top: 12px; width: 100%; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.grabando { background: #D9373F !important; color: #FBF3E2 !important; border: 2px solid #FBF3E2 !important; animation: pulso 1.2s ease-out infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(217, 55, 63, 0.6); } 100% { box-shadow: 0 0 0 22px rgba(217, 55, 63, 0); } }
.fila-botones { display: flex; gap: 8px; justify-content: center; }
.fila-botones .boton-linea, .fila-botones .boton-principal { height: 46px; padding: 0 13px; font-size: 13px; }
.aviso { margin: 8px 0 0; font-size: 12px; color: var(--acento); min-height: 16px; }
.pequeno { margin: 6px 0 0; font-size: 11px; letter-spacing: 0.04em; color: var(--tinta-suave); line-height: 1.45; }

/* ---------- mensajes de estado a pantalla completa ---------- */
.centro { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 0 10px; }
.grande-script { margin: 0; font-family: 'Great Vibes', cursive; font-size: 64px; line-height: 1.15; color: var(--acento); white-space: nowrap; }
.girando { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--linea); border-top-color: var(--acento); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .vista, .tarjeta, .onda span, .grabando { animation: none !important; transition: none !important; }
}
