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

:root {
  --bg: #0f0f0f;
  --bg-elev: #212121;
  --text: #f1f1f1;
  --text-dim: #aaaaaa;
  --border: #303030;
  --hover: #272727;
  --chip: #272727;
}

body {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ===================== HEADER ===================== */
.masthead {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 16px; background: var(--bg);
}
.masthead-start, .masthead-end { display: flex; align-items: center; gap: 8px; }
.masthead-center { display: flex; align-items: center; gap: 12px; flex: 0 1 640px; margin: 0 40px; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: transparent; color: var(--text); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--hover); }

.yt-logo { display: flex; align-items: center; color: var(--text); margin-left: 8px; text-decoration: none; }
.yt-logo-icon { display: flex; align-items: center; }
.yt-logo-text {
  font-family: "Roboto", "Arial", sans-serif; font-weight: 700; font-size: 20px;
  letter-spacing: -1.5px; color: var(--text); margin-left: 5px;
}
.logo-country { font-size: 10px; color: var(--text-dim); vertical-align: super; margin-left: 2px; }

.search-box {
  display: flex; flex: 1; height: 40px; border: 1px solid var(--border);
  border-radius: 40px 0 0 40px; background: #121212; overflow: hidden;
}
.search-box input {
  flex: 1; border: none; background: transparent; color: var(--text);
  padding: 0 16px; font-size: 16px; outline: none;
}
.search-btn {
  width: 64px; border: none; border-left: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); border-radius: 0 40px 40px 0;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.search-btn:hover { background: #313131; }
.mic-btn {
  width: 40px; height: 40px; border: none; border-radius: 50%;
  background: var(--bg-elev); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn:hover { background: #313131; }

.notif-dot {
  position: absolute; top: 2px; right: 2px; background: #cc0000; color: #fff;
  font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 10px; line-height: 1.2;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: #3ea6ff; color: #0f0f0f;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
  font-size: 14px; cursor: pointer; margin-left: 4px;
}

/* ===================== LAYOUT ===================== */
.content { display: flex; gap: 24px; max-width: 1754px; margin: 24px auto; padding: 0 24px; }
.primary { flex: 1; min-width: 0; max-width: 1280px; }

/* ===================== PLAYER (self-contained fake player) ===================== */
.player-vturb { margin: 4px 0 12px; }

.player { position: relative; width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.player-inner {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,0.08), transparent 55%),
    linear-gradient(160deg, #1a1633 0%, #0b0a1f 45%, #241a10 100%);
  display: flex; align-items: center; justify-content: center;
}
.player-inner::before {
  /* EDIT: this glyph is the faint watermark behind the fake player. Swap the emoji/char per niche. */
  content: "▶"; position: absolute; font-size: 150px; color: rgba(255,255,255,0.08);
  top: 50%; left: 50%; transform: translate(-50%, -55%);
}
.live-badge {
  position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 4px; letter-spacing: 0.5px;
}
.play-overlay { cursor: pointer; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); z-index: 2; transition: transform 0.15s; }
.play-overlay:hover { transform: scale(1.08); }
.play-overlay.hidden { display: none; }
.player-title-overlay {
  position: absolute; bottom: 60px; left: 18px; color: #fff; font-size: 15px; font-weight: 500;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 0 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,0.7)); }
.progress-bar { height: 4px; background: rgba(255,255,255,0.3); border-radius: 2px; margin-bottom: 6px; cursor: pointer; }
.progress-live { width: 100%; height: 100%; background: #f00; border-radius: 2px; }
.controls-row { display: flex; align-items: center; justify-content: space-between; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 4px; }
.ctrl { background: transparent; border: none; cursor: pointer; padding: 6px; display: flex; align-items: center; border-radius: 50%; }
.ctrl:hover { background: rgba(255,255,255,0.1); }
.time-label { color: #fff; font-size: 13px; margin-left: 8px; display: flex; align-items: center; gap: 6px; }
.live-dot-small { width: 8px; height: 8px; border-radius: 50%; background: #f00; display: inline-block; }

/* ===================== VIDEO META ===================== */
.video-title { font-size: 20px; font-weight: 700; margin: 14px 0 12px; line-height: 1.4; }
.video-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.channel { display: flex; align-items: center; gap: 12px; }
.channel-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, #6d4aff, #b06dff);
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.channel-name { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.verified { color: #0f0f0f; font-size: 11px; background: var(--text-dim); width: 15px; height: 15px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.channel-subs { font-size: 12px; color: var(--text-dim); }
.subscribe-btn { margin-left: 12px; background: #fff; color: #0f0f0f; border: none; border-radius: 18px; padding: 0 16px; height: 36px; font-weight: 600; font-size: 14px; cursor: pointer; }
.subscribe-btn:hover { background: #d9d9d9; }
.subscribe-btn.subscribed { background: var(--chip); color: var(--text); }

.actions { display: flex; align-items: center; gap: 8px; }
.pill { display: flex; align-items: center; gap: 6px; background: var(--chip); color: var(--text); border: none; border-radius: 18px; height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.pill:hover { background: #3f3f3f; }
.pill.icon-only { padding: 0 12px; font-weight: 700; letter-spacing: 1px; }
.pill.active { color: #3ea6ff; }
.pill.active svg path { fill: #3ea6ff; }
.like-group { display: flex; align-items: center; background: var(--chip); border-radius: 18px; }
.like-group .pill { background: transparent; }
.divider-v { width: 1px; height: 24px; background: #555; }

.description { background: var(--bg-elev); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.5; }
.desc-stats { font-weight: 600; margin-bottom: 6px; }
.desc-text { color: var(--text); }

/* ===================== TOAST + SHARE DIALOG ===================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #e6e6e6; color: #0f0f0f; padding: 12px 20px; border-radius: 8px; font-size: 14px;
  font-weight: 500; box-shadow: 0 4px 16px rgba(0,0,0,0.5); opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.share-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 900; }
.share-overlay.show { display: flex; }
.share-dialog { background: #282828; border-radius: 12px; padding: 20px 24px; width: 480px; max-width: 90vw; }
.share-dialog h3 { font-size: 16px; font-weight: 500; margin-bottom: 16px; }
.share-icons { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.share-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }
.share-link-row { display: flex; gap: 8px; background: #1a1a1a; border: 1px solid var(--border); border-radius: 8px; padding: 6px 6px 6px 12px; align-items: center; }
.share-link-row input { flex: 1; background: transparent; border: none; color: var(--text); font-size: 14px; outline: none; }
.share-copy-btn { background: #3ea6ff; color: #0f0f0f; border: none; border-radius: 18px; padding: 8px 16px; font-weight: 600; cursor: pointer; }
.share-close { position: absolute; top: 20px; right: 24px; background: transparent; border: none; color: var(--text); font-size: 24px; cursor: pointer; }

/* ===================== LIVE CHAT ===================== */
.chat { width: 402px; flex-shrink: 0; height: 640px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.chat-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.chat-title { font-size: 16px; font-weight: 500; }
.chat-menu { background: transparent; border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.chat-messages { flex: 1; overflow-y: auto; padding: 8px 12px; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.chat-msg { display: flex; gap: 8px; padding: 4px 4px; font-size: 13px; line-height: 1.35; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.msg-avatar { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-weight: 600; overflow: hidden; }
.msg-avatar-img { background: transparent; }
.msg-avatar-img svg { display: block; width: 100%; height: 100%; }
.av-photo { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; border-radius: 50%; }
.msg-body { min-width: 0; }
.msg-author { color: var(--text-dim); font-weight: 500; margin-right: 6px; }
.msg-author.mod { color: #5e84f1; }
.msg-author.member { color: #2ba640; }
.msg-badge { font-size: 10px; margin-left: 2px; }
.msg-text { color: var(--text); }

.super-chat { background: linear-gradient(#f57c00, #e65100); border-radius: 8px; padding: 6px 10px; margin: 6px 2px; animation: fadeIn 0.3s ease; }
.super-chat .sc-top { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; color: #fff; }
.super-chat .sc-author { display: flex; align-items: center; gap: 6px; }
.super-chat .sc-avatar { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: inline-block; }
.super-chat .sc-avatar svg { display: block; width: 100%; height: 100%; }
.super-chat .sc-amount { background: rgba(0,0,0,0.2); padding: 1px 8px; border-radius: 10px; }
.super-chat .sc-text { font-size: 13px; color: #fff; margin-top: 3px; }

.chat-input { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border); }
.chat-avatar { width: 28px; height: 28px; border-radius: 50%; background: #3ea6ff; color: #0f0f0f; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.chat-input input { flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--border); color: var(--text); padding: 6px 2px; font-size: 14px; outline: none; }
.chat-input input:focus { border-bottom-color: #fff; }
.send-btn { background: transparent; border: none; color: #3ea6ff; font-size: 18px; cursor: pointer; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1100px) {
  .content { flex-direction: column; }
  .chat { width: 100%; height: 480px; }
  .masthead-center { margin: 0 12px; }
}
@media (max-width: 640px) {
  .masthead-center { display: none; }
  .video-title { font-size: 17px; }
}

/* ===== Comentarios fijos ===== */
.comments-panel { height: auto; max-height: none; }
.comments-list { padding: 12px 16px; overflow-y: visible; }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.c-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.c-body { min-width: 0; flex: 1; }
.c-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.c-text { font-size: 14px; line-height: 1.45; color: var(--text); }
.c-actions { margin-top: 6px; font-size: 12px; font-weight: 500; color: var(--text-dim); }
.c-time { font-weight: 400; }
.c-replies { margin-top: 8px; border-left: 2px solid var(--border); padding-left: 12px; }
.c-replies .c-avatar { width: 32px; height: 32px; }
.c-replies .comment { padding: 8px 0; }
