* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #121316;
  color: #e1e1e6;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding-bottom: 40px;
  overflow-y: scroll; 
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* --- ЧЕРНЫЙ КАНТ (ОБВОДКА) ДЛЯ ВСЕХ ЗАГОЛОВКОВ --- */
h1, h2, h3, h4, h5, h6, .section-title, .logo {
  text-shadow: 
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     0px  3px 8px rgba(0, 0, 0, 0.9) !important;
}

/* --- ШАПКА САЙТА И МЕНЮ --- */
.header {
  background-color: #1a1b1f;
  border-bottom: 1px solid #2a2b30;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.logo span span {
  color: #E62020;
}

.header-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.header-nav a {
  color: #b0b0b0;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s, transform 0.2s;
}

.header-nav a:hover, .header-nav a.active {
  color: #E62020;
  transform: translateY(-2px);
}

/* --- КНОПКА ВОЙТИ И МЕНЮ ПРОФИЛЯ --- */
.auth-wrapper {
  position: relative;
  display: inline-block;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
  z-index: 1400;
}

.auth-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 5px;
  background: #24252a;
  min-width: 180px;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 5px 20px rgba(0,0,0,0.8);
  flex-direction: column;
  overflow: hidden;
  padding: 5px 0;
  z-index: 1500;
}

.auth-wrapper:hover .auth-dropdown.active {
  display: flex;
}

.auth-dropdown a {
  padding: 12px 15px;
  color: #b0b0b0;
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.auth-dropdown a:hover {
  background: #E62020;
  color: #fff;
}

.btn-login {
  background-color: #E62020;
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-login:hover {
  background-color: #ff2a2a;
  transform: translateY(-1px);
}

.auth-avatar-icon { font-size: 1.2rem; }
.auth-avatar-img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.auth-username { margin: 0 6px; white-space: nowrap; }
.auth-chevron { font-size: 0.7em; }

/* ==================================================
   СЕТКА (GRID) И ВИДЖЕТЫ
   ================================================== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 25px; 
  margin-top: 25px;
  margin-bottom: 40px;
  align-items: start;
}

.main-content {
  width: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px; 
  position: sticky;
  top: 85px; 
  max-height: calc(100vh - 100px); 
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 50;
}

#playlist,
#chat-messages,
.playlist-scroll-area,
.widget-content {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
#playlist::-webkit-scrollbar,
#chat-messages::-webkit-scrollbar,
.playlist-scroll-area::-webkit-scrollbar,
.widget-content::-webkit-scrollbar {
  width: 0px !important; 
  background: transparent !important;
  display: none !important;
}

.mobile-only { display: none; }
.desktop-only { display: block; }

/* ==================================================
   СВОРАЧИВАЕМЫЕ ВИДЖЕТЫ
   ================================================== */
.widget {
  background-color: #1a1b1f;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.widget-header {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #E62020;
  cursor: pointer;
  background-color: #1a1b1f;
  user-select: none;
}

.widget-header h3 {
  font-size: 1rem; 
  margin: 0; 
  color: #fff;
  border: none;
  padding: 0;
}

.widget-toggle-btn {
  background: transparent;
  border: none;
  color: #b0b0b0;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.3s ease, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.widget-header:hover .widget-toggle-btn {
  color: #E62020;
}

.widget-content {
  padding: 15px;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease, opacity 0.3s ease;
  opacity: 1;
  max-height: 1000px;
}

.widget.collapsed .widget-header {
  border-bottom: 2px solid transparent; 
}

.widget.collapsed .widget-toggle-btn {
  transform: rotate(-180deg);
}

.widget.collapsed .widget-content {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  opacity: 0;
  overflow: hidden;
}

/* ==================================================
   КАТАЛОГ АНИМЕ И ЕДИНАЯ ШТОРКА НА ПОСТЕРЕ
   ================================================== */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); 
  gap: 20px;
  margin-top: 5px; 
  padding: 20px; 
}

.card-info {
  display: none !important; 
}

.anime-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background-color: #1a1b1f;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  cursor: pointer;
  z-index: 1;
}

.anime-card:hover {
  transform: scale(1.15) translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
  z-index: 10; 
}

