:root {
  --bg-color: #0b1428;
  --glass-bg: rgba(18, 26, 44, 0.55);
  --glass-bg-hover: rgba(22, 34, 56, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(155, 89, 182, 0.35);
  --purple-accent: #9b59b6;
  --purple-glow: rgba(155, 89, 182, 0.25);
  --text-main: #ffffff;
  --text-muted: #98a8c8;
  --radius: 18px;
  --shadow-glass: 0 8px 40px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 120px;
}

/* === Фоновое свечение === */
body::before, body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
}
body::before {
  top: -30%;
  left: -20%;
  width: 70%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(155, 89, 182, 0.2), transparent 70%);
}
body::after {
  bottom: -20%;
  right: -20%;
  width: 60%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(52, 152, 219, 0.14), transparent 70%);
}

/* === Шапка === */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-main);
  text-decoration: none;
  font-size: 1.2rem;
  flex-shrink: 0;
}

 /* === Подшапочная навигация === */
.sub-nav {
max-width: 1280px;
margin: 1rem auto 0;
padding: 0 1.5rem;
position: sticky;
top: 84px;
z-index: 99;
}

.sub-nav-inner {
display: flex;
gap: 0.5rem;

/* Полупрозрачный фон — лёгкое стекло */
background: rgba(12, 18, 32, 0.5);
backdrop-filter: blur(18px);
-webkit-backdrop-filter: blur(18px);

border: 1px solid rgba(10, 15, 28, 0.95);
box-shadow:
0 0 20px rgba(0, 0, 0, 0.45),
inset 0 0 8px rgba(155, 89, 182, 0.12);
border-radius: 16px;
padding: 0.6rem;
}

.sub-nav-link {
color: #ffffff; /* Белый цвет текста везде */
text-decoration: none;
font-size: 0.96rem;
font-weight: 500;
padding: 0.7rem 1.4rem;
border-radius: 12px;
border: none;
transition: all 0.3s cubic-bezier(0.3, 0, 0.2, 1);
position: relative;
}

.sub-nav-link::after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
width: 0%;
height: 3px;
background-color: #d480ff;
border-radius: 2px;
transform: translateX(-50%);
transition: width 0.3s ease-out;
box-shadow: 0 0 6px rgba(212, 128, 255, 0.6);
}

.sub-nav-link:hover {
color: #ffffff;
background: rgba(212, 128, 255, 0.22);
box-shadow:
0 0 24px rgba(212, 128, 255, 0.55),
inset 0 0 10px rgba(212, 128, 255, 0.3);
}

.sub-nav-link:hover::after {
width: 100%;
box-shadow: 0 0 18px rgba(212, 128, 255, 0.9);
}

/* Активная ссылка — тоже белый, но жирный */
.sub-nav-link.active {
color: #ffffff;
font-weight: 700;
}

.sub-nav-link.active::after {
width: 0%;
}


/* === Поиск === */
.search-container {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin: 0 2rem;
}

.search-box {
  display: flex;
  align-items: center;
  background: transparent;
  border: 1.5px solid rgba(155, 89, 182, 0.5);
  border-radius: 9999px;
  padding: 0.5rem 1.1rem;
  box-shadow: 0 0 10px rgba(155, 89, 182, 0.25);
  transition: all 0.25s ease;
}

.search-box:focus-within {
  border-color: var(--purple-accent);
  box-shadow: 0 0 18px rgba(155, 89, 182, 0.5);
}

.search-icon {
  color: rgba(155, 89, 182, 0.8);
  margin-right: 0.55rem;
  flex-shrink: 0;
}

#globalSearch {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
}

#globalSearch::placeholder { color: var(--text-muted); opacity: 0.7; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(20, 25, 40, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(155, 89, 182, 0.25);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 16px rgba(155, 89, 182, 0.15);
  z-index: 1000;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.search-result-item:hover { background: rgba(155, 89, 182, 0.12); }
.search-result-item:last-child { border-bottom: none; }

.search-result-thumb {
  width: 80px;
  height: 45px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(155, 89, 182, 0.15);
}

.search-result-info { flex: 1; overflow: hidden; }

