* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #0f0f0f; color: #fff; font-family: -apple-system, "Helvetica Neue", Arial, sans-serif; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; color: #fff; }

/* ---- top bar ---- */
.topbar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  -webkit-box-align: center; -webkit-align-items: center; align-items: center;
  -webkit-box-pack: justify; -webkit-justify-content: space-between; justify-content: space-between;
  height: 48px; padding: 0 12px; background: #0f0f0f;
  position: -webkit-sticky; position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid #222;
}
.icon-btn { font-size: 20px; padding: 6px 10px; }
.topbar-actions { display: -webkit-box; display: -webkit-flex; display: flex; }

/* ---- search bar ---- */
.searchbar { display: -webkit-box; display: -webkit-flex; display: flex; padding: 8px 10px; background: #0f0f0f; border-bottom: 1px solid #222; position: -webkit-sticky; position: sticky; top: 48px; z-index: 49; }
#search-input { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; background: #222; border: none; border-radius: 20px; padding: 8px 14px; color: #fff; font-size: 15px; }
.searchbar button { padding: 8px 10px; font-size: 14px; color: #3ea6ff; }

/* ---- main scroll area ---- */
#view-root { min-height: calc(100vh - 48px - 56px); padding-bottom: 12px; }

/* ---- video card (list style, like the mobile app) ---- */
.video-card { display: block; margin-bottom: 14px; }
.thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #222; overflow: hidden; }
.thumb-wrap img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.duration-badge { position: absolute; right: 6px; bottom: 6px; background: rgba(0,0,0,0.8); color: #fff; font-size: 11px; padding: 1px 4px; border-radius: 2px; }
.video-meta { display: -webkit-box; display: -webkit-flex; display: flex; padding: 8px 12px; }
.channel-avatar { width: 36px; height: 36px; border-radius: 50%; background: #333; margin-right: 10px; flex-shrink: 0; -webkit-flex-shrink: 0; overflow: hidden; }
.channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.video-text { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; min-width: 0; }
.video-title { font-size: 14.5px; font-weight: 500; line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-sub { font-size: 12.5px; color: #aaa; line-height: 1.4; }

/* ---- loading / spinner ---- */
.spinner-wrap { display: -webkit-box; display: -webkit-flex; display: flex; justify-content: center; -webkit-justify-content: center; padding: 30px 0; }
.spinner { width: 24px; height: 24px; border: 3px solid #444; border-top-color: #fff; border-radius: 50%; -webkit-animation: spin 0.8s linear infinite; animation: spin 0.8s linear infinite; }
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- watch page ---- */
.player-wrap { width: 100%; padding-top: 56.25%; position: relative; background: #000; }
.player-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }
.watch-title { font-size: 16px; font-weight: 600; padding: 10px 12px 2px; }
.watch-subline { font-size: 12.5px; color: #aaa; padding: 0 12px 8px; }
.watch-channel-row { display: -webkit-box; display: -webkit-flex; display: flex; align-items: center; -webkit-align-items: center; padding: 10px 12px; border-top: 1px solid #222; border-bottom: 1px solid #222; }
.watch-channel-name { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; font-size: 14px; font-weight: 500; }
.subscribe-btn { background: #fff; color: #000; padding: 8px 16px; border-radius: 18px; font-size: 13px; font-weight: 600; }
.subscribe-btn.subscribed { background: #333; color: #fff; }
.watch-desc { padding: 10px 12px; font-size: 13px; color: #ccc; background: #181818; margin: 10px 12px; border-radius: 10px; white-space: pre-wrap; }
.up-next-label { padding: 14px 12px 6px; font-size: 14px; font-weight: 600; }

/* ---- channel page ---- */
.channel-banner { width: 100%; height: 80px; background: #222; }
.channel-header { display: -webkit-box; display: -webkit-flex; display: flex; align-items: center; -webkit-align-items: center; padding: 12px; }
.channel-avatar-lg { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; margin-right: 12px; flex-shrink: 0; -webkit-flex-shrink: 0; background: #333; }
.channel-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.channel-name { font-size: 16px; font-weight: 600; }
.channel-subs { font-size: 12px; color: #aaa; margin-top: 2px; }

/* ---- empty state ---- */
.empty-state { text-align: center; padding: 60px 20px; color: #999; font-size: 14px; }

/* ---- bottom tab bar ---- */
.tabbar {
  display: -webkit-box; display: -webkit-flex; display: flex;
  position: fixed; left: 0; right: 0; bottom: 0; height: 56px;
  background: #0f0f0f; border-top: 1px solid #222; z-index: 50;
}
.tab { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; display: -webkit-box; display: -webkit-flex; display: flex;
  flex-direction: column; -webkit-flex-direction: column; align-items: center; -webkit-align-items: center;
  justify-content: center; -webkit-justify-content: center; color: #999; }
.tab.active { color: #fff; }
.tab-icon { font-size: 20px; line-height: 1; margin-bottom: 3px; }
.tab-label { font-size: 10px; }
