:root {
  --bg: #07090f;
  --card-shadow: rgba(0, 0, 0, 0.5);
  --txt: #f7f8fb;
  --muted: #cbced9;
  --accent: #ff2d55;
  --accent-2: #1ce6d6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at top, #141b2f 0%, var(--bg) 45%);
  color: var(--txt);
  font-family: "Cairo", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
}

.brand {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.mode-tabs {
  display: flex;
  gap: 6px;
}

.tab {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7ef;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: #111;
}

.icon-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
}

.feed {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.reel-card {
  position: relative;
  width: 100%;
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  isolation: isolate;
  background: #0b0e18;
}

.reel-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.78) 8%, rgba(0, 0, 0, 0.2) 35%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
  z-index: 1;
}

.action-rail {
  position: fixed;
  left: 14px;
  bottom: 110px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.action-btn,
.avatar-btn {
  border: 0;
  color: #fff;
  background: rgba(8, 12, 24, 0.62);
  box-shadow: 0 6px 20px var(--card-shadow);
  backdrop-filter: blur(8px);
}

.action-btn {
  width: 58px;
  border-radius: 24px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

.action-icon {
  font-size: 21px;
  line-height: 1;
}

.action-count {
  font-size: 12px;
  font-weight: 700;
}

.like-btn.active {
  background: rgba(255, 45, 85, 0.22);
  border: 1px solid rgba(255, 45, 85, 0.35);
}

.avatar-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.reel-meta {
  position: fixed;
  right: 0;
  left: 88px;
  bottom: 94px;
  z-index: 9;
  padding: 0 14px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
}

.author-line {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 6px;
}

.caption-line {
  margin: 0 0 12px;
  color: #f2f4fb;
  font-size: 14px;
  line-height: 1.7;
  max-width: min(60ch, 95%);
}

.cta-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(115deg, var(--accent), var(--accent-2));
  color: #fff;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
}

.bottom-nav {
  position: fixed;
  right: 0;
  left: 0;
  bottom: env(safe-area-inset-bottom);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(1, 2, 6, 0.82);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.bottom-item {
  min-height: 56px;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.bottom-item.active {
  color: #fff;
}

.bottom-item.upload {
  font-size: 29px;
  color: #fff;
  line-height: 1;
}

@media (min-width: 991px) {
  body {
    background:
      radial-gradient(circle at 10% 15%, #20315c 0%, transparent 38%),
      radial-gradient(circle at 92% 88%, #742146 0%, transparent 32%),
      #05070f;
  }

  .app-shell {
    max-width: 430px;
    margin: 0 auto;
    border-inline: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.4);
  }

  .top-bar,
  .bottom-nav {
    max-width: 430px;
    margin: 0 auto;
  }

  .action-rail {
    left: calc(50% - 200px);
  }

  .reel-meta {
    left: calc(50% - 160px);
    right: calc(50% - 208px);
  }
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
