:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161e;
  --bg-hover: #1e1e2a;
  --bg-sidebar: #0e0e16;
  --purple-main: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: #9333ea;
  --purple-dark: #4c1d95;
  --purple-subtle: rgba(124,58,237,0.15);
  --pink-accent: #ec4899;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border: rgba(124,58,237,0.2);
  --border-light: rgba(255,255,255,0.05);
  --header-h: 56px;
  --sidebar-w: 240px;
  --sidebar-collapsed-w: 72px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-glow: 0 0 20px rgba(124,58,237,0.3);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);
  --transition: 0.2s ease;
}

/* ========== LIGHT MODE ========== */
[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #e8e8f0;
  --bg-sidebar: #ffffff;
  --text-primary: #0f0f13;
  --text-secondary: #4a4a6a;
  --text-muted: #888899;
  --border: rgba(124,58,237,0.2);
  --border-light: rgba(0,0,0,0.08);
  --shadow-card: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-glow: 0 0 20px rgba(124,58,237,0.2);
}
[data-theme="light"] body { background: var(--bg-primary); color: var(--text-primary); }
[data-theme="light"] header { background: rgba(255,255,255,0.95); border-bottom: 1px solid var(--border-light); }
[data-theme="light"] #sidebar { background: var(--bg-sidebar); border-right: 1px solid var(--border-light); }
[data-theme="light"] .video-card { background: var(--bg-card); box-shadow: var(--shadow-card); }
[data-theme="light"] .dropdown-menu { background: #fff; border: 1px solid var(--border-light); }
[data-theme="light"] .modal-content { background: #fff; }
[data-theme="light"] .auth-tabs { background: #f0f0f5; }
[data-theme="light"] .auth-tab.active { background: #fff; color: var(--purple-main); }
[data-theme="light"] .auth-input { background: #f5f5fa; border-color: #ddd; color: var(--text-primary); }
[data-theme="light"] .auth-input:focus { background: #fff; }
[data-theme="light"] .studio-nav { background: #fff; border-right: 1px solid var(--border-light); }
[data-theme="light"] .studio-nav a { color: var(--text-secondary); }
[data-theme="light"] .studio-nav a.active { background: var(--purple-subtle); color: var(--purple-main); }
[data-theme="light"] .chat-panel { background: #fff; border-left: 1px solid var(--border-light); }
[data-theme="light"] .comment-input { background: #f5f5fa; }
[data-theme="light"] select, [data-theme="light"] textarea { background: #f5f5fa; color: var(--text-primary); border-color: #ddd; }
[data-theme="light"] .spinner { border-color: rgba(0,0,0,0.1); border-top-color: var(--purple-main); }
[data-theme="light"] .toast { background: #1a1a2e; }
/* smooth theme transition */
*, *::before, *::after { transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease; }

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-main); }

/* HEADER */
#main-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(10,10,15,0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px 0 16px; gap: 0;
}

.header-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.header-center { flex: 0 0 auto; width: 560px; max-width: 42vw; }
.header-right { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; padding-right: 12px; }

.hamburger {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 18px;
  transition: var(--transition);
}
.hamburger:hover { background: var(--bg-hover); color: var(--text-primary); }

.logo-link { display: flex; align-items: center; gap: 8px; }
.logo-img { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(124,58,237,0.6)); padding: 2px; box-sizing: content-box; }
.logo-text { font-size: 20px; font-weight: 800; background: linear-gradient(135deg, #a855f7, #ec4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; }

.search-bar {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px; overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.search-bar:focus-within { border-color: var(--purple-main); box-shadow: 0 0 0 2px rgba(124,58,237,0.18); }
.search-bar input {
  flex: 1; padding: 9px 18px; background: transparent;
  color: var(--text-primary); font-size: 14px; border: none;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
  padding: 8px 16px; color: var(--text-secondary);
  transition: var(--transition); font-size: 14px;
}
.search-bar button:hover { color: var(--purple-light); }
.search-bar #voice-search-btn { border-left: 1px solid var(--border); }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 19px;
  transition: var(--transition); position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); transform: scale(1.08); }

.notif-badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--pink-accent); color: white; border-radius: 50%;
  width: 16px; height: 16px; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.user-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 50px;
  transition: var(--transition); cursor: pointer;
}
.user-avatar-btn:hover { background: var(--bg-hover); }
.user-avatar-btn img {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--purple-main);
}
.user-avatar-btn .avatar-placeholder {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-main), var(--pink-accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: white;
}
.user-avatar-btn span { font-size: 13px; font-weight: 600; }

.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); min-width: 200px;
  box-shadow: var(--shadow-card); z-index: 200; overflow: hidden;
  animation: fadeDown 0.15s ease;
}
@keyframes fadeDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: translateY(0); } }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-secondary);
  font-size: 14px; width: 100%; text-align: left;
  transition: var(--transition);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-menu .divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.dropdown-menu a[style*="ef4444"]:hover { background: rgba(239,68,68,0.1) !important; color: #ef4444 !important; }

/* Watch-Page "Mehr"-Menü (Watch Party / Clip erstellen / Remix / Melden) —
   fehlte komplett im Stylesheet, dadurch wurde das Menü nicht als schwebendes
   Dropdown positioniert/versteckt, sondern lief einfach unstyled im Textfluss mit. */
.watch-more-wrap { position: relative; display: inline-block; }
.watch-more-dropdown {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); min-width: 210px;
  box-shadow: var(--shadow-card); z-index: 200; overflow: hidden;
}
.watch-more-dropdown.open { display: block; animation: fadeDown 0.15s ease; }
.watch-more-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text-secondary);
  font-size: 14px; cursor: pointer; transition: var(--transition);
}
.watch-more-item:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-login {
  padding: 7px 16px; border-radius: 50px;
  border: 1px solid var(--purple-main); color: var(--purple-light);
  font-size: 13px; font-weight: 600; transition: var(--transition);
}
.btn-login:hover { background: var(--purple-subtle); }
.btn-register {
  padding: 7px 16px; border-radius: 50px;
  background: linear-gradient(135deg, var(--purple-main), var(--purple-glow));
  color: white; font-size: 13px; font-weight: 600;
  box-shadow: 0 0 16px rgba(124,58,237,0.4); transition: var(--transition);
}
.btn-register:hover { box-shadow: 0 0 24px rgba(124,58,237,0.6); transform: translateY(-1px); }

/* SIDEBAR */
#sidebar {
  position: fixed; left: 0; top: var(--header-h);
  width: var(--sidebar-w); height: calc(100vh - var(--header-h));
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  transition: width 0.25s ease, transform 0.25s ease;
  z-index: 90;
  display: flex; flex-direction: column;
}
#sidebar.collapsed { width: var(--sidebar-collapsed-w); }
#sidebar.collapsed .nav-item span,
#sidebar.collapsed .sidebar-footer { display: none; }
#sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }

.sidebar-nav { padding: 8px 0; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  transition: var(--transition); border-radius: 0;
  white-space: nowrap;
}
.nav-item i { font-size: 18px; min-width: 20px; text-align: center; }
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { color: var(--purple-light); background: var(--purple-subtle); }
.nav-item.active i { color: var(--purple-main); }
.nav-item.premium-item { color: #f59e0b; }
.nav-item.premium-item i { color: #f59e0b; }
.nav-item.premium-item:hover { background: rgba(245,158,11,0.1); }
.nav-divider { height: 1px; background: var(--border-light); margin: 6px 12px; }
.sidebar-footer {
  padding: 16px 20px 20px;
  color: var(--text-muted);
  font-size: 11px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}
.sidebar-footer .footer-copy {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.sidebar-footer .footer-email a {
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.75;
  font-size: 11px;
  transition: opacity 0.15s;
}
.sidebar-footer .footer-email a:hover { opacity: 1; }
.sidebar-footer .footer-legal {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.sidebar-footer .footer-legal a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  opacity: 0.65;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  transition: opacity 0.15s, color 0.15s;
}
.sidebar-footer .footer-legal a:hover { opacity: 1; color: var(--accent); }
.sidebar-footer .footer-legal a i {
  font-size: 9px;
  width: 12px;
  text-align: center;
  opacity: 0.7;
}
.sidebar-footer .footer-discord {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 12px;
  background: #5865F2;
  color: #fff !important;
  border-radius: 8px;
  font-size: 11px;
  text-decoration: none;
  font-weight: 600;
  opacity: 1 !important;
  transition: background 0.15s, transform 0.1s;
}
.sidebar-footer .footer-discord:hover { background: #4752c4; transform: translateY(-1px); }

/* MAIN CONTENT */
#main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
  transition: margin-left 0.25s ease;
  padding: 24px;
}
#main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed-w); }

/* PAGES */
.page { display: block; }

/* VIDEO GRID */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card), 0 0 20px rgba(124,58,237,0.15); }

.video-thumb {
  position: relative; width: 100%; padding-top: 56.25%; background: #1a1a22; overflow: hidden;
}
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-thumb img { transform: scale(1.05); }
.video-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-thumb-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: rgba(255,255,255,0.1); font-size: 40px;
}
.video-duration {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.8); color: white;
  padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600;
  font-family: 'Space Mono', monospace;
}
.live-badge {
  position: absolute; top: 8px; left: 8px;
  background: #ef4444; color: white; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.short-badge-thumb {
  position: absolute; top: 8px; right: 8px;
  background: linear-gradient(135deg, var(--purple-main), var(--pink-accent));
  color: white; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
}
.paid-badge {
  position: absolute; top: 8px; left: 8px;
  background: #f59e0b; color: #000; padding: 2px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 700;
}