.card-poster {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: 8px;
}

.card-poster img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.poster-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #000000;
  color: #ffffff;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 5px 0;
  z-index: 5;
  letter-spacing: 0.5px;
}

.poster-header .studio-red { color: #E62020; }
.poster-header .studio-blue { color: #00bfff; }
.poster-header .studio-lilac { color: #b19cd9; }

.episode-badge {
  position: absolute;
  top: 35px; 
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: bold;
  z-index: 5;
}

.unified-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(26, 27, 31, 1) 30%, rgba(26, 27, 31, 0.8) 75%, rgba(26, 27, 31, 0) 100%);
  padding: 15px 12px 12px 12px;
  z-index: 20;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: none; 
  box-shadow: inset 0 2px 0 0 rgba(230, 32, 32, 0); 
  box-sizing: border-box;
}

.anime-card:hover .unified-overlay,
.carousel-item:hover .unified-overlay {
  background: rgba(26, 27, 31, 0.96); 
  box-shadow: inset 0 2px 0 0 #E62020; 
  backdrop-filter: blur(4px);
}

.unified-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
  display: -webkit-box;
  -webkit-line-clamp: 2; 
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: all 0.3s ease;
}

.anime-card:hover .unified-title,
.carousel-item:hover .unified-title {
  -webkit-line-clamp: 10;
  text-shadow: none;
}

.unified-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: #b0b0b0;
  font-size: 0.82rem; 
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anime-card:hover .unified-details,
.carousel-item:hover .unified-details {
  max-height: 120px;
  opacity: 1;
  margin-top: 8px;
}

/* ==================================================
   ВЫПАДАЮЩИЙ ФИЛЬТР ЖАНРОВ И ПАНЕЛИ ФИЛЬТРОВ
   ================================================== */
.alphabet-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
  background-color: #1a1b1f;
  padding: 12px;
  border-radius: 8px;
}

.alpha-btn {
  background-color: #24252a;
  color: #e1e1e6;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.alpha-btn:hover, .alpha-btn.active {
  background-color: #E62020;
  color: #fff;
}

.genre-filter-wrapper {
  position: relative;
  display: inline-block;
}

.genre-filter-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 15px;
  background: transparent;
  z-index: 1000;
}

.genre-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  background: #24252a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px;
  min-width: 220px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

.genre-filter-wrapper:hover .genre-dropdown {
  display: block;
}

.genre-dropdown-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.genre-dropdown-list::-webkit-scrollbar { width: 6px; display: block !important; }
.genre-dropdown-list::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ==================================================
   ПРЕВЬЮ НОВОСТЕЙ, БУЛАВКА И ПОЛНАЯ НОВОСТЬ
   ================================================== */
.news-preview-card {
  background: #1a1b1f;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  border: 1px solid transparent;
}

.news-preview-card:hover {
  box-shadow: 0 8px 25px rgba(230, 32, 32, 0.15);
  transform: translateY(-2px);
  border-color: #333;
}

/* Стили для булавки закрепа новостей */
.news-pin-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.2rem;
  color: #E62020;
  z-index: 10;
  transition: transform 0.2s, color 0.2s;
}
.news-pin-icon.clickable {
  cursor: pointer;
}
.news-pin-icon.clickable:hover {
  transform: scale(1.2);
}
.news-pin-icon.unpinned {
  color: #555;
}
.news-pin-icon.unpinned:hover {
  color: #E62020;
}

.news-preview-content {
  color: #b0b0b0;
  line-height: 1.5;
  margin: 0;
  font-size: 0.9rem;
  max-height: 65px; 
  overflow: hidden;
  position: relative;
}

.news-preview-content::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: linear-gradient(rgba(26, 27, 31, 0), rgba(26, 27, 31, 1));
}

.news-preview-content img {
  max-height: 60px !important;
  width: auto !important;
  display: inline-block !important;
  margin: 5px 10px 5px 0 !important;
  border-radius: 4px;
}

.news-full-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 8px;
  margin: 10px 0;
}

/* Защита от вылезания контента и iframe в новостях */
.news-full-content, .news-preview-content {
  word-break: break-word;
  overflow-wrap: break-word;
}
.news-full-content iframe,
.news-preview-content iframe,
.news-video-container {
  max-width: 100%;
}

