/* Museo de Ideas · Propuesta 4 · Burbujas
   Fondo blanco, un campo en el centro, ideas que flotan. */

:root {
  --bg: #ffffff;
  --ink: oklch(0.24 0.02 270);
  --ink-2: oklch(0.45 0.015 270);
  --ink-3: oklch(0.5 0.014 270);
  --line: oklch(0.91 0.006 270);
  --focus: oklch(0.62 0.19 45);
  --pill-shadow: 0 1px 2px oklch(0.3 0.02 270 / 0.06), 0 18px 40px -18px oklch(0.3 0.03 270 / 0.28);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --love: oklch(0.62 0.21 28);
  --water: oklch(0.64 0.05 235);
  --display: 'Red Hat Display', system-ui, sans-serif;
  --text: 'Red Hat Text', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}
::selection { background: oklch(0.86 0.1 60); color: var(--ink); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Agua: las ondas viven bajo las burbujas ---------- */
.water {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  border: var(--bw, 1.5px) solid oklch(0.6 0.075 235 / 0.8);
  background: radial-gradient(closest-side, oklch(0.8 0.05 235 / 0) 72%, oklch(0.8 0.05 235 / 0.16) 96%, oklch(0.8 0.05 235 / 0) 100%);
  box-shadow:
    0 4px 10px -5px oklch(0.45 0.08 235 / 0.45),
    inset 0 -4px 10px -6px oklch(0.55 0.07 235 / 0.5);
  opacity: 0;
  will-change: transform, opacity;
}
.drop {
  position: absolute;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: oklch(0.64 0.05 235 / 0.3);
  box-shadow: 0 2px 4px -1px oklch(0.5 0.06 235 / 0.3);
}

/* ---------- Campo de burbujas ---------- */
.field {
  position: fixed; inset: 0;
  z-index: 1;
  touch-action: none;
  transition: filter 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
}
.field.dim { filter: blur(3px) saturate(0.8); opacity: 0.42; pointer-events: none; }
.top { position: fixed; inset: 0; z-index: 30; pointer-events: none; }

.bub {
  --l: 0.84; --c: 0.12; --h: 40;
  --tint: oklch(0.32 0.09 var(--h));
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  margin: 0; padding: 0; border: 0;
  border-radius: 50%;
  color: var(--tint);
  font: 600 17px/1.22 var(--display);
  letter-spacing: -0.01em;
  text-align: center;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 1px oklch(1 0 0 / 0.9),
    inset 0 0 0 2.5px oklch(0.8 0.1 var(--h) / 0.32),
    inset 0 -12px 22px -12px oklch(0.55 0.15 var(--h) / 0.5),
    inset 0 10px 16px -10px oklch(1 0 0 / 0.95),
    0 20px 32px -20px oklch(0.42 0.12 var(--h) / 0.5);
  transform-origin: 50% 50%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ---------- Material: pompa de jabón ----------
   Núcleo casi transparente teñido con el color de la idea (ahí vive el texto),
   dos películas iridiscentes que giran en sentidos opuestos y se mezclan como aceite en agua,
   el reflejo de una ventana arriba y el arco de luz de abajo. Más me gusta = película más viva. */
.bub, .lens {
  --glow: 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%,
      oklch(0.985 0.02 var(--h) / 0.9) 0 34%,
      oklch(0.93 0.075 var(--h) / 0.76) 62%,
      oklch(0.82 0.145 var(--h) / 0.78) 100%);
}
.bub::after, .lens::after, .film {
  content: '';
  position: absolute; inset: 0;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  -webkit-mask: radial-gradient(closest-side, transparent 52%, #000 82%, #000 96%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 52%, #000 82%, #000 96%, transparent 100%);
  opacity: calc(0.6 + 0.4 * var(--glow));
  transition: opacity 0.6s var(--ease-out);
}
.bub::after, .lens::after {
  background: conic-gradient(from 20deg at 46% 54%,
    oklch(0.7 0.21 345 / 0.78),
    oklch(0.87 0.15 85 / 0.62) 13%,
    oklch(0.78 0.17 var(--h) / 0.8) 25%,
    oklch(0.78 0.14 215 / 0.74) 39%,
    oklch(0.64 0.2 295 / 0.66) 54%,
    oklch(0.74 0.18 var(--h) / 0.7) 64%,
    oklch(0.8 0.16 35 / 0.56) 77%,
    oklch(0.7 0.21 345 / 0.78));
  animation: spin var(--sa, 16s) linear infinite;
  animation-delay: var(--sd, 0s);
}
.film {
  background: conic-gradient(from 200deg at 56% 44%,
    oklch(0.8 0.14 200 / 0.62),
    oklch(0.7 0.2 330 / 0) 17%,
    oklch(0.89 0.14 95 / 0.58) 33%,
    oklch(0.76 0.17 var(--h) / 0.7) 51%,
    oklch(0.8 0.14 200 / 0) 69%,
    oklch(0.74 0.18 15 / 0.52) 84%,
    oklch(0.8 0.14 200 / 0.62));
  animation: spin var(--sb, 23s) linear infinite reverse;
  animation-delay: var(--sd, 0s);
}
@keyframes spin { to { rotate: 360deg; } }
/* Reflejo de ventana: una forma de luz curvada, como en una pompa real. */
.bub::before, .lens::before {
  content: '';
  position: absolute; left: 16%; top: 12%;
  z-index: 1;
  width: 31%; height: 21%;
  border-radius: 46% 54% 40% 60% / 62% 64% 36% 38%;
  background: linear-gradient(165deg, oklch(1 0 0 / 0.96), oklch(1 0 0 / 0.42) 58%, oklch(1 0 0 / 0) 100%);
  rotate: -34deg;
  pointer-events: none;
  transition: opacity 0.4s;
}
/* Arco de luz inferior, la otra mitad del reflejo. */
.glint {
  position: absolute; inset: 5.5%;
  z-index: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: oklch(1 0 0 / 0.85);
  border-right-color: oklch(1 0 0 / 0.3);
  rotate: 20deg;
  pointer-events: none;
}
.bub .txt, .bub .likes, .lens-in, .lens-close { z-index: 2; }
#measure::after, #measure::before { display: none; }

.bub .txt {
  position: relative;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 9;
  overflow: hidden;
  max-width: 68%;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
  pointer-events: none;
}
/* Chip de me gusta, pegado al borde de la burbuja */
.bub .likes {
  position: absolute; left: 84%; top: 84%;
  translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 3px;
  height: 24px; padding: 0 8px 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: 700 12px/1 var(--text);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 10px -4px oklch(0.35 0.08 var(--h) / 0.5);
  pointer-events: none;
}
.bub .likes i { font-style: normal; }
.bub .likes svg { width: 13px; height: 13px; }
.bub .likes path { fill: var(--love); }
.bub.morph .likes { display: none; }
/* El medidor no parte palabras: así la burbuja crece hasta que la palabra larga quepa entera. */
#measure .txt { overflow-wrap: normal; hyphens: manual; }
.bub:focus { outline: none; }
.bub:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.bub.held { opacity: 0 !important; pointer-events: none; }
/* Las pompas revientan de golpe: un leve estirón y desaparecen (las gotitas las pone el script). */
.bub.pop { animation: pop 0.26s cubic-bezier(0.3, 0, 0.6, 1) forwards; pointer-events: none; }
@keyframes pop {
  45% { opacity: 1; }
  to { opacity: 0; }
}
.drip {
  position: fixed; z-index: 35;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 -1px 2px oklch(0.4 0.1 250 / 0.25);
}

/* La burbuja mientras nace del campo de texto */
.bub.morph {
  position: fixed;
  box-shadow: var(--pill-shadow);
  cursor: default;
}
.bub.morph::before, .bub.morph::after, .bub.morph .film, .bub.morph .glint { opacity: 0; }
.bub.morph:not(.formed) { background-image: none; }
.bub.morph .txt { max-width: max(68%, calc(100% - 64px)); -webkit-line-clamp: 12; }
.bub.morph.formed::before, .bub.morph.formed .glint { opacity: 1; }
.bub.morph.formed::after, .bub.morph.formed .film { opacity: calc(0.6 + 0.4 * var(--glow)); }

/* ---------- Campo de texto central ---------- */
.ask {
  position: fixed; left: 50%; top: 50%;
  z-index: 20;
  width: min(580px, calc(100vw - 32px));
  translate: -50% -50%;
  transition: opacity 0.35s var(--ease-out), scale 0.5s var(--ease-out);
}
/* Vidrio flotante: las pompas pasan por detrás y se ven difuminadas a través de él. */
@property --rim { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.pill {
  position: relative;
  display: flex; align-items: center;
  height: 68px;
  padding: 0 64px;
  background: oklch(1 0 0 / 0.82);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  border-radius: 999px;
  box-shadow:
    inset 0 1.5px 0 oklch(1 0 0 / 1),
    inset 0 -2px 6px -2px oklch(0.3 0.03 270 / 0.07),
    0 1px 2px oklch(0.3 0.03 270 / 0.12),
    0 10px 22px -8px oklch(0.3 0.04 270 / 0.2),
    0 34px 64px -26px oklch(0.28 0.06 270 / 0.4);
  transition: box-shadow 0.35s var(--ease-out), translate 0.45s var(--ease-out);
}
/* Borde iridiscente, como la película de las pompas; gira mientras escribes. */
.pill::before {
  content: '';
  position: absolute; inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--rim),
    oklch(0.7 0.2 345), oklch(0.85 0.15 85), oklch(0.78 0.15 160), oklch(0.72 0.15 225), oklch(0.62 0.2 295), oklch(0.7 0.2 345));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), padding 0.35s var(--ease-out);
}
.pill:hover {
  box-shadow:
    inset 0 1.5px 0 oklch(1 0 0 / 1),
    inset 0 -2px 6px -2px oklch(0.3 0.03 270 / 0.07),
    0 1px 2px oklch(0.3 0.03 270 / 0.12),
    0 14px 26px -8px oklch(0.3 0.04 270 / 0.22),
    0 40px 72px -26px oklch(0.28 0.06 270 / 0.44);
}
.pill:focus-within {
  translate: 0 -2px;
  box-shadow:
    inset 0 1.5px 0 oklch(1 0 0 / 1),
    inset 0 -2px 6px -2px oklch(0.3 0.03 270 / 0.07),
    0 1px 2px oklch(0.3 0.03 270 / 0.12),
    0 16px 30px -8px oklch(0.3 0.05 270 / 0.24),
    0 46px 80px -26px oklch(0.28 0.07 270 / 0.48);
}
.pill:focus-within::before { opacity: 1; padding: 2px; animation: rim 5s linear infinite; }
@keyframes rim { to { --rim: 360deg; } }
.pill input {
  flex: 1; min-width: 0;
  height: 100%;
  padding: 0;
  border: 0; outline: none; background: transparent;
  color: var(--ink);
  caret-color: var(--focus);
  font: 500 19px/1 var(--text);
  letter-spacing: -0.01em;
  text-align: center;
}
.pill input::placeholder { color: var(--ink-3); opacity: 1; transition: opacity 0.3s; }
.pill input.swap::placeholder { opacity: 0; }
.go {
  position: absolute; right: 10px; top: 50%; margin-top: -24px;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--ink); color: #fff;
  cursor: pointer;
  transition: opacity 0.25s, scale 0.35s var(--ease-out), background 0.2s;
}
.go svg { width: 22px; height: 22px; }
.go:hover { background: oklch(0.34 0.03 270); }
.go:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.go:disabled { opacity: 0; scale: 0.6; pointer-events: none; }
.ask.sending { opacity: 0; scale: 0.97; transition: none; }
.ask.away { opacity: 0; scale: 0.96; pointer-events: none; }

