:root {
  --bg: #000000;
  --bg-card: #121212;
  --bg-hover: #1a1a1a;
  --bg-comment: #1e1e1e;
  --border: #2f2f2f;
  --text: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #fe2c55;
  --accent-hover: #ff4470;
  --tiktok-cyan: #25f4ee;
  --link: #25f4ee;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- LAYOUT --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- PROFILE HEADER --- */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
}
.profile-info h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.profile-info .username {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 12px;
}
.profile-stats {
  display: flex;
  gap: 24px;
}
.profile-stat {
  text-align: center;
}
.profile-stat .num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.profile-stat .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- VIDEO GRID --- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  padding-bottom: 60px;
}
.video-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 9/12;
  background: var(--bg-card);
  cursor: pointer;
  transition: transform 0.15s;
}
.video-card:hover { transform: scale(1.02); }
.video-card a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.video-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-card .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.video-card .overlay .title {
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}
.video-card .overlay .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.7);
}
.video-card .overlay .meta svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.video-card .duration-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* --- VIDEO PAGE --- */
.video-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: 100vh;
  overflow: hidden;
}
.video-player-wrap {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
.video-player-wrap video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.video-sidebar {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Video info */
.video-info {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.video-info .desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  word-break: break-word;
}
.video-info .desc a { color: var(--link); }
.video-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.video-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.video-meta-item svg { width: 16px; height: 16px; fill: var(--text-muted); }

/* Author */
.video-author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.video-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.video-author .author-info {
  flex: 1;
}
.video-author .author-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.video-author .author-name a {
  color: var(--text);
  text-decoration: none;
}
.video-author .author-name a:hover { color: var(--link); }
.video-author .author-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Music ticker */
.music-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.music-disk {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #282828;
  border: 2px solid #404040;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.music-disk::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #181818;
  border: 2px solid #333;
  position: absolute;
  z-index: 2;
}
.music-disk img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.music-disk.spinning {
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.music-info {
  overflow: hidden;
  flex: 1;
}
.music-info .music-name {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-info .music-author {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Comments */
.comments-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.comments-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.comment {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.comment-author a {
  color: var(--text-muted);
  text-decoration: none;
}
.comment-author a:hover { color: var(--link); }
.comment-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}
.comment-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* View replies button */
.view-replies-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}
.view-replies-btn:hover { color: var(--text-secondary); }

/* Replies — TikTok style */
.replies {
  margin-top: 8px;
  padding-left: 0;
}
.reply {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.reply-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.reply-body { flex: 1; }
.reply-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.reply-author a {
  color: var(--text-muted);
  text-decoration: none;
}
.reply-author a:hover { color: var(--link); }
.reply-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}
.reply-meta {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Download btn */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
  margin-top: 12px;
}
.download-btn:hover { background: var(--accent-hover); text-decoration: none; }

/* --- NAV --- */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(10px);
  z-index: 100;
}
.top-nav .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-nav .logo:hover { text-decoration: none; }
.top-nav .logo svg { width: 24px; height: 24px; }
.top-nav .nav-links {
  display: flex;
  gap: 16px;
}
.top-nav .nav-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
}
.top-nav .nav-links a:hover { color: var(--text); }

/* --- FOOTER --- */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .video-page {
    grid-template-columns: 1fr;
  }
  .video-player-wrap {
    position: relative;
    height: auto;
    aspect-ratio: 9/16;
    max-height: 70vh;
  }
  .video-sidebar {
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  .profile-stats { justify-content: center; }
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
@media (max-width: 600px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
  }
  .profile-header { padding: 24px 0 20px; }
  .profile-avatar { width: 72px; height: 72px; }
  .profile-info h1 { font-size: 1.4rem; }
}

/* --- PROFILE BIO --- */
.profile-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 8px 0;
  line-height: 1.5;
  white-space: pre-line;
}
.profile-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--link);
  margin-bottom: 12px;
}

/* --- HOVER PREVIEW --- */
.video-card .hover-preview {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 1;
}
.video-card:hover .hover-preview { opacity: 1; }
.video-card:hover .hover-preview + img,
.video-card:hover .hover-preview ~ div { opacity: 0; transition: opacity 0.2s; }

/* --- TIKTOK PLAYER CONTROLS --- */
.player-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
.player-overlay.hidden { display: none; }
.play-icon {
  width: 64px; height: 64px;
  opacity: 0.8;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
  transition: opacity 0.15s;
}
.player-overlay:hover .play-icon { opacity: 1; }

.player-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  padding: 24px 12px 8px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.video-player-wrap:hover .player-controls { opacity: 1; }

.progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  cursor: pointer;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
}
.ctrl-btn svg { width: 24px; height: 24px; }

.unmute-top {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 20px;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
  transition: opacity 0.2s, background 0.15s;
  opacity: 0;
  pointer-events: none;
}
.video-player-wrap:hover .unmute-top { opacity: 1; pointer-events: auto; }
.unmute-top:hover { background: rgba(0,0,0,0.8); }
.unmute-top.hidden { display: none; }

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