.video-info { padding: 12px; }
.video-meta { display: flex; gap: 10px; align-items: flex-start; }
.video-channel-avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.video-channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* Wrapper that does NOT clip: lets frame ring overflow freely */
.video-channel-avatar-wrap {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  /* minimum width so row doesn't collapse when no frame */
  min-width: 36px;
}
.video-meta-text h3 { font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta-text p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.video-meta-text .views-time { font-size: 12px; color: var(--text-muted); }

/* WATCH PAGE */
#page-watch { max-width: 1400px; }
.watch-layout { display: grid; grid-template-columns: 1fr 380px; gap: 24px; }
.watch-player-section {}
.watch-player-wrapper {
  background: #000; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; padding-top: 56.25%;
}
.watch-player-wrapper video {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.watch-player-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.watch-player-wrapper .short-player { padding-top: 177%; }

/* Chromecast / Remote Playback Button */
.nxd-cast-btn {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 36px; height: 36px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.55); color: #fff; border: none;
  cursor: pointer; backdrop-filter: blur(4px);
  transition: background 0.15s ease, transform 0.1s ease;
}
.nxd-cast-btn:hover { background: rgba(0,0,0,0.8); }
.nxd-cast-btn:active { transform: scale(0.94); }
.nxd-cast-btn svg { display: block; }
/* Short player: overrides the 16:9 wrapper completely */
.short-player-wrapper {
  position: relative !important; max-width: 400px; margin: 0 auto;
  border-radius: var(--radius-xl) !important; overflow: hidden; background: #000;
  aspect-ratio: 9/16 !important; padding-top: 0 !important;
}
.short-player-wrapper video {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important;
  object-fit: cover !important; display: block !important;
}

.watch-info { padding: 16px 0; }
.watch-title { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.watch-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; gap: 12px; }
.watch-views { color: var(--text-muted); font-size: 14px; }
.watch-actions { display: flex; gap: 8px; }
.action-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 50px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: var(--transition);
}
.action-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-btn.active { background: var(--purple-subtle); border-color: var(--purple-main); color: var(--purple-light); }

.watch-channel {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 0; border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light);
  margin: 12px 0;
}
.watch-channel-info { flex: 1; }
.watch-channel-name { font-size: 16px; font-weight: 600; cursor: pointer; }
.watch-channel-name:hover { color: var(--purple-light); }
.watch-channel-subs { font-size: 13px; color: var(--text-muted); }
.watch-channel-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--purple-main); }
.watch-channel-avatar-placeholder {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--purple-dark), var(--pink-accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
}

.subscribe-btn {
  padding: 8px 20px; border-radius: 50px;
  background: var(--text-primary); color: var(--bg-primary);
  font-weight: 700; font-size: 14px; transition: var(--transition);
}
.subscribe-btn:hover { background: var(--purple-light); color: white; }
.subscribe-btn.subscribed { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.subscribe-btn.subscribed:hover { border-color: #ef4444; color: #ef4444; }

.bell-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.bell-btn.active { color: #f59e0b; border-color: #f59e0b; }
.bell-btn:hover { background: var(--bg-hover); }

.watch-description {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 14px 16px; font-size: 14px; color: var(--text-secondary);
  cursor: pointer; max-height: 88px; overflow: hidden;
  transition: max-height 0.35s ease; position: relative;
  line-height: 1.6;
  white-space: pre-wrap;     /* respect newlines as fallback */
  white-space: normal;       /* but let our <br>/<p> tags handle it */
  word-break: break-word;
}
.watch-description p { margin: 0; }
.watch-description p + p { margin-top: 8px; }
.watch-description.expanded { max-height: 2000px; }
.watch-description::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 48px; background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
}
.watch-description.expanded::after { display: none; }
.watch-description .mehr-btn {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

/* AD BANNER */
.ad-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(236,72,153,0.1));
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 16px; text-align: center; color: var(--text-muted);
  font-size: 12px; position: relative; margin-bottom: 16px;
}
.ad-banner .skip-ad {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); color: var(--text-secondary);
  padding: 4px 8px; border-radius: 4px; font-size: 11px;
}

/* COMMENTS */
.comments-section { margin-top: 24px; }
.comments-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.comment-input { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.comment-input textarea {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: var(--text-primary); padding: 8px 0; font-size: 14px; resize: none; min-height: 36px;
  transition: border-color 0.2s;
}
.comment-input textarea:focus { border-color: var(--purple-main); }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }

.comment-item { display: flex; gap: 12px; margin-bottom: 16px; }
.comment-body { flex: 1; }
.comment-author { font-size: 13px; font-weight: 600; margin-right: 8px; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-text { font-size: 14px; color: var(--text-secondary); margin-top: 4px; line-height: 1.5; }
.comment-actions { display: flex; gap: 12px; margin-top: 6px; }
.comment-action { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; cursor: pointer; }
.comment-action:hover { color: var(--text-primary); }
.comment-action.active { color: var(--purple-light); }

/* SIDEBAR VIDEOS LIST */
.related-videos h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.related-video-item {
  display: flex; gap: 10px; cursor: pointer; padding: 8px;
  border-radius: var(--radius-md); transition: var(--transition);
}
.related-video-item:hover { background: var(--bg-hover); }
.related-thumb {
  width: 120px; height: 68px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-card); flex-shrink: 0; position: relative;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--bg-card); color: rgba(255,255,255,0.1); font-size: 24px; }
.related-info h4 { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-info p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* SHORTS PAGE – YouTube-Style mit Sidebar + Header */
#page-shorts {
  display: flex;
  justify-content: center;
  padding: 0;
  position: relative;
}

.shorts-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 420px;
  max-width: 420px;
  height: calc(100vh - var(--header-h) - 48px);
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 8px 0;
}
.shorts-container::-webkit-scrollbar { display: none; }

