* { box-sizing: border-box; }
body {
  margin: 0; background: #0f0f10; color: #f1f1f1;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}
a { color: inherit; text-decoration: none; }

#topbar {
  display: flex; align-items: center; gap: 16px; padding: 10px 20px;
  border-bottom: 1px solid #272727; position: sticky; top: 0; background: #0f0f10; z-index: 10;
}
#topbar .brand { font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
#topbar .brand .red { color: #ff4141; }
#searchBox { flex: 1; max-width: 560px; display: flex; }
#searchBox input {
  flex: 1; background: #121212; border: 1px solid #303030; border-right: none;
  color: #fff; padding: 8px 14px; border-radius: 20px 0 0 20px; font-size: 14px; outline: none;
}
#searchBox button {
  background: #222; border: 1px solid #303030; color: #fff; padding: 0 18px;
  border-radius: 0 20px 20px 0; cursor: pointer;
}
.spacer { flex: 1; }
.navbtn {
  background: #272727; border: none; color: #fff; padding: 8px 16px; border-radius: 18px;
  cursor: pointer; font-size: 13.5px; font-weight: 600;
}
.navbtn.primary { background: #ff4141; }
#userChip { font-size: 13px; color: #aaa; }

#feed {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px; padding: 24px;
}
.vcard { cursor: pointer; }
.vcard .thumbWrap {
  position: relative; width: 100%; aspect-ratio: 16/9; background: #222;
  border-radius: 10px; overflow: hidden;
}
.vcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard .dur {
  position: absolute; bottom: 6px; right: 6px; background: rgba(0,0,0,0.8);
  padding: 2px 6px; border-radius: 4px; font-size: 11px;
}
.vcard .meta { display: flex; gap: 10px; padding-top: 10px; }
.vcard .avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #ff4141; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.vcard .title { font-size: 14.5px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.vcard .sub { font-size: 12.5px; color: #aaa; }

.empty { text-align: center; color: #777; padding: 60px 20px; grid-column: 1/-1; }

/* watch page */
#watchWrap { max-width: 960px; margin: 0 auto; padding: 20px; }
video#player { width: 100%; border-radius: 12px; background: #000; }
#watchTitle { font-size: 19px; font-weight: 700; margin: 14px 0 6px; }
#watchStats { display: flex; align-items: center; justify-content: space-between; color: #aaa; font-size: 13px; margin-bottom: 14px; }
#likeBtn {
  background: #272727; border: none; color: #fff; padding: 8px 18px; border-radius: 18px; cursor: pointer; font-size: 13.5px;
}
#likeBtn.liked { background: #ff4141; }
#watchDesc { background: #181818; border-radius: 12px; padding: 14px; font-size: 13.5px; color: #ddd; margin-bottom: 20px; white-space: pre-wrap; }
#commentForm { display: flex; gap: 10px; margin-bottom: 20px; }
#commentForm input {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid #333; color: #fff;
  padding: 8px 4px; font-size: 13.5px; outline: none;
}
#commentForm button { background: #ff4141; border: none; color: #fff; padding: 8px 16px; border-radius: 18px; cursor: pointer; }
.comment { display: flex; gap: 10px; margin-bottom: 16px; }
.comment .avatar { width: 32px; height: 32px; border-radius: 50%; background: #444; flex-shrink: 0; display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700; }
.comment b { font-size: 13px; }
.comment .body { font-size: 13.5px; color: #ddd; margin-top: 2px; }

/* forms */
.centerForm {
  max-width: 380px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; padding: 0 20px;
}
.centerForm h2 { text-align: center; margin-bottom: 6px; }
.centerForm input, .centerForm textarea {
  background: #181818; border: 1px solid #303030; color: #fff; padding: 10px 12px;
  border-radius: 8px; font-size: 13.5px; outline: none;
}
.centerForm textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.centerForm button {
  background: #ff4141; border: none; color: #fff; padding: 11px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 14px;
}
.centerForm .err { color: #ff6b6b; font-size: 12.5px; text-align: center; }
.centerForm input[type=file] { padding: 8px; }
