:root {
  /* TikTok official palette (reference) */
  --tt-black: #010101;
  --tt-cyan: #69c9d0;
  --tt-white: #ffffff;
  --tt-pink: #ee1d52;
  --tt-pink-soft: #ff4a73;
  --tt-pink-glow: rgba(238, 29, 82, 0.35);
  --tt-cyan-glow: rgba(105, 201, 208, 0.35);
  /* Semantic tokens */
  --bg: var(--tt-black);
  --bg-soft: #0f0f0f;
  --card: #141414;
  --card-2: #1a1a1a;
  --line: #2a2a2a;
  --text: var(--tt-white);
  --muted: rgba(255, 255, 255, 0.68);
  --muted-2: rgba(255, 255, 255, 0.5);
  --primary: var(--tt-pink);
  --primary-soft: var(--tt-pink-soft);
  --accent: var(--tt-cyan);
  --radius: 14px;
  --shadow-1: 0 12px 24px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 20px 40px rgba(0, 0, 0, 0.55);
}

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

html {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  background: var(--tt-black);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

body {
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  background: radial-gradient(1200px 80% at 50% 120%, #141414 0%, var(--tt-black) 55%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

a {
  color: var(--text);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Top nav */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  z-index: 60;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.35) 70%, transparent 100%);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.brand-logo .material-symbols-rounded {
  font-size: 24px !important;
}

.brand-text {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.45px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.nav-tabs {
  display: flex;
  gap: 14px;
  font-weight: 650;
  font-size: 15px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.nav-tabs span {
  color: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.nav-tabs span.active {
  color: var(--tt-white);
  border-bottom: 2px solid var(--tt-cyan);
  padding-bottom: 5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-action-icon {
  cursor: pointer;
  font-size: 23px !important;
  color: #fff;
  opacity: 0.96;
}

.top-action-icon:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Search */
#search-bar {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  padding: 12px 14px;
  z-index: 65;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.78));
  box-shadow: var(--shadow-1);
}

#search-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid #2f2f2f;
  outline: none;
  background: #181818;
  color: var(--tt-white);
  font-size: 15px;
}

#search-input:focus {
  border-color: rgba(105, 201, 208, 0.55);
  box-shadow: 0 0 0 1px rgba(105, 201, 208, 0.2);
}

/* Feed */
#scroller {
  height: 100vh;
  width: 100vw;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  background: var(--tt-black);
}

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

.short-wrapper {
  height: 100vh;
  width: 100vw;
  position: relative;
  scroll-snap-align: start;
  background-color: var(--tt-black);
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-container {
  width: 100%;
  max-width: 460px;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: #101010;
}

@media (min-width: 680px) {
  .video-container {
    height: 92vh;
    border-radius: 18px;
    box-shadow: var(--shadow-2);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.iframe-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  transform: scale(1.38);
}

.video-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.45s ease;
  background-color: #111;
}

.click-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  cursor: pointer;
}

.center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 82px !important;
  z-index: 15;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
}

.center-icon.animate-pause {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.16);
}

.sidebar-ui {
  position: absolute;
  right: 12px;
  bottom: 98px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.profile-pic-container {
  position: relative;
  margin-bottom: 8px;
}

.profile-pic {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
  background: #333;
}

.action-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.15s;
  display: flex;
  justify-content: center;
  align-items: center;
}

.action-btn:hover {
  opacity: 0.92;
}

.action-btn:active {
  transform: scale(0.83);
}

.action-btn .material-symbols-rounded {
  font-size: 39px;
  filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, 0.7));
}

.action-text {
  font-size: 13px;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.88);
}

.liked .material-symbols-rounded {
  color: var(--primary);
  font-variation-settings: "FILL" 1;
}

.saved .material-symbols-rounded {
  color: var(--accent);
  font-variation-settings: "FILL" 1;
}

.bottom-ui {
  position: absolute;
  left: 14px;
  bottom: 24px;
  right: 86px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.88);
}

.channel-name {
  font-size: 17px;
  font-weight: 720;
  display: flex;
  align-items: center;
  gap: 6px;
}

.video-title {
  font-size: 15px;
  font-weight: 420;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.music-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.music-icon {
  animation: spin 4s linear infinite;
  font-size: 18px !important;
}

.progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 30;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.1s linear;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Common overlays/panels */
#status-board {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background: rgba(0, 0, 0, 0.8);
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-1);
}

.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 72vh;
  z-index: 120;
  background: linear-gradient(to bottom, #121212, #0b0b0b);
  border-top: 1px solid #2d2d2d;
  overflow: auto;
  padding: 14px;
}

.list-item {
  background: #181818;
  border: 1px solid #262626;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 8px;
}

.row {
  display: flex;
  gap: 8px;
}

.row > * {
  flex: 1;
}

/* Auth */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.auth-screen.no-overlay {
  background: var(--tt-black);
}

.auth-card {
  width: min(440px, 92vw);
  background: linear-gradient(180deg, #151515 0%, #0f0f0f 100%);
  border: 1px solid #2e2e2e;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-2);
}

.auth-card h1 {
  font-size: 30px;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.auth-form input,
.auth-form button,
.simple-page input,
.simple-page select,
.simple-page button,
.simple-page textarea {
  width: 100%;
  padding: 12px 12px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  outline: none;
}

.auth-form input:focus,
.simple-page input:focus,
.simple-page select:focus,
.simple-page textarea:focus {
  border-color: #5a5a5a;
}

.auth-form button,
.simple-page button {
  background: linear-gradient(180deg, var(--primary-soft), var(--primary));
  border: 0;
  font-weight: 700;
  cursor: pointer;
}

.captcha-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.captcha-wrap strong {
  background: #222;
  border-radius: 10px;
  padding: 11px 14px;
  letter-spacing: 2px;
  border: 1px solid #333;
}

/* Simple pages */
.simple-page {
  padding: 76px 14px 90px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--tt-black);
}

.simple-page h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.simple-page .panel {
  background: linear-gradient(180deg, #131313 0%, #101010 100%);
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

/* Footer nav */
.bottom-footer-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 66px;
  background: rgba(1, 1, 1, 0.94);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  z-index: 90;
}

.bottom-footer-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #acacac;
  font-size: 11px;
  gap: 2px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.bottom-footer-nav a .material-symbols-rounded {
  font-size: 22px !important;
}

.bottom-footer-nav a.active {
  color: var(--tt-white);
}

.bottom-footer-nav a:active {
  transform: scale(0.96);
}

/* Desktop polish */
@media (min-width: 1024px) {
  .top-nav {
    padding-inline: 22px;
  }
  .brand-text {
    font-size: 21px;
  }
  .simple-page {
    max-width: 980px;
    margin: 0 auto;
  }
}