.short-card {
  position: relative;
  width: 420px;
  aspect-ratio: 9/16;
  height: calc(100vh - var(--header-h) - 64px);
  max-height: 780px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
  border-radius: 16px;
  flex-shrink: 0;
}
.short-card video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.short-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.75) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 16px 20px;
}
.short-side-actions {
  position: absolute; right: 12px; bottom: 80px; z-index: 10;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.short-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: white; cursor: pointer; user-select: none;
  transition: transform 0.15s ease;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.short-action:active { transform: scale(0.88); }
.short-action i { font-size: 26px; }
.short-action span { font-size: 12px; font-weight: 700; }
.short-info h4 { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.short-info p { font-size: 13px; color: rgba(255,255,255,0.75); text-shadow: 0 1px 4px rgba(0,0,0,0.8); }

/* Nav-Pfeile rechts neben dem Video */
.shorts-nav-btn {
  position: fixed;
  right: calc(50vw - var(--sidebar-w)/2 - 210px - 64px);
  z-index: 300;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
  box-shadow: var(--shadow-card);
}
.shorts-nav-btn:hover { background: var(--bg-hover); transform: scale(1.08); }
.shorts-nav-btn:active { transform: scale(0.94); }
#shorts-nav-up { bottom: calc(50vh + 30px); }
#shorts-nav-down { bottom: calc(50vh - 30px); }

/* Progress dots */
.shorts-progress { display: none; }


/* LIVE STREAM PAGE */
.stream-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.stream-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: transform 0.2s;
  border: 1px solid var(--border-light);
}
.stream-card:hover { transform: translateY(-4px); }
.stream-thumb { position: relative; padding-top: 56.25%; background: #0a0010; }
.stream-thumb-img { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.stream-thumb-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at center, rgba(124,58,237,0.3), #0a0010);
  font-size: 48px; color: rgba(255,255,255,0.2);
}
.stream-viewers {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.7); color: white; padding: 2px 8px;
  border-radius: 4px; font-size: 12px;
}
.stream-info { padding: 12px; }
.stream-title { font-size: 14px; font-weight: 600; }
.stream-streamer { font-size: 12px; color: var(--text-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }

.stream-watch-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; height: calc(100vh - 120px); }
.stream-player-wrap { position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.stream-player-wrap video { width: 100%; height: 100%; object-fit: contain; }
.stream-offline {
  position: relative; min-height: 300px; aspect-ratio: 16/9;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(124,58,237,0.2), #0a0a0f);
  border-radius: var(--radius-lg);
  color: rgba(255,255,255,0.5); gap: 16px;
}

/* ==== Modern Live-Player (ersetzt native <video controls>) ==== */
.nx-player {
  position: relative; width: 100%; aspect-ratio: 16/9; max-height: calc(100vh - 220px);
  background: #0a0a0f; border-radius: var(--radius-lg); overflow: hidden;
}
.nx-player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #0a0a0f; }

.nx-player-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: radial-gradient(circle at 50% 40%, rgba(124,58,237,0.18), #0a0a0f 75%);
  color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 600; transition: opacity 0.25s ease;
  pointer-events: none;
}
.nx-player-loading.nx-hidden { opacity: 0; visibility: hidden; }
.nx-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--purple-light, #a78bfa);
  animation: nx-spin 0.8s linear infinite;
}
@keyframes nx-spin { to { transform: rotate(360deg); } }

.nx-player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.55) 60%, transparent);
  opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease;
}
.nx-player.nx-controls-visible .nx-player-controls,
.nx-player:not(.nx-has-js) .nx-player-controls { opacity: 1; transform: translateY(0); }
.nx-player-controls .nx-ctrl-btn {
  background: none; border: none; color: #fff; font-size: 15px; cursor: pointer;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: background 0.15s ease;
}
.nx-player-controls .nx-ctrl-btn:hover { background: rgba(255,255,255,0.12); }
.nx-ctrl-spacer { flex: 1; }
.nx-volume-slider { width: 70px; accent-color: var(--purple-light, #a78bfa); cursor: pointer; }
.nx-live-dot {
  display: inline-flex; align-items: center; gap: 6px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.5px; padding: 4px 9px; border-radius: 20px;
  position: relative;
}
.nx-live-dot-ping {
  width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.5s infinite;
}
@media (max-width: 640px) {
  .nx-volume-slider { display: none; }
  .nx-player { max-height: 50vh; }
}
.stream-chat { background: var(--bg-card); border-radius: var(--radius-lg); display: flex; flex-direction: column; border: 1px solid var(--border); overflow: hidden; }
.chat-header { padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { font-size: 13px; }
.chat-msg .chat-username { color: var(--purple-light); font-weight: 600; }
.chat-input-area { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.chat-input-area input { flex: 1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 50px; padding: 8px 14px; color: var(--text-primary); font-size: 13px; }

/* CREATOR STUDIO */
.studio-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; min-height: 500px; }
.studio-nav { background: var(--bg-card); border-radius: var(--radius-lg); padding: 12px; height: fit-content; position: sticky; top: 80px; }
.studio-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 14px;
  transition: var(--transition);
}
.studio-nav a:hover { background: var(--bg-hover); color: var(--text-primary); }
.studio-nav a.active { background: var(--purple-subtle); color: var(--purple-light); }
.studio-content { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; }

/* CHANNEL PAGE */
.channel-banner { width: 100%; height: 180px; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(135deg, var(--purple-dark), #0a0020); margin-bottom: -60px; position: relative; }
.channel-banner img, .channel-banner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.channel-header { padding: 0 24px 24px; display: flex; gap: 16px; align-items: flex-end; position: relative; z-index: 1; }
.channel-avatar-wrap { position: relative; width: 100px; height: 100px; border-radius: 50%; flex-shrink: 0; }
.channel-avatar {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--bg-primary); background: var(--purple-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
}
.channel-avatar-wrap video,
video.channel-avatar {
  display: block; width: 100px; height: 100px;
  object-fit: cover; border-radius: 50%;
  border: 4px solid var(--bg-primary);
  flex-shrink: 0;
}
.channel-info { padding-bottom: 8px; }
.channel-name { font-size: 22px; font-weight: 800; }
.channel-handle { font-size: 14px; color: var(--text-muted); margin-top: 2px; }
.channel-stats { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.channel-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.channel-tab { padding: 12px 20px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition); }
.channel-tab:hover { color: var(--text-primary); }
.channel-tab.active { color: var(--purple-light); border-bottom-color: var(--purple-main); }

/* PREMIUM PAGE */
.premium-hero { text-align: center; padding: 60px 24px; }
.premium-hero h1 { font-size: 48px; font-weight: 900; background: linear-gradient(135deg, #f59e0b, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.premium-hero p { font-size: 18px; color: var(--text-secondary); margin-top: 12px; }
.premium-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 900px; margin: 40px auto; }
.premium-card {
  background: var(--bg-card); border-radius: var(--radius-xl); padding: 32px;
  border: 1px solid var(--border); text-align: center; position: relative; overflow: hidden;
}
.premium-card.featured { border-color: var(--purple-main); box-shadow: 0 0 40px rgba(124,58,237,0.3); }
.premium-card::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s; background: radial-gradient(circle at 50% 0%, rgba(124,58,237,0.15), transparent 70%); pointer-events: none; }
.premium-card:hover::before { opacity: 1; }
.premium-card .price { font-size: 48px; font-weight: 900; color: var(--text-primary); }
.premium-card .price small { font-size: 18px; font-weight: 400; color: var(--text-muted); }
.premium-features { list-style: none; margin: 24px 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.premium-features li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-secondary); }
.premium-features li i { color: #22c55e; }
.premium-features li.premium-only { color: var(--purple-light); }
.premium-features li.premium-only i { color: var(--purple-light); }

/* POSTS / FEED */
.feed-container { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.create-post-bar {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 16px; border: 1px solid var(--border); display: flex; gap: 12px; align-items: center;
  cursor: pointer; transition: var(--transition);
}
.create-post-bar:hover { border-color: var(--purple-main); }
.create-post-bar input { flex: 1; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 50px; padding: 10px 16px; color: var(--text-primary); cursor: pointer; }
.post-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 16px; border: 1px solid var(--border-light); }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.post-author-name { font-weight: 700; font-size: 14px; }
.post-time { font-size: 12px; color: var(--text-muted); }
.post-text { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.post-images { display: grid; gap: 4px; border-radius: var(--radius-md); overflow: hidden; }
.post-images.one { grid-template-columns: 1fr; }
.post-images.two { grid-template-columns: 1fr 1fr; }
.post-images.three { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-images.three img:first-child { grid-row: span 2; }
.post-images img { width: 100%; object-fit: cover; cursor: pointer; max-height: 400px; }
.post-actions { display: flex; gap: 16px; padding-top: 12px; border-top: 1px solid var(--border-light); }
.post-action { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13px; cursor: pointer; transition: var(--transition); }
.post-action:hover { color: var(--purple-light); }
.post-action.active { color: var(--pink-accent); }

/* MODALS */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; z-index: 1; background: var(--bg-card);
  border-radius: var(--radius-xl); padding: 32px;
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  animation: modalIn 0.2s ease;
}
.upload-modal-box { max-width: 620px; }
@keyframes modalIn { from { opacity:0; transform: scale(0.95) translateY(20px); } to { opacity:1; transform: scale(1) translateY(0); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-hover); color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.1); }

.auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--bg-secondary); border-radius: 50px; padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border-radius: 50px; font-size: 14px; font-weight: 600; color: var(--text-muted); transition: var(--transition); }
.auth-tab.active { background: var(--purple-main); color: white; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-group input, .form-group textarea, .form-group select {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text-primary); font-size: 14px; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--purple-main); }
.form-group select option { background: var(--bg-secondary); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 16px; }
.toggle-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); cursor: pointer; }
.toggle-label input[type=checkbox] { accent-color: var(--purple-main); width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple-main), var(--purple-glow));
  color: white; padding: 10px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 700; transition: var(--transition);
  box-shadow: 0 4px 15px rgba(124,58,237,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(124,58,237,0.5); }
.btn-primary:disabled { opacity: 0.5; transform: none; }
.btn-secondary { background: var(--bg-hover); color: var(--text-primary); padding: 10px 24px; border-radius: 50px; font-size: 14px; font-weight: 600; transition: var(--transition); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.full-width { width: 100%; }
.btn-danger { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); padding: 8px 16px; border-radius: 50px; font-size: 14px; font-weight: 600; transition: var(--transition); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.error-msg { color: #ef4444; font-size: 13px; margin-top: 8px; text-align: center; }

/* UPLOAD TABS */
.upload-tabs-nav { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.utab { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: var(--transition); }
.utab.active { color: var(--purple-light); border-bottom-color: var(--purple-main); }
.utab:hover { color: var(--text-primary); }
.upload-type-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.upload-tab { flex: 1; padding: 10px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition); }
.upload-tab.active { border-color: var(--purple-main); color: var(--purple-light); background: var(--purple-subtle); }
.utab-content { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-lg);
  padding: 40px; text-align: center; cursor: pointer;
  transition: var(--transition);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--purple-main); background: var(--purple-subtle); }
.drop-zone i { font-size: 40px; color: var(--purple-light); margin-bottom: 12px; }
.drop-zone p { color: var(--text-secondary); font-size: 15px; font-weight: 500; }
.drop-zone small { color: var(--text-muted); }

.thumbnail-upload .thumb-drop {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 20px; text-align: center; cursor: pointer;
  transition: var(--transition); overflow: hidden; min-height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.thumb-drop:hover { border-color: var(--purple-main); }
.thumb-drop #thumb-preview-img { max-height: 120px; border-radius: var(--radius-sm); }
.thumb-placeholder { color: var(--text-muted); }

#video-preview { width: 100%; border-radius: var(--radius-md); margin-top: 12px; max-height: 240px; background: #000; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 700; margin-top: 4px; }
.badge-short { background: linear-gradient(135deg, var(--purple-main), var(--pink-accent)); color: white; }

.progress-bar { background: var(--bg-secondary); border-radius: 50px; height: 6px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--purple-main), var(--pink-accent)); transition: width 0.3s; }

