/* tubehot dark theme — genérico, sin imitar marcas registradas */
:root {
  --bg: #0f0f12;
  --bg2: #18181d;
  --card: #1f1f26;
  --line: #2c2c35;
  --text: #e8e8ec;
  --muted: #9a9aa5;
  --accent: #e85d2f;
  --accent2: #ff8a5c;
  --ok: #3fb96b;
  --danger: #e5484d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }

body.locked { overflow: hidden; }

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg2); border-bottom: 1px solid var(--line);
  padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: .5px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); display: inline-block; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12px; }

nav.cats { display: flex; gap: 4px; flex-wrap: wrap; order: 3; width: 100%; }
nav.cats a {
  color: var(--muted); font-size: 13px; padding: 6px 10px; border-radius: 6px;
}
nav.cats a.active, nav.cats a:hover { background: var(--card); color: var(--text); text-decoration: none; }

nav.cats .nav-toggle { display: none; }

.search { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search input {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 7px 12px; border-radius: 6px; width: 200px; font-size: 13px;
}
.search input:focus { outline: none; border-color: var(--accent); }

main { max-width: 1280px; margin: 0 auto; padding: 16px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.toolbar h1 { font-size: 22px; }
.toolbar .count { color: var(--muted); font-size: 13px; }

select {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 7px 10px; border-radius: 6px; font-size: 13px;
}

/* ---------- grid de videos ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px;
}
.card {
  cursor: pointer; border-radius: 10px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .12s, border-color .12s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card .thumb { position: relative; aspect-ratio: 16/9; background: #000; flex: 0 0 auto; overflow: hidden; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card .dur {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,.78); color: #fff; font-size: 11px;
  padding: 2px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.card-body { display: flex; flex-direction: column; padding: 10px 12px 8px; flex: 1 1 auto; }
.card .title {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2 * 1.35em; word-break: break-word;
}
.card .meta { margin-top: 6px; color: var(--muted); font-size: 11px; }

/* ---------- tarjeta publicitaria (aspecto de video-card) ---------- */
.card.ad-card { cursor: pointer; background: repeating-linear-gradient(45deg, #232330, #232330 10px, #262634 10px, #262634 20px); border-style: dashed; border-color: #3a3a48; }
.card.ad-card:hover { transform: none; border-color: #3a3a48; }
.ad-thumb { aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; }
.ad-inner { display: flex; flex-direction: column; gap: 8px; align-items: center; color: var(--muted); }
.ad-inner b { font-size: 22px; letter-spacing: 2px; color: #cfcfd8; }
.ad-inner em { font-style: normal; font-size: 12px; text-align: center; padding: 0 10px; }
.ad-title { color: var(--muted); font-weight: 600; justify-content: center; display: flex; min-height: 0; -webkit-line-clamp: 1; }

/* ---------- banners publicitarios (entre contenidos) ---------- */
.ad-banner {
  grid-column: 1 / -1;
  border-radius: 10px; border: 1px dashed #3a3a48;
  background: #191922;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted); position: relative; overflow: hidden;
}
.ad-banner-leader { min-height: 90px; }
.ad-banner-mobile { min-height: 50px; }
.ad-banner .ad-tag {
  position: absolute; top: 6px; left: 8px; font-size: 10px;
  color: #8a8a96; letter-spacing: 1px; text-transform: uppercase;
}
.ad-banner .ad-label { font-size: 13px; }

/* ---------- watch page ---------- */
.watch-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.watch-main { min-width: 0; }
.watch-side { display: flex; flex-direction: column; gap: 16px; }
.watch-side .ad-slot {
  border: 1px dashed #3a3a48; border-radius: 10px; background: #191922;
  min-height: 250px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; color: var(--muted);
}

.player-wrap { background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; position: relative; aspect-ratio: 16/9; }
.player-wrap iframe { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: 0; display: block; }

.player-meta h1 { font-size: 21px; margin-bottom: 4px; line-height: 1.3; }
.player-meta .mrow { color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0 10px; }
.player-meta .mrow b { color: var(--text); font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
}
.chip:hover { color: var(--accent2); border-color: var(--accent2); text-decoration: none; }

.related h2 { font-size: 15px; margin: 8px 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.pager button {
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager span { color: var(--muted); font-size: 13px; }

.page-content { max-width: 720px; }
.page-content h1 { font-size: 24px; margin-bottom: 16px; }
.page-content h2 { font-size: 17px; margin: 22px 0 8px; color: var(--accent2); }
.page-content p { color: #c6c6ce; line-height: 1.6; margin-bottom: 12px; font-size: 14px; }
.page-content ul { color: #c6c6ce; margin: 0 0 12px 22px; font-size: 14px; line-height: 1.7; }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 16px; color: var(--muted); font-size: 12px; text-align: center; }
footer a { color: var(--muted); margin: 0 8px; }
footer .dmca { margin-top: 8px; font-size: 11px; color: #6f6f7a; max-width: 720px; margin-left: auto; margin-right: auto; }

/* Age gate */
.agegate {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.agegate .box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; max-width: 460px; padding: 36px; text-align: center; }
.agegate h1 { font-size: 20px; margin-bottom: 12px; }
.agegate p { color: var(--muted); font-size: 13px; margin-bottom: 24px; line-height: 1.6; }
.agegate .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { padding: 11px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--line); }

.hidden { display: none !important; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .watch-layout { grid-template-columns: 1fr; }
  .watch-side { flex-direction: row; flex-wrap: wrap; }
  .watch-side .ad-slot { flex: 1 1 240px; min-height: 200px; }
}

@media (max-width: 640px) {
  header { gap: 10px; }
  .brand { font-size: 18px; }
  .search { width: 100%; order: 2; }
  .search input { flex: 1; width: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card-body { padding: 8px 10px 6px; }
  .card .title { font-size: 12px; }
  .toolbar h1 { font-size: 18px; }

  /* Categorías colapsables en móvil */
  nav.cats { display: block; }
  nav.cats .nav-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: var(--card); border: 1px solid var(--line); color: var(--text);
    padding: 9px 12px; border-radius: 6px; font-size: 13px; font-weight: 600;
    cursor: pointer;
  }
  nav.cats .nav-toggle:hover { border-color: var(--accent); }
  nav.cats .nav-caret { color: var(--muted); transition: transform .15s; }
  nav.cats.open .nav-caret { transform: rotate(180deg); }
  nav.cats .nav-list { display: none; flex-wrap: wrap; gap: 4px; padding-top: 8px; }
  nav.cats.open .nav-list { display: flex; }
}