:root {
  --fondo: #0b0b0f;
  --panel: #15151c;
  --linea: #262631;
  --texto: #f2f2f5;
  --suave: #9a9aab;
  --acento: #ff2d6f;
  --acento-2: #25e3d0;
  --barra: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
img { display: block; max-width: 100%; }

/* ---- Barra ---- */
.barra { position: fixed; inset: 0 0 auto 0; height: var(--barra); z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: linear-gradient(#0b0b0fe6, #0b0b0f00); }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.02em; text-decoration: none;
  background: linear-gradient(90deg, var(--acento), var(--acento-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.barra nav { display: flex; gap: 4px; margin-left: auto; }
.barra nav a { text-decoration: none; padding: 6px 12px; border-radius: 99px; color: var(--suave); font-weight: 600; font-size: 14px; }
.barra nav a.on { color: var(--texto); background: #ffffff1a; }

/* ---- Feed ---- */
.es-feed { overflow: hidden; }
.feed { height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.feed-titulo { position: fixed; top: calc(var(--barra) + 4px); left: 50%; transform: translateX(-50%); z-index: 15; font-weight: 700;
  padding: 4px 12px; border-radius: 99px; background: #0009; font-size: 13px; }
.es-feed .pie { display: none; }
.slide { position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center;
  background: radial-gradient(120% 80% at 50% 40%, color-mix(in srgb, var(--c) 45%, #000) 0%, #000 70%); }
.marco { position: relative; height: 100dvh; width: min(100vw, calc(100dvh * 9 / 16)); background: #000 center / cover no-repeat;
  overflow: hidden; }
.marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Medidas del reproductor de RedGifs (/ifr/): logo arriba a la izquierda (~130x40 px), columna de
   botones abajo a la derecha (ver, SONIDO, compartir, SD, pantalla completa: ~60x290 px) y barra
   con su usuario abajo a la izquierda (~64 px). Tapamos logo y barra; su columna queda libre. */
.marca { position: absolute; top: 0; left: 0; z-index: 6; padding: 10px 18px 10px 14px; background: #000; border-bottom-right-radius: 16px;
  font: 900 26px/1 system-ui, sans-serif; letter-spacing: -.03em; color: #fff; text-decoration: none; min-width: 58%; }
.marca span { color: var(--acento); }
.velo { position: absolute; inset: 0; z-index: 2;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 300px), calc(100% - 66px) calc(100% - 300px), calc(100% - 66px) 100%, 0 100%); }
.quien { position: absolute; left: 0; bottom: 0; z-index: 6; width: calc(100% - 66px); height: 88px; padding: 18px 12px 0;
  display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; color: #fff;
  background: linear-gradient(to top, #000 0%, #000 82%, #0000 100%); }
.quien .ruta { color: #cfcfd8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quien .ruta b { color: #fff; }
.info { position: absolute; left: 12px; bottom: 94px; z-index: 5; width: calc(100% - 90px); text-shadow: 0 1px 3px #000c; pointer-events: none; }
.info a, .info .chip { pointer-events: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.tag { color: #ddd; }
.acciones { position: absolute; right: 8px; bottom: 310px; z-index: 5; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.acc { display: flex; flex-direction: column; align-items: center; gap: 2px; color: #fff; background: none; border: 0; cursor: pointer;
  text-decoration: none; font: inherit; text-shadow: 0 1px 3px #000c; }
.acc i { font-style: normal; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: #0006;
  backdrop-filter: blur(6px); }
.acc small { font-size: 12px; font-weight: 600; }
.acc.of i { background: var(--acento); }
/* En el feed la marca del vídeo hace de logo: la barra solo lleva la navegación. */
.es-feed .barra { background: none; pointer-events: none; }
.es-feed .barra .logo { visibility: hidden; }
.es-feed .barra nav { pointer-events: auto; }
@media (max-height: 560px) { .acciones { bottom: auto; top: 70px; } }

/* ---- Avatares y chips ---- */
.av { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; overflow: hidden; font-weight: 800;
  background: hsl(var(--h, 330) 70% 45%); color: #fff; border: 2px solid #fff3; }
.av img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.av-xl { width: 168px; height: 168px; font-size: 64px; border-width: 3px; }
.chip { display: inline-block; text-decoration: none; padding: 3px 10px; border-radius: 99px; background: #ffffff22; font-size: 13px; font-weight: 600;
  backdrop-filter: blur(6px); }
.chip:hover { background: var(--acento); }

/* ---- Páginas normales ---- */
.pagina { max-width: 980px; margin: 0 auto; padding: calc(var(--barra) + 16px) 16px 40px; }
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.1; margin: 8px 0 8px; letter-spacing: -.02em; }
.intro { color: var(--suave); margin: 0 0 16px; max-width: 60ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chips .chip { background: var(--panel); border: 1px solid var(--linea); }

.ranking { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fila { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--linea);
  text-decoration: none; }
.fila:hover { border-color: var(--acento); }
.pos { width: 28px; text-align: right; color: var(--suave); font-weight: 700; font-variant-numeric: tabular-nums; }
.datos { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.datos b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datos small, .cifras small { color: var(--suave); font-size: 12px; }
.cifras { display: flex; gap: 18px; text-align: right; }
.cifras > span { display: flex; flex-direction: column; min-width: 64px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cifras > span:nth-child(n+2) { display: none; }
  .fila { padding: 10px; gap: 10px; }
  .pos { width: 20px; }
}

/* ---- Perfil ---- */
.cab-perfil { display: flex; gap: 20px; align-items: center; margin-bottom: 14px; }
.cab-perfil h1 { margin: 0; }
.ok { color: var(--acento-2); font-size: .6em; vertical-align: middle; }
.arroba { color: var(--suave); margin: 2px 0 8px; }
.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; color: var(--suave); font-size: 14px; }
.stats b { color: var(--texto); }
.botones { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 99px; background: var(--acento); color: #fff; text-decoration: none; font-weight: 700; }
.btn-2 { background: var(--panel); border: 1px solid var(--linea); }
.bio { color: #cfcfd8; max-width: 70ch; }
.ficha { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ficha div { background: var(--panel); border: 1px solid var(--linea); border-radius: 10px; padding: 6px 12px; }
.ficha dt { font-size: 11px; color: var(--suave); text-transform: uppercase; letter-spacing: .05em; }
.ficha dd { margin: 0; font-weight: 600; }
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 10px; }
.celda { position: relative; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; text-decoration: none; display: grid; place-items: center;
  background-color: #111; background-image: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, #ff2d6f) 0%, #111 100%);
  background-size: cover; background-position: center; }
/* Sombra para que se lean las cifras sobre la miniatura. */
.celda::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(#0000, #000b); }
.celda > * { z-index: 1; }
.play { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #0007; font-size: 18px; }
.celda:hover .play { background: var(--acento); }
.pie-celda { position: absolute; inset: auto 8px 6px 8px; display: flex; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 700;
  text-shadow: 0 1px 2px #000; }
.tags-celda { position: absolute; inset: 8px 8px auto 8px; font-size: 11px; color: #fffc; text-shadow: 0 1px 2px #000; }
@media (max-width: 520px) {
  .rejilla { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .cab-perfil { gap: 14px; }
  .av-xl { width: 116px; height: 116px; font-size: 44px; }
}

/* ---- Pie, edad, toast ---- */
.pie { border-top: 1px solid var(--linea); color: var(--suave); font-size: 13px; padding: 18px 16px 30px; text-align: center; }
.pie p { margin: 4px auto; max-width: 70ch; }
.rta { opacity: .6; }
.edad { position: fixed; inset: 0; z-index: 100; background: #000e; display: grid; place-items: center; padding: 16px; }
.edad[hidden] { display: none; }
.edad-caja { max-width: 380px; background: var(--panel); border: 1px solid var(--linea); border-radius: 18px; padding: 24px; text-align: center; }
.edad-caja button { width: 100%; padding: 12px; border: 0; border-radius: 99px; background: var(--acento); color: #fff; font-weight: 800; font-size: 16px;
  cursor: pointer; margin: 6px 0 10px; }
.edad-caja a { color: var(--suave); font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 50; background: #fff; color: #000; padding: 8px 16px;
  border-radius: 99px; font-weight: 700; }
