
/* FIX V3.1: permite ocultar correctamente el age gate.
   En V3, .age-gate tenía display:grid y anulaba el atributo hidden. */
[hidden] { display: none !important; }
.age-gate.is-hidden { display: none !important; }

:root {
  --bg: #0b0d14;
  --panel: #141827;
  --panel2: #1b2133;
  --text: #f7f7fb;
  --muted: #a5acc3;
  --soft: rgba(255,255,255,.08);
  --line: rgba(255,255,255,.12);
  --accent: #ff3d71;
  --accent2: #7c5cff;
  --ok: #18c37e;
  --warn: #ffbd2e;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0,0,0,.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, rgba(124,92,255,.22), transparent 34rem), radial-gradient(circle at top right, rgba(255,61,113,.18), transparent 32rem), var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px clamp(16px, 3vw, 38px);
  background: rgba(11,13,20,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.logo-badge, .brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-weight: 900; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 10px 30px rgba(255,61,113,.25);
}
.logo small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.main-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.main-nav a, .lang-menu button, .chip, .server-btn, .btn, .mini-filter button {
  border: 1px solid var(--line); background: rgba(255,255,255,.055); color: var(--text);
  border-radius: 999px; padding: 9px 13px; cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.main-nav a:hover, .lang-menu button:hover, .chip:hover, .server-btn:hover, .btn:hover, .mini-filter button:hover { transform: translateY(-1px); background: rgba(255,255,255,.1); }
.lang-menu { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: 360px; }
.lang-menu button { padding: 6px 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.lang-menu img, .flag-img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; background: rgba(0,0,0,.35); }

.app-shell { width: min(1280px, calc(100vw - 28px)); margin: 28px auto 46px; }
.hero { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; align-items: stretch; margin-bottom: 24px; }
.hero-card, .side-card, .panel { background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-card { padding: clamp(22px, 4vw, 44px); overflow: hidden; position: relative; }
.hero-card:after { content: ""; position: absolute; inset: auto -20% -70% 45%; height: 360px; background: radial-gradient(circle, rgba(255,61,113,.35), transparent 68%); pointer-events: none; }
.eyebrow { color: var(--accent); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 8px 0 12px; font-size: clamp(32px, 5vw, 68px); line-height: .98; letter-spacing: -.04em; }
.hero p, .panel p, .video-plot { color: var(--muted); line-height: 1.65; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; font-weight: 800; }
.btn.ghost { background: transparent; }
.side-card { padding: 22px; display: grid; gap: 14px; align-content: center; }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: rgba(255,255,255,.055); padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); }
.stat span { color: var(--muted); }
.stat strong { font-size: 20px; }

.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin: 18px 0; }
.search { width: 100%; border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.06); border-radius: 999px; padding: 13px 16px; outline: none; }
.search:focus { border-color: rgba(255,61,113,.7); }
.mini-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-filter button.active, .chip.active { background: linear-gradient(135deg, rgba(255,61,113,.88), rgba(124,92,255,.85)); border-color: transparent; font-weight: 800; }

.section-title { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 30px 0 14px; }
.section-title h2 { margin: 0; font-size: clamp(22px, 3vw, 34px); }
.section-title p { margin: 4px 0 0; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 18px; }
.card { background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .16s ease, border-color .16s ease; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,61,113,.45); }
.cover-wrap { position: relative; overflow: hidden; background: #0f1320; }
.cover-wrap.scene { aspect-ratio: 16/9; }
.cover-wrap.movie { aspect-ratio: 2/3; }
.cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.fallback { display: grid; place-items: center; background: linear-gradient(135deg, #22283a, #1b1026); color: rgba(255,255,255,.7); min-height: 100%; }
.flag-bar { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 5px; align-items: center; flex-wrap: nowrap; z-index: 3; pointer-events: none; }
[dir="rtl"] .flag-bar { left: 8px; right: 8px; }
.flag-bar img, .flag-more, .lang-badge { width: 25px; height: 25px; border-radius: 50%; background: rgba(0,0,0,.58); padding: 2px; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.flag-more { width: auto; min-width: 25px; color: #fff; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; font-weight: 900; font-size: 12px; }
.studio-badge { position: absolute; top: 8px; right: 8px; z-index: 4; max-width: 46%; display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; background: rgba(0,0,0,.58); backdrop-filter: blur(8px); font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[dir="rtl"] .studio-badge { right: auto; left: 8px; }
.studio-badge img { width: 18px; height: 18px; object-fit: contain; border-radius: 4px; }
.quality-badge { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.12); border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 900; }
.card-body { padding: 13px 14px 15px; }
.card h3 { margin: 0 0 8px; font-size: 15px; line-height: 1.35; }
.meta { color: var(--muted); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.tags { margin-top: 11px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 8px; font-size: 11px; cursor: default; }
.empty { padding: 30px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

.video-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr); gap: 22px; align-items: start; }
.player-shell { background: #05060a; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.player-placeholder { aspect-ratio: 16/9; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; background: radial-gradient(circle, rgba(255,61,113,.18), transparent 50%), #090b12; }
.player-shell iframe { display: block; width: 100%; aspect-ratio: 16/9; height: auto; border: 0; background: #000; }
.server-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 20px; }
.server-btn.active { background: linear-gradient(135deg, rgba(255,61,113,.88), rgba(124,92,255,.85)); border-color: transparent; font-weight: 800; }
.video-title { font-size: clamp(28px, 4vw, 48px); margin: 0 0 10px; letter-spacing: -.035em; }
.info-list { display: grid; gap: 10px; margin-top: 14px; }
.info-item { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.info-item span:first-child { color: var(--muted); }
.lang-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.lang-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: rgba(255,255,255,.06); padding: 8px 10px; border-radius: 999px; }

.premium-card { padding: clamp(22px, 4vw, 38px); }
.premium-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin-top: 20px; }
.premium-feature { padding: 18px; background: rgba(255,255,255,.055); border: 1px solid var(--line); border-radius: 16px; }

.age-gate { position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; padding: 24px; background: rgba(5,6,10,.94); backdrop-filter: blur(14px); }
.age-card { width: min(460px, 100%); text-align: center; padding: 34px; border-radius: 26px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); }
.age-card .brand-mark { margin: 0 auto 10px; }
.age-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.footer { width: min(1280px, calc(100vw - 28px)); margin: 0 auto 34px; color: var(--muted); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 22px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer a { color: var(--text); }

@media (max-width: 900px) {
  .hero, .video-layout, .toolbar { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-wrap: wrap; }
  .main-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .lang-menu { margin-left: auto; }
}
@media (max-width: 520px) {
  .app-shell { width: min(100vw - 18px, 1280px); margin-top: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .card h3 { font-size: 13px; }
  .studio-badge { display: none; }
  .flag-bar img, .flag-more { width: 21px; height: 21px; }
}