.search-result-artist {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.search-no-results { padding: 1.2rem; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* === Правый блок шапки === */
.top-bar-right { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.auth-buttons { display: flex; align-items: center; gap: 0.5rem; }

.btn-auth {
  padding: 0.5rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.25s ease;
}

.btn-auth:hover {
  background: rgba(155, 89, 182, 0.12);
  border: 1px solid rgba(155, 89, 182, 0.3);
  color: var(--purple-accent);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}

.profile-block { position: relative; display: none; }
.profile-block.active { display: flex; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.profile-header:hover {
  background: rgba(155, 89, 182, 0.12);
  border: 1px solid rgba(155, 89, 182, 0.3);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}

.profile-header:hover .profile-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(155, 89, 182, 0.3);
}

.profile-name { color: #fff; font-size: 0.9rem; font-weight: 500; }

.role-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.role-badge { border: 1px solid transparent; }
.role-badge.admin { background: rgba(231, 76, 60, 0.25); border: 1px solid rgba(231, 76, 60, 0.4); color: #ff6b6b; }
.role-badge.moderator { background: rgba(255, 165, 2, 0.2); border: 1px solid rgba(255, 165, 2, 0.35); color: #ffa502; }
.role-badge.user { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.12); color: var(--text-muted); }
.role-badge.artist { background: rgba(155, 89, 182, 0.25); border: 1px solid rgba(155, 89, 182, 0.4); color: #c8a8ff; }

.profile-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: rgba(20, 25, 40, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 16px;
  padding: 0.5rem;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.25s ease;
  z-index: 100;
}

.profile-dropdown-item {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  transition: all 0.25s ease;
}

.profile-dropdown-item:hover {
  background: rgba(155, 89, 182, 0.12);
  border: 1px solid rgba(155, 89, 182, 0.3);
  color: var(--purple-accent);
}

/* === LAYOUT: видео + сайдбар === */
.video-layout {
  display: flex;
  gap: 1.5rem;
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.video-main { flex: 1; min-width: 0; }
.video-container { max-width: 100%; margin: 0; padding: 0; }

video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  display: block;
}

.video-info h1 { color: #fff; margin: 1.5rem 0 0.5rem; font-size: 1.5rem; }

.video-meta {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.back-link {
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.5rem;
  display: inline-block;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  transition: all 0.25s ease;
  font-size: 0.9rem;
}

.back-link:hover {
  background: rgba(155, 89, 182, 0.12);
  border-color: var(--purple-accent);
  color: var(--purple-accent);
  box-shadow: 0 0 12px rgba(155, 89, 182, 0.2);
}

.loading { color: #888; text-align: center; padding: 3rem; }

/* Кнопки лайк/дизлайк видео */
.vote-buttons { display: flex; gap: 0.75rem; align-items: center; }

.vote-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #888;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  user-select: none;
  font-family: inherit;
}

.vote-btn:hover:not(.voted):not(:disabled) { background: rgba(255, 255, 255, 0.12); color: #fff; }
.vote-btn.like.voted { background: rgba(46, 204, 113, 0.15); border-color: rgba(46, 204, 113, 0.4); color: #2ecc71; }
.vote-btn.dislike.voted { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.4); color: #e74c3c; }
.vote-btn:disabled { opacity: 0.5; cursor: default; }

.vote-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.views-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 500;
}

/* === БОКОВАЯ ПАНЕЛЬ: случайные видео === */
.video-sidebar { width: 300px; flex-shrink: 0; }

.sidebar-frame {
  background: rgba(20, 30, 50, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 8rem;
  align-self: flex-start;
  max-height: calc(100vh - 9rem);
  overflow-y: auto;
}

.sidebar-frame::-webkit-scrollbar { width: 5px; }
.sidebar-frame::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.sidebar-frame::-webkit-scrollbar-thumb { background: rgba(155, 89, 182, 0.4); border-radius: 3px; }

.sidebar-video {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-video:hover { background: rgba(155, 89, 182, 0.1); }
.sidebar-video:last-child { border-bottom: none; }

.sidebar-video-thumb {
  width: 120px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(155, 89, 182, 0.15);
}

.sidebar-video-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.sidebar-video-artist { font-size: 0.82rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-video-title { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.2rem; }
.sidebar-video-views { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }
.sidebar-loading { color: var(--text-muted); text-align: center; padding: 1.5rem 0; font-size: 0.85rem; }

@media (max-width: 1000px) {
  .video-layout { flex-direction: column; }
  .video-sidebar { width: 100%; }
  .sidebar-frame { position: static; max-height: none; }
}

/* === Модальные окна === */
.auth-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.auth-modal.open { display: flex; }

.auth-modal-content {
  position: relative;
  background: rgba(20, 25, 40, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.auth-modal-content h3 { color: #fff; margin-bottom: 1.5rem; text-align: center; }
.auth-modal .form-group { margin-bottom: 1rem; }
.auth-modal .form-label { display: block; color: #ccc; margin-bottom: 0.4rem; font-size: 0.9rem; }

.auth-modal .form-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid rgba(155, 89, 182, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.25s ease;
}

.auth-modal .form-input:focus { outline: none; border-color: rgba(155, 89, 182, 0.5); }

.auth-modal .btn-primary {
  width: 100%;
  padding: 0.7rem;
  background: rgba(155, 89, 182, 0.2);
  border: 1px solid rgba(155, 89, 182, 0.4);
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
}

.auth-modal .btn-primary:hover { background: rgba(155, 89, 182, 0.35); box-shadow: 0 0 16px rgba(155, 89, 182, 0.3); }

.auth-modal .btn-cancel {
  margin-top: 0.75rem;
  width: 100%;
  background: transparent;
  color: #888;
  border: none;
  cursor: pointer;
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.9rem;
}

.auth-modal .btn-cancel:hover { color: #aaa; }

.auth-error { color: #e74c3c; font-size: 0.85rem; margin-bottom: 0.75rem; display: none; }

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: transparent;
  color: #888;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  z-index: 10;
}

.modal-close-btn:hover { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.3); color: #e74c3c; }

.edit-profile-header { text-align: center; margin-bottom: 1.5rem; }
.edit-profile-nickname { color: #fff; font-size: 1.15rem; font-weight: 600; margin-bottom: 1rem; }
.edit-profile-avatar-wrapper { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }

.edit-profile-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(155, 89, 182, 0.3);
  background: #2a3650;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.edit-profile-avatar-label { color: #aaa; font-size: 0.85rem; margin-bottom: 0.25rem; }
.edit-profile-avatar-hint { color: #666; font-size: 0.78rem; text-align: center; margin-bottom: 1.5rem; line-height: 1.4; }

.auth-modal .form-file {
  width: 100%;
  padding: 0.4rem;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid rgba(155, 89, 182, 0.15);
  border-radius: 12px;
  color: #ccc;
  font-size: 0.85rem;
  box-sizing: border-box;
}

@media (max-width: 700px) {
  .search-container { display: none; }
  .sub-nav-inner { padding: 0 1rem; }
  .sub-nav-link { padding: 0.6rem 0.8rem; font-size: 0.82rem; }
}

/* === БЛОК КОММЕНТАРИЕВ === */
.comments-section { max-width: 100%; margin: 2rem 0 0; padding: 0; }

.comments-frame {
  background: rgba(20, 30, 50, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.comments-title { color: var(--text-main); font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.comments-count { color: var(--purple-accent); font-size: 0.85rem; font-weight: 400; }

.comments-list { max-height: 900px; overflow-y: auto; padding-right: 0.5rem; margin-bottom: 1rem; }
.comments-list::-webkit-scrollbar { width: 6px; }
.comments-list::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); border-radius: 3px; }
.comments-list::-webkit-scrollbar-thumb { background: rgba(155, 89, 182, 0.4); border-radius: 3px; }
.comments-list::-webkit-scrollbar-thumb:hover { background: rgba(155, 89, 182, 0.6); }

.comment-item { display: flex; gap: 0.75rem; padding: 0.85rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.comment-item:last-child { border-bottom: none; }

.comment-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(155, 89, 182, 0.3); flex-shrink: 0; cursor: pointer; }
.comment-body { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; flex-wrap: wrap; }

.comment-author { color: var(--text-main); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.comment-author:hover { color: var(--purple-accent); }


.comment-time { color: var(--text-muted); font-size: 0.75rem; margin-left: auto; }
.comment-text { color: #d0d8e8; font-size: 0.92rem; line-height: 1.5; word-wrap: break-word; white-space: pre-wrap; }

.comment-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.45rem; flex-wrap: wrap; }

.comment-role {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.comment-role.artist {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.6), rgba(206, 16, 220, 0.4));
  border-color: rgba(155, 89, 182, 0.5);
  color: #fff;
}

.comment-role.admin {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.6), rgba(249, 115, 115, 0.4));
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
}

.comment-role.premium {
  background: linear-gradient(135deg, rgba(59, 246, 152, 0.6), rgba(34, 197, 94, 0.4));
  border-color: rgba(59, 246, 152, 0.5);
  color: #0f172a;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
  transition: all 0.2s;
  user-select: none;
}

.action-btn:hover:not(:disabled) { background: rgba(155, 89, 182, 0.12); border-color: rgba(155, 89, 182, 0.3); color: var(--purple-accent); }
.action-btn.liked { background: rgba(233, 30, 99, 0.12); border-color: rgba(233, 30, 99, 0.3); color: #e91e63; }
.action-btn:disabled { opacity: 0.5; cursor: default; }

.like-heart { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: all 0.2s ease; }
.action-btn.liked .like-heart { fill: #e91e63; stroke: #e91e63; }
.like-count { font-size: 0.8rem; font-weight: 600; }

.comment-delete {
  background: transparent;
  border: 1px solid rgba(231, 76, 60, 0.2);
  border-radius: 8px;
  color: #e74c3c;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
  transition: all 0.2s;
  display: none;
}

.comment-item.can-delete .comment-delete { display: inline-block; }
.comment-delete:hover { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.4); }

.replies-block { margin-top: 0.5rem; padding-left: 0.5rem; border-left: 2px solid rgba(155, 89, 182, 0.2); }
.reply-item { display: flex; gap: 0.6rem; padding: 0.6rem 0; }
.reply-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(155, 89, 182, 0.25); flex-shrink: 0; }
.reply-body { flex: 1; min-width: 0; }
.reply-header { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.2rem; flex-wrap: wrap; }
.reply-author { color: var(--text-main); font-size: 0.85rem; font-weight: 600; }
.reply-text { color: #c5d0e0; font-size: 0.88rem; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap; }
.reply-time { color: var(--text-muted); font-size: 0.72rem; margin-left: auto; }
.comments-empty { color: var(--text-muted); text-align: center; padding: 1.5rem; font-size: 0.9rem; }

.comment-form { margin-top: 1rem; }

.reply-indicator {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.5rem;
  background: rgba(155, 89, 182, 0.08);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reply-indicator.active { display: flex; }
.reply-indicator-name { color: var(--purple-accent); font-weight: 600; }

.reply-indicator-cancel { margin-left: auto; background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; padding: 0; font-family: inherit; }
.reply-indicator-cancel:hover { color: #e74c3c; }

.comment-input-wrapper { position: relative; display: flex; gap: 0.5rem; align-items: flex-end; width: 100%; }

.comment-input {
  width: 100%;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 16px;
  color: var(--text-main);
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  resize: none;
  min-height: 100px;
  max-height: 200px;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.comment-input:focus { outline: none; border-color: var(--purple-accent); box-shadow: 0 0 12px rgba(155, 89, 182, 0.2); }
.comment-input::placeholder { color: var(--text-muted); opacity: 0.6; }

.emoji-btn {
  background: transparent;
  border: 1px solid rgba(155, 89, 182, 0.2);
  border-radius: 12px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.35rem;
  padding: 0.6rem 0.8rem;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
}

.emoji-btn:hover { background: rgba(155, 89, 182, 0.12); border-color: rgba(155, 89, 182, 0.4); transform: translateY(-1px); }

.comment-send {
  background: rgba(155, 89, 182, 0.2);
  border: 1px solid rgba(155, 89, 182, 0.4);
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  flex-shrink: 0;
  transition: all 0.2s;
}

.comment-send:hover { background: rgba(155, 89, 182, 0.35); box-shadow: 0 0 12px rgba(155, 89, 182, 0.3); }
.comment-send:disabled { opacity: 0.4; cursor: default; }

.comment-guest { text-align: center; padding: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.comment-guest a { color: var(--purple-accent); cursor: pointer; text-decoration: none; font-weight: 600; }
.comment-guest a:hover { text-decoration: underline; }

.emoji-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(15, 20, 35, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(155, 89, 182, 0.3);
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 20px rgba(155, 89, 182, 0.1);
  z-index: 500;
  overflow: hidden;
}

.emoji-picker.open { display: block; animation: emojiPop 0.25s ease; }

@keyframes emojiPop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.emoji-picker-header { padding: 0.6rem 0.8rem; background: rgba(155, 89, 182, 0.08); border-bottom: 1px solid rgba(155, 89, 182, 0.15); font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 0.2rem; padding: 0.5rem; max-height: 240px; overflow-y: auto; }
.emoji-grid::-webkit-scrollbar { width: 5px; }
.emoji-grid::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.03); border-radius: 3px; }
.emoji-grid::-webkit-scrollbar-thumb { background: rgba(155, 89, 182, 0.4); border-radius: 3px; }

.emoji-item {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
}

.emoji-item:hover { background: rgba(155, 89, 182, 0.15); transform: scale(1.25); }
.emoji-item:active { transform: scale(0.9); }

@media (max-width: 600px) {
  .comments-frame { padding: 1rem; }
  .comment-input-wrapper { flex-wrap: wrap; }
  .comment-input { width: 100%; flex: 1 1 100%; }
  .emoji-picker { position: fixed; left: 1rem; right: 1rem; }
}

/* === РЕКЛАМА (Pre-roll) === */
.video-wrapper { position: relative; width: 100%; }

.ad-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: #000;
  z-index: 50;
  display: none;
  border-radius: 8px;
  overflow: hidden;
}

.ad-overlay.active { display: block; }
.ad-overlay video { width: 100%; height: 100%; object-fit: contain; display: block; }

.ad-label { position: absolute; top: 10px; left: 10px; background: rgba(155, 89, 182, 0.85); color: #fff; padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; z-index: 60; }
.ad-countdown { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.75); color: #fff; padding: 4px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; z-index: 60; }

.ad-skip-btn {
  position: absolute;
  bottom: 12px; right: 12px;
  background: rgba(155, 89, 182, 0.8);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 60;
  display: none;
  transition: background 0.2s;
}

.ad-skip-btn:hover { background: rgba(155, 89, 182, 1); }
.ad-skip-btn.visible { display: block; }

/* === АДМИН: секция рекламы === */
.ads-section { margin-bottom: 2rem; }
.ads-section h2 { color: var(--text-main); margin-bottom: 1rem; font-size: 1.3rem; }

.ads-upload-form { display: flex; gap: 0.75rem; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; }
.ads-upload-form input[type="file"] { padding: 0.5rem; background: rgba(10, 15, 25, 0.8); border: 1px solid rgba(155, 89, 182, 0.2); border-radius: 12px; color: #ccc; font-size: 0.9rem; flex: 1; min-width: 200px; }

.ads-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.ad-card { background: rgba(20, 30, 50, 0.45); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 16px; padding: 1rem; transition: border-color 0.2s; }
.ad-card:hover { border-color: rgba(155, 89, 182, 0.3); }
.ad-card video { width: 100%; border-radius: 8px; margin-bottom: 0.5rem; }
.ad-card-name { color: var(--text-main); font-size: 0.85rem; margin-bottom: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-card-date { color: var(--text-muted); font-size: 0.75rem; margin-bottom: 0.5rem; }

.ad-delete-btn { background: rgba(231, 76, 60, 0.15); border: 1px solid rgba(231, 76, 60, 0.3); color: #e74c3c; padding: 0.4rem 1rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-family: inherit; transition: all 0.2s; }
.ad-delete-btn:hover { background: rgba(231, 76, 60, 0.3); }
.ads-empty { color: var(--text-muted); text-align: center; padding: 2rem; font-size: 0.9rem; }

/* === СЕТКА ВСЕХ ВИДЕО === */
.all-videos-page { max-width: 1280px; margin: 1.5rem auto; padding: 0 1rem; }
.all-videos-title { color: var(--text-main); font-size: 1.6rem; font-weight: 700; margin-bottom: 1.5rem; }

.all-videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

.all-videos-loading, .all-videos-empty { color: var(--text-muted); text-align: center; padding: 3rem; font-size: 0.95rem; grid-column: 1 / -1; }

.video-card {
  background: rgba(20, 30, 50, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
}

.video-card:hover { border-color: rgba(155, 89, 182, 0.4); transform: translateY(-4px); box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 0 16px rgba(155, 89, 182, 0.15); }

.video-card-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.video-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.video-card:hover .video-card-thumb img { transform: scale(1.05); }

.video-card-views {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.video-card-info { padding: 0.85rem 1rem; }

.video-card-artist { font-size: 0.88rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-card-title { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* SVG-иконки в метриках карточки */
.card-stat-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Метрики в карточке: лайки, комментарии — белые */
.video-card-stats { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
.video-card-stat { font-size: 0.72rem; color: #ffffff; display: inline-flex; align-items: center; gap: 0.25rem; }
.video-card-likes { color: #ffffff; }
.video-card-comments { color: #ffffff; }

@media (max-width: 600px) {
  .all-videos-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
  .video-card-info { padding: 0.6rem 0.7rem; }
  .video-card-artist { font-size: 0.82rem; }
  .video-card-title { font-size: 0.75rem; }
}

.ad-link-btn {
  position: absolute;
  bottom: 60px;
  left: 16px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(155, 89, 182, 0.85);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.ad-link-btn:hover {
  background: rgba(155, 89, 182, 1);
}

.ad-btn-icon svg,
.ad-link-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.comment-avatar-wrap,
.reply-avatar-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.comment-avatar-hat,
.reply-avatar-hat {
  position: absolute;
  /* Чуть-чуть приподнимаем: было -12px, стало -14px */
  top: -14px;
  left: 50%;
  transform: translateX(-50%);

  /* Размер оставляем фиксированным, чтобы не скакал */
  width: 28px;
  height: auto;

  pointer-events: none;
  z-index: 2;

  /* Тень оставляем, она убирает эффект обрезанности */
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
  box-sizing: border-box;
}

