/* Página Conecta (/c/:id) — fondo «Seda» animado + burbujas de vidrio que crecen al tocarlas. */
:root { --ink: #f5f7fa; --muted: rgba(245,247,250,.62); }
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body { background: #000; color: var(--ink); font-family: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }

canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* Textura: grano fino encima del negro */
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .13; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0) } 20% { transform: translate(-3%,2%) } 40% { transform: translate(2%,-3%) }
  60% { transform: translate(-2%,-1%) } 80% { transform: translate(3%,3%) } 100% { transform: translate(0,0) }
}
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 70% at 50% 30%, transparent 40%, rgba(0,0,0,.55) 100%); }

.screen {
  position: relative; z-index: 2; min-height: 100dvh; max-width: 430px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  padding: max(64px, env(safe-area-inset-top)) 20px max(26px, env(safe-area-inset-bottom));
  opacity: 0; transition: opacity .6s ease;
}
.screen.ready { opacity: 1; }

/* Logo de vidrio (logo del negocio o tiendita) */
.logo {
  width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; position: relative; overflow: visible;
  background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(214,220,230,.85));
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), inset 0 -8px 18px rgba(0,0,0,.18),
              0 0 0 3px rgba(255,255,255,.18), 0 0 24px rgba(180,220,255,.35), 0 14px 30px rgba(0,0,0,.6);
}
.logo::after { /* reflejo iridiscente del marco */
  content: ""; position: absolute; inset: -4px; border-radius: 30px; padding: 3px;
  background: conic-gradient(from 0deg, #fff8, #a7f3ff99, #fff8, #ffc8f099, #fff8);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.logo svg { width: 58px; height: 58px; }
.logo img { width: 80%; height: 80%; object-fit: contain; border-radius: 14px; }
.name { margin-top: 18px; font-weight: 700; font-size: 16px; line-height: 1.15; text-align: center; letter-spacing: -.01em; max-width: 300px; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.name:empty { display: none; }
.divider { width: 46px; height: 3px; border-radius: 3px; margin: 26px 0 10px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent); }
.title { font-weight: 500; font-size: 20px; letter-spacing: .01em; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.6); margin-bottom: 28px; }

/* ---------- Burbujas ---------- */
.bubbles { position: relative; width: 300px; margin: auto 0; } /* centradas entre el título y la firma */
.bubbles ~ .sign { margin-top: 0; }
.float { position: absolute; width: 96px; height: 96px; animation: float 6s ease-in-out infinite; }
.float:nth-child(2) { animation-duration: 7s; animation-delay: -3s; }
.float:nth-child(3) { animation-duration: 6.5s; animation-delay: -2s; }
.float:nth-child(4) { animation-duration: 7.5s; animation-delay: -4s; }
.float:nth-child(5) { animation-duration: 6.8s; animation-delay: -5s; }
.float:nth-child(6) { animation-duration: 7.2s; animation-delay: -1s; }
.float:nth-child(7) { animation-duration: 6.6s; animation-delay: -3.5s; }
.float:nth-child(8) { animation-duration: 7.4s; animation-delay: -2.5s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) }
  33% { transform: translate(2px, -7px) }
  66% { transform: translate(-2px, 4px) }
}

.bubble {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none;
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,.55) 0 8%, rgba(255,255,255,.12) 24%, transparent 46%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.02) 55%, rgba(255,255,255,.22) 72%, rgba(255,255,255,.5) 100%);
  box-shadow:
    inset 0 0 14px rgba(255,255,255,.45),
    inset -8px -12px 22px rgba(120,210,255,.28),
    inset 8px 10px 18px rgba(255,170,240,.22),
    0 12px 28px rgba(0,0,0,.55);
  backdrop-filter: blur(3px) saturate(1.5); -webkit-backdrop-filter: blur(3px) saturate(1.5);
  transition: transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, filter .3s ease;
}
.bubble::before { /* brillo de jabón que gira */
  content: ""; position: absolute; inset: 0; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--a, 0deg), rgba(255,255,255,.7), rgba(120,240,255,.6), rgba(255,255,255,.2), rgba(255,140,230,.6), rgba(255,240,140,.5), rgba(255,255,255,.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 9s linear infinite; opacity: .85;
}
.bubble::after { /* destello */
  content: ""; position: absolute; width: 26%; height: 14%; left: 22%; top: 14%; border-radius: 50%;
  background: rgba(255,255,255,.85); filter: blur(1.5px); transform: rotate(-35deg);
}
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --a: 360deg; } }
.bubble svg { width: 48%; height: 48%; position: relative; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }

/* Al pasar el dedo o el cursor: crecen con brillo (opción A elegida el 26-oct) */
.bubble:hover, .bubble:focus-visible, .bubble.pressed {
  transform: scale(1.2);
  box-shadow: inset 0 0 18px rgba(255,255,255,.6), inset -8px -12px 22px rgba(120,210,255,.4),
              inset 8px 10px 18px rgba(255,170,240,.3), 0 0 26px rgba(56,189,248,.55), 0 0 60px rgba(212,175,55,.35), 0 16px 34px rgba(0,0,0,.6);
  filter: brightness(1.12);
}
.bubble:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.float:has(.bubble:hover), .float:has(.bubble.pressed), .float:has(.bubble:focus-visible) { z-index: 3; }

.empty { margin-top: 26px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; max-width: 280px; }

/* Firma */
.sign { margin-top: auto; padding-top: 24px; text-align: center; }
.sign .brand { font-weight: 600; letter-spacing: .28em; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.sign .brand svg { width: 14px; height: 14px; }
.sign .by { font-size: 9px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }

/* Celulares bajitos: que quepa todo sin encimarse */
@media (max-height: 720px) {
  .screen { padding-top: max(44px, env(safe-area-inset-top)); }
  .logo { width: 78px; height: 78px; border-radius: 22px; }
  .logo svg { width: 46px; height: 46px; }
  .divider { margin: 16px 0 8px; }
  .bubbles { transform: scale(.86); transform-origin: top center; }
}

@media (prefers-reduced-motion: reduce) {
  .float, .bubble::before, .grain { animation: none; }
  .screen { transition: none; }
}