.advanced-note { background: var(--purple-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.advanced-note i { color: #f59e0b; }
.note { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

.images-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.images-preview-grid img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

/* SIDE PANEL */
.side-panel {
  position: fixed; top: var(--header-h); right: 0;
  width: 360px; height: calc(100vh - var(--header-h));
  background: var(--bg-card); border-left: 1px solid var(--border);
  z-index: 95; display: flex; flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.panel-header h3 { font-size: 16px; font-weight: 700; }
.panel-header button { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: var(--transition); }
.panel-header button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* TOAST */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 20px;
  color: var(--text-primary); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-card); animation: toastIn 0.3s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-color: #22c55e; }
.toast.error { border-color: #ef4444; }
.toast i.success { color: #22c55e; }
.toast i.error { color: #ef4444; }
@keyframes toastIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

/* PAGE HEADERS */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h2 { font-size: 24px; font-weight: 800; }
.page-header .page-header-actions { display: flex; gap: 8px; }

.empty-state {
  text-align: center; padding: 80px 24px; color: var(--text-muted);
}
.empty-state i { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 15px; margin-bottom: 24px; }

/* LOADING SPINNER */
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--purple-main); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SECTION TITLE */
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--purple-light); }

/* CATEGORY PILLS */
.category-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 16px; scrollbar-width: none; margin-bottom: 8px; }
.category-strip::-webkit-scrollbar { display: none; }
.cat-pill { padding: 6px 16px; border-radius: 50px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: var(--transition); }
.cat-pill:hover { border-color: var(--purple-main); color: var(--purple-light); }
.cat-pill.active { background: var(--purple-main); border-color: var(--purple-main); color: white; }

/* RESPONSIVE */
/* =============================================================
   RESPONSIVE — TABLET, MOBILE, SMALL PHONE
   ============================================================= */

/* 1200px: watch page layout */
@media (max-width: 1200px) {
  .watch-layout { grid-template-columns: 1fr; }
  .related-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
  .related-video-item { flex-direction: column; }
  .related-thumb { width: 100%; height: 130px; }
  .stream-watch-layout { grid-template-columns: 1fr; height: auto; }
}

/* ── TABLET 960px ─────────────────────────────────────────── */
@media (max-width: 960px) {
  #sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    z-index: 300;
  }
  #sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }
  /* Dim overlay when sidebar open */
  #sidebar-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 299;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
  }
  #sidebar-backdrop.active { display: block; }

  #main-content { margin-left: 0 !important; }
  .header-left { min-width: auto; }
  .header-center { width: auto; max-width: 100%; flex: 1; margin: 0 8px; }
  .logo-text { display: none; }
  .studio-layout { grid-template-columns: 1fr; }
  .studio-nav {
    display: flex; flex-wrap: wrap; gap: 6px;
    border-right: none; border-bottom: 1px solid var(--border);
    padding-bottom: 12px; margin-bottom: 16px;
  }
  .studio-nav a { padding: 6px 14px; font-size: 12px; border-radius: 20px; background: var(--bg-secondary); }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ── MOBILE 640px ─────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --header-h: 52px; }

  /* ── Header ── */
  #main-header {
    padding: 0 8px;
    gap: 0;
    height: var(--header-h);
  }
  .header-left { flex: 0 0 auto; gap: 6px; }
  .logo-img { width: 28px; height: 28px; }
  .header-center {
    flex: 1;
    margin: 0 6px;
    min-width: 0;
  }
  .search-bar {
    width: 100%;
    border-radius: 24px;
    height: 38px;
    min-height: 38px;
  }
  .search-bar input {
    padding: 0 12px;
    font-size: 15px;
    min-width: 0;
    height: 100%;
    line-height: 38px;
  }
  .search-bar button {
    padding: 0 12px;
    height: 100%;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .header-right { flex: 0 0 auto; gap: 2px; padding-right: 0; }
  .icon-btn { width: 34px; height: 34px; font-size: 15px; }

  /* ── Main content ── */
  #main-content {
    padding: 10px 8px 72px; /* bottom: room for nav bar */
  }
  .page-header { margin-bottom: 12px; }
  .page-header h2 { font-size: 17px; }

  /* ── Video grid: 2 columns ── */
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .video-card .thumb { border-radius: 8px; }
  .video-card .card-info { padding: 6px 2px 4px; }
  .video-card .card-title { font-size: 12px; line-height: 1.35; }
  .video-card .card-meta { font-size: 11px; }
  .card-avatar { width: 22px; height: 22px; }

  /* ── Watch page ── */
  #page-watch { padding: 0; }
  .watch-player-wrapper { border-radius: 0 !important; }
  .watch-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
  .watch-info { padding: 12px 10px; }
  .watch-actions { flex-wrap: wrap; gap: 6px; }
  .action-btn { padding: 7px 12px; font-size: 13px; gap: 5px; }
  .watch-channel-info { gap: 8px; }
  .watch-desc { font-size: 13px; }

  /* ── Ad overlay mobile fix ── */
  #nxd-ad-overlay {
    border-radius: 0 !important;
    font-size: 12px;
  }
  #nxd-ad-overlay video {
    object-fit: contain !important;
    max-height: calc(100% - 80px) !important;
  }
  #nxd-ad-overlay > div:last-child {
    /* bottom bar */
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }
  #nxd-ad-skip-btn {
    padding: 6px 14px !important;
    font-size: 12px !important;
    min-width: 90px;
  }
  #nxd-ad-countdown {
    font-size: 11px !important;
    padding: 4px 10px !important;
  }

  /* ── Shorts ── */
  .shorts-container { padding: 0; }
  .short-player-wrapper { max-width: 100% !important; border-radius: 0 !important; }

  /* ── Modal (slides up from bottom) ── */
  .modal-overlay {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px 16px 24px !important;
    overflow-y: auto;
    animation: mobileSlideUp 0.28s cubic-bezier(0.32,0.72,0,1) !important;
    margin: 0 !important;
  }
  @keyframes mobileSlideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  /* Drag handle on modals */
  .modal-box::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 14px;
  }
  /* Auth modal special – don't move modal-close */
  .auth-modal .modal-close { top: 16px; right: 16px; }
  .auth-form .form-group { margin-bottom: 10px; }
  .auth-form input { padding: 12px 14px; font-size: 15px; }

  /* Upload modal */
  .upload-modal-box { max-height: 95dvh !important; }
  .drop-zone { padding: 20px 14px; }
  .drop-zone i { font-size: 28px; }
  .upload-type-tabs { gap: 6px; }
  .upload-tab { padding: 8px 14px; font-size: 13px; }

  /* ── Comments ── */
  .comment-item { gap: 8px; }
  .comment-avatar { width: 30px; height: 30px; font-size: 12px; }
  .comment-content { font-size: 13px; }

  /* ── Studio nav (horizontal scroll) ── */
  .studio-layout { gap: 8px; }
  .studio-nav {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    gap: 6px;
    padding: 0 0 10px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .studio-nav::-webkit-scrollbar { display: none; }
  .studio-nav a {
    flex-shrink: 0 !important;
    padding: 7px 14px !important;
    font-size: 12px !important;
    border-radius: 20px !important;
    background: var(--bg-secondary) !important;
    white-space: nowrap;
  }
  .studio-nav a.active {
    background: var(--purple-main) !important;
    color: white !important;
  }
  .studio-table th, .studio-table td { padding: 10px 8px; font-size: 12px; }
  .studio-table .thumb-cell { width: 80px; }
  .studio-table img { width: 80px; height: 45px; }

  /* ── Premium ── */
  .premium-hero h1 { font-size: 24px; }
  .premium-cards { gap: 10px; }

  /* ── Dropdown ── */
  .dropdown-menu { right: -4px; min-width: 190px; }
  .dropdown-menu a, .dropdown-menu button { padding: 11px 14px; }

  /* ── History / Saved ── */
  .history-thumb { width: 110px; height: 62px; }
  .history-info h4 { font-size: 13px; }

  /* ── Mobile bottom nav bar ── */
  #mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 250;
    height: 58px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    align-items: stretch;
  }
  #mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, transform 0.1s;
  }
  #mobile-bottom-nav a i { font-size: 18px; line-height: 1; }
  #mobile-bottom-nav a.active { color: var(--purple-light); }
  #mobile-bottom-nav a:active { transform: scale(0.88); }
  /* Upload button in center */
  #mobile-bottom-nav a:nth-child(3) { flex: 1.1; }
}

/* ── Mobile search icon + overlay ── */
@media (max-width: 640px) {
  .header-center { display: none !important; }
  #mobile-search-btn { display: flex !important; }
}
#mobile-search-btn { display: none; }
#mobile-search-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg-primary);
  flex-direction: column;
  padding: 10px 12px;
}
#mobile-search-overlay.open { display: flex; }
#mobile-search-overlay .mobile-search-inner {
  display: flex; align-items: center; gap: 10px;
}
#mobile-search-overlay input {
  flex: 1; height: 42px; border-radius: 24px;
  border: 1px solid var(--purple-main);
  background: var(--bg-secondary); color: var(--text-primary);
  padding: 0 16px; font-size: 15px;
}
#mobile-search-overlay input:focus { outline: none; box-shadow: 0 0 0 2px rgba(124,58,237,0.25); }
#mobile-search-overlay .mobile-search-back {
  background: none; border: none; color: var(--text-primary);
  font-size: 20px; cursor: pointer; padding: 4px;
}