.news-video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  background: #000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.news-video-container iframe,
.news-video-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==================================================
   БАННЕРЫ И КАРУСЕЛЬ
   ================================================== */
.banner-container {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 10.8; 
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  background-color: #1a1b1f;
}

.banner-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-wrapper {
  position: relative;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0;
  transition: opacity 0.3s ease, background 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
}

.carousel-wrapper:hover .carousel-btn { opacity: 1; }
.carousel-btn:hover { background: #E62020; }
.carousel-prev { left: -15px; }
.carousel-next { right: -15px; }

/* ==================================================
   ВКЛАДКИ СЕРИЙ (ДЛЯ СТРАНИЦЫ АНИМЕ)
   ================================================== */
.player-section { margin-top: 15px; }

.player-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.player-tab {
  background: #24252a;
  color: #b0b0b0;
  border: 1px solid #333;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.player-tab.active, .player-tab:hover {
  background: #E62020;
  color: #fff;
  border-color: #E62020;
}

.player-wrapper {
  background: #1a1b1f;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.player-container {
  position: relative;
  width: 100%;
  height: 620px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.episodes-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 5px;
}

.episode-btn {
  background: #24252a;
  color: #e1e1e6;
  border: 1px solid #333;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  font-weight: bold;
}

.episode-btn.active, .episode-btn:hover {
  background: #E62020;
  color: #fff;
  border-color: #E62020;
}

/* ==================================================
   КАСТОМНЫЙ АУДИОПЛЕЕР (ВИДЖЕТ МУЗЫКА)
   ================================================== */
.custom-player-content {
  display: flex;
  flex-direction: column;
  padding: 0 !important; 
  max-height: 400px !important;
}

.custom-player-fixed {
  padding: 15px 15px 5px 15px;
  background: #1a1b1f;
  border-bottom: 1px solid #2a2b30;
  z-index: 10;
}

.cp-track-name {
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #000;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #333;
}

.cp-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 10px;
}

.cp-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cp-btn {
  background: none;
  border: none;
  color: #b0b0b0;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-btn:hover { color: #E62020; }
.cp-btn:active { transform: scale(0.9); }

.play-pause-btn {
  font-size: 1.8rem;
  color: #fff;
}
.play-pause-btn:hover { color: #ff4d4d; }

.cp-volume-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cp-volume-slider-container {
  position: absolute;
  top: 100%; 
  right: -5px;
  margin-top: 10px;
  background: #24252a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 15px 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.8);
  display: none; 
  z-index: 100;
}

.cp-volume-wrapper:hover .cp-volume-slider-container { display: flex; }

.cp-volume-wrapper::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -10px;
  width: 40px;
  height: 15px;
  background: transparent;
}

.cp-volume-slider {
  writing-mode: bt-lr; 
  -webkit-appearance: slider-vertical; 
  width: 8px;
  height: 80px;
  background: #333;
  outline: none;
  border-radius: 4px;
  cursor: pointer;
  accent-color: #E62020;
}

.cp-timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: #888;
}

.cp-timeline {
  flex: 1;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.cp-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E62020;
  cursor: pointer;
  transition: transform 0.1s;
}

.cp-timeline::-webkit-slider-thumb:hover { transform: scale(1.3); }

#restore-playlist-btn {
  width: 100%;
  background: #24252a;
  color: #888;
  border: 1px solid #333;
  padding: 6px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}

#restore-playlist-btn:hover {
  color: #E62020;
  border-color: #E62020;
}

.playlist-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 15px 15px 15px;
}

.playlist-list { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.playlist-item {
  background-color: #24252a; 
  padding: 8px 12px; 
  border-radius: 8px;
  cursor: pointer; 
  display: flex; 
  justify-content: space-between;
  align-items: center; 
  transition: all 0.2s; 
  font-weight: 600; 
  font-size: 0.9rem; 
  border-left: 4px solid transparent;
}

.playlist-item:hover { 
  background-color: #2a2b30; 
  border-left: 4px solid #E62020; 
}

.playlist-item.active { 
  background-color: #E62020; 
  color: #fff; 
  border-left: 4px solid #fff; 
}

.playlist-item .track-info-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  overflow: hidden;
}

