/* ═══════════════════════════════════════════════════════════════
   САЙТ ДЕТСТВА — Global Stylesheet
   Glassmorphism / Liquid Glass design system
═══════════════════════════════════════════════════════════════ */

/* ─── Variables — Dark theme (default) ──────────────────────── */
:root {
  --bg:            #0c0c14;
  --glass-bg:      rgba(255, 255, 255, 0.05);
  --glass-border:  rgba(255, 255, 255, 0.10);
  --glass-blur:    blur(20px) saturate(130%);
  --glass-hover:   rgba(255, 255, 255, 0.08);
  --accent-1:      #5b5ef4;
  --accent-2:      #818cf8;
  --accent-grad:   linear-gradient(135deg, #5b5ef4, #818cf8);
  --accent-glow:   0 0 18px rgba(91, 94, 244, 0.45), 0 0 36px rgba(129, 140, 248, 0.2);
  --txt-primary:   rgba(255, 255, 255, 0.92);
  --txt-secondary: rgba(255, 255, 255, 0.52);
  --txt-muted:     rgba(255, 255, 255, 0.30);
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --shadow:        0 8px 32px rgba(0, 0, 0, 0.5);
  --transition:    0.25s ease;
  --header-bg:     rgba(12, 12, 20, 0.80);
  --modal-bg:      rgba(14, 14, 26, 0.92);
  --card-bg:       rgba(255, 255, 255, 0.04);
  --input-bg:      rgba(255, 255, 255, 0.05);
}

/* ─── Variables — Light theme ────────────────────────────────── */
body.theme-light {
  --bg:            #f0f0fa;
  --glass-bg:      rgba(255, 255, 255, 0.55);
  --glass-border:  rgba(100, 80, 200, 0.18);
  --glass-blur:    blur(25px) saturate(180%);
  --glass-hover:   rgba(255, 255, 255, 0.75);
  --txt-primary:   rgba(10, 5, 30, 0.92);
  --txt-secondary: rgba(10, 5, 30, 0.55);
  --txt-muted:     rgba(10, 5, 30, 0.35);
  --shadow:        0 8px 32px rgba(100, 80, 200, 0.15);
  --header-bg:     rgba(240, 240, 250, 0.8);
  --modal-bg:      rgba(245, 243, 255, 0.92);
  --card-bg:       rgba(255, 255, 255, 0.65);
  --input-bg:      rgba(255, 255, 255, 0.7);
}
body.theme-light .blob { opacity: 0.18; }
body.theme-light ::-webkit-scrollbar-thumb { background: rgba(100,80,200,0.25); }

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ─── Animated background blobs ─────────────────────────────── */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
}
.blob-1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #5b21b6, #4f46e5);
  top: -200px; left: -150px;
  animation: blobFloat1 20s ease-in-out infinite;
}
.blob-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #be185d, #9333ea);
  top: 25%; right: -200px;
  animation: blobFloat2 25s ease-in-out infinite;
}
.blob-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0e7490, #1d4ed8);
  bottom: -100px; left: 25%;
  animation: blobFloat3 18s ease-in-out infinite;
}
@keyframes blobFloat1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-50px) scale(1.06); }
  66%      { transform: translate(-30px,30px) scale(0.94); }
}
@keyframes blobFloat2 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(-50px,40px) scale(1.08); }
  70%     { transform: translate(30px,-20px) scale(0.95); }
}
@keyframes blobFloat3 {
  0%,100% { transform: translate(0,0) scale(1); }
  30%     { transform: translate(30px,50px) scale(1.05); }
  70%     { transform: translate(-40px,-30px) scale(0.96); }
}

/* ─── Glass utility ──────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

/* ─── Layout wrapper ─────────────────────────────────────────── */
#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
  flex-shrink: 0;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-greeting {
  color: var(--txt-secondary);
  font-size: 0.9rem;
}
.user-greeting strong { color: var(--txt-primary); }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--txt-primary);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: var(--glass-hover);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
}
.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}
.btn-primary:hover {
  box-shadow: var(--accent-glow);
  transform: translateY(-1px);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.35); }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* ─── Season filter ──────────────────────────────────────────── */
.season-filter {
  max-width: 1400px;
  margin: 28px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 18px;
  border-radius: 99px;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--txt-secondary);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 14px rgba(124,58,237,0.45);
}

