/* =========================================================
   YN CRECIENDO VIRAL · estilos
   Paleta: morado YN + negros tintados
   ========================================================= */
:root {
  --bg: #0b0910;
  --ink: #07060a;
  --surface: #15111d;
  --surface-2: #1d1728;
  --line: #2e2541;
  --purple: #8050ed;
  --purple-hi: #9a73f6;
  --purple-deep: #4b2a9c;
  --lilac: #b298ff;
  --text: #f5f1fc;
  --muted: #b5a9c9;
  --dim: #7d7191;
  --danger: #ff7a98;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 500 15px/1.45 var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* Fondo ambiental (solo visible en pantallas anchas) */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 12% 18%, rgba(128, 80, 237, .22), transparent 60%),
    radial-gradient(50vmax 45vmax at 88% 85%, rgba(178, 152, 255, .12), transparent 60%),
    var(--ink);
}

/* ---------- Marco de la app ---------- */
.app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  width: 100%; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 700px) {
  .app { height: calc(100dvh - 32px); margin-top: 16px; border-radius: 28px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(128,80,237,.08); }
}

.stage { position: relative; min-height: 0; overflow: hidden; }
.view { position: absolute; inset: 0; }
.view-page { overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 28px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.logo {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--purple); color: #fff;
  font: 800 15px/1 var(--font-display); letter-spacing: -.02em;
  box-shadow: 0 6px 18px rgba(128, 80, 237, .45), inset 0 1px 0 rgba(255,255,255,.25);
}
.logo-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 24px; }
.brand-text { font: 800 12px/1.1 var(--font-display); letter-spacing: .06em; }
.brand-text span { color: var(--lilac); }
.brand-text-lg { font-size: 15px; }

/* ---------- Barra superior del feed ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 28px;
  background: linear-gradient(to bottom, rgba(7,6,10,.7), transparent);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.topbar-tab {
  font-weight: 800; font-size: 15px; position: relative; padding-bottom: 6px;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.topbar-tab::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 0; height: 3px; border-radius: 3px; background: var(--lilac); }

.sound-hint {
  position: absolute; z-index: 6; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid rgba(178,152,255,.35);
  background: rgba(21, 17, 29, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-weight: 700; font-size: 13px; white-space: nowrap;
  animation: hint-in .5s .8s both cubic-bezier(.2,.8,.2,1);
}
.sound-hint svg { width: 18px; height: 18px; color: var(--lilac); }
@keyframes hint-in { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ---------- Feed vertical ---------- */
.feed {
  height: 100%; overflow-y: scroll; overflow-x: hidden;
  scroll-snap-type: y mandatory; overscroll-behavior-y: contain;
  scrollbar-width: none; outline: none;
  background: var(--ink);
}
.feed::-webkit-scrollbar { display: none; }

.slide {
  position: relative; height: 100%; width: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; background: var(--ink);
  isolation: isolate;
}
.slide-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: var(--ink);
}
.slide.is-landscape .slide-video { object-fit: contain; }
.slide::after { /* degradado inferior para legibilidad */
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(7,6,10,.85), rgba(7,6,10,.35) 55%, transparent);
}
.tap-layer { position: absolute; inset: 0; z-index: 2; background: none; border: 0; padding: 0; cursor: pointer; }
.tap-layer:focus-visible { outline-offset: -4px; }

