* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; }

:root {
  --accent: #ff0055;
  --accent-soft: rgba(255, 0, 85, 0.15);
}

body {
  background: #0f0f14;
  color: #e8e8ee;
  min-height: 100vh;
}

/* Шапка */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 30px;
  background: #16161d;
  border-bottom: 1px solid #26262f;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  color: var(--accent);
  letter-spacing: 0.5px;
}
.header-actions { display: flex; gap: 15px; align-items: center; }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 30px;
  transition: background 0.2s;
}
.user-info:hover { background: #20202a; }

.avatar-small {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 18px;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}
.avatar-small img, .avatar-big img {
  width: 100%; height: 100%; object-fit: cover;
}

.avatar-big {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 60px;
  border: 4px solid var(--accent);
}

/* Кнопки */
.btn {
  background: #26262f;
  color: #e8e8ee;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn:hover { background: #33333f; }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { filter: brightness(1.15); }
.btn-back { margin-bottom: 20px; }

/* Страницы */
.page {
  display: none;
  padding: 30px;
  max-width: 1300px;
  margin: 0 auto;
}
.page.active { display: block; }

.page-title {
  font-size: 24px;
  margin-bottom: 25px;
  font-weight: 700;
}

/* Сетка видео */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.video-card {
  background: #16161d;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #22222c;
}
.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #0a0a10;
  object-fit: cover;
  display: block;
}
.video-thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a1a24, #2a2a3a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #444;
}
.video-info { padding: 12px 14px; }
.video-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.video-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #999;
  margin-top: 8px;
}
.video-author .avatar-small { width: 24px; height: 24px; font-size: 12px; border-width: 1px; }

/* Просмотр видео */
.watch-container { max-width: 1000px; margin: 0 auto; }
#watch-player {
  width: 100%;
  border-radius: 14px;
  background: #000;
  max-height: 75vh;
}
#watch-title { margin: 20px 0 15px; font-size: 22px; }
.watch-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.author-block { display: flex; gap: 12px; align-items: center; }
.author-block .avatar-small { width: 44px; height: 44px; }
.date-small { font-size: 12px; color: #888; }
.watch-description { color: #b0b0b8; line-height: 1.6; padding: 15px; background: #16161d; border-radius: 12px; }

/* Профиль */
.profile-card {
  display: flex;
  gap: 40px;
  background: #16161d;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid #22222c;
  flex-wrap: wrap;
}
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.profile-settings {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-settings label {
  font-size: 13px;
  color: #999;
  margin-top: 8px;
  font-weight: 600;
}
input[type="text"], input[type="password"], textarea {
  background: #0f0f14;
  border: 1px solid #2a2a36;
  color: #e8e8ee;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  resize: vertical;
  transition: border 0.2s;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.color-picker {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #999;
  font-size: 14px;
}
input[type="color"] {
  width: 50px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
}

/* Модалка */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal.hidden { display: none; }
.modal-content {
  background: #16161d;
  padding: 30px;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid #26262f;
}
.modal-content h3 { margin-bottom: 10px; }
.modal-content label {
  font-size: 13px;
  color: #999;
  margin-top: 8px;
  font-weight: 600;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}
input[type="file"] {
  background: #0f0f14;
  border: 1px dashed #2a2a36;
  padding: 12px;
  border-radius: 10px;
  color: #999;
  cursor: pointer;
  font-size: 13px;
}
.thumb-preview img {
  width: 100%;
  border-radius: 10px;
  margin-top: 8px;
}
.thumb-preview.hidden { display: none; }

.empty-message {
  text-align: center;
  color: #666;
  padding: 60px 20px;
  font-size: 16px;
}
.hidden { display: none !important; }

.upload-status {
  font-size: 13px;
  color: var(--accent);
  text-align: center;
  margin-top: 8px;
}

/* Адаптив */
@media (max-width: 600px) {
  .header { padding: 12px 15px; }
  .logo { font-size: 18px; }
  .page { padding: 15px; }
  .profile-card { padding: 20px; gap: 20px; }
  .avatar-big { width: 110px; height: 110px; font-size: 45px; }
}