/* ─── Episodes grid ──────────────────────────────────────────── */
.episodes-wrap {
  max-width: 1400px;
  margin: 24px auto 60px;
  padding: 0 20px;
}
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* ─── Episode card ───────────────────────────────────────────── */
.ep-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.ep-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.4);
}
.ep-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(236,72,153,0.3));
}
.ep-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.ep-card:hover .ep-thumb img { transform: scale(1.06); }
.ep-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, rgba(124,58,237,0.4), rgba(236,72,153,0.4));
}
.ep-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  background: rgba(0,0,0,0.35);
  transition: opacity var(--transition);
}
.ep-card:hover .ep-play-icon { opacity: 1; }
.ep-play-icon svg { width: 52px; height: 52px; fill: #fff; drop-shadow: 0 2px 8px rgba(0,0,0,0.6); }

.ep-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ep-season-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.ep-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--txt-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--txt-secondary);
  margin-top: auto;
  padding-top: 8px;
  flex-wrap: wrap;
}
.ep-meta span { display: flex; align-items: center; gap: 4px; }

/* ─── Empty / Loading state ──────────────────────────────────── */
.state-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--txt-secondary);
}
.state-msg .icon { font-size: 3.5rem; margin-bottom: 16px; }
.state-msg p { font-size: 1.1rem; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--modal-bg);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow);
}
.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 1.4rem;
  color: var(--txt-secondary);
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}
.modal-close:hover { color: var(--txt-primary); }

.modal-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--txt-secondary);
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
}
.tab-btn.active {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124,58,237,0.4);
}

.auth-form h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.form-group {
  margin-bottom: 14px;
}
.form-group small {
  display: block;
  color: var(--txt-muted);
  font-size: 0.75rem;
  margin-top: 4px;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--txt-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input::placeholder { color: var(--txt-muted); }
.form-input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.form-error {
  color: #fca5a5;
  font-size: 0.83rem;
  min-height: 18px;
  margin-bottom: 8px;
}
.auth-form .btn-primary { width: 100%; margin-top: 4px; justify-content: center; padding: 12px; font-size: 1rem; }

/* ─── Toast notification ─────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 340px;
}
.toast.success { background: rgba(16,185,129,0.25); border-color: rgba(16,185,129,0.5); color: #6ee7b7; }
.toast.error   { background: rgba(239,68,68,0.25);  border-color: rgba(239,68,68,0.5);  color: #fca5a5; }
.toast.info    { background: rgba(124,58,237,0.25); border-color: rgba(124,58,237,0.5); color: #c4b5fd; }
@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

/* ─── User avatar button in header ──────────────────────────── */
.user-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  padding: 4px 12px 4px 4px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--txt-primary);
  font-size: 0.88rem;
  font-weight: 500;
}
.user-avatar-btn:hover { background: var(--glass-hover); box-shadow: 0 0 12px rgba(124,58,237,0.3); }
.user-avatar-img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-grad);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

/* ─── Profile modal ──────────────────────────────────────────── */
.profile-modal .modal { max-width: 460px; }
.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.profile-avatar-circle {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 700; color: #fff;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 2px solid var(--glass-border);
  transition: var(--transition);
}
.profile-avatar-circle:hover { box-shadow: var(--accent-glow); }
.profile-avatar-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
  font-size: 1.4rem;
}
.profile-avatar-circle:hover .profile-avatar-overlay { opacity: 1; }
.profile-username-tag {
  font-size: 0.82rem;
  color: var(--txt-muted);
  font-family: monospace;
}

/* ─── Settings panel (slide-in from top-right) ───────────────── */
.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 64px 20px 0;
  pointer-events: none;
}
.settings-overlay.open { display: flex; pointer-events: all; }
.settings-panel {
  background: var(--modal-bg);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 240px;
  box-shadow: var(--shadow);
  animation: settingsIn 0.2s ease;
  pointer-events: all;
}
@keyframes settingsIn { from { opacity:0; transform: translateY(-10px) scale(0.97); } to { opacity:1; transform: none; } }
.settings-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--txt-muted);
  margin-bottom: 14px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--txt-primary);
}
.theme-switch {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }
.theme-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition);
  border: 1px solid var(--glass-border);
}
.theme-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.theme-switch input:checked + .theme-slider { background: var(--accent-1); }
.theme-switch input:checked + .theme-slider::before { transform: translateX(20px); }