/* ── Auth buttons: side by side on mobile ── */
@media (max-width: 640px) {
  #auth-section { display: flex !important; flex-direction: row !important; gap: 6px !important; align-items: center; }
  .btn-login  { padding: 6px 12px; font-size: 12px; }
  .btn-register { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 380px) {
  .video-grid { grid-template-columns: 1fr; }
  .header-center { max-width: calc(100vw - 140px); }
  .search-bar input { font-size: 14px; }
  #mobile-bottom-nav a span { display: none; }
  #mobile-bottom-nav { height: 52px; }
}

/* STUDIO TABLES */
.studio-table { width: 100%; border-collapse: collapse; }
.studio-table th, .studio-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.studio-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.studio-table tr:hover td { background: var(--bg-hover); }
.studio-table .thumb-cell { width: 140px; }
.studio-table img { width: 120px; height: 68px; object-fit: cover; border-radius: var(--radius-sm); }

/* PROFILE DROPDOWN */
.profile-dropdown { position: relative; }

/* STREAM INFO BAR */
.stream-info-bar { padding: 12px 0; display: flex; justify-content: space-between; align-items: center; }
.stream-info-bar h3 { font-size: 18px; font-weight: 700; }

/* HISTORY / SAVED PAGE */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item { display: flex; gap: 12px; padding: 12px; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); }
.history-item:hover { background: var(--bg-card); }
.history-thumb { width: 160px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--bg-card); }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-info h4 { font-size: 15px; font-weight: 600; }
.history-info p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* NOTIFICATION ITEMS */
.notif-item { padding: 12px 20px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--bg-hover); }
.notif-item .notif-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--purple-subtle); display: flex; align-items: center; justify-content: center; color: var(--purple-light); flex-shrink: 0; }
.notif-item .notif-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-item .notif-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-item.unread { background: rgba(124,58,237,0.05); }

/* STREAM KEY BOX */
.stream-key-box { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; }
.stream-key-display { font-family: 'Space Mono', monospace; font-size: 13px; color: var(--purple-light); word-break: break-all; }
.stream-key-actions { display: flex; gap: 8px; margin-top: 12px; }

/* MISC */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-muted { color: var(--text-muted); }
.text-purple { color: var(--purple-light); }
.fw-700 { font-weight: 700; }

/* SHARE MENU */
.share-btn-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px; background: var(--bg-secondary); border-radius: 12px;
  text-decoration: none; color: var(--text-primary);
  border: 1px solid var(--border-light); cursor: pointer;
  transition: all 0.2s; font-size: 12px; font-weight: 600;
}
.share-btn-item:hover { background: var(--purple-main); color: white; transform: translateY(-2px); }

/* AD OVERLAY */
#ad-overlay { border-radius: inherit; }

/* VOICE SEARCH */
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.3; } }
#voice-search-btn.recording { background: rgba(239,68,68,0.15); border-color: #ef4444; }

/* SHORT COMMENT PANEL drag handle */
#short-comment-panel::before {
  content: ''; display: block; width: 40px; height: 4px;
  background: var(--border); border-radius: 2px; margin: 0 auto 12px;
}

/* CHAT COLORS & MOD */
.chat-msg { position: relative; padding: 5px 8px; border-radius: 6px; font-size: 13px; line-height: 1.45; animation: nx-chat-in 0.18s ease; }
.chat-msg:hover { background: rgba(255,255,255,0.05); }
.chat-msg:hover .chat-mod-btn { opacity: 1; }
.chat-msg a { color: var(--purple-light); text-decoration: underline; pointer-events: auto; word-break: break-all; }
.chat-msg a:hover { opacity: 0.85; }
.chat-username { font-weight: 700; }
.chat-colon { color: var(--text-muted); margin: 0 2px; }
.chat-badge { font-size: 11px; margin-right: 3px; }
.streamer-badge { }
.mod-badge { }
@keyframes nx-chat-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-mod-btn {
  display: inline-block; opacity: 0; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-muted); cursor: pointer; font-size: 14px; padding: 1px 6px; line-height: 1.5;
  transition: opacity 0.15s;
}
.chat-mod-btn:hover { color: #fff; border-color: var(--purple-light); }
.ctx-btn {
  display: block; width: 100%; background: none; border: none; padding: 7px 10px;
  text-align: left; color: var(--text-primary); cursor: pointer; font-size: 13px; border-radius: 5px;
}
.ctx-btn:hover { background: var(--bg-secondary); }

/* SETUP-PANEL (Streamer-Einstellungen: Quellen, Qualität, Chat-Mod) */
.nx-setup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.nx-setup-card { background: var(--bg-secondary); border-radius: 14px; padding: 18px; border: 1px solid var(--border); }
.nx-setup-card h4 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 14px; }
.nx-setup-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.nx-setup-row:last-child { border-bottom: none; }
.nx-setup-row-label { font-size: 13px; font-weight: 600; }
.nx-setup-row-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.nx-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.nx-toggle input { opacity: 0; width: 0; height: 0; }
.nx-toggle-slider { position: absolute; inset: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; cursor: pointer; transition: 0.2s; }
.nx-toggle-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: var(--text-muted); border-radius: 50%; transition: 0.2s; }
.nx-toggle input:checked + .nx-toggle-slider { background: var(--purple-main); border-color: var(--purple-main); }
.nx-toggle input:checked + .nx-toggle-slider::before { transform: translateX(18px); background: #fff; }
.nx-select { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 12px; padding: 6px 10px; }
.nx-mod-list-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.nx-mod-list-item .nx-mli-name { flex: 1; }
.nx-mli-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 4px; }
.nx-mli-remove:hover { color: #ef4444; }

/* PREMIUM MODAL ANIMATIONS */
@keyframes premiumPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
#premium-payment-modal input::placeholder { color: rgba(255,255,255,0.25); }
#premium-payment-modal input { transition: border-color 0.2s, background 0.2s; }

/* ==================== CAMERA RECORDING UI ====================  */
#camera-record-ui { animation: fadeIn 0.2s ease; }
.filter-btn { transition: all 0.15s ease; font-weight: 500; }
.filter-btn:active { transform: scale(0.93); }

#record-btn { transition: all 0.2s cubic-bezier(0.175,0.885,0.32,1.275); }
#record-btn:active { transform: scale(0.92) !important; }

#camera-preview { transform: scaleX(-1); } /* Mirror front cam */
#camera-preview.rear-cam { transform: scaleX(1); }

/* Upload source buttons */
#mobile-record-bar button { transition: all 0.15s ease; font-weight: 600; }
#mobile-record-bar button:active { transform: scale(0.96); }

/* Mobile modal slide-up animation */
@media (max-width: 640px) {
  .upload-modal-box {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    transform: none !important;
    animation: mobileSlideUp 0.3s cubic-bezier(0.32,0.72,0,1) !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 95dvh !important;
    overflow-y: auto;
  }
  @keyframes mobileSlideUp {
    from { transform: translateY(100%); opacity: 0.5; }
    to { transform: translateY(0); opacity: 1; }
  }
  /* Drag handle */
  .upload-modal-box::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 14px;
  }
}


/* ============================================================
   NORYNEX — ANIMATION & UI UPGRADE
   ============================================================ */

/* ── Reset transitions for animations ─────────────────────── */
/* Override the broad transition only for interaction elements */
button, a, .video-card, .nav-item, .cat-pill, .action-btn,
.stream-card, .post-card, .related-video-item, .history-item,
.premium-card, .share-btn-item, .icon-btn {
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.2s ease,
              background 0.18s ease,
              border-color 0.18s ease,
              color 0.18s ease,
              opacity 0.18s ease !important;
}

/* ── Ripple ──────────────────────────────────────────────── */
.ripple-host { position: relative; overflow: hidden; }
@keyframes ripple-anim {
  from { transform: scale(0); opacity: 0.35; }
  to   { transform: scale(4); opacity: 0; }
}
.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
  animation: ripple-anim 0.55s ease-out forwards;
  transform-origin: center;
}

/* ── Button press ────────────────────────────────────────── */
.btn-primary:active  { transform: scale(0.95) translateY(1px) !important; }
.btn-secondary:active{ transform: scale(0.95) !important; }
.btn-login:active    { transform: scale(0.96) !important; }
.btn-register:active { transform: scale(0.96) !important; }
.icon-btn:active     { transform: scale(0.88) !important; }
.cat-pill:active     { transform: scale(0.93) !important; }
.action-btn:active   { transform: scale(0.94) !important; }
.subscribe-btn:active{ transform: scale(0.95) !important; }

/* ── Video card ──────────────────────────────────────────── */
.video-card {
  transform-origin: center bottom;
  will-change: transform;
}
.video-card:hover {
  transform: translateY(-6px) scale(1.012) !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5),
              0 0 0 1px rgba(124,58,237,0.25),
              0 0 30px rgba(124,58,237,0.12) !important;
}
.video-card:active {
  transform: translateY(-2px) scale(1.004) !important;
}
.video-card .video-thumb img {
  transition: transform 0.4s cubic-bezier(0.25,0.46,0.45,0.94) !important;
}
.video-card:hover .video-thumb img {
  transform: scale(1.07) !important;
}

