:root {
  --bg: #020617;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(17, 24, 39, 0.78);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html,
body {
  width: 100%;
  height: 100%;
}

body {
  background:
    radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 18%),
    linear-gradient(180deg, #020617, #000000);
  overflow: hidden;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.nav-tabs,
.search-btn {
  pointer-events: auto;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.nav-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 10px;
}

.nav-tab.active {
  color: #fff;
  position: relative;
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 18px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, #a78bfa);
}

.search-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 1rem;
  backdrop-filter: blur(12px);
}

#feed {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#feed::-webkit-scrollbar {
  display: none;
}

.reel {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)),
    #000;
}

.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.18) 38%,
    rgba(0, 0, 0, 0.12) 100%
  );
  pointer-events: none;
}

.player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  transform: scale(1);
  transition: transform 0.35s ease;
}

.reel.active .player {
  transform: scale(1.02);
}

.overlay {
  position: absolute;
  left: 16px;
  right: 96px;
  bottom: calc(116px + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(45deg, #f97316, #ec4899);
  box-shadow: var(--shadow);
}

.title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  max-width: 100%;
  text-wrap: pretty;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.meta-row span:first-child {
  font-weight: 600;
}

.actions {
  position: absolute;
  right: 14px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.action-btn {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.18s ease, background 0.18s ease;
}

.action-btn:hover,
.action-btn:active {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.14);
}

.action-btn.small {
  width: 48px;
  height: 48px;
  font-size: 0.98rem;
}

.action-count {
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 10;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f8fafc, #8b5cf6);
}

@media (max-width: 480px) {
  .overlay {
    left: 14px;
    right: 88px;
    bottom: calc(112px + env(safe-area-inset-bottom));
  }

  .actions {
    right: 12px;
    bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .action-btn {
    width: 50px;
    height: 50px;
  }

  .action-btn.small {
    width: 44px;
    height: 44px;
  }
}