/* ─── Season/Episode dropdown overlay on player ──────────────── */
.ep-selector-bar {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, transparent 100%);
  pointer-events: none;
}
.ep-selector-wrap {
  position: relative;
  pointer-events: all;
}
.ep-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-selector-btn:hover { background: rgba(0,0,0,0.75); }
.ep-selector-btn .chevron { font-size: 0.7rem; opacity: 0.7; transition: transform var(--transition); flex-shrink: 0; }
.ep-selector-wrap.open .ep-selector-btn .chevron { transform: rotate(180deg); }
.ep-selector-label { color: rgba(255,255,255,0.55); font-weight: 400; margin-right: 2px; flex-shrink: 0; }
.ep-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  max-width: 300px;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(10,8,25,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  z-index: 20;
  padding: 6px;
}
.ep-selector-wrap.open .ep-dropdown { display: block; }
.ep-dropdown-item {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep-dropdown-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.ep-dropdown-item.active {
  background: rgba(56,189,248,0.2);
  color: #7dd3fc;
  font-weight: 600;
}
.ep-dropdown-item.active::before { content: '▶'; font-size: 0.65rem; opacity: 0.8; }
.ep-dropdown-item:not(.active)::before { content: ''; display: inline-block; width: 0.65em; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .episodes-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .header-inner  { padding: 0 14px; }
  .episodes-wrap { padding: 0 14px; }
  .season-filter { padding: 0 14px; }
}
@media (max-width: 480px) {
  .episodes-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .btn { padding: 10px 16px; font-size: 0.95rem; }
  .logo { font-size: 1.1rem; }
}
@media (max-width: 360px) {
  .episodes-grid { grid-template-columns: 1fr; }
}

/* ─── News section (public) ────────────────────────────────────── */
.news-section {
  max-width: 780px;
  margin: 24px auto 60px;
  padding: 0 20px;
}
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.news-post {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.news-post:hover { border-color: rgba(124, 58, 237, 0.45); }
.news-post-body { padding: 20px 24px; }
.news-post-date {
  font-size: 0.78rem;
  color: var(--txt-muted);
  margin-bottom: 8px;
}
.news-post-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--txt-primary);
}
.news-post-text {
  font-size: 0.92rem;
  color: var(--txt-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.news-post-text a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.news-post-text a:hover { color: var(--accent-2); }
.news-post-media {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}
video.news-post-media {
  max-height: 480px;
  background: #000;
  width: 100%;
}

/* ─── News list items in admin panel ───────────────────────────── */
.news-admin-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.news-admin-item-info { flex: 1; min-width: 0; }
.news-admin-item-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-admin-item-meta { font-size: 0.78rem; color: var(--txt-muted); margin-top: 3px; }

/* ─── Tracks page section ──────────────────────────────────────── */
.tracks-page-section {
  padding-top: 0;
}
.track-card .ep-play-icon.track-play-btn {
  font-size: 1.8rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.track-card.playing .ep-thumb {
  box-shadow: 0 0 0 3px var(--accent-1), var(--accent-glow);
}

/* ─── Header left (hamburger + logo group) ──────────────────── */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}

/* ─── Hamburger (3-line) button — always visible ────────────── */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: var(--transition);
}
.hamburger-btn:hover { background: var(--glass-hover); }
.ham-line {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--txt-primary);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.18s ease;
  transform-origin: center;
}
.hamburger-btn.active .ham-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.active .ham-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.active .ham-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Page tabs: hidden by default, slide down on hamburger ─── */
.page-tabs {
  display: none !important;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 150;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  max-width: 260px;
  background: var(--header-bg);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.page-tabs.nav-open { display: flex !important; animation: slideDownNav 0.2s ease; }

.page-tab-btn {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--txt-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  cursor: pointer;
}
.page-tab-btn.active {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
}
.page-tab-btn:hover:not(.active) {
  background: var(--glass-hover);
  color: var(--txt-primary);
}

/* ─── Mobile: compact header ─────────────────────────────────── */
@media (max-width: 640px) {
  /* Keep header nav compact */
  .header-nav { gap: 6px; flex-shrink: 0; }

  /* Logo can shrink */
  .logo { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

  /* Shorten "Войти / Регистрация" button on very small screens */
  #btn-open-auth { max-width: 90px; font-size: 0.78rem; padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Fix: header buttons stay compact at 480px */
@media (max-width: 480px) {
  .header-nav .btn, .header-nav .btn-sm {
    padding: 5px 8px;
    font-size: 0.78rem;
  }
}

@keyframes slideDownNav {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL CHAT  (glassmorphism)
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-section {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 72px);
  padding: 0;
  overflow: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
  gap: 8px;
}
.chat-topbar-title { font-weight: 600; font-size: .95rem; }

.online-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--txt-secondary);
}
.online-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4caf82;
  box-shadow: 0 0 6px #4caf82;
  flex-shrink: 0;
}

