:root { --bg:#0f0f0f; --bg2:#212121; --bg3:#272727; --fg:#f1f1f1; --muted:#aaa; --line:#3f3f3f; --red:#ff0033; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--fg); font-family: Roboto, "Segoe UI", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.top { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 16px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 6px; font-size: 20px; letter-spacing: -.5px; }
.brand b { font-weight: 700; }
.logo-mark svg { width: 30px; height: 21px; display: block; }
.search { flex: 0 1 600px; margin: 0 auto; display: flex; }
.search input { flex: 1; height: 40px; background: #121212; border: 1px solid #303030; border-right: 0; border-radius: 40px 0 0 40px; padding: 0 16px; color: var(--fg); font-size: 16px; }
.search button { width: 64px; height: 40px; background: #222; border: 1px solid #303030; border-radius: 0 40px 40px 0; color: var(--fg); }
.search svg { width: 22px; height: 22px; }
.me { width: 32px; height: 32px; border-radius: 50%; background: #7c4dff; display: grid; place-items: center; font-size: 13px; font-weight: 600; }

.chanbar { position: sticky; top: 56px; z-index: 19; background: var(--bg); display: flex; gap: 10px; padding: 10px 16px 12px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 4px; background: var(--bg3); border-radius: 10px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.home { padding: 0 12px; }
.chip img { width: 26px; height: 26px; border-radius: 50%; }
.chip.on { background: var(--fg); color: #0f0f0f; }
.chip .tag { font-size: 11px; color: var(--muted); margin-left: 2px; }
.chip.on .tag { color: #444; }

main { padding: 8px 24px 60px; max-width: 2200px; margin: 0 auto; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; margin: 26px 0 14px; }
.section-title svg { width: 24px; height: 24px; color: var(--red); }

/* video grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 40px 16px; }
.card .thumb { position: relative; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #222; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.card:hover .thumb img { transform: scale(1.02); }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); font-size: 12px; font-weight: 600; padding: 2px 5px; border-radius: 4px; }
.meta { display: flex; gap: 12px; margin-top: 12px; }
.meta .av { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.meta h3 { font-size: 16px; line-height: 22px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta .sub { color: var(--muted); font-size: 14px; line-height: 20px; margin-top: 4px; }

/* shorts shelf */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.scard .sthumb { aspect-ratio: 9/16; border-radius: 12px; overflow: hidden; background: #222; }
.scard .sthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scard h3 { font-size: 16px; font-weight: 600; margin-top: 10px; line-height: 22px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scard .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* channel page */
.banner { aspect-ratio: 6.2/1; border-radius: 16px; overflow: hidden; background: #222; margin-top: 8px; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chead { display: flex; gap: 24px; align-items: center; margin: 22px 0 8px; }
.chead .bigav { width: 160px; height: 160px; border-radius: 50%; flex: none; }
.chead h1 { font-size: 36px; font-weight: 700; }
.chead .handle { color: var(--muted); font-size: 14px; margin-top: 8px; }
.chead .handle b { color: var(--fg); font-weight: 500; }
.chead .desc { color: var(--muted); font-size: 14px; margin-top: 8px; max-width: 760px; line-height: 20px; }
.subbtn { margin-top: 14px; height: 36px; padding: 0 16px; border-radius: 18px; background: var(--fg); color: #0f0f0f; font-weight: 600; font-size: 14px; }
.subbtn.on { background: var(--bg3); color: var(--fg); }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin: 10px 0 24px; }
.tabs span { padding: 12px 0; font-weight: 600; font-size: 16px; color: var(--muted); }
.tabs span.on { color: var(--fg); border-bottom: 2px solid var(--fg); }
.concept { background: var(--bg2); border-radius: 12px; padding: 16px 18px; color: #ccc; font-size: 14px; line-height: 21px; margin-bottom: 26px; max-width: 980px; }
.concept b { color: var(--fg); }

/* watch page */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; max-width: 1760px; margin: 0 auto; }
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; }
.player video { width: 100%; height: 100%; display: block; background: #000; }
.watch h1 { font-size: 20px; line-height: 28px; font-weight: 700; margin-top: 12px; }
.chrow { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.chrow .av { width: 40px; height: 40px; border-radius: 50%; }
.chrow .nm { font-weight: 600; font-size: 16px; }
.chrow .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.chrow .subbtn { margin: 0 0 0 12px; }
.pills { margin-left: auto; display: flex; gap: 8px; }
.pill { height: 36px; padding: 0 16px; border-radius: 18px; background: var(--bg3); display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.pill svg { width: 20px; height: 20px; }
.descbox { background: var(--bg2); border-radius: 12px; padding: 12px; margin-top: 12px; font-size: 14px; line-height: 20px; white-space: pre-wrap; word-wrap: break-word; }
.descbox .stats { font-weight: 600; margin-bottom: 4px; }
.descbox a.ts { color: #3ea6ff; cursor: pointer; }
.descbox.clamp { max-height: 128px; overflow: hidden; position: relative; cursor: pointer; }
.descbox.clamp::after { content: "...more"; position: absolute; right: 12px; bottom: 10px; background: var(--bg2); padding-left: 6px; font-weight: 600; }
.chapters { margin-top: 18px; }
.chapters h4 { font-size: 16px; margin-bottom: 10px; }
.chap { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; }
.chap:hover { background: var(--bg2); }
.chap .t { color: #3ea6ff; font-size: 13px; width: 48px; }
.side .mini { display: flex; gap: 8px; margin-bottom: 10px; }
.side .mini .thumb { width: 168px; flex: none; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; position: relative; }
.side .mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.side .mini h3 { font-size: 14px; line-height: 20px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side .mini .sub { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 18px; }
.comments { margin-top: 24px; }
.comments h4 { font-size: 20px; margin-bottom: 16px; }
.cmt { display: flex; gap: 14px; margin-bottom: 18px; font-size: 14px; line-height: 20px; }
.cmt .cav { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; }
.cmt b { font-size: 13px; font-weight: 600; margin-right: 6px; }
.cmt small { color: var(--muted); font-size: 12px; }
.cmt .likes { color: var(--muted); font-size: 12px; margin-top: 6px; }
.notes { margin-top: 16px; background: #1a1a2a; border: 1px solid #2c2c4a; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #c9c9e6; line-height: 19px; }
.notes b { color: #fff; }

/* shorts player */
.shorts { height: calc(100vh - 120px); overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.short { height: calc(100vh - 120px); scroll-snap-align: start; display: flex; justify-content: center; align-items: center; gap: 16px; padding: 8px 0; }
.sframe { position: relative; height: 100%; aspect-ratio: 9/16; border-radius: 14px; overflow: hidden; background: #000; }
.sframe video { width: 100%; height: 100%; object-fit: cover; display: block; }
.soverlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 16px 16px; background: linear-gradient(transparent, rgba(0,0,0,.7)); pointer-events: none; }
.soverlay .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; pointer-events: auto; }
.soverlay .who img { width: 32px; height: 32px; border-radius: 50%; }
.soverlay .who button { margin-left: 6px; background: #fff; color: #000; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: 600; }
.soverlay p { margin-top: 10px; font-size: 14px; line-height: 19px; }
.sprog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.25); }
.sprog i { display: block; height: 100%; width: 0; background: var(--red); }
.sactions { display: flex; flex-direction: column; gap: 16px; align-self: flex-end; padding-bottom: 20px; }
.sact { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.sact span.b { width: 48px; height: 48px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; }
.sact svg { width: 24px; height: 24px; }
.sact.liked span.b { background: #fff; color: #000; }
.tapplay { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; }
.tapplay .pp { width: 72px; height: 72px; border-radius: 50%; background: rgba(0,0,0,.5); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.tapplay.show .pp { opacity: 1; }
.snav { position: fixed; right: 24px; top: 50%; display: flex; flex-direction: column; gap: 12px; transform: translateY(-50%); }
.snav button { width: 56px; height: 56px; border-radius: 50%; background: var(--bg3); display: grid; place-items: center; }
.snav svg { width: 24px; height: 24px; }
.mute { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 3; }
.mute svg { width: 22px; height: 22px; }

@media (max-width: 1100px) {
  .watch { grid-template-columns: 1fr; }
  .chead .bigav { width: 96px; height: 96px; }
  .chead h1 { font-size: 26px; }
  main { padding: 8px 12px 60px; }
  .snav { display: none; }
  .pills { margin-left: 0; }
}
@media (max-width: 600px) {
  .search { display: none; }
  .sactions { position: absolute; right: 8px; bottom: 90px; }
  .short { padding: 0; }
  .sframe { height: 100%; width: 100%; aspect-ratio: auto; border-radius: 0; }
}