.hint {
  position: absolute; left: 50%; top: calc(100% + 14px);
  translate: -50% 0;
  width: max-content; max-width: 100%;
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px -10px oklch(0.3 0.04 270 / 0.35);
  color: var(--ink-2);
  font: 500 14px/1.4 var(--text);
  text-align: center;
  transition: opacity 0.3s;
}
.hint.err { color: oklch(0.5 0.18 28); }
.hint:empty { opacity: 0; }
.hint .n { font-variant-numeric: tabular-nums; }

/* ---------- Esquinas ---------- */
.mark, .count, .note {
  position: fixed; z-index: 10;
  margin: 0;
  pointer-events: none;
}
/* Firma: logo de Placetopay, una línea fina y el nombre de la actividad. */
.mark {
  left: 28px; top: 20px;
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-areas: "logo sep name" "logo sep lema";
  align-items: center;
  column-gap: 16px; row-gap: 3px;
}
.mark .brand {
  grid-area: logo; display: block; height: 40px; width: auto;
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.mark { -webkit-user-select: none; user-select: none; }
.mark-sep {
  grid-area: sep;
  width: 1px; height: 36px;
  background: oklch(0.24 0.02 270 / 0.18);
}
.mark-name {
  grid-area: name; align-self: end;
  margin: 0;
  font: 800 21px/1 var(--display);
  letter-spacing: -0.025em;
  color: var(--ink);
}
.mark-lema {
  grid-area: lema; align-self: start;
  margin: 0;
  max-width: 34ch;
  font: 500 13px/1.3 var(--text);
  color: var(--ink-2);
}
.count {
  left: 28px; bottom: 24px;
  font: 600 14px/1.3 var(--text);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.count b { color: var(--ink); font-weight: 700; }
.count .likes-total { display: inline-flex; align-items: center; gap: 3px; transform-origin: 30% 60%; }
.count .likes-total svg { width: 13px; height: 13px; }
.count .likes-total path { fill: var(--love); }
.note {
  right: 28px; bottom: 24px;
  max-width: 340px;
  font: 500 13px/1.35 var(--text);
  color: var(--ink-3);
  text-align: right;
}
.note.warn { color: oklch(0.5 0.16 50); }

/* ---------- En vivo: presencia y avisos de actividad ---------- */
.live-wrap {
  position: fixed; right: 28px; top: 24px;
  z-index: 10;
  display: flex; align-items: center; gap: 8px;
}
.live {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; margin: 0; padding: 0 13px 0 11px;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.82);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 oklch(1 0 0), 0 6px 16px -8px oklch(0.3 0.04 270 / 0.3);
  color: var(--ink-2);
  font: 600 13px/1 var(--text);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.live-short { display: none; }
.live-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: oklch(0.64 0.17 150);
}
.live-dot::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: oklch(0.64 0.17 150);
  animation: livePulse 2.2s var(--ease-out) infinite;
}
@keyframes livePulse { from { scale: 1; opacity: 0.55; } to { scale: 3.2; opacity: 0; } }
.metrics-btn {
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: #fff;
  font: 600 13px/1 var(--text);
  cursor: pointer;
  transition: background 0.2s, scale 0.3s var(--ease-out);
}
.metrics-btn:hover { background: oklch(0.34 0.03 270); }
.metrics-btn:active { scale: 0.96; }
.metrics-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.feed {
  position: fixed; right: 28px; top: 70px;
  z-index: 12;
  width: 300px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 100%;
  padding: 10px 14px 10px 12px;
  border: 0; border-radius: 16px;
  background: oklch(1 0 0 / 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
  box-shadow: inset 0 1px 0 oklch(1 0 0), 0 10px 24px -12px oklch(0.3 0.05 270 / 0.4);
  color: var(--ink);
  font: 400 13px/1.35 var(--text);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s;
}
.toast:hover { background: oklch(1 0 0 / 0.97); }
.toast:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.toast-dot {
  flex: none;
  width: 12px; height: 12px; margin-top: 3px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, oklch(0.97 0.03 var(--h)), oklch(0.78 0.14 var(--h)));
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.8);
}
.toast-body b { display: block; font-weight: 600; }
.toast-body span { display: block; color: var(--ink-2); }