/* ── Messages area ───────────────────────────────────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.chat-loading, .chat-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--txt-secondary);
  font-size: .9rem;
  padding: 40px 0;
  flex: 1;
}

/* ── Message row ─────────────────────────────────────────────────────────── */
.chat-msg-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 82%;
}
.chat-msg-wrap.my   { align-self: flex-end;  flex-direction: row-reverse; }
.chat-msg-wrap.their{ align-self: flex-start; }

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.msg-animate { animation: msgIn .22s ease; }

/* ── Avatar ──────────────────────────────────────────────────────────────── */
.chat-avatar { flex-shrink: 0; }
.chat-avatar-img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.chat-avatar-letter {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; font-weight: 700; color: #fff;
}

/* ── Bubble ──────────────────────────────────────────────────────────────── */
.chat-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  max-width: 100%;
  word-break: break-word;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-size: .9rem;
  line-height: 1.45;
}
.chat-msg-wrap.their .chat-bubble {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-bottom-left-radius: 4px;
}
.chat-msg-wrap.my .chat-bubble {
  background: rgba(91,94,244,0.18);
  border: 1px solid rgba(91,94,244,0.30);
  border-bottom-right-radius: 4px;
}

.chat-sender {
  font-size: .72rem;
  font-weight: 600;
  margin-bottom: 3px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.chat-text { white-space: pre-wrap; }
.chat-text a { color: #818cf8; text-decoration: underline; }
.chat-time {
  font-size: .65rem;
  color: var(--txt-secondary);
  margin-top: 4px;
  text-align: right;
}

/* ── Voice bubble ────────────────────────────────────────────────────────── */
.voice-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 190px;
  max-width: 280px;
}
.voice-play-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background .15s;
  flex-shrink: 0;
}
.voice-play-btn:hover { background: rgba(255,255,255,.22); }

.voice-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 28px;
  flex: 1;
}
.vw-bar {
  flex: 1;
  border-radius: 2px;
  background: rgba(255,255,255,.3);
  min-height: 4px;
  transition: background .15s;
}
.vw-bar.active { background: rgba(99,102,241,0.85); }

.voice-duration {
  font-size: .72rem;
  color: var(--txt-secondary);
  min-width: 30px;
  text-align: right;
}
.voice-speed-btn {
  font-size: .7rem;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 1px 5px;
  cursor: pointer;
  color: var(--txt-secondary);
  transition: background .15s;
}
.voice-speed-btn:hover { background: rgba(255,255,255,.18); }

/* ── Circle bubble (video message) ──────────────────────────────────────── */
.circle-wrap {
  width: 160px; height: 160px;
  position: relative;
  flex-shrink: 0;
}
.circle-progress-ring {
  position: relative;
  width: 100%; height: 100%;
}
.circle-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.circle-track { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 4; }
.circle-prog  {
  fill: none;
  stroke: url(#circleGrad);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset .15s linear;
}

/* ── Typing indicator ────────────────────────────────────────────────────── */
.chat-typing {
  padding: 4px 18px 6px;
  font-size: .78rem;
  color: var(--txt-secondary);
  font-style: italic;
  min-height: 22px;
  flex-shrink: 0;
}

/* ── Input bar ───────────────────────────────────────────────────────────── */
.chat-input-bar {
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-shrink: 0;
  position: relative;
}
.chat-login-prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px;
  color: var(--txt-secondary);
  font-size: .88rem;
}
.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px;
}
.chat-textarea {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  padding: 9px 14px;
  color: inherit;
  font: inherit;
  font-size: .9rem;
  resize: none;
  min-height: 38px;
  max-height: 160px;
  line-height: 1.4;
  overflow-y: auto;
  transition: border-color .15s, background .15s;
}
.chat-textarea:focus {
  outline: none;
  background: rgba(255,255,255,.11);
  border-color: rgba(91,94,244,.5);
}
.chat-send-btn,
.chat-record-btn,
.chat-media-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: transform .12s, background .15s;
}
.chat-send-btn:active, .chat-record-btn:active, .chat-media-btn:active { transform: scale(.9); }

