/* NightReel — premium dark theme */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #08080c;
  --surface: #14141c;
  --surface-2: #1b1b25;
  --line: #26262f;
  --line-soft: #1e1e27;
  --text: #f3f1f7;
  --text-dim: #918da3;
  --accent: #ff2e63;
  --accent-2: #ff6b8f;
  --accent-soft: rgba(255, 46, 99, .12);
  --radius: 14px;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(255, 46, 99, .10), transparent 60%),
    radial-gradient(900px 500px at 85% -5%, rgba(120, 80, 255, .08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #23232e; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #34343f; background-clip: content-box; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 34px;
  background: rgba(12, 12, 18, .72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.logo span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.search { flex: 1; display: flex; min-width: 220px; max-width: 620px; }
.search input {
  flex: 1; padding: 11px 18px; font-size: .95rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-right: none;
  border-radius: 999px 0 0 999px; outline: none;
  transition: border-color .2s var(--ease), background .2s;
}
.search input::placeholder { color: #6f6b80; }
.search input:focus { border-color: var(--accent); background: var(--surface-2); }
.search button {
  padding: 11px 22px; border: none; cursor: pointer; font-weight: 600; color: #fff;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border: none; border-radius: 999px; cursor: pointer;
  font-size: .92rem; font-weight: 600; white-space: nowrap; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(255, 46, 99, .28);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(255, 46, 99, .36); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Chips ---------- */
.chips { display: flex; gap: 10px; padding: 20px 34px 4px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  font-size: .84rem; font-weight: 500; color: var(--text-dim);
  background: var(--surface); border: 1px solid var(--line);
  transition: all .18s var(--ease);
}
.chip:hover { color: var(--text); border-color: #3a3a47; transform: translateY(-1px); }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(255, 46, 99, .3);
}

/* ---------- Ad banners ---------- */
.ad-banner {
  display: block; margin: 24px 34px 0; padding: 22px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text-dim); font-size: .88rem;
}
.ad-banner strong { display: block; font-size: .66rem; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 4px; }
.ad-img { display: block; margin: 0 auto; max-width: 100%; height: auto; border-radius: var(--radius); }
.ad-banner.has-ad { padding: 0; border: none; background: none; }
.ad-banner.has-ad .ad-note { display: none; }
a.ad-banner { transition: transform .2s var(--ease), filter .2s; }
a.ad-banner:hover { transform: translateY(-2px); filter: brightness(1.07); }

/* ---------- Section heads ---------- */
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 30px 34px 14px; }
.row-head h2 { font-size: 1.18rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 11px; }
.row-head h2::before {
  content: ""; width: 4px; height: 20px; border-radius: 99px; flex: 0 0 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.count { color: var(--text-dim); font-weight: 400; font-size: .84rem; }
.see-all { color: var(--accent); font-size: .85rem; font-weight: 600; white-space: nowrap; transition: color .18s; }
.see-all:hover { color: var(--accent-2); }
.section-title { padding: 26px 34px 0; font-size: 1.15rem; font-weight: 700; display: flex; gap: 10px; align-items: center; }

/* ---------- Rows & grid ---------- */
.row-section { padding: 2px 0; }
.row { display: flex; gap: 18px; overflow-x: auto; padding: 2px 34px 18px; scroll-snap-type: x proximity; scroll-padding-left: 34px; scroll-behavior: smooth; }
.row .card { flex: 0 0 280px; scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px 20px; padding: 18px 34px 40px; }
.grid-section { padding-bottom: 6px; }
.more-wrap { text-align: center; padding: 4px 34px 54px; }
.more-wrap .btn { padding: 13px 34px; }
.empty-note { padding: 18px 34px; color: var(--text-dim); font-size: .92rem; }

/* ---------- Cards ---------- */
.card { display: block; cursor: pointer; }
.thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-color: #13131a; background-size: cover; background-position: center;
  border: 1px solid var(--line-soft);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.card:hover .thumb { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #33333f; }
.thumb::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent); pointer-events: none;
}
.thumb .play {
  position: relative; z-index: 2; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(10,10,14,.5); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.85);
  transition: opacity .25s var(--ease), transform .25s var(--ease), background .25s;
}
.card:hover .play { opacity: 1; transform: scale(1); background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.thumb .play::after { content: ""; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.thumb .duration {
  position: absolute; right: 9px; bottom: 9px; z-index: 3;
  font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 7px;
  background: rgba(8,8,12,.82); color: #fff;
}
.cat-tag {
  position: absolute; left: 9px; bottom: 9px; z-index: 3;
  font-size: .64rem; font-weight: 600; letter-spacing: .3px; padding: 4px 9px; border-radius: 7px;
  background: rgba(8,8,12,.7); color: #e6e2ee; border: 1px solid rgba(255,255,255,.1);
}
.thumb .badge { position: absolute; top: 9px; left: 9px; z-index: 3; font-size: .6rem; letter-spacing: 1px; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #fff; }
.card-title, .card h3 {
  margin-top: 11px; font-size: .93rem; font-weight: 600; line-height: 1.4;
  white-space: normal; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  transition: color .18s;
}
.card:hover .card-title { color: var(--accent-2); }
.card .meta { margin-top: 5px; font-size: .78rem; color: var(--text-dim); }

.t1 { background: linear-gradient(135deg, #3a2b4d, #1b1529); }
.t2 { background: linear-gradient(135deg, #472336, #241220); }
.t3 { background: linear-gradient(135deg, #22304a, #12192a); }
.t4 { background: linear-gradient(135deg, #432f29, #201612); }
.t5 { background: linear-gradient(135deg, #2a3d36, #13201b); }
.t6 { background: linear-gradient(135deg, #40263c, #1f1122); }

/* ---------- Sponsored cards ---------- */
.ad-card .thumb.ad-thumb { background-size: contain; background-repeat: no-repeat; background-color: #101018; border: 1px solid var(--line); }
.ad-card .thumb.ad-thumb::after { display: none; }
.ad-card .thumb .play { display: none; }
.ad-badge {
  position: absolute; top: 9px; left: 9px; z-index: 3;
  font-size: .6rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* ---------- Age gate ---------- */
.gate-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate {
  max-width: 500px; width: 100%; text-align: center; padding: 48px 40px;
  background: linear-gradient(160deg, rgba(27,27,37,.92), rgba(16,16,22,.94));
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}
.gate .logo { font-size: 2rem; }
.gate h1 { font-size: 1.32rem; margin: 22px 0 10px; letter-spacing: -.01em; }
.gate p { color: var(--text-dim); font-size: .93rem; margin-bottom: 28px; }
.gate .buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.gate .btn { padding: 13px 30px; font-size: 1rem; }
.gate .fine-print { margin-top: 26px; font-size: .74rem; color: #6f6b80; }

/* ---------- Watch page ---------- */
.watch-layout { display: grid; grid-template-columns: 1fr 340px; gap: 30px; padding: 28px 34px 46px; align-items: start; }
@media (max-width: 980px) { .watch-layout { grid-template-columns: 1fr; } }
.player-real { width: 100%; aspect-ratio: 16/9; border-radius: 16px; background: #000; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.player {
  aspect-ratio: 16/9; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(135deg, #1c1626, #0e0e14);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; color: var(--text-dim); text-align: center; padding: 20px;
}
.player .play { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.player .play::after { content: ""; border-left: 22px solid #fff; border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }
.watch-title { font-size: 1.35rem; margin-top: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; }
.watch-meta { display: flex; align-items: center; gap: 14px; margin-top: 12px; color: var(--text-dim); font-size: .87rem; flex-wrap: wrap; }
.watch-cat { display: none; padding: 5px 13px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); font-size: .78rem; font-weight: 600; }
.watch-desc { margin-top: 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: .9rem; color: var(--text-dim); white-space: pre-wrap; }
.uploader { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #7b2d8e); display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.uploader .name { font-weight: 600; font-size: .95rem; }
.uploader .subs { font-size: .8rem; color: var(--text-dim); }
.side h2 { font-size: 1rem; margin: 0 0 14px; font-weight: 700; }
.side .ad-banner { margin: 0 0 18px; }
.side .card { margin-bottom: 16px; }

/* ---------- Forms ---------- */
.form-wrap { max-width: 680px; margin: 34px auto 60px; padding: 0 20px; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow-lg); }
.form-card h1 { font-size: 1.35rem; margin-bottom: 6px; letter-spacing: -.01em; }
.form-card .sub { color: var(--text-dim); font-size: .9rem; margin-bottom: 24px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
@media (max-width: 520px) { .mode-switch { grid-template-columns: 1fr; } }
.mode-opt { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; font-size: .9rem; background: var(--bg); transition: all .18s var(--ease); }
.mode-opt small { color: var(--text-dim); }
.mode-opt.active { border-color: var(--accent); background: var(--accent-soft); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: .95rem; font-family: inherit; outline: none;
  transition: border-color .18s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--text-dim); font-size: .92rem; cursor: pointer; transition: all .18s var(--ease); }
.dropzone:hover, .dropzone.has-file { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.legal-box { background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 18px; margin: 22px 0; }
.legal-box h2 { font-size: .95rem; margin-bottom: 12px; }
.legal-box label { display: flex; gap: 10px; align-items: flex-start; font-size: .86rem; margin-bottom: 10px; cursor: pointer; }
.legal-box input { margin-top: 3px; }
.progress-wrap { display: none; margin-top: 16px; height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .1s; }
.success { display: none; text-align: center; padding: 40px 20px; }
.success .big { font-size: 3rem; }
.success h2 { margin: 14px 0 8px; }
.success p { color: var(--text-dim); font-size: .92rem; }

/* ---------- Signup / OTP ---------- */
.closed-note {
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 18px;
  background: rgba(233, 195, 125, .10); border: 1px solid rgba(233, 195, 125, .55);
  color: #e9c37d; font-size: .88rem; line-height: 1.55;
}
.mode-opt.disabled { opacity: .45; cursor: not-allowed; }
.mode-opt.disabled:hover { border-color: var(--line); background: var(--bg); }

.form-error { color: #ff6b6b; font-size: .88rem; margin-bottom: 14px; }
.otp-sent {
  padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  font-size: .9rem; color: var(--text);
}
.test-note {
  padding: 13px 15px; border-radius: var(--radius); margin-bottom: 16px;
  background: rgba(233, 195, 125, .12); border: 1px solid #e9c37d;
  color: #e9c37d; font-size: .85rem; font-weight: 600; line-height: 1.5;
}
.otp-input {
  text-align: center; font-size: 1.6rem !important; letter-spacing: .5em;
  font-weight: 700; padding: 14px !important; text-indent: .5em;
}

/* ---------- Comments ---------- */
.comments { margin-top: 26px; }
.comments-title { font-size: 1.08rem; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }

.login-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,46,99,.10), rgba(120,80,255,.08));
  border: 1px solid var(--line); color: var(--text-dim); font-size: .92rem;
}

.comment-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.comment-form textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font-family: inherit; font-size: .93rem;
  outline: none; resize: vertical; transition: border-color .18s;
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.as-user { color: var(--text-dim); font-size: .82rem; }
.comment-err { color: #ff6b6b; font-size: .85rem; margin-top: 10px; }

.comment-list { margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 13px; }
.comment-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7b2d8e);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.comment-user { font-weight: 600; font-size: .9rem; }
.comment-time { color: var(--text-dim); font-size: .78rem; }
.comment-text { margin-top: 4px; font-size: .92rem; line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }

/* liked state on the Like button */
#likeBtn.liked { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line-soft); padding: 28px 34px 40px; color: var(--text-dim); font-size: .8rem; text-align: center; }

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; gap: 12px; }
  .chips, .row-head, .row, .grid, .more-wrap, .empty-note, .site-footer { padding-left: 16px; padding-right: 16px; }
  .ad-banner { margin-left: 16px; margin-right: 16px; }
  .watch-layout { padding: 20px 16px 40px; }
  .row { scroll-padding-left: 16px; }
  .row .card { flex: 0 0 210px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 14px; }
}

/* ---------- Hero carousel ---------- */
.hero {
  position: relative; margin: 22px 34px 6px; height: 392px;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg);
  background: #0c0c12;
}
.hero:empty { display: none; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; display: block; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .7s var(--ease);
}
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-bg {
  position: absolute; inset: -60px; background-size: cover; background-position: center;
  filter: blur(30px) saturate(165%) brightness(.66); transform: scale(1.12);
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6,6,10,.93) 0%, rgba(6,6,10,.72) 45%, rgba(6,6,10,.22) 100%),
    linear-gradient(to top, rgba(6,6,10,.85), transparent 55%);
}
.hero-inner {
  position: relative; z-index: 2; height: 100%;
  display: flex; align-items: center; gap: 46px;
  padding: 0 52px; max-width: 1460px; margin: 0 auto;
}
.hero-text { flex: 1 1 auto; min-width: 0; max-width: 600px; }
.hero-kicker {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: 2.2px;
  text-transform: uppercase; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid rgba(255,46,99,.4); color: var(--accent-2);
}
.hero-title {
  margin: 16px 0 10px; font-size: clamp(1.5rem, 2.9vw, 2.5rem); font-weight: 800;
  line-height: 1.16; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 2px 26px rgba(0,0,0,.6);
}
.hero-meta { color: #c6c1d6; font-size: .86rem; letter-spacing: .3px; }
.hero-btn { margin-top: 24px; display: inline-block; padding: 13px 32px; font-size: .95rem; }
.hero-art { flex: 0 0 auto; }
.hero-thumb {
  width: 288px; height: 192px; border-radius: 16px;
  background-size: cover; background-position: center; background-color: #13131a;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 26px 60px rgba(0,0,0,.72);
  transition: transform .4s var(--ease);
}
.hero-slide:hover .hero-thumb { transform: translateY(-5px) scale(1.02); }
.hero-dots { position: absolute; z-index: 3; right: 52px; bottom: 22px; display: flex; gap: 8px; }
.hero-dot {
  width: 9px; height: 9px; padding: 0; border: none; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.28); transition: width .3s var(--ease), background .3s;
}
.hero-dot:hover { background: rgba(255,255,255,.55); }
.hero-dot.active { width: 26px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
@media (max-width: 900px) {
  .hero { height: 330px; margin: 16px; }
  .hero-inner { padding: 0 26px; gap: 22px; }
  .hero-art { display: none; }
  .hero-dots { right: 26px; }
}

/* ---------- Trending chart ---------- */
.chart {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 12px; padding: 2px 34px 20px;
}
.chart-item {
  display: flex; align-items: center; gap: 15px; padding: 10px 14px 10px 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft);
  transition: background .22s, border-color .22s, transform .22s var(--ease);
}
.chart-item:hover { background: var(--surface-2); border-color: #33333f; transform: translateY(-2px); }
.chart-rank {
  flex: 0 0 40px; text-align: center; font-size: 1.7rem; font-weight: 800; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chart-thumb {
  position: relative; flex: 0 0 132px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden;
  background-size: cover; background-position: center; background-color: #13131a;
  border: 1px solid var(--line-soft);
}
.chart-body { min-width: 0; }
.chart-title {
  font-size: .92rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .18s;
}
.chart-item:hover .chart-title { color: var(--accent-2); }
.chart-meta { margin-top: 4px; font-size: .76rem; color: var(--text-dim); }
@media (max-width: 900px) {
  .chart { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .chart-thumb { flex: 0 0 108px; }
}

/* ---------- Hover preview (thumbnails flip through frames) ---------- */
.thumb.previewing, .chart-thumb.previewing { border-color: rgba(255,46,99,.55); }
.thumb.previewing::before, .chart-thumb.previewing::before {
  content: "PREVIEW"; position: absolute; top: 8px; right: 8px; z-index: 4;
  font-size: .56rem; font-weight: 700; letter-spacing: 1.4px;
  padding: 3px 7px; border-radius: 6px;
  background: rgba(255,46,99,.9); color: #fff;
}
.chart-thumb.previewing::before { top: 5px; right: 5px; font-size: .5rem; padding: 2px 5px; }

/* ---------- Row arrows ---------- */
.row-wrap { position: relative; }
.row-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(16,16,24,.82); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .22s, background .22s, border-color .22s, transform .22s var(--ease);
}
.row-wrap:hover .row-arrow { opacity: 1; }
.row-arrow:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.row-arrow.hide { opacity: 0 !important; pointer-events: none; }
.row-arrow::after {
  content: ""; width: 9px; height: 9px; border-right: 2px solid #fff; border-top: 2px solid #fff;
}
.row-arrow.left { left: 12px; }
.row-arrow.left::after { transform: rotate(-135deg); margin-left: 3px; }
.row-arrow.right { right: 12px; }
.row-arrow.right::after { transform: rotate(45deg); margin-right: 3px; }
@media (hover: none) { .row-arrow { display: none; } }

/* rows are browsed with the arrows / swipe — hide the raw scrollbar */
.row { scrollbar-width: none; -ms-overflow-style: none; }
.row::-webkit-scrollbar { display: none; }

/* ==========================================================
   Sidebar layout (rou.video style)
   ========================================================== */
.shell { display: flex; align-items: flex-start; }
.content { flex: 1 1 auto; min-width: 0; }

.sidebar {
  flex: 0 0 236px; width: 236px;
  position: sticky; top: var(--hdr, 74px); align-self: flex-start;
  height: calc(100vh - var(--hdr, 74px)); overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 12px 30px;
  border-right: 1px solid var(--line-soft);
  background: rgba(14,14,20,.5);
  transition: width .22s var(--ease), flex-basis .22s var(--ease);
}
.sidebar::-webkit-scrollbar { width: 6px; }

.nav-heading {
  padding: 18px 14px 7px; font-size: .68rem; font-weight: 700;
  letter-spacing: 1.6px; text-transform: uppercase; color: #64607a;
}
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 14px; border-radius: 11px;
  color: var(--text-dim); font-size: .92rem; font-weight: 500;
  white-space: nowrap; position: relative;
  transition: background .18s, color .18s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { width: 21px; height: 21px; flex: 0 0 21px; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }

/* collapsed = icons only */
body.nav-collapsed .sidebar { flex-basis: 74px; width: 74px; padding-left: 10px; padding-right: 10px; }
body.nav-collapsed .nav-label { display: none; }
body.nav-collapsed .nav-item { justify-content: center; padding-left: 0; padding-right: 0; }
body.nav-collapsed .nav-heading { text-align: center; font-size: 0; padding: 14px 0 6px; }
body.nav-collapsed .nav-heading::after {
  content: ""; display: block; height: 1px; background: var(--line-soft); margin: 0 12px;
}

.nav-backdrop { display: none; }

/* hamburger */
.nav-toggle {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s, background .18s;
}
.nav-toggle:hover { border-color: var(--accent); background: var(--accent-soft); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 2px; border-radius: 2px; background: var(--text); position: relative;
}
.nav-toggle span::before { content: ""; position: absolute; top: -5px; }
.nav-toggle span::after  { content: ""; position: absolute; top: 5px; }

/* ---------- header: pill search like rou.video ---------- */
.search { position: relative; }
.search input {
  border-radius: 999px; padding-left: 44px; padding-right: 52px; height: 46px;
}
.search::before {
  content: ""; position: absolute; left: 17px; top: 50%; width: 13px; height: 13px;
  margin-top: -8px; border: 2px solid #6f6b80; border-radius: 50%; pointer-events: none;
}
.search::after {
  content: ""; position: absolute; left: 30px; top: 50%; width: 7px; height: 2px;
  margin-top: 3px; background: #6f6b80; transform: rotate(45deg); pointer-events: none;
}
.search button {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; padding: 0; font-size: 0;
  display: flex; align-items: center; justify-content: center;
}
.search button::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid #fff; border-top: 2px solid #fff;
  transform: rotate(45deg); margin-left: -2px;
}

/* page padding now lives inside .content */
.hero { margin-left: 28px; margin-right: 28px; }
.chips, .row-head, .row, .grid, .more-wrap, .empty-note, .chart, .site-footer { padding-left: 28px; padding-right: 28px; }
.ad-banner { margin-left: 28px; margin-right: 28px; }
.watch-layout { padding-left: 28px; padding-right: 28px; }
.row { scroll-padding-left: 28px; }
.row-arrow.left { left: 6px; }
.row-arrow.right { right: 6px; }

/* ---------- Categories page ---------- */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px; padding: 16px 28px 44px;
}
.cat-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
  min-height: 104px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-lg);
  transition: transform .24s var(--ease), border-color .24s;
}
.cat-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,6,10,.72), rgba(6,6,10,.12));
}
.cat-tile:hover { transform: translateY(-4px); border-color: var(--accent); }
.cat-name { position: relative; z-index: 2; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.cat-count { position: relative; z-index: 2; font-size: .78rem; color: #cfcadd; }

/* ---------- Related videos column ---------- */
.side-title { font-size: 1.02rem; font-weight: 700; margin: 6px 0 12px; }
.related-list { display: flex; flex-direction: column; gap: 10px; }
.rel-item {
  display: flex; gap: 11px; padding: 7px; border-radius: 12px;
  border: 1px solid transparent; transition: background .2s, border-color .2s;
}
.rel-item:hover { background: var(--surface); border-color: var(--line-soft); }
.rel-thumb {
  position: relative; flex: 0 0 132px; aspect-ratio: 16/9; border-radius: 9px; overflow: hidden;
  background-size: cover; background-position: center; background-color: #13131a;
  border: 1px solid var(--line-soft);
}
.rel-dur {
  position: absolute; right: 5px; bottom: 5px; z-index: 3;
  font-size: .66rem; font-weight: 600; padding: 2px 6px; border-radius: 5px;
  background: rgba(8,8,12,.85); color: #fff;
}
.rel-body { min-width: 0; padding-top: 2px; }
.rel-title {
  font-size: .85rem; font-weight: 600; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .18s;
}
.rel-item:hover .rel-title { color: var(--accent-2); }
.rel-meta { margin-top: 4px; font-size: .74rem; color: var(--text-dim); }

/* ---------- narrow screens: sidebar becomes a drawer ---------- */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 90;
    height: 100vh; width: 260px; flex-basis: 260px;
    padding-top: 74px; background: #0d0d14;
    transform: translateX(-100%); transition: transform .26s var(--ease);
    box-shadow: 24px 0 60px rgba(0,0,0,.6);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 80; background: rgba(4,4,8,.6);
    backdrop-filter: blur(2px);
  }
  body.nav-collapsed .sidebar { width: 260px; flex-basis: 260px; padding-left: 12px; padding-right: 12px; }
  body.nav-collapsed .nav-label { display: block; }
  body.nav-collapsed .nav-item { justify-content: flex-start; padding-left: 14px; padding-right: 14px; }
  body.nav-collapsed .nav-heading { text-align: left; font-size: .68rem; padding: 18px 14px 7px; }
  body.nav-collapsed .nav-heading::after { display: none; }
}

@media (max-width: 760px) {
  .hdr-upload { display: none; }
  .hero { margin-left: 16px; margin-right: 16px; }
  .chips, .row-head, .row, .grid, .more-wrap, .empty-note, .chart, .site-footer,
  .cat-grid, .watch-layout { padding-left: 16px; padding-right: 16px; }
  .ad-banner { margin-left: 16px; margin-right: 16px; }
  .row { scroll-padding-left: 16px; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .search input { height: 42px; }
}

/* restore the small-screen sizes the layout block above would otherwise win over */
@media (max-width: 900px) {
  .hero { height: 330px; margin-left: 16px; margin-right: 16px; }
  .chart { padding-left: 16px; padding-right: 16px; }
}

/* category tiles now carry a real picture behind the name */
.cat-tile { min-height: 132px; }
.cat-pic {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  transition: transform .4s var(--ease);
}
.cat-tile:hover .cat-pic { transform: scale(1.06); }
.cat-tile::after {
  background: linear-gradient(to top, rgba(6,6,10,.92) 8%, rgba(6,6,10,.45) 55%, rgba(6,6,10,.2) 100%);
}
.cat-name { text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.cat-count { color: #ded9ea; text-shadow: 0 1px 8px rgba(0,0,0,.8); }
.cat-pic.previewing::before { display: none; }

/* ---------- Legal pages ---------- */
.legal { max-width: 800px; margin: 0 auto; padding: 34px 28px 50px; }
.legal h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.legal-date { color: var(--text-dim); font-size: .82rem; margin-top: 6px; }
.legal h2 {
  font-size: 1.04rem; font-weight: 700; margin: 30px 0 10px;
  padding-top: 20px; border-top: 1px solid var(--line-soft);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; }
.legal p, .legal li { color: #c9c4d8; font-size: .94rem; line-height: 1.72; }
.legal p { margin-bottom: 12px; }
.legal ul { margin: 0 0 14px 20px; }
.legal li { margin-bottom: 7px; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent-2); text-decoration: underline; }
.legal code {
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 6px; font-size: .86rem; color: var(--accent-2);
}
.legal-lead { font-size: 1rem !important; color: var(--text) !important; }
.legal-todo {
  background: rgba(255,176,32,.09); border: 1px solid rgba(255,176,32,.45);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 26px;
  font-size: .88rem !important; color: #f0d9a8 !important;
}
.legal-todo strong { color: #ffc95c; }

/* footer links */
.footer-links {
  display: flex; gap: 20px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 12px;
}
.footer-links a { color: var(--text-dim); transition: color .18s; }
.footer-links a:hover { color: var(--accent-2); }

/* a network's own ad code sits in here */
.ad-network { margin: 22px 28px; display: flex; justify-content: center; min-height: 0; }
@media (max-width: 760px) {
  .ad-network { margin-left: 16px; margin-right: 16px; }
  .legal { padding: 26px 16px 44px; }
}