/* ---------- Panel de métricas (moderación) ---------- */
.panel-scrim {
  position: fixed; inset: 0; z-index: 59;
  background: oklch(1 0 0 / 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.3s var(--ease-out);
}
.panel-scrim.on { opacity: 1; }
.panel {
  --series: #2a78d6;
  --track: #cde2fb;
  --grid: oklch(0.92 0.005 270);
  position: fixed; left: 50%; top: 50%;
  z-index: 60;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding: 28px 32px 32px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 2px 4px oklch(0.3 0.03 270 / 0.06), 0 40px 80px -30px oklch(0.25 0.05 270 / 0.45);
  translate: -50% -47%;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out), translate 0.45s var(--ease-out);
}
.panel.on { opacity: 1; translate: -50% -50%; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h2 { margin: 0; font: 800 26px/1.1 var(--display); letter-spacing: -0.02em; }
.panel-sub { margin: 6px 0 0; color: var(--ink-2); font: 500 13px/1.4 var(--text); }
.panel-x { --tint: var(--ink); background: oklch(0.96 0.004 270); box-shadow: none; }
.panel-x:hover { background: oklch(0.93 0.006 270); }
.panel-body { margin-top: 24px; }
.hero { display: flex; align-items: center; gap: 24px; }
.hero-v { margin: 0; font: 700 64px/1 var(--text); letter-spacing: -0.03em; color: var(--ink); }
.hero-t { flex: 1; }
.hero-t p { margin: 0 0 10px; color: var(--ink-2); font: 500 15px/1.4 var(--text); max-width: 52ch; }
.hero-t b { color: var(--ink); }
.meter { height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--series); transition: width 0.6s var(--ease-out); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.kpi { padding: 14px 16px; border-radius: 14px; background: oklch(0.975 0.004 270); }
.kpi-l { margin: 0; color: var(--ink-2); font: 500 13px/1.3 var(--text); }
.kpi-v { margin: 6px 0 0; color: var(--ink); font: 600 26px/1.1 var(--text); letter-spacing: -0.01em; }
.kpi-s { margin: 4px 0 0; color: var(--ink-3); font: 500 12px/1.3 var(--text); }
.chart { margin: 32px 0 0; }
.chart h3 { margin: 0; font: 700 16px/1.3 var(--display); letter-spacing: -0.01em; }
.chart figcaption p { margin: 4px 0 0; color: var(--ink-2); font: 500 13px/1.4 var(--text); }
.chart-plot { position: relative; margin-top: 12px; }
.chart-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-plot .grid { stroke: var(--grid); stroke-width: 1; }
.chart-plot .tick { fill: var(--ink-3); font: 500 11px var(--text); font-variant-numeric: tabular-nums; }
.chart-plot .val { fill: var(--ink); font: 600 12px var(--text); }
.chart-plot .bar { fill: var(--series); }
.chart-plot .hit { fill: transparent; cursor: default; outline: none; }
.chart-plot .hit.on { fill: oklch(0.24 0.02 270 / 0.045); }
.chart-plot .hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.tip {
  position: absolute; top: -8px;
  padding: 8px 11px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px oklch(0.3 0.03 270 / 0.1), 0 10px 22px -10px oklch(0.3 0.05 270 / 0.4);
  pointer-events: none;
  white-space: nowrap;
}
.tip b { display: block; color: var(--ink); font: 600 15px/1.2 var(--text); }
.tip span { display: block; margin-top: 2px; color: var(--ink-2); font: 500 12px/1.3 var(--text); }
.rank { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.rank-t { margin: 0 0 6px; color: var(--ink); font: 500 14px/1.35 var(--text); }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-bar { height: 12px; border-radius: 0 4px 4px 0; background: var(--series); }
.rank-v { color: var(--ink); font: 600 13px/1 var(--text); font-variant-numeric: tabular-nums; }

/* ---------- Lente: la burbuja abierta ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 25;
  background: oklch(1 0 0 / 0.35);
  opacity: 0; transition: opacity 0.45s var(--ease-out);
}
.scrim.on { opacity: 1; }

.lens {
  --l: 0.84; --c: 0.12; --h: 40;
  --tint: oklch(0.3 0.09 var(--h));
  position: fixed; left: 50%; top: 50%;
  z-index: 40;
  width: var(--d); height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--tint);
  box-shadow:
    inset 0 0 0 1.5px oklch(1 0 0 / 0.9),
    inset 0 0 0 4px oklch(0.8 0.1 var(--h) / 0.3),
    inset 0 -30px 50px -30px oklch(0.55 0.15 var(--h) / 0.5),
    inset 0 24px 36px -24px oklch(1 0 0 / 0.95),
    0 44px 80px -40px oklch(0.4 0.13 var(--h) / 0.55);
  transform-origin: 50% 50%;
}
.lens .glint { border-width: 3px; }
.lens::before { left: 19%; top: 12%; width: 22%; height: 13%; background: linear-gradient(165deg, oklch(1 0 0 / 0.9), oklch(1 0 0 / 0.25) 60%, oklch(1 0 0 / 0) 100%); }
.lens-in {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 70%;
  text-align: center;
  transition: opacity 0.3s;
}
.lens.closing .lens-in, .lens.opening .lens-in { opacity: 0; }
.lens-txt {
  margin: 0;
  font: 700 var(--fs, 24px)/1.22 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}
.lens-meta {
  margin: 0;
  font: 500 14px/1.35 var(--text);
  color: oklch(0.34 0.07 var(--h));
  font-variant-numeric: tabular-nums;
}
.lens-row { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.join, .like {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--tint);
  color: oklch(0.97 0.02 var(--h));
  font: 700 16px/1 var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, scale 0.3s var(--ease-out);
}
.join svg, .like svg { width: 18px; height: 18px; }
.join:hover, .like:hover { background: oklch(0.22 0.07 var(--h)); }
.join:active, .like:active { scale: 0.95; }
.join:disabled, .like:disabled { opacity: 0.55; cursor: not-allowed; }
.like { padding: 0 10px 0 18px; }
.like:has(.num[hidden]) { padding-right: 22px; }
.like .heart { width: 20px; height: 20px; overflow: visible; }
.like .heart path {
  fill: transparent;
  stroke: currentColor; stroke-width: 2; stroke-linejoin: round;
  transition: fill 0.2s, stroke 0.2s;
}
.like[aria-pressed="true"] {
  background: oklch(1 0 0 / 0.72);
  color: var(--tint);
}
.like[aria-pressed="true"]:hover { background: oklch(1 0 0 / 0.9); }
.like[aria-pressed="true"] .heart path { fill: var(--love); stroke: var(--love); }
.like .num {
  display: inline-grid; place-items: center;
  height: 28px; min-width: 28px; padding: 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: oklch(1 0 0 / 0.16);
  font-variant-numeric: tabular-nums;
}
.like[aria-pressed="true"] .num { background: oklch(0.3 0.08 var(--h) / 0.1); }
.like .num i { grid-area: 1 / 1; font-style: normal; }
.icon-btn {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: oklch(1 0 0 / 0.62);
  box-shadow: inset 0 0 0 1px oklch(0.3 0.09 var(--h) / 0.12);
  color: var(--tint);
  cursor: pointer;
  transition: background 0.2s;
}
.icon-btn:hover { background: oklch(1 0 0 / 0.9); }
.icon-btn svg { width: 20px; height: 20px; }
.join:focus-visible, .like:focus-visible, .icon-btn:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
.lens-close { position: absolute; left: 50%; top: 5.5%; translate: -50% 0; }
.lens-x { width: 40px; height: 40px; }
.burst {
  position: absolute; left: 50%; top: 50%;
  width: 100%; height: 100%;
  translate: -50% -50%;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--tint);
  opacity: 0;
  pointer-events: none;
}
.burst.go-burst { animation: burst 0.7s var(--ease-out); }
/* Acciones secundarias: editar, explotar, reportar, aprobar. Las irreversibles piden un segundo toque. */
.lens-acts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px;
  margin-top: -6px;
}
.act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 999px;
  background: oklch(1 0 0 / 0.5);
  color: var(--tint);
  font: 600 13px/1 var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, scale 0.3s var(--ease-out);
}
.act svg { width: 15px; height: 15px; flex: none; }
.act:hover { background: oklch(1 0 0 / 0.85); }
.act:active { scale: 0.95; }
.act:disabled { opacity: 0.6; cursor: default; }
.act:disabled:hover { background: oklch(1 0 0 / 0.5); }
.act.armed { background: var(--love); color: #fff; }
.act.armed:hover { background: oklch(0.56 0.21 28); }
.act:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }

/* Edición en la propia burbuja: se escribe sobre el texto, con su misma letra. */
.lens.editing .lens-txt { display: none; }
.edit-wrap { position: relative; width: 100%; }
.lens-edit {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  margin: 0; padding: 2px 0 12px;
  border: 0;
  background: transparent;
  color: var(--tint);
  font: 700 var(--fs, 22px)/1.22 var(--display);
  letter-spacing: -0.02em;
  text-align: center;
  caret-color: var(--love);
  outline: none;
}
.lens-edit::selection { background: oklch(0.86 0.1 var(--h)); }
.edit-line {
  position: absolute; left: 50%; bottom: 0;
  width: 40%; height: 2px;
  translate: -50% 0;
  border-radius: 2px;
  background: oklch(0.3 0.09 var(--h) / 0.22);
  transition: width 0.45s var(--ease-out), background 0.3s;
}
.lens-edit:focus + .edit-line { width: 70%; background: var(--tint); }
.lens-meta .n { font-variant-numeric: tabular-nums; font-weight: 700; }
.lens-meta.low .n { color: oklch(0.5 0.2 28); }
.act-ghost { background: transparent; }
.act-ghost:hover { background: oklch(1 0 0 / 0.55); }

/* Antes de explotar: la burbuja cambia por dentro para invitar a reconsiderar. */
.lens > .lens-in, .lens > .lens-confirm { grid-area: 1 / 1; }
.lens-in { transition: opacity 0.3s, translate 0.45s var(--ease-out); }
.lens.confirming .lens-in { opacity: 0; translate: 0 -12px; pointer-events: none; }
.lens-confirm {
  position: relative; z-index: 2;
  width: 74%;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
  opacity: 0; translate: 0 12px;
  transition: opacity 0.32s var(--ease-out), translate 0.45s var(--ease-out);
}
.lens-confirm.on { opacity: 1; translate: 0 0; }
.confirm-title {
  margin: 0;
  font: 800 clamp(19px, calc(var(--d) * 0.05), 24px)/1.15 var(--display);
  letter-spacing: -0.02em;
}
.confirm-body {
  margin: 0;
  max-width: 30ch;
  font: 500 15px/1.45 var(--text);
  text-wrap: pretty;
}
.confirm-note {
  margin: -2px 0 0;
  max-width: 32ch;
  color: oklch(0.38 0.09 var(--h));
  font: 600 13px/1.4 var(--text);
  text-wrap: pretty;
}
.confirm-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.hold {
  position: relative;
  display: inline-grid;
  height: 38px; margin: 0; padding: 0;
  border: 0; border-radius: 999px;
  background: transparent;
  font: 600 13px/1 var(--text);
  cursor: pointer;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  transition: scale 0.3s var(--ease-out);
}
.hold-face, .hold-fill {
  grid-area: 1 / 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 16px;
  border-radius: 999px;
}
.hold-face {
  color: oklch(0.47 0.18 28);
  background: oklch(1 0 0 / 0.5);
  box-shadow: inset 0 0 0 1.5px oklch(0.55 0.2 28 / 0.42);
}
.hold-fill { color: #fff; background: var(--love); clip-path: inset(0 100% 0 0 round 999px); }
.hold svg { width: 15px; height: 15px; flex: none; }
.hold:hover .hold-face { background: oklch(1 0 0 / 0.75); }
.hold.holding { scale: 0.97; }
.hold:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; }
.lens .lens-x { transition: opacity 0.25s; }
.lens.confirming .lens-x { opacity: 0; pointer-events: none; }
.join .heart path { fill: currentColor; stroke: none; }