.chat-send-btn {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 12px rgba(91,94,244,.4);
}
.chat-record-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.chat-record-btn.recording {
  background: rgba(255,60,60,.25);
  border-color: rgba(255,60,60,.5) !important;
  animation: pulse-rec 1s ease infinite;
}
@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,60,60,.4); }
  50%       { box-shadow: 0 0 0 8px rgba(255,60,60,0); }
}
.chat-media-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14) !important;
  font-size: 1.1rem;
}

/* ── Recording overlay ───────────────────────────────────────────────────── */
.chat-rec-overlay {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0,0,0,.15);
}
.rec-wave-wrap { flex: 1; }
.rec-canvas { display: block; width: 100%; border-radius: 6px; }
.rec-circle-preview-wrap {
  position: relative;
  width: 80px; height: 80px;
  flex-shrink: 0;
}
.rec-circle-video {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 2px solid rgba(255,60,60,.6);
}
.rec-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f44;
  animation: pulse-rec 1s ease infinite;
}
.rec-label { font-size: .78rem; color: var(--txt-secondary); }
.rec-stop-btn {
  background: rgba(255,60,60,.25);
  border: 1px solid rgba(255,60,60,.4);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: .8rem;
  cursor: pointer;
  color: #fff;
  transition: background .15s;
}
.rec-stop-btn:hover { background: rgba(255,60,60,.4); }

/* ── Link preview card ───────────────────────────────────────────────────── */
.chat-link-preview {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-left: 3px solid rgba(91,94,244,.6);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
  overflow: hidden;
}
.chat-link-preview:hover { background: rgba(255,255,255,.12); }
.chat-link-preview img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.lp-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-title { font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-desc  { font-size: .75rem; color: var(--txt-secondary); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lp-url   { font-size: .7rem; color: #818cf8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Mobile tweaks ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .chat-section { height: calc(100dvh - 64px); }
  .chat-msg-wrap { max-width: 92%; }
  .voice-player { min-width: 160px; }
  .circle-wrap { width: 130px; height: 130px; }
  .chat-textarea { font-size: .86rem; }
}

/* ── Share button on episode/track cards (inline in meta row) ────────────── */
.ep-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--txt-secondary);
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  margin-left: auto;
}
.ep-share-btn:hover {
  background: rgba(124,58,237,0.28);
  border-color: var(--accent-1);
  color: #c4b5fd;
}

/* ── Delete message button ───────────────────────────────────────────────── */
.chat-msg-delete {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
  flex-shrink: 0;
  align-self: center;
  padding: 0;
}
.chat-msg-wrap:hover .chat-msg-delete { opacity: 1; }
.chat-msg-delete:hover { background: rgba(239,68,68,0.28); }

/* ── Telegram-style voice recording bar ─────────────────────────────────── */
.chat-rec-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  animation: recBarIn .15s ease;
}
@keyframes recBarIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.rec-pulse {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}
.rec-timer-lg {
  font-size: .88rem;
  font-weight: 600;
  color: #ef4444;
  min-width: 38px;
  font-variant-numeric: tabular-nums;
}
.rec-canvas-inline {
  flex: 1;
  display: block;
  height: 32px;
  border-radius: 6px;
}
.rec-hint-text {
  font-size: .75rem;
  color: var(--txt-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Telegram-style circle recording overlay ─────────────────────────────── */
.chat-rec-circle-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  animation: recCircleIn .2s ease;
}
@keyframes recCircleIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: none; }
}
.rec-circle-container {
  position: relative;
  width: 240px; height: 240px;
}
.rec-circle-preview {
  width: 240px; height: 240px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.rec-circle-ring-anim {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: #ef4444;
  border-right-color: rgba(239,68,68,0.4);
  animation: recSpin 1.2s linear infinite;
}
@keyframes recSpin {
  to { transform: rotate(360deg); }
}
.rec-circle-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: .92rem;
}

/* ── Delete account danger zone ──────────────────────────────────────────── */
.danger-zone {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(239,68,68,0.2);
}
.btn-danger-outline {
  width: 100%;
  justify-content: center;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(239,68,68,0.4);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-danger-outline:hover {
  background: rgba(239,68,68,0.14);
  border-color: rgba(239,68,68,0.6);
}
.delete-confirm-section {
  margin-top: 12px;
  padding: 14px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  animation: recBarIn .15s ease;
}
.delete-confirm-section p {
  font-size: .83rem;
  color: #fca5a5;
  margin-bottom: 12px;
  line-height: 1.55;
}