/* Play icon overlay on hover */
.video-thumb::after {
  content: '\f144';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: white;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  opacity: 0;
  transition: opacity 0.2s ease !important;
  pointer-events: none;
  background: rgba(0,0,0,0.25);
  border-radius: inherit;
}
.video-card:hover .video-thumb::after { opacity: 1; }

/* ── Stream card ─────────────────────────────────────────── */
.stream-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(124,58,237,0.2) !important;
}

/* ── Nav item — sliding indicator ───────────────────────── */
.nav-item {
  position: relative;
  border-radius: 0 10px 10px 0 !important;
  margin-right: 8px;
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 70%;
  background: linear-gradient(180deg, #a855f7, #ec4899);
  border-radius: 0 3px 3px 0;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.nav-item.active::before,
.nav-item:hover::before { transform: translateY(-50%) scaleY(1); }
.nav-item:hover { transform: translateX(3px) !important; }
.nav-item:active { transform: translateX(1px) scale(0.98) !important; }

/* ── Category pills ──────────────────────────────────────── */
.cat-pill:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(124,58,237,0.2);
}
.cat-pill.active {
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
}

/* ── Page transitions ────────────────────────────────────── */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page { animation: pageIn 0.22s cubic-bezier(0.25,0.46,0.45,0.94); }

/* ── Modal entrance ──────────────────────────────────────── */
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box { animation: modalIn 0.22s cubic-bezier(0.34,1.2,0.64,1) !important; }

/* ── Dropdown ────────────────────────────────────────────── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-menu { animation: fadeDown 0.16s cubic-bezier(0.34,1.56,0.64,1) !important; }

/* ── Toast ───────────────────────────────────────────────── */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(110%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
.toast { animation: toastIn 0.3s cubic-bezier(0.34,1.3,0.64,1) !important; }

/* ── Header scroll shadow ────────────────────────────────── */
#main-header {
  transition: box-shadow 0.3s ease !important;
}
#main-header.scrolled {
  box-shadow: 0 4px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(124,58,237,0.2);
}

/* ── Search bar focus ────────────────────────────────────── */
.search-bar {
  transition: box-shadow 0.2s ease, border-color 0.2s ease !important;
}
.search-bar:focus-within {
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18), 0 2px 12px rgba(124,58,237,0.12) !important;
}

/* ── Icon btn ────────────────────────────────────────────── */
.icon-btn:hover {
  transform: scale(1.12) !important;
  background: rgba(124,58,237,0.12) !important;
  color: var(--purple-light) !important;
}

/* ── Post card ───────────────────────────────────────────── */
.post-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.post-card:hover {
  border-color: rgba(124,58,237,0.3) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
}
.post-action:hover {
  transform: scale(1.1) !important;
}

/* ── Register button pulse ───────────────────────────────── */
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 16px rgba(124,58,237,0.4); }
  50%      { box-shadow: 0 0 28px rgba(168,85,247,0.7); }
}
.btn-register {
  animation: glowPulse 2.5s ease-in-out infinite;
}
.btn-register:hover {
  animation: none;
  box-shadow: 0 0 32px rgba(124,58,237,0.8) !important;
  transform: translateY(-2px) scale(1.03) !important;
}

/* ── Action buttons ──────────────────────────────────────── */
.action-btn:hover {
  transform: translateY(-2px) !important;
}

/* ── Premium card ────────────────────────────────────────── */
.premium-card {
  transition: transform 0.2s cubic-bezier(0.34,1.4,0.64,1), box-shadow 0.2s ease !important;
}
.premium-card:hover {
  transform: translateY(-8px) !important;
}
.premium-card.featured:hover {
  box-shadow: 0 0 60px rgba(124,58,237,0.5) !important;
}

/* ── Share buttons ───────────────────────────────────────── */
.share-btn-item:hover {
  transform: translateY(-4px) scale(1.05) !important;
}

/* ── Mobile bottom nav ───────────────────────────────────── */
#mobile-bottom-nav a {
  transition: color 0.15s ease, transform 0.15s cubic-bezier(0.34,1.56,0.64,1) !important;
}
#mobile-bottom-nav a.active i {
  animation: navPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes navPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Skeleton loading shimmer ────────────────────────────── */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    var(--bg-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-md);
}


/* ============================================================
   CHAPTERS / TIMESTAMPS
   ============================================================ */
.chapters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 10px;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease !important;
}
.chapter-item:hover {
  background: var(--bg-hover);
  transform: translateX(4px) !important;
}
.chapter-item.active {
  background: var(--purple-subtle);
  border-left: 3px solid var(--purple-main);
  padding-left: 7px;
}
.chapter-item.active .chapter-time { color: var(--purple-light); }
.chapter-item.active .chapter-label { color: var(--text-primary); font-weight: 600; }

.chapter-time {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-light);
  min-width: 44px;
  flex-shrink: 0;
}
.chapter-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar chapter markers */
.chapter-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255,255,255,0.6);
  pointer-events: none;
  z-index: 5;
}


/* ============================================================
   CUSTOM SELECT DROPDOWNS (Upload form)
   ============================================================ */
.nxd-select-wrap {
  position: relative;
}
.nxd-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  text-align: left;
}
.nxd-select-btn:hover,
.nxd-select-btn.open {
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.nxd-select-btn span:nth-child(2) {
  flex: 1;
  font-weight: 600;
}
.nxd-select-arrow {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s ease !important;
}
.nxd-select-btn.open .nxd-select-arrow {
  transform: rotate(180deg);
}
.nxd-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 500;
  overflow: hidden;
  animation: fadeDown 0.15s ease;
}
.nxd-select-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s ease !important;
}
.nxd-select-option:hover {
  background: var(--bg-hover);
}
.nxd-select-option i:first-child {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ============================================================
   QUEUE
   ============================================================ */
.queue-add-btn {
  position: absolute;
  bottom: 6px; right: 6px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease !important;
  cursor: pointer;
  z-index: 2;
}
.related-video-item:hover .queue-add-btn,
.video-card:hover .queue-add-btn { opacity: 1; }
.queue-add-btn:hover {
  background: var(--purple-main) !important;
  transform: scale(1.15) !important;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.15s ease !important;
  cursor: pointer;
}
.queue-item:hover { background: var(--bg-hover); }

.queue-item-thumb {
  width: 72px; height: 42px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-secondary);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.queue-ctrl-btn {
  width: 22px; height: 22px;
  border-radius: 4px;
  background: var(--bg-hover);
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s !important;
}
.queue-ctrl-btn:hover { background: rgba(124,58,237,0.2); color: var(--purple-light); }

@keyframes slideUp {
  from { opacity:0; transform:translateY(20px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}

/* ============================================================
   POLLS
   ============================================================ */
.poll-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0;
}
.poll-question {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.poll-option {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s !important;
  background: var(--bg-card);
}
.poll-option:hover:not(.poll-voted) {
  border-color: var(--purple-main);
  transform: translateX(3px) !important;
}
.poll-option.poll-chosen {
  border-color: var(--purple-main);
}
.poll-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(124,58,237,0.2), rgba(168,85,247,0.15));
  transition: width 0.6s cubic-bezier(0.34,1.1,0.64,1) !important;
  pointer-events: none;
}
.poll-option-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.poll-opt-text { font-size: 14px; color: var(--text-primary); }
.poll-pct { font-size: 13px; font-weight: 700; color: var(--purple-light); }
.poll-footer {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   REALTIME DASHBOARD
   ============================================================ */
.dash-stat-card {
  cursor: default;
  transition: transform 0.2s ease !important;
}
.dash-stat-card:hover {
  transform: translateY(-3px) !important;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Kanal-Trailer: klein & rund ── */
.channel-trailer-wrap {
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.channel-trailer-wrap:hover { background: var(--bg-hover); }
.channel-trailer-thumb {
  position: relative;
  width: 160px; height: 90px; flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.channel-trailer-thumb video,
.channel-trailer-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.channel-trailer-thumb .trailer-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  transition: background 0.15s;
}
.channel-trailer-wrap:hover .trailer-play-btn { background: rgba(0,0,0,0.55); }
.channel-trailer-thumb .trailer-play-btn i {
  font-size: 22px; color: white; margin-left: 3px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.channel-trailer-info { flex: 1; min-width: 0; }
.channel-trailer-label {
  font-size: 11px; font-weight: 700; color: var(--purple-light);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 5px;
  display: flex; align-items: center; gap: 5px;
}
.channel-trailer-title {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.channel-trailer-desc {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.channel-trailer-arrow {
  color: var(--text-muted); font-size: 14px; flex-shrink: 0; padding: 0 4px;
}

/* ── Trailer select custom styling ── */
#trailer-video-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
}
#trailer-video-select:focus {
  outline: none;
  border-color: var(--purple-main) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
#trailer-video-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
}

/* ============================================================
   RAHMEN-SHOP
   ============================================================ */
.shop-premium-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(245,158,11,0.1));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 14px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-primary);
}
.shop-premium-banner i { color: #f59e0b; font-size: 16px; flex-shrink:0; }
.shop-premium-banner-hint { background: rgba(245,158,11,0.07); }

.shop-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.shop-cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.shop-cat-btn:hover, .shop-cat-btn.active {
  background: var(--purple-main);
  border-color: var(--purple-main);
  color: white;
}

.shop-frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.shop-frame-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.shop-frame-card:hover {
  transform: translateY(-3px);
  border-color: var(--purple-main);
  box-shadow: 0 8px 24px rgba(124,58,237,0.2);
}
.shop-frame-card.shop-frame-active {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.25);
}

.shop-frame-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-frame-info {
  text-align: center;
}
.shop-frame-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.shop-frame-cat {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.shop-frame-action { width: 100%; }

.shop-badge-active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(34,197,94,0.15);
  color: #22c55e;
  font-size: 13px;
  font-weight: 600;
  width: 100%;
}

.shop-btn-activate, .shop-btn-free, .shop-btn-buy {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.shop-btn-activate:hover, .shop-btn-free:hover, .shop-btn-buy:hover { opacity: 0.85; }

.shop-btn-activate {
  background: rgba(124,58,237,0.15);
  color: var(--purple-light);
  border: 1px solid rgba(124,58,237,0.3);
}
.shop-btn-free {
  background: linear-gradient(135deg, rgba(245,158,11,0.2), rgba(124,58,237,0.2));
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.35);
}
.shop-btn-buy {
  background: var(--purple-main);
  color: white;
}

/* ── Trailer select custom styling ── */
#trailer-video-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  padding-right: 36px !important;
}
#trailer-video-select:focus {
  outline: none;
  border-color: var(--purple-main) !important;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
#trailer-video-select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
}