/* Moderación: bandera con el número de reportes; las ocultas se ven atenuadas y punteadas. */
.bub .flags {
  position: absolute; left: 16%; top: 84%;
  z-index: 3;
  translate: -50% -50%;
  display: inline-flex; align-items: center; gap: 3px;
  height: 22px; padding: 0 7px 0 5px;
  border-radius: 999px;
  background: oklch(0.55 0.2 28);
  color: #fff;
  font: 700 11px/1 var(--text);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.bub .flags svg { width: 12px; height: 12px; }
.bub .flags i { font-style: normal; }
.bub.flagged { opacity: 0.5 !important; outline: 2px dashed oklch(0.55 0.2 28); outline-offset: 5px; }

.lens-heart {
  position: absolute; left: 33%; top: 33%;
  width: 34%; height: 34%;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 14px 18px oklch(0.35 0.12 var(--h) / 0.45));
}
.lens-heart svg { width: 100%; height: 100%; }
.lens-heart path { fill: currentColor; }
.spark {
  position: fixed; z-index: 45;
  border-radius: 50%;
  pointer-events: none;
}
.spark.h {
  border-radius: 0;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.3c-.3 0-.6-.1-.8-.3C7.6 17 3 13.3 3 8.9 3 6.2 5.1 4 7.7 4c1.7 0 3.2.9 4.3 2.3C13.1 4.9 14.6 4 16.3 4 18.9 4 21 6.2 21 8.9c0 4.4-4.6 8.1-8.2 11.1-.2.2-.5.3-.8.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.3c-.3 0-.6-.1-.8-.3C7.6 17 3 13.3 3 8.9 3 6.2 5.1 4 7.7 4c1.7 0 3.2.9 4.3 2.3C13.1 4.9 14.6 4 16.3 4 18.9 4 21 6.2 21 8.9c0 4.4-4.6 8.1-8.2 11.1-.2.2-.5.3-.8.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
@keyframes burst {
  from { opacity: 0.5; scale: 1; }
  to { opacity: 0; scale: 1.14; }
}

/* ---------- Teléfono ---------- */
@media (max-width: 640px) {
  .pill { height: 60px; padding: 0 56px; }
  .pill input { font-size: 17px; }
  .go { width: 44px; height: 44px; right: 8px; margin-top: -22px; }
  .mark {
    left: 16px; right: 16px; top: max(14px, env(safe-area-inset-top));
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "logo sep name" "lema lema lema";
    column-gap: 12px; row-gap: 8px;
  }
  .mark .brand { height: 30px; }
  .lens-confirm { width: 80%; gap: 9px; }
  .confirm-body { font-size: 14px; }
  .confirm-note { font-size: 12.5px; }
  .confirm-note.soft { display: none; }
  .lens.editing .lens-in { width: 80%; }
  .live-wrap { left: 16px; right: auto; top: calc(max(14px, env(safe-area-inset-top)) + 74px); }
  .live { height: 28px; padding: 0 10px 0 9px; font-size: 12px; }
  .metrics-btn { height: 28px; padding: 0 11px; font-size: 12px; }
  .feed { left: 16px; right: 16px; top: calc(max(14px, env(safe-area-inset-top)) + 114px); width: auto; align-items: stretch; }
  .live-long { display: none; }
  .live-short { display: inline; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .panel { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; padding: 20px 18px 28px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hero-v { font-size: 52px; }
  .mark-sep { height: 24px; }
  .mark-name { align-self: center; font-size: 18px; }
  .mark-lema { max-width: none; font-size: 12.5px; }
  .count { left: 18px; bottom: max(18px, env(safe-area-inset-bottom)); font-size: 13px; }
  .note { right: 18px; left: 18px; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 22px); max-width: none; text-align: left; }
  .bub { font-size: 15px; }
}

/* ---------- Cursor (solo con mouse) ----------
   Un punto de tinta exacto y un anillo que lo sigue con resorte. Sobre una pompa crece
   y se vuelve iridiscente; dentro de la burbuja abierta muestra un corazón (doble clic = me gusta). */
.has-cur.cur-on, .has-cur.cur-on * { cursor: none !important; }
.has-cur.cur-on input { cursor: text !important; }
.cur-dot, .cur-ring {
  position: fixed; left: 0; top: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.cur-on .cur-dot, .cur-on .cur-ring { opacity: 1; }
.cur-dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--ink);
  transition: opacity 0.25s, scale 0.3s var(--ease-out);
}
.cur-ring {
  border-radius: 50%;
  transition: opacity 0.25s, scale 0.35s var(--ease-out);
}
.cur-ring::before, .cur-ring::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity 0.35s var(--ease-out);
}
.cur-ring::before { background: oklch(0.24 0.02 270 / 0.42); }
.cur-ring::after {
  padding: 2px;
  background: conic-gradient(oklch(0.7 0.2 345), oklch(0.85 0.15 85), oklch(0.78 0.15 160), oklch(0.72 0.15 225), oklch(0.62 0.2 295), oklch(0.7 0.2 345));
  opacity: 0;
  animation: spin 4s linear infinite;
}
.cur-ring .cur-heart {
  position: absolute; left: 50%; top: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px;
  background: var(--love);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.3c-.3 0-.6-.1-.8-.3C7.6 17 3 13.3 3 8.9 3 6.2 5.1 4 7.7 4c1.7 0 3.2.9 4.3 2.3C13.1 4.9 14.6 4 16.3 4 18.9 4 21 6.2 21 8.9c0 4.4-4.6 8.1-8.2 11.1-.2.2-.5.3-.8.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.3c-.3 0-.6-.1-.8-.3C7.6 17 3 13.3 3 8.9 3 6.2 5.1 4 7.7 4c1.7 0 3.2.9 4.3 2.3C13.1 4.9 14.6 4 16.3 4 18.9 4 21 6.2 21 8.9c0 4.4-4.6 8.1-8.2 11.1-.2.2-.5.3-.8.3Z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0; scale: 0.4;
  transition: opacity 0.25s, scale 0.35s var(--ease-out);
}
.cur-bub .cur-ring::before, .cur-btn .cur-ring::before { opacity: 0; }
.cur-bub .cur-ring::after, .cur-btn .cur-ring::after { opacity: 1; }
.cur-btn .cur-dot { scale: 0; }
.cur-lens .cur-ring .cur-heart { opacity: 1; scale: 1; }
.cur-lens .cur-dot { scale: 0; }
.cur-text .cur-dot, .cur-text .cur-ring { opacity: 0; }
.cur-down .cur-ring { scale: 0.82; }
.cur-down .cur-dot { scale: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .pill:focus-within::before { animation: none; }
  .cur-ring::after { animation: none; }
  .live-dot::after { animation: none; }
  .panel, .panel-scrim { transition-duration: 0.01s; }
  .field, .ask, .scrim { transition-duration: 0.01s; }
  .burst.go-burst { animation: none; }
  .bub::after, .lens::after, .film { animation: none; }
}
