/* ===== ManuTube — tema escuro estilo YouTube ===== */
:root {
  --bg: #0f0f0f;
  --bg2: #181818;
  --panel: #212121;
  --hover: #272727;
  --chip: #272727;
  --text: #f1f1f1;
  --sub: #aaaaaa;
  --line: #303030;
  --accent: #ff0033;
  --accent2: #ff4d6d;
  --premium-grad: linear-gradient(90deg, #ff0033, #a043ff);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scrollbar-color: #4d4d4d transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: #4d4d4d; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Topbar ===== */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--bg); gap: 16px;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg { width: 22px; height: 22px; fill: var(--text); }
.logo {
  display: flex; align-items: center; gap: 6px; font-size: 19px; font-weight: 700;
  letter-spacing: -0.5px; white-space: nowrap;
}
.logo .play-badge {
  width: 30px; height: 21px; border-radius: 6px; background: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.logo .play-badge svg { width: 13px; height: 13px; fill: #fff; }
.logo sup { font-size: 10px; color: var(--sub); font-weight: 400; margin-left: 2px; }
.logo-sm { font-size: 16px; }
.tb-center { flex: 1; display: flex; justify-content: center; max-width: 720px; }
#searchForm { display: flex; width: 100%; max-width: 640px; }
#searchInput {
  flex: 1; height: 40px; padding: 0 16px; font-size: 16px;
  background: #121212; color: var(--text);
  border: 1px solid var(--line); border-right: none; border-radius: 20px 0 0 20px;
  outline: none; min-width: 0;
}
#searchInput:focus { border-color: #1c62b9; }
#searchBtn {
  width: 64px; height: 40px; background: var(--chip);
  border: 1px solid var(--line); border-radius: 0 20px 20px 0;
  display: flex; align-items: center; justify-content: center;
}
#searchBtn:hover { background: #3d3d3d; }
#searchBtn svg { width: 20px; height: 20px; fill: var(--text); }
.avatar-btn {
  width: 34px; height: 34px; border-radius: 50%; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, #7b1fa2, #ff0033); color: #fff;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.avatar-btn.premium { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px gold; }

/* ===== Dropdowns ===== */
.dropdown {
  position: fixed; top: 56px; right: 12px; z-index: 90;
  background: var(--panel); border-radius: 12px; padding: 8px 0;
  width: 300px; box-shadow: 0 8px 30px rgba(0,0,0,.6); border: 1px solid var(--line);
}
.dropdown .dd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  font-size: 14px; cursor: pointer; width: 100%; text-align: left;
}
.dropdown .dd-item:hover { background: var(--hover); }
.dropdown .dd-item svg { width: 20px; height: 20px; fill: var(--text); flex: none; }
.dropdown .dd-head { padding: 12px 16px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown .dd-head b { display: block; font-size: 15px; }
.dropdown .dd-head span { font-size: 12px; color: var(--sub); }
.pill-premium {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; background: var(--premium-grad); color: #fff; margin-left: 6px;
}

/* ===== Sidebar ===== */
#sidebar {
  position: fixed; top: 56px; left: 0; bottom: 0; width: 224px; z-index: 40;
  background: var(--bg); padding: 12px; overflow-y: auto;
  transition: transform .2s ease;
}
.sb-item {
  display: flex; align-items: center; gap: 20px; padding: 9px 12px;
  border-radius: 10px; font-size: 14px; width: 100%; text-align: left;
}
.sb-item:hover { background: var(--hover); }
.sb-item.active { background: var(--hover); font-weight: 600; }
.sb-item svg { width: 22px; height: 22px; fill: var(--text); flex: none; }
.sb-sep { border-top: 1px solid var(--line); margin: 10px 0; }
.sb-title { padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--text); }
.sb-premium {
  background: linear-gradient(90deg, rgba(255,0,51,.15), rgba(160,67,255,.15));
  border: 1px solid rgba(255,0,51,.35);
}
.sb-premium svg { fill: url(#premGrad) !important; }
.sb-premium .sb-sub { font-size: 11px; color: var(--sub); font-weight: 400; }
.sb-channel { display: flex; align-items: center; gap: 14px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.sb-channel:hover { background: var(--hover); }
.sb-channel .ch-dot {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

/* ===== Main ===== */
#main { margin: 56px 0 0 224px; padding: 0 24px 80px; transition: margin .2s; }
#main.full { margin-left: 0; }

/* chips */
.chips {
  display: flex; gap: 10px; overflow-x: auto; padding: 14px 0;
  position: sticky; top: 56px; background: var(--bg); z-index: 10;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 13px; border-radius: 8px; background: var(--chip);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip:hover { background: #3d3d3d; }
.chip.active { background: var(--text); color: #0f0f0f; }

/* grade de vídeos */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px 16px; padding-top: 10px;
}
.card { cursor: pointer; }
.card .thumb {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/9; background: #1f1f1f;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.card:hover .thumb img { transform: scale(1.03); }
.card .dur {
  position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,.85);
  font-size: 11px; font-weight: 600; padding: 2px 5px; border-radius: 4px;
}
.card-row { display: flex; gap: 11px; padding-top: 11px; }
.ch-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #fff; background: #555;
}
.ch-avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-info { min-width: 0; }
.card-title {
  font-size: 15px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-sub { font-size: 13px; color: var(--sub); margin-top: 3px; }
.card-sub:hover { color: var(--text); }

/* lista (busca) */
.list { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; max-width: 1100px; }
.list-card { display: flex; gap: 16px; cursor: pointer; }
.list-card .thumb {
  width: 400px; max-width: 45%; flex: none; position: relative;
  border-radius: 12px; overflow: hidden; aspect-ratio: 16/9; background: #1f1f1f;
}
.list-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-card .lc-title { font-size: 17px; font-weight: 500; line-height: 1.4; }
.list-card .lc-sub { font-size: 12px; color: var(--sub); margin: 6px 0; }
.list-card .lc-ch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); margin: 8px 0; }
.list-card .lc-desc { font-size: 12px; color: var(--sub); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* shorts shelf */
.shorts-shelf { padding: 18px 0 6px; }
.shorts-shelf h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 12px; }
.shorts-shelf h2 svg { width: 22px; height: 22px; fill: var(--accent); }
.shorts-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.short-card { flex: none; width: 160px; cursor: pointer; }
.short-card .thumb {
  border-radius: 12px; overflow: hidden; aspect-ratio: 9/16; background: #1f1f1f;
}
.short-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.short-card .s-title { font-size: 13px; font-weight: 500; margin-top: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.short-card .s-views { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* skeleton */
.sk { border-radius: 12px; background: linear-gradient(90deg, #1c1c1c 25%, #2a2a2a 40%, #1c1c1c 60%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.sk-card .sk-thumb { aspect-ratio: 16/9; }
.sk-line { height: 13px; margin-top: 9px; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }

.error-box { text-align: center; padding: 60px 20px; color: var(--sub); }
.error-box button {
  margin-top: 14px; padding: 9px 18px; border-radius: 18px;
  background: var(--text); color: #0f0f0f; font-weight: 600;
}

.load-more { display: block; margin: 26px auto; padding: 10px 26px; border-radius: 20px;
  background: var(--chip); font-weight: 600; font-size: 14px; }
.load-more:hover { background: #3d3d3d; }

.section-title { font-size: 18px; font-weight: 700; padding: 22px 0 4px; }
.page-title { font-size: 22px; font-weight: 700; padding: 24px 0 6px; }
.empty-msg { color: var(--sub); padding: 30px 0; font-size: 14px; }

/* ===== Watch overlay ===== */
#watchOverlay {
  position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto;
}
.watch-topbar {
  position: sticky; top: 0; z-index: 5; height: 56px; display: flex; align-items: center;
  gap: 12px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.bg-status { font-size: 12px; color: #0f0f0f; background: #aee1ff; border-radius: 12px; padding: 3px 10px; font-weight: 600; }
.watch-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px;
  max-width: 1750px; margin: 0 auto; padding: 20px 24px 60px;
}
.player-box {
  position: relative; aspect-ratio: 16/9; background: #000;
  border-radius: 14px; overflow: hidden;
}
#playerSlot, #playerSlot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-overlay {
  position: absolute; inset: 0; z-index: 3;
}
.w-title { font-size: 19px; font-weight: 600; margin: 14px 0 10px; line-height: 1.35; }
.watch-actions-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.channel-block { display: flex; align-items: center; gap: 12px; }
.w-avatar {
  width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg,#ff0033,#a043ff);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px;
  overflow: hidden; flex: none;
}
.w-avatar img { width: 100%; height: 100%; object-fit: cover; }
.w-ch-info { line-height: 1.3; }
.w-ch-info b { font-size: 15px; display: block; }
.w-ch-info span { font-size: 12px; color: var(--sub); }
.btn-sub {
  margin-left: 8px; padding: 9px 16px; border-radius: 18px;
  background: var(--text); color: #0f0f0f; font-weight: 600; font-size: 14px;
}
.btn-sub.subbed { background: var(--chip); color: var(--text); font-weight: 500; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.act {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px;
  border-radius: 18px; background: var(--chip); font-size: 13px; font-weight: 600;
}
.act:hover { background: #3d3d3d; }
.act svg { width: 19px; height: 19px; fill: var(--text); }
.act.on { background: rgba(255,0,51,.18); color: var(--accent2); }
.act.on svg { fill: var(--accent2); }
.like-group { display: flex; align-items: center; background: var(--chip); border-radius: 18px; overflow: hidden; }
.like-group .act { background: transparent; border-radius: 0; }
.like-sep { width: 1px; height: 22px; background: var(--line); }
.badge-prem {
  font-size: 9px; font-weight: 800; letter-spacing: .5px; padding: 2px 6px;
  border-radius: 6px; background: var(--premium-grad); color: #fff; text-transform: uppercase;
}
.w-desc {
  background: var(--chip); border-radius: 12px; padding: 13px 15px;
  font-size: 13.5px; line-height: 1.55; margin-top: 14px; white-space: pre-wrap;
  word-break: break-word; max-height: 320px; overflow-y: auto;
}
.w-desc b { display: block; margin-bottom: 5px; }

/* comentários */
.w-comments { margin-top: 26px; }
.w-comments h3 { font-size: 16px; margin-bottom: 18px; }
.comment { display: flex; gap: 13px; margin-bottom: 20px; }
.c-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.c-body { min-width: 0; }
.c-head { font-size: 12.5px; color: var(--sub); margin-bottom: 3px; }
.c-head b { color: var(--text); font-size: 13px; margin-right: 7px; }
.c-text { font-size: 14px; line-height: 1.5; }
.c-actions { display: flex; align-items: center; gap: 14px; margin-top: 7px; color: var(--sub); font-size: 12px; }
.c-actions svg { width: 15px; height: 15px; fill: var(--sub); }

/* relacionados */
.w-related { display: flex; flex-direction: column; gap: 10px; }
.rel-card { display: flex; gap: 10px; cursor: pointer; }
.rel-card .thumb {
  width: 168px; flex: none; aspect-ratio: 16/9; border-radius: 9px;
  overflow: hidden; position: relative; background: #1f1f1f;
}
.rel-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rel-card .r-title { font-size: 13.5px; font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-card .r-sub { font-size: 12px; color: var(--sub); margin-top: 4px; }
.rel-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }

/* ===== Anúncio fake (plano grátis) ===== */
#adOverlay {
  background: linear-gradient(135deg, #14142b, #2b0f1e);
  display: flex; align-items: center; justify-content: center; z-index: 4;
}
.ad-card { text-align: center; max-width: 480px; padding: 20px; }
.ad-tag {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: #ffcc00; color: #000; border-radius: 4px; padding: 3px 8px; margin-bottom: 16px;
}
.ad-card h2 { font-size: 26px; margin-bottom: 10px; }
.ad-card p { color: #cfcfcf; font-size: 14.5px; line-height: 1.5; margin-bottom: 18px; }
.ad-skip-row { display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  position: absolute; bottom: 18px; right: 18px; }
.ad-count { font-size: 13px; background: rgba(0,0,0,.7); padding: 7px 12px; border-radius: 4px; }
.ad-skip { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.4);
  padding: 8px 16px; font-weight: 600; border-radius: 4px; font-size: 14px; }
.ad-skip:disabled { opacity: .45; cursor: default; }
.ad-prem-link { color: #8ab4f8; font-size: 13px; text-decoration: underline; }

/* ===== Modo tela apagada ===== */
.audio-overlay {
  background: #000; z-index: 5; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; cursor: pointer; text-align: center;
}
.audio-overlay .ao-icon { font-size: 52px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .75; } }
.audio-overlay h3 { font-size: 18px; }
.audio-overlay p { color: var(--sub); font-size: 13px; max-width: 320px; }
.audio-overlay .ao-hint { margin-top: 10px; font-size: 12px; color: #666; }

/* ===== Mini player ===== */
#miniPlayer {
  position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 70;
  background: #1c1c1c; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 13px; padding: 0 14px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.5);
}
#miniThumb { width: 88px; height: 50px; object-fit: cover; border-radius: 7px; }
.mini-info { flex: 1; min-width: 0; }
.mini-info b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info span { font-size: 12px; color: var(--sub); }
.mini-badge { font-size: 11px; font-weight: 700; color: #0f0f0f; background: #aee1ff; padding: 3px 9px; border-radius: 10px; flex: none; }

/* ===== Planos ===== */
.plans-hero { text-align: center; padding: 44px 16px 10px; }
.plans-hero h1 { font-size: 34px; font-weight: 800; }
.plans-hero h1 .grad { background: var(--premium-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plans-hero p { color: var(--sub); margin-top: 10px; font-size: 15px; }
.plans-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px; max-width: 1050px; margin: 34px auto 60px;
}
.plan-card {
  background: var(--panel); border-radius: 18px; padding: 28px 24px;
  border: 1px solid var(--line); display: flex; flex-direction: column; position: relative;
}
.plan-card.featured { border: 2px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--premium-grad) border-box; }
.plan-flag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--premium-grad); font-size: 11px; font-weight: 800; letter-spacing: .5px;
  padding: 4px 14px; border-radius: 12px; text-transform: uppercase;
}
.plan-card h3 { font-size: 20px; margin-bottom: 4px; }
.plan-price { font-size: 32px; font-weight: 800; margin: 12px 0 2px; }
.plan-price small { font-size: 14px; font-weight: 400; color: var(--sub); }
.plan-trial { font-size: 12.5px; color: #4caf50; font-weight: 600; margin-bottom: 16px; }
.plan-feats { list-style: none; margin: 8px 0 22px; flex: 1; }
.plan-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px;
  color: #d5d5d5; padding: 6px 0; line-height: 1.4; }
.plan-feats li svg { width: 17px; height: 17px; fill: #4caf50; flex: none; margin-top: 1px; }
.plan-feats li.no { color: #777; }
.plan-feats li.no svg { fill: #666; }
.plan-btn {
  padding: 13px; border-radius: 24px; font-weight: 700; font-size: 15px; text-align: center;
  background: var(--chip); width: 100%;
}
.plan-btn:hover { background: #3d3d3d; }
.plan-btn.primary { background: var(--premium-grad); color: #fff; }
.plan-btn.primary:hover { filter: brightness(1.12); }
.plan-btn.current { background: transparent; border: 1px solid var(--line); color: var(--sub); cursor: default; }
.plans-note { text-align: center; color: var(--sub); font-size: 12px; max-width: 640px; margin: -34px auto 50px; line-height: 1.6; }

/* ===== Modal ===== */
#modalRoot {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.72);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal {
  background: var(--panel); border-radius: 18px; width: 100%; max-width: 460px;
  padding: 26px; position: relative; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--line);
}
.modal h2 { font-size: 21px; margin-bottom: 6px; }
.modal .m-sub { color: var(--sub); font-size: 13.5px; margin-bottom: 18px; line-height: 1.5; }
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal-close svg { width: 20px; height: 20px; fill: var(--sub); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.field input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 9px; font-size: 15px;
  background: #121212; color: var(--text); border: 1px solid var(--line); outline: none;
}
.field input:focus { border-color: var(--accent); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.m-btn {
  width: 100%; padding: 14px; border-radius: 24px; font-weight: 700; font-size: 15px;
  background: var(--premium-grad); color: #fff; margin-top: 8px;
}
.m-btn:disabled { opacity: .6; cursor: default; }
.m-btn.ghost { background: var(--chip); }
.m-secure { text-align: center; font-size: 11.5px; color: var(--sub); margin-top: 12px; }
.m-success { text-align: center; padding: 18px 0 8px; }
.m-success .check {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 18px;
  background: rgba(76,175,80,.15); display: flex; align-items: center; justify-content: center;
}
.m-success .check svg { width: 40px; height: 40px; fill: #4caf50; }
.m-err { color: #ff6b6b; font-size: 12.5px; margin-top: 8px; min-height: 16px; }

/* ===== PIX ===== */
.pix-box { display: flex; justify-content: center; padding: 8px 0 16px; }
.pix-qr { width: 230px; height: 230px; border-radius: 12px; background: #fff; padding: 8px; }
.pix-code {
  width: 100%; background: #121212; color: #f1f1f1; border: 1px solid var(--line);
  border-radius: 9px; padding: 10px; font-size: 12px; resize: none; font-family: monospace;
}

/* ===== Toasts ===== */
#toasts {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #f1f1f1; color: #0f0f0f; font-size: 14px; font-weight: 500;
  padding: 12px 20px; border-radius: 10px; opacity: 0; transform: translateY(8px);
  transition: all .25s; box-shadow: 0 6px 20px rgba(0,0,0,.5); max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== Responsivo ===== */
@media (max-width: 1100px) {
  .watch-layout { grid-template-columns: 1fr; }
  .w-related { max-width: 860px; }
}
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); top: 0; padding-top: 70px; width: 240px; background: var(--bg2); }
  #sidebar.open { transform: translateX(0); box-shadow: 6px 0 30px rgba(0,0,0,.5); }
  #scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 39; }
  #main { margin-left: 0; padding: 0 14px 90px; }
}
@media (max-width: 640px) {
  #searchInput { font-size: 14px; }
  .grid { grid-template-columns: 1fr; }
  .list-card { flex-direction: column; }
  .list-card .thumb { width: 100%; max-width: 100%; }
  .watch-layout { padding: 12px 12px 60px; }
  .watch-actions-row { flex-direction: column; align-items: flex-start; }
  #btnAudio span.lbl, #btnBg span.lbl { display: inline; }
}

/* ---------- filtros de busca estilo YouTube ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.filter-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.fg { margin-bottom: 14px; }
.fg:last-child { margin-bottom: 0; }
.fg-t { font-size: 12px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 8px; }
.fg-c { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-thumb { width: 136px; min-width: 136px; border-radius: 50% !important; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--panel); }
.ch-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ch-thumb .ch-avatar { width: 100%; height: 100%; font-size: 40px; border-radius: 50%; }
.ch-card { cursor: pointer; }
@media (max-width: 640px) { .ch-thumb { width: 88px; min-width: 88px; } }

/* ---------- Shorts: player vertical estilo TikTok ---------- */
#shortsOverlay { position: fixed; inset: 0; background: #000; z-index: 400; display: flex; align-items: center; justify-content: center; }
#shortsStage { height: 100dvh; aspect-ratio: 9 / 16; max-width: 100vw; background: #111; }
#shortsStage iframe { width: 100%; height: 100%; border: 0; display: block; }
.shorts-loading { height: 100%; display: flex; align-items: center; justify-content: center; color: #888; font-size: 15px; aspect-ratio: 9 / 16; }
.shorts-close { position: absolute; top: 14px; left: 14px; z-index: 402; background: rgba(255,255,255,.14) !important; }
.shorts-meta { position: absolute; left: 18px; bottom: 28px; right: 96px; z-index: 401; pointer-events: none; text-shadow: 0 1px 5px rgba(0,0,0,.9); }
#shortsTitle { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
#shortsViews { font-size: 13px; color: #ddd; }
.shorts-nav { position: absolute; right: 14px; bottom: 110px; display: flex; flex-direction: column; gap: 14px; z-index: 402; }
.shorts-nav .icon-btn { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; }
.shorts-nav .icon-btn svg { width: 26px; height: 26px; fill: #fff; }
@media (min-width: 700px) {
  #shortsStage { height: 92dvh; }
  #shortsStage iframe { border-radius: 16px; }
}

/* ---------- menu flutuante inferior (estilo app) ---------- */
#bottomNav { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 250;
  display: flex; gap: 2px; padding: 8px 12px;
  background: rgba(18,18,24,.88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 30px; box-shadow: 0 10px 34px rgba(0,0,0,.55);
  transform: translate(-50%, 160%); transition: transform .32s cubic-bezier(.2,.9,.3,1.2); }
#bottomNav.show { transform: translate(-50%, 0); }
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; color: #ccc; font-size: 10px; font-weight: 600;
  padding: 7px 13px; border-radius: 20px; cursor: pointer; font-family: inherit; }
.bn-item svg { width: 22px; height: 22px; fill: #ccc; }
.bn-item:active { transform: scale(.92); }
.bn-add { background: var(--premium-grad, linear-gradient(90deg,#ff0033,#a043ff)); color: #fff; padding: 7px 16px; }
.bn-add svg { fill: #fff; }

/* ---------- shorts: miniatura instantânea + spinner ---------- */
#shortsStage { position: relative; overflow: hidden; }
.short-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.short-spin { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
  animation: shspin .9s linear infinite; }
@keyframes shspin { to { transform: rotate(360deg); } }
#shortsStage iframe { position: relative; z-index: 1; transition: opacity .25s ease; }

/* ---------- shorts: camada de gestos (swipe livre, sem botões) ---------- */
#shortsTouch { position: absolute; inset: 0; z-index: 2; touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.shorts-close { z-index: 403; }
#shortsPauseFlash { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 3;
  width: 84px; height: 84px; border-radius: 50%; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; pointer-events: none; }
#shortsPauseFlash svg { width: 40px; height: 40px; fill: #fff; }
#shortsPauseFlash.pop { animation: shpop .65s ease forwards; }
@keyframes shpop { 0% { transform: translate(-50%,-50%) scale(.6); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1.15); opacity: 0; } }

/* ---------- painel de estatísticas ---------- */
.stat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.stat-v { display: block; font-size: 22px; font-weight: 800; background: var(--premium-grad, linear-gradient(90deg,#ff0033,#a043ff)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-l { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .4px; }
.stat-row { font-size: 13px; color: #bbb; margin: 8px 0; line-height: 1.5; }
.stat-sec { font-size: 12px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: .5px; margin: 18px 0 8px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding: 0 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--premium-grad, linear-gradient(180deg,#ff0033,#a043ff)); min-height: 3px; }
.bar2 { background: linear-gradient(180deg,#3ea6ff,#1c62b9); }
.bar-col span { font-size: 10px; color: #888; }

/* ---------- página de canal + comentários reais ---------- */
.ch-banner { margin: -16px -16px 0; height: 140px; overflow: hidden; border-radius: 0 0 14px 14px; }
.ch-banner img { width: 100%; height: 100%; object-fit: cover; }
.ch-head { display: flex; gap: 16px; align-items: flex-start; padding: 16px 0; flex-wrap: wrap; }
.ch-avatar-big { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ch-avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.ch-meta { flex: 1; min-width: 200px; }
.ch-meta h1 { font-size: 24px; margin: 0 0 4px; }
.ch-sub2 { color: #999; font-size: 13px; }
.ch-desc { color: #aaa; font-size: 13px; margin-top: 8px; line-height: 1.5; }
.sub-btn { border: none; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 14px; cursor: pointer; background: #fff; color: #000; }
.sub-btn.subbed { background: var(--panel); color: #ccc; border: 1px solid var(--line); }
.ch-link { cursor: pointer; }
.ch-link:hover { color: #8ab4f8; }
.c-avatar-img { background: none !important; overflow: hidden; padding: 0; }
.c-avatar-img img { width: 100%; height: 100%; object-fit: cover; }
.c-replies { margin-left: 52px; margin-top: 4px; }
.c-replies .comment { padding: 8px 0; }
.c-replies .c-avatar { width: 26px; height: 26px; font-size: 12px; }

/* ---------- temas + cupons + push ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 6px; }
.theme-opt { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #ddd; font-size: 13px; cursor: pointer; }
.theme-opt.on { border-color: var(--accent); background: rgba(255,255,255,.06); font-weight: 700; }
.theme-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.coupon-row { display: flex; gap: 8px; margin: 10px 0; }
.coupon-row input { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: #fff; font-size: 14px; width: 100%; }
.coupon-ok { color: #4caf50; font-size: 13px; font-weight: 700; }
.coupon-item { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }

/* ---------- faixa de destaque + modo TV ---------- */
.feat-banner { background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.feat-badge { display: inline-block; background: var(--premium-grad, linear-gradient(90deg,#ff0033,#a043ff)); color: #fff; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.feat-head { display: flex; align-items: center; gap: 12px; }
.feat-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.feat-meta { flex: 1; min-width: 0; }
.feat-meta b { font-size: 15px; display: block; }
.feat-meta span { color: #999; font-size: 12px; }
.feat-meta p { color: #aaa; font-size: 12px; margin: 4px 0 0; }
.feat-btn { background: #fff; color: #000; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; flex-shrink: 0; }
#tvCount { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.85); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px; z-index: 100; }
.act.on { background: var(--accent) !important; color: #fff !important; }
#miniPlayer.audio-mode { background: linear-gradient(90deg, var(--panel), var(--panel)); }

/* v24 — prévia ao passar o mouse */
.hover-preview {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 3; background: #000; border-radius: inherit;
  pointer-events: none; /* não atrapalha o clique no card */
}
.list-card .thumb { position: relative; }

/* v28 — modo áudio: arte por cima do player (bloqueia o iframe, evita som duplo) */
.audio-art { background: #000; }
.audio-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .35; filter: blur(14px); }
.aa-center { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; padding: 14px; text-align: center; }
.aa-icon { font-size: 30px; }
.aa-title { font-size: 14px; font-weight: 600; margin: 8px 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 90%; }
.aa-play { width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--accent, #3ea6ff); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 18px rgba(0,0,0,.5); }
.aa-play svg { width: 26px; height: 26px; }