/* ── Shop: rotate-Animation für Rahmen-Ringe ── */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Rahmen-Spind ── */
#rahmen-spind {
  margin-top: 32px;
}
#rahmen-spind h3 {
  font-size: 17px;
  font-weight: 700;
}
#locker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
#locker-grid > div:hover {
  border-color: var(--purple-main) !important;
}

/* ── Spind improved styles ── */
#rahmen-spind #locker-grid > div {
  user-select: none;
}
#rahmen-spind #locker-grid > div:active {
  transform: scale(0.96) !important;
}

/* ── Search Bar Wrapper (for history dropdown) ── */
.search-bar-wrapper {
  position: relative;
  width: 100%;
}

/* ── Search History Dropdown ── */
.search-history-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 9999;
  animation: dropdownIn 0.15s ease;
}
@keyframes dropdownIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.search-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  transition: background 0.15s;
}
.search-history-item:hover { background: var(--bg-hover, rgba(255,255,255,0.06)); }
.search-history-item .sh-icon { color: var(--text-muted); font-size: 12px; flex-shrink:0; }
.search-history-item .sh-text { flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.search-history-item .sh-del {
  color: var(--text-muted);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.search-history-item .sh-del:hover { color:#ef4444; background:rgba(239,68,68,0.12); }
.search-history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}
.search-history-footer a {
  color: var(--purple-light);
  cursor: pointer;
  text-decoration: none;
}
.search-history-footer a:hover { text-decoration: underline; }

/* ── Cast Modal ── */
.cast-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px 16px 0 0;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from {opacity:0} to {opacity:1} }
.cast-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 280px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  animation: modalSlideIn 0.2s ease;
}
@keyframes modalSlideIn {
  from { opacity:0; transform:translateY(-12px) scale(0.97); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.cast-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.cast-modal-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cast-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.cast-close-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.07); }
.cast-device-list { padding: 8px 0; }
.cast-device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.cast-device-item:hover { background: rgba(255,255,255,0.06); }
.cast-device-item.casting { background: rgba(124,58,237,0.1); }
.cast-device-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cast-device-item.casting .cast-device-icon { color: var(--purple-light); border-color: var(--purple-main); }
.cast-device-info { flex: 1; min-width: 0; }
.cast-device-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cast-device-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cast-scanning { padding: 20px 16px; text-align:center; color: var(--text-muted); font-size: 13px; display:flex; align-items:center; justify-content:center; gap:8px; }
.cast-modal-footer {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
}
.cast-sources-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.cast-sources-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--purple-main); }

/* Search history full modal list */
#search-history-full-list .sh-full-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 13px;
  transition: background 0.15s;
}
#search-history-full-list .sh-full-item:hover { background: rgba(255,255,255,0.05); }
#search-history-full-list .sh-full-item .sh-del { color: var(--text-muted); margin-left:auto; padding: 2px 8px; border-radius:6px; }
#search-history-full-list .sh-full-item .sh-del:hover { color:#ef4444; background:rgba(239,68,68,0.12); }
.sh-empty { padding: 24px 16px; text-align:center; color:var(--text-muted); font-size:13px; }

/* ============================================================
   NORYNEX v202 – TOUCH / 9:16 MOBILE OVERHAUL
   Targets: portrait phones & tablets (≤640px wide)
   ============================================================ */

/* ── Reset touch-action & tap highlight ── */
* { -webkit-tap-highlight-color: transparent; }
button, a, [onclick] { touch-action: manipulation; }

/* ── Modern scroll behavior on iOS ── */
html { -webkit-overflow-scrolling: touch; scroll-behavior: smooth; }
body { overscroll-behavior-y: contain; }

@media (max-width: 640px) and (orientation: portrait) {

  /* ── Variables: tighter spacing on small screens ── */
  :root {
    --header-h: 54px;
    --radius-lg: 14px;
  }

  /* ── Header: always show search bar, compact icons ── */
  #main-header {
    padding: 0 10px;
    gap: 0;
    height: var(--header-h);
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(124,58,237,0.15);
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .header-left {
    flex: 0 0 auto;
    gap: 0;
  }

  /* Always show search bar – full width in center column */
  .header-center {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    display: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Mobile search icon shown instead */
  #mobile-search-btn { display: flex !important; }

  /* Auth buttons side by side */
  #auth-section { display: flex !important; flex-direction: row !important; gap: 6px !important; align-items: center !important; }
  .btn-login  { padding: 6px 11px !important; font-size: 12px !important; }
  .btn-register { padding: 6px 11px !important; font-size: 12px !important; }

  .search-bar {
    width: 100%;
    height: 44px;
    border-radius: 22px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(124,58,237,0.45);
    display: flex !important;
    box-shadow: 0 0 0 0 rgba(124,58,237,0);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  }

  .search-bar:focus-within {
    background: rgba(255,255,255,0.12);
    border-color: var(--purple-main);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.22);
  }

  .search-bar input {
    font-size: 16px; /* 16px verhindert iOS auto-zoom */
    padding: 0 14px;
    height: 100%;
    min-width: 0;
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    color: var(--text-primary);
    background: transparent;
    caret-color: var(--purple-main);
  }

  .search-bar input::placeholder {
    color: rgba(255,255,255,0.45);
    font-size: 15px;
  }

  .search-bar button {
    padding: 0 14px;
    height: 100%;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: rgba(255,255,255,0.7);
  }

  .search-bar button:active {
    color: var(--purple-main);
    background: rgba(124,58,237,0.15);
  }

  /* Search button bekommt lila Hintergrund */
  .search-bar #search-btn {
    background: var(--purple-main);
    color: #fff;
    border-radius: 0 22px 22px 0;
    min-width: 48px;
    font-size: 15px;
  }

  .search-bar #search-btn:active {
    background: var(--purple-dark, #5b21b6);
  }

  /* Hide voice search button on very small screens to save space */
  .search-bar #voice-search-btn { display: none; }

  .header-right {
    flex: 0 0 auto;
    gap: 2px;
    padding-right: 0;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-radius: 50%;
  }

  /* ── Sidebar: full-screen overlay on mobile ── */
  #sidebar {
    position: fixed;
    left: -100%;
    top: var(--header-h);
    height: calc(100dvh - var(--header-h));
    width: 85%;
    max-width: 300px;
    z-index: 800;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
    border-right: 1px solid rgba(124,58,237,0.15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 40px rgba(0,0,0,0.7);
  }

  /* ── Main content area ── */
  #main-content {
    padding: 10px 8px 78px;
    min-height: calc(100dvh - var(--header-h));
  }

  /* ── Video grid: 1 column on mobile ── */
  .video-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* ── Home feed rows ── */
  .home-video-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .home-shorts-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  .video-card .thumb { border-radius: 10px; }
  .video-card .card-info { padding: 6px 2px 4px; }
  .video-card .card-title { font-size: 12px; line-height: 1.35; -webkit-line-clamp: 2; }
  .video-card .card-meta { font-size: 11px; }
  .card-avatar { width: 22px; height: 22px; }

  /* ── Shorts: full-height on 9:16 ── */
  .shorts-player-wrap {
    height: calc(100dvh - var(--header-h) - 60px);
    border-radius: 0 !important;
  }

  /* ── Watch page ── */
  #page-watch { padding: 0; }
  .watch-player-wrapper { border-radius: 0 !important; }
  .watch-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
  .watch-info { padding: 12px 10px; }
  .watch-actions { flex-wrap: wrap; gap: 6px; }
  .action-btn { padding: 7px 12px; font-size: 13px; gap: 5px; }

  /* ── Modern bottom navigation ── */
  #mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    height: 60px;
    display: flex;
    background: rgba(10,10,15,0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(124,58,237,0.15);
    z-index: 850;
    padding-bottom: env(safe-area-inset-bottom);
    padding-bottom: constant(safe-area-inset-bottom);
  }

  #mobile-bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s, transform 0.15s;
    padding: 6px 2px;
    border-radius: 12px;
    margin: 4px 2px;
    letter-spacing: 0.2px;
  }

  #mobile-bottom-nav a i {
    font-size: 19px;
    line-height: 1;
  }

  #mobile-bottom-nav a.active {
    color: var(--purple-light);
  }

  #mobile-bottom-nav a:active {
    transform: scale(0.88);
  }

  /* Upload (+) button in bottom nav – pill style */
  #mobile-bottom-nav a:nth-child(3) {
    flex: 0 0 52px;
  }

  #mobile-bottom-nav a:nth-child(3) i {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--purple-main), var(--pink-accent));
    border-radius: 14px;
    font-size: 18px;
    color: white;
    box-shadow: 0 4px 16px rgba(124,58,237,0.45);
    transition: transform 0.15s, box-shadow 0.15s;
  }

  #mobile-bottom-nav a:nth-child(3):active i {
    transform: scale(0.88);
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
  }

  /* ── Modals: slide up from bottom ── */
  .modal-box,
  .upload-modal-box {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    animation: slideUpModal 0.3s cubic-bezier(0.32,0.72,0,1) !important;
  }

  @keyframes slideUpModal {
    from { transform: translateY(100%); opacity: 0.5; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* ── Studio / Creator Studio ── */
  .studio-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 4px;
    padding-bottom: 4px;
  }

  .studio-nav::-webkit-scrollbar { display: none; }

  .studio-nav a {
    flex-shrink: 0;
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 20px;
    white-space: nowrap;
  }

  /* Studio table: horizontal scroll */
  .studio-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }

  /* ── Form inputs: bigger tap targets ── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important; /* prevents iOS zoom */
    min-height: 44px;
  }

  button.btn-primary,
  button.btn-secondary {
    min-height: 44px;
    font-size: 14px;
  }

  /* ── Cards & Sections ── */
  .form-group label {
    font-size: 12px;
  }

  /* ── Toast notifications ── */
  #toast-container {
    bottom: 72px !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
  }

  .toast {
    width: 100%;
    text-align: center;
    border-radius: 14px;
    font-size: 13px;
  }

  /* ── Dropdowns: full width ── */
  .dropdown-menu,
  #lang-dropdown-menu {
    width: calc(100vw - 20px) !important;
    right: 10px !important;
    left: auto !important;
    max-height: 70dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Channel page ── */
  .channel-banner { height: 110px !important; }
  .channel-info-row { flex-wrap: wrap; gap: 10px; }

  /* ── Comment section ── */
  .comment-box { gap: 8px; }
  .comment-box textarea { font-size: 14px; }

  /* ── Safe area for notched phones ── */
  #main-content {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
}

