* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow: hidden;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ---------- top bar ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  background: linear-gradient(180deg, rgba(0,0,0,0.65), transparent);
  padding-top: env(safe-area-inset-top, 0);
}

.top-tabs {
  display: flex;
  gap: 20px;
  font-size: 17px;
  font-weight: 600;
  margin: 0 auto;
}

.tab {
  color: rgba(255,255,255,0.55);
  position: relative;
}

.tab.active {
  color: #fff;
}

.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

.top-search {
  position: absolute;
  right: 16px;
  font-size: 22px;
  color: #fff;
}

/* ---------- feed ---------- */
.feed {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.video-card {
  position: relative;
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  overflow: hidden;
}

.video-card .bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
}

.video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 60%, rgba(0,0,0,0.75) 100%);
  pointer-events: none;
}

/* left bottom (info) */
.card-info {
  position: absolute;
  left: 14px;
  right: 90px;
  bottom: 90px;
  z-index: 3;
}
.author {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.author .verified {
  font-size: 13px;
  background: #20D5EC;
  color: #000;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 800;
}
.caption {
  font-size: 15px;
  line-height: 1.35;
  margin-bottom: 8px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.caption .tag { color: #fff; opacity: 0.9; font-weight: 600; }
.music {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.95;
}
.music .note {
  display: inline-block;
  animation: spin 4s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* right side (actions) */
.card-actions {
  position: absolute;
  right: 10px;
  bottom: 110px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  z-index: 3;
}
.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.action .ico {
  font-size: 30px;
  line-height: 1;
}
.action.like .ico { color: #fff; }
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  background-size: cover;
  background-position: center;
  position: relative;
}
.avatar .plus {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FE2C55;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.disc {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #444 0%, #222 50%, #000 51%, #222 100%);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  animation: spin 5s linear infinite;
}

/* play progress bar mock */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 76px;
  height: 2px;
  background: rgba(255,255,255,0.2);
  z-index: 3;
}
.progress .bar {
  height: 100%;
  width: 36%;
  background: #fff;
}

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76px;
  background: #000;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 60;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 11px;
  gap: 2px;
}
.nav-item.active { color: #fff; }
.nav-ico { font-size: 22px; line-height: 1; }
.nav-item.plus {
  align-self: center;
}
.plus-btn {
  width: 48px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(90deg, #25F4EE 0%, #FFFFFF 50%, #FE2C55 100%);
  color: #000;
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow:
    -3px 0 0 #25F4EE,
    3px 0 0 #FE2C55;
}

/* hidden capture elements */
#hidden-cam, #hidden-canvas {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