.playlist-item i { color: #E62020; font-size: 1.1rem; transition: color 0.2s; }
.playlist-item.active i, .playlist-item:hover.active i { color: #fff; }

/* ==================================================
   СОЦСЕТИ И ПРОЧЕЕ
   ================================================== */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background-color: #24252a;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 1px solid #2a2b30;
}

.social-btn:hover {
  background-color: #E62020;
  border-color: #E62020;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(230, 32, 32, 0.3);
}

.social-btn i { font-size: 1.3rem; width: 24px; text-align: center; }

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: #E62020; }
input:checked + .slider:before { transform: translateX(24px); }

/* ==================================================
   АДАПТИВНОСТЬ И МОБИЛЬНАЯ ВЕРСИЯ
   ================================================== */
@media (max-width: 1100px) {
  .anime-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 851px) {
  body { overflow: hidden; }
  .main-content {
    height: calc(100vh - 105px);
    overflow-y: auto;
    padding-right: 20px;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
  }
  .main-content:hover { scrollbar-color: rgba(255, 255, 255, 0.3) transparent; }
  .main-content::-webkit-scrollbar { width: 6px; }
  .main-content::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
  .main-content:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); }
}

/* МОБИЛЬНАЯ ВЕРСИЯ (экран <= 850px) */
@media (max-width: 850px) {
  body { overflow: auto; }

  .layout { 
    display: flex !important; 
    flex-direction: column !important; 
    gap: 20px; 
  }
  
  .main-content { 
    width: 100%; 
    height: auto; 
    overflow-y: visible; 
    padding: 10px 0; 
  }
  
  .sidebar { 
    width: 100%; 
    position: static !important; 
    height: auto; 
    max-height: none; 
    display: flex !important; 
    flex-direction: column; 
    gap: 15px; 
    margin-top: 25px; 
  }
  
  .header-container { 
    flex-wrap: nowrap; 
    justify-content: space-between; 
    padding: 8px 10px; 
    gap: 5px;
  }
  
  #header-site-name { display: none; }
  .logo { margin: 0; gap: 0; }
  .header-logo-img { width: 38px; height: 38px; border-radius: 50%; }
  
  .header-nav { 
    order: 0; 
    width: auto; 
    flex: 1; 
    justify-content: space-evenly; 
    margin-top: 0; 
    gap: 2px; 
  }
  .header-nav > a {
    flex-direction: column;
    gap: 3px;
    font-size: 0.65rem;
    padding: 4px;
    text-align: center;
  }
  .header-nav > a i { font-size: 1.3rem; margin: 0; }
  
  .auth-wrapper { margin-left: 0; }
  .btn-login {
    width: 42px; 
    height: 42px; 
    padding: 0; 
    border-radius: 50%; 
    justify-content: center; 
    overflow: hidden;
    font-size: 0 !important; 
  }
  .btn-login i {
    font-size: 1.4rem !important; 
    margin: 0;
  }
  .auth-username, .auth-chevron { display: none !important; }
  .auth-avatar-icon { font-size: 1.4rem; margin: 0; }
  .auth-avatar-img { width: 100%; height: 100%; border-radius: 50%; margin: 0; }
  
  .anime-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Фикс высоты iframe на телефонах, чтобы они сохраняли 16:9 */
  .news-full-content iframe,
  .news-preview-content iframe {
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .news-video-container iframe {
    height: 100%; 
  }
}

/* СПЕЦИАЛЬНО ДЛЯ СМАРТФОНОВ (экран <= 480px) */
@media (max-width: 480px) {
  .anime-grid { 
    grid-template-columns: repeat(2, 1fr) !important; 
    gap: 10px;
    padding: 10px 0;
  }
  
  .anime-grid .card-poster img {
    height: 240px !important;
  }
  
  .anime-grid .unified-title { font-size: 0.85rem; }
  .anime-grid .unified-details { font-size: 0.75rem; }
  .anime-grid .poster-header { font-size: 0.65rem; padding: 4px 0; }
  .anime-grid .episode-badge { font-size: 0.7rem; padding: 3px 6px; top: 25px; right: 5px; }
}