/* Extra small (≤380px) – e.g. iPhone SE */
@media (max-width: 380px) {
  .search-bar input { font-size: 14px; }
  #mobile-bottom-nav a span { display: none; }
  #mobile-bottom-nav { height: 54px; }
  .video-grid { gap: 6px; }
  #main-content { padding: 8px 6px 72px; }
}

/* ── Home Feed: YouTube-style rows ── */
.home-video-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .home-video-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) {
  .home-video-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .home-video-row { grid-template-columns: 1fr; gap: 10px; }
}

/* ── Home Feed: Shorts row ── */
.home-shorts-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 1200px) {
  .home-shorts-row { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 960px) {
  .home-shorts-row { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .home-shorts-row { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
@media (max-width: 380px) {
  .home-shorts-row { grid-template-columns: repeat(2, 1fr); }
}

/* Short cards in home feed: portrait ratio */
.home-shorts-row .video-card .video-thumb {
  aspect-ratio: 9 / 16;
  height: auto;
}

/* Video error banner animation */
@keyframes slideDown {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Hide shorts nav arrow buttons when removed */
.shorts-nav-btn { display: none !important; }

/* Upload float button */
#upload-float-btn {
  display: none;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════
   NORYNEX v45 – MOBILE OVERRIDES (FINAL, ganz unten = höchste Priorität)
   ══════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* 1) Suchleiste im Header komplett verstecken */
  .header-center,
  .search-bar-wrapper,
  .search-bar,
  #search-history-dropdown { display: none !important; }

  /* 2) Mobile-Suche-Button anzeigen */
  #mobile-search-btn { display: flex !important; }

  /* 3) Anmelden + Registrieren nebeneinander */
  #auth-section {
    display: flex !important;
    flex-direction: row !important;
    gap: 5px !important;
    align-items: center !important;
  }
  .btn-login {
    padding: 5px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }
  .btn-register {
    padding: 5px 10px !important;
    font-size: 11px !important;
    white-space: nowrap !important;
  }

  /* 4) Videos einzeln untereinander (1 Spalte) */
  .home-video-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* 5) Shorts 2×2 */
  .home-shorts-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }

  /* 6) Shorts-Player: volle Breite, kein schwarzer Rand */
  #page-shorts {
    padding: 0 !important;
    justify-content: stretch !important;
  }
  .shorts-container {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100dvh - var(--header-h) - 58px) !important;
  }
  .short-card {
    width: 100% !important;
    height: calc(100dvh - var(--header-h) - 58px) !important;
    max-height: none !important;
    border-radius: 0 !important;
    aspect-ratio: unset !important;
  }
  .short-card video {
    object-fit: cover !important;
  }

  /* 7) Short-Titel immer sichtbar, groß genug */
  .short-overlay {
    padding: 12px 12px 70px !important;
  }
  .short-info h4 {
    font-size: 14px !important;
    margin-bottom: 2px !important;
  }
  .short-info p {
    font-size: 12px !important;
  }
  .short-side-actions {
    bottom: 70px !important;
    right: 10px !important;
  }

  /* 8) Watch-Seite: kein Padding oben, Video 16:9 normal */
  #page-watch {
    padding: 0 !important;
  }
  .watch-player-wrapper {
    border-radius: 0 !important;
    padding-top: 56.25% !important;
  }
  .watch-info {
    padding: 10px 12px !important;
  }
  .watch-title {
    font-size: 15px !important;
  }
  .watch-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .action-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 640px) {
  /* Header aufräumen: Upload + Story Icons verstecken auf Mobile */
  #upload-btn-header,
  #story-btn-header { display: none !important; }

  /* Notifications-Bell behalten, aber kleiner */
  #notifications-btn { width: 30px !important; height: 30px !important; font-size: 14px !important; }
}

@media (max-width: 640px) {
  /* Short wenn als Watch geöffnet: volle Breite, 9:16 */
  .short-player-wrapper {
    max-width: 100% !important;
    border-radius: 0 !important;
    aspect-ratio: 9/16 !important;
  }
}

/* ── v45 Header + Shorts Overlay Fix ── */
@media (max-width: 640px) {
  /* Header: kein flex:1 auf left, kein gap zwischen Logo und Icons */
  .header-left {
    flex: 0 0 auto !important;
    gap: 8px !important;
  }
  .header-right {
    flex: 1 !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    padding-right: 4px !important;
  }

  /* Shorts: Info und Name ganz nach unten */
  .short-overlay {
    justify-content: flex-end !important;
    padding: 0 12px 80px !important;
  }
  .short-info {
    margin-bottom: 0 !important;
  }
  .short-side-actions {
    bottom: 90px !important;
  }
}

/* ══════════════════════════════════════════════
   NORYNEX v56 – WATCH PAGE MOBILE FIX (YouTube-style)
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Force single-column layout */
  .watch-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* Video: full width, no padding, edge-to-edge */
  #page-watch {
    padding: 0 !important;
    max-width: 100% !important;
  }
  .watch-player-wrapper {
    border-radius: 0 !important;
    width: 100% !important;
    padding-top: 56.25% !important;
  }
  .short-player-wrapper {
    max-width: 100% !important;
    border-radius: 0 !important;
    aspect-ratio: 9/16 !important;
  }

  /* Info section: readable padding */
  .watch-info {
    padding: 10px 12px 4px !important;
  }
  .watch-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }
  .watch-meta {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  /* Action buttons: wrap nicely */
  .watch-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .action-btn {
    padding: 6px 10px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }

  /* Speed buttons: horizontal scroll instead of overflow */
  #speed-btns {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding-bottom: 2px !important;
    max-width: calc(100vw - 140px) !important;
    scrollbar-width: none !important;
  }
  #speed-btns::-webkit-scrollbar { display: none !important; }

  /* Channel info: compact */
  .watch-channel {
    padding: 10px 12px !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }
  .watch-channel-name {
    font-size: 14px !important;
  }
  .watch-channel-subs {
    font-size: 12px !important;
  }
  .subscribe-btn {
    font-size: 13px !important;
    padding: 7px 14px !important;
    white-space: nowrap !important;
  }

  /* Related videos below content */
  .related-videos {
    padding: 12px !important;
  }
  .related-videos h3 {
    font-size: 14px !important;
    margin-bottom: 10px !important;
  }
  .related-video-item {
    flex-direction: row !important;
    gap: 8px !important;
  }
  .related-thumb {
    width: 120px !important;
    min-width: 120px !important;
    height: 68px !important;
    border-radius: 6px !important;
  }

  /* Hide more-dropdown button on mobile (too cramped), keep core actions */
  .watch-more-wrap {
    display: none !important;
  }
}
