/* Wrapper uses small viewport units to avoid mobile browser bars overlap */
.ttk-wrapper {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

/* Top bar pinned to safe area */
.ttk-topbar {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: calc(env(safe-area-inset-left, 0px) + 8px);
  z-index: 9999;
  pointer-events: none;
}
.ttk-topbar .ttk-back {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

/* Feed / item */
.ttk-feed {
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
  height: 100%;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.ttk-item {
  position: relative;
  scroll-snap-align: start;
  height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.ttk-video {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #000;
}

/* Overlay (title removed) */
.ttk-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
}

/* Right action rail — centered vertically on the right */
.ttk-rail {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}
.ttk-rail > a,
.ttk-rail > button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}

/* Sound icon states:
   - Default hidden for both X and waves; JS toggles .unmuted on .ttk-sound
*/
.sound-wave,
.muted-x {
  opacity: 0;
}
/* Muted → show X only */
.ttk-sound:not(.unmuted) .muted-x {
  opacity: 1;
}
/* Unmuted → show waves only */
.ttk-sound.unmuted .sound-wave {
  opacity: 1;
}

/* Share sheet */
.ttk-share-sheet {
  position: absolute;
  right: 12px;
  bottom: 160px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 6000;
}
.ttk-share-sheet button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

/* Clean scrollbars */
.ttk-feed::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Prevent accidental selection */
.ttk-topbar,
.ttk-topbar * {
  -webkit-user-select: none;
  user-select: none;
}