.play-badge {
  position: absolute; z-index: 3; left: 50%; top: 50%; translate: -50% -50%;
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(7,6,10,.45); backdrop-filter: blur(6px);
  opacity: 0; scale: .7; transition: opacity .2s, scale .25s cubic-bezier(.2,.9,.3,1.4);
  pointer-events: none;
}
.play-badge svg { width: 36px; height: 36px; fill: #fff; stroke: none; margin-left: 4px; }
.slide.is-paused .play-badge { opacity: 1; scale: 1; }

.loader {
  position: absolute; z-index: 3; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%; border: 3px solid rgba(178,152,255,.2); border-top-color: var(--lilac);
  animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.slide.is-buffering .loader { opacity: 1; transition-delay: .35s; }
@keyframes spin { to { rotate: 360deg; } }

.slide-error {
  position: absolute; z-index: 3; inset: 0; display: none; place-content: center; text-align: center; gap: 8px; color: var(--muted); padding: 24px;
}
.slide.has-error .slide-error { display: grid; }
.slide.has-error .loader { display: none; }

/* Información del video */
.meta {
  position: absolute; z-index: 4; left: 14px; right: 84px; bottom: 18px;
  text-shadow: 0 1px 6px rgba(0,0,0,.55);
}
.meta-user { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 0; font-weight: 800; font-size: 16px; }
.meta-user:hover { text-decoration: underline; text-underline-offset: 3px; }
.meta-views { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; color: rgba(245,241,252,.82); font-size: 12.5px; font-weight: 700; vertical-align: middle; }
.meta-views svg { width: 14px; height: 14px; }
.meta-date { color: rgba(245,241,252,.7); font-weight: 600; font-size: 13px; margin-left: 6px; }
.meta-desc {
  margin: 6px 0 0; font-size: 14.5px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta.is-open .meta-desc { -webkit-line-clamp: unset; display: block; max-height: 40vh; overflow-y: auto; }
.meta-more { background: none; border: 0; padding: 2px 0 0; color: #fff; font-weight: 800; font-size: 13.5px; opacity: .85; }
.tag { background: none; border: 0; padding: 0; font-weight: 800; color: #fff; }
.tag:hover { color: var(--lilac); }

/* Columna de acciones */
.rail {
  position: absolute; z-index: 4; right: 8px; bottom: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.rail-avatar { position: relative; margin-bottom: 8px; }
.rail-avatar-btn { display: block; background: none; border: 0; padding: 0; border-radius: 50%; }
.rail-avatar .avatar { width: 48px; height: 48px; font-size: 18px; border: 2px solid #fff; }
.rail-follow {
  position: absolute; left: 50%; bottom: -9px; translate: -50% 0;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: var(--purple); color: #fff; border: 0; transition: transform .15s, background .2s;
}
.rail-follow:hover { background: var(--purple-hi); }
.rail-follow:active { transform: scale(.85); }
.rail-follow svg { width: 12px; height: 12px; stroke-width: 3; }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 0; color: #fff;
  font-weight: 800; font-size: 12.5px; text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.act .ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(21,17,29,.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .15s, background .2s;
}
.act .ic svg { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.act:active .ic { transform: scale(.88); }
.act:hover .ic { background: rgba(128,80,237,.35); }
.act-like[aria-pressed="true"] .ic svg { fill: var(--lilac); stroke: var(--lilac); animation: pop .35s cubic-bezier(.2,.9,.3,1.6); }
.act-like[aria-pressed="true"] { color: var(--lilac); }
.act-sound .ic, .act-more .ic { width: 40px; height: 40px; }
.act-more .ic svg { width: 22px; height: 22px; }
.act-sound .ic svg { width: 22px; height: 22px; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

.progress { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.14); }
.progress span { display: block; height: 100%; background: var(--lilac); transform-origin: 0 50%; transform: scaleX(0); }

/* Corazón de doble toque */
.burst {
  position: absolute; z-index: 6; width: 110px; height: 110px; margin: -55px 0 0 -55px; pointer-events: none;
  color: var(--lilac); animation: burst .85s cubic-bezier(.2,.8,.2,1) forwards;
}
.burst svg { width: 100%; height: 100%; fill: currentColor; stroke: none; filter: drop-shadow(0 8px 24px rgba(128,80,237,.7)); }
@keyframes burst {
  0% { opacity: 0; transform: scale(.3) rotate(var(--r, -12deg)); }
  20% { opacity: 1; transform: scale(1.15) rotate(var(--r, -12deg)); }
  45% { transform: scale(.95) rotate(var(--r, -12deg)); }
  100% { opacity: 0; transform: translateY(-90px) scale(1.3) rotate(var(--r, -12deg)); }
}

/* Esqueleto de carga */
.slide.skeleton { background: linear-gradient(160deg, #15111d, #0d0a13); }
.skeleton .sk { position: absolute; border-radius: 10px; background: linear-gradient(90deg, #1d1728 0%, #2a2139 50%, #1d1728 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Estado vacío / error del feed */
.feed-empty {
  height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 32px;
}
.feed-empty .glyph { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--surface-2); color: var(--lilac); border: 1px solid var(--line); }
.feed-empty .glyph svg { width: 38px; height: 38px; }
.feed-empty h2 { margin: 6px 0 0; font: 800 19px/1.2 var(--font-display); }
.feed-empty p { margin: 0; color: var(--muted); max-width: 30ch; }

/* ---------- Avatar ---------- */
.avatar {
  display: grid; place-items: center; border-radius: 50%; flex: none;
  width: 40px; height: 40px; font: 800 15px/1 var(--font-display); color: #fff; text-transform: uppercase;
  background: linear-gradient(135deg, hsl(var(--h, 262) 78% 62%), hsl(calc(var(--h, 262) + 28) 70% 34%));
}
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-xl { width: 96px; height: 96px; font-size: 34px; box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--purple); }

/* ---------- Menú inferior ---------- */
.tabbar {
  position: relative; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--ink); border-top: 1px solid #1b1623;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .01em;
  transition: color .2s;
}
.tab svg { width: 25px; height: 25px; }
.tab.is-active { color: #fff; }
.tab.is-active svg { stroke-width: 2.4; }
.tab.is-active[data-view="home"] svg { fill: currentColor; }
.tab:hover { color: var(--text); }
.tab-publish i {
  display: grid; place-items: center; width: 50px; height: 32px; border-radius: 10px;
  background: var(--purple); color: #fff;
  box-shadow: -4px 0 0 var(--lilac), 4px 0 0 var(--purple-deep);
  transition: transform .15s;
}
.tab-publish i svg { width: 22px; height: 22px; stroke-width: 3; }
.tab-publish:active i { transform: scale(.92); }
.tab-publish span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Reproductor superpuesto ---------- */
.player { position: absolute; inset: 0; z-index: 8; background: var(--ink); animation: slide-in .28s cubic-bezier(.2,.8,.2,1); }
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }
.player-bar {
  position: absolute; z-index: 6; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 10px 26px;
  background: linear-gradient(to bottom, rgba(7,6,10,.7), transparent);
  font-weight: 800; pointer-events: none;
}
.player-bar > * { pointer-events: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(21,17,29,.55); border: 0; color: #fff;
}
.icon-btn:hover { background: rgba(128,80,237,.35); }

/* ---------- Páginas (Buscar / Perfil) ---------- */
.search-bar {
  position: sticky; top: -18px; z-index: 2; margin: -18px -16px 14px; padding: 18px 16px 12px;
  display: flex; align-items: center; gap: 10px; background: var(--bg);
}
.search-bar svg { position: absolute; left: 30px; width: 20px; height: 20px; color: var(--dim); pointer-events: none; }
.search-bar input {
  width: 100%; padding: 13px 14px 13px 44px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); outline: none;
}
.search-bar input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(128,80,237,.25); }
.search-bar input::placeholder { color: var(--dim); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips:empty { display: none; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: 13px; color: var(--text);
}
.chip b { color: var(--lilac); }
.chip:hover { border-color: var(--purple); }

.users-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.user-pill { display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0; width: 72px; font-size: 12px; font-weight: 700; }
.user-pill .avatar { width: 60px; height: 60px; font-size: 22px; }
.user-pill span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.section-title { margin: 6px 0 12px; font: 800 14px/1 var(--font-display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 -16px; }
.tile {
  position: relative; aspect-ratio: 9 / 16; padding: 0; border: 0; overflow: hidden; background: var(--surface-2);
}
.tile video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tile::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(to top, rgba(7,6,10,.8), transparent); }
.tile-stat { position: absolute; z-index: 1; left: 7px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 12px; }
.tile-stat svg { width: 14px; height: 14px; }
.tile:hover video { scale: 1.04; transition: scale .4s; }
.grid-empty { grid-column: 1 / -1; padding: 36px 20px; text-align: center; color: var(--muted); }
.grid-empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.tile.sk { animation: shimmer 1.3s infinite linear; background: linear-gradient(90deg, #1d1728 0%, #2a2139 50%, #1d1728 100%); background-size: 200% 100%; }

/* Autenticación */
.auth { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 10px 6px 20px; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.auth-title { margin: 0 0 8px; font: 800 clamp(26px, 7vw, 32px)/1.1 var(--font-display); letter-spacing: -.02em; }
.auth-title em { font-style: normal; color: var(--lilac); }
.auth-sub { margin: 0 0 24px; color: var(--muted); }
.auth-form { display: grid; gap: 12px; }

.field { display: grid; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.field > span { display: flex; justify-content: space-between; }
.field small { color: var(--dim); font-weight: 600; }
.field input, .field textarea, .prefixed {
  width: 100%; padding: 13px 14px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--text); font-weight: 500; font-size: 15px; outline: none; resize: vertical;
}
.field input:focus, .field textarea:focus, .prefixed:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(128,80,237,.25); }
.prefixed { display: flex; align-items: center; gap: 4px; }
.prefixed b { color: var(--lilac); }
.prefixed input { border: 0; padding: 0; background: none; box-shadow: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 18px; border-radius: 14px; border: 0;
  font-weight: 800; font-size: 15px; transition: transform .12s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 10px 24px -10px rgba(128,80,237,.8); }
.btn-primary:hover { background: var(--purple-hi); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--purple); }
.btn-soft { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); padding: 11px 16px; }
.btn-soft:hover { border-color: var(--purple); }
.form-status { margin: 4px 0 0; min-height: 1.2em; font-size: 14px; color: var(--muted); }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--lilac); }
.hint { color: var(--dim); font-size: 12.5px; }
.row { display: flex; gap: 10px; }

/* Perfil */
.profile-head { display: grid; justify-items: center; text-align: center; padding: 18px 0 22px; }
.profile-name { margin: 16px 0 2px; font: 800 20px/1.2 var(--font-display); overflow-wrap: anywhere; }
.profile-mail { margin: 0; color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.profile-stats { display: flex; gap: 22px; margin: 18px 0; }
.profile-stats div { display: grid; }
.profile-stats dd { margin: 0; order: -1; font: 800 19px/1.2 var(--font-display); }
.profile-stats dt { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.profile-actions { display: flex; gap: 8px; }
.profile-actions .btn { width: auto; }
.admin-link { width: auto; margin-top: 12px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.suspended-note { margin: 12px 0 0; padding: 10px 14px; border: 1px solid rgba(255, 122, 152, .4); border-radius: 12px; background: rgba(255, 122, 152, .08); color: var(--danger); font-size: 13px; text-align: center; max-width: 340px; }
.edit-form { display: grid; gap: 10px; width: 100%; margin-top: 18px; text-align: left; }

/* ---------- Hojas inferiores (diálogos) ---------- */
.sheet {
  padding: 0; border: 0; margin: auto auto 0; width: 100%; max-width: 480px;
  max-height: 72dvh; height: 72dvh; background: transparent; color: var(--text); overflow: visible;
}
.sheet-tall { height: auto; max-height: 92dvh; }
.sheet::backdrop { background: rgba(7,6,10,.55); backdrop-filter: blur(2px); }
.sheet[open] .sheet-inner { animation: sheet-up .3s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet-inner {
  height: 100%; max-height: inherit; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b);
}
.sheet-head {
  position: relative; display: flex; align-items: center; justify-content: center;
  padding: 18px 16px 12px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: 15px; font-weight: 800; }
.sheet-head .icon-btn { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; background: var(--surface-2); }
.sheet-head .icon-btn svg { width: 18px; height: 18px; }
.grabber { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line); }

.comments { list-style: none; margin: 0; padding: 8px 16px; flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.comment { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 10px 0; animation: fade-in .3s both; }
.comment .avatar { width: 36px; height: 36px; font-size: 13px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.comment-head b { color: var(--muted); font-weight: 800; }
.comment-head time { color: var(--dim); font-size: 12px; }
.comment p { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-line; }
.comment-del { margin-left: auto; background: none; border: 0; padding: 0; color: var(--dim); font-size: 12px; font-weight: 700; }
.comment-del:hover { color: var(--danger); }
.comments-empty { display: grid; place-items: center; text-align: center; gap: 6px; height: 100%; color: var(--muted); padding: 20px; }
.comments-empty b { color: var(--text); font-size: 16px; }
.comment.sk { grid-template-columns: 36px 1fr; }
.comment.sk span { height: 36px; border-radius: 50%; }
.comment.sk div { height: 32px; border-radius: 8px; }
.comment.sk span, .comment.sk div { background: linear-gradient(90deg, #1d1728 0%, #2a2139 50%, #1d1728 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }

.comment-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.comment-form input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); outline: none; }
.comment-form input:focus { border-color: var(--purple); }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--purple); color: #fff; }
.send:disabled { opacity: .5; }
.send svg { width: 20px; height: 20px; }
.comment-login { margin: 10px 12px 12px; width: auto; }

/* Publicar */
.upload { display: grid; gap: 14px; padding: 16px; overflow-y: auto; }
.drop {
  position: relative; display: grid; place-items: center; aspect-ratio: 9 / 12; max-height: 46dvh; width: 100%;
  border-radius: var(--radius); border: 2px dashed var(--line); background: var(--surface-2); overflow: hidden; cursor: pointer;
  transition: border-color .2s;
}
.drop:hover, .drop:focus-within { border-color: var(--purple); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2; }
.drop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--ink); }
.drop-empty { display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); padding: 16px; }
.drop-empty svg { width: 44px; height: 44px; color: var(--lilac); margin-bottom: 4px; }
.drop-empty b { color: var(--text); font-size: 16px; }
.drop-change { position: absolute; z-index: 1; bottom: 10px; padding: 7px 12px; border-radius: 999px; background: rgba(7,6,10,.7); font-weight: 700; font-size: 13px; }
.upload-progress { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.upload-progress span { display: block; height: 100%; width: 40%; background: var(--lilac); border-radius: 4px; animation: indeterminate 1.1s infinite ease-in-out; }
@keyframes indeterminate { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px);
  max-width: min(90vw, 420px); padding: 11px 16px; border-radius: 14px;
  background: #f5f1fc; color: #1a1324; font-weight: 700; font-size: 14px; text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.noscript { position: fixed; inset: auto 0 50%; text-align: center; z-index: 200; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Foto de perfil editable ---------- */
.avatar-edit { position: relative; display: inline-block; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; -webkit-user-select: none; user-select: none; }
.avatar-edit:focus-visible, label.btn:focus-visible { outline: 2px solid var(--purple-hi); outline-offset: 3px; }
label.btn { cursor: pointer; -webkit-user-select: none; user-select: none; }
.avatar-edit.is-busy, label.btn.is-busy { pointer-events: none; cursor: progress; }
label.btn.is-busy { opacity: .55; }
/* Selector de archivos invisible pero presente (no display:none, que algunos navegadores móviles ignoran) */
.file-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; }
.avatar-edit i {
  position: absolute; right: -2px; bottom: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--purple); color: #fff; border: 3px solid var(--bg);
}
.avatar-edit i svg { width: 16px; height: 16px; }
.avatar-edit:hover i { background: var(--purple-hi); }
.avatar-edit.is-busy .avatar { opacity: .5; }
.avatar-edit.is-busy i { animation: spin 1s linear infinite; }

/* ---------- Perfil de otro usuario ---------- */
.userpage { position: absolute; inset: 0; z-index: 7; background: var(--bg); animation: slide-in .28s cubic-bezier(.2,.8,.2,1); }
.userpage .player-bar { background: linear-gradient(to bottom, var(--bg) 55%, transparent); padding-bottom: 14px; }
.userpage-body { position: absolute; inset: 0; padding-top: 52px; }
.btn-follow { min-width: 160px; }
.btn-follow.is-following { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn-follow.is-following:hover { border-color: var(--purple); background: var(--surface-2); }
.profile-stats dd.sk { color: transparent; border-radius: 6px; background: var(--surface-2); min-width: 24px; }

/* ---------- Opciones / reportar ---------- */
.sheet-menu { display: grid; padding: 8px 10px 14px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 12px; border: 0; border-radius: 12px;
  background: none; text-align: left; font-weight: 700;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 22px; height: 22px; color: var(--lilac); }
.menu-item.is-danger, .menu-item.is-danger svg { color: var(--danger); }
.report-hint { margin: 0; }
.reasons { display: grid; gap: 6px; }
.reasons label {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; font-weight: 700; font-size: 14px;
}
.reasons label:has(input:checked) { border-color: var(--purple); background: rgba(128,80,237,.16); }
.reasons input { accent-color: var(--purple); width: 18px; height: 18px; margin: 0; flex: none; }
.comment-user { background: none; border: 0; padding: 0; color: inherit; text-align: left; }
.comment > .comment-user { border-radius: 50%; align-self: start; }
