/* TikDrop — Authentic TikTok Dark Design System (extracted via REA MCP from tiktok.com) */
:root {
  --tt-bg: #000000;
  --tt-surface: #121212;
  --tt-surface-elevated: #1f1f1f;
  --tt-surface-hover: #292929;
  --tt-pill-bg: rgba(255, 255, 255, 0.13);
  --tt-pill-bg-hover: rgba(255, 255, 255, 0.18);
  --tt-border: rgba(255, 255, 255, 0.12);
  --tt-border-strong: rgba(255, 255, 255, 0.2);

  --tt-primary: #ff3b5c;
  --tt-primary-hover: #fe2c55;
  --tt-cyan: #25f4ee;

  --tt-text: rgba(255, 255, 255, 0.92);
  --tt-text-bright: #f6f6f6;
  --tt-text-muted: rgba(255, 255, 255, 0.58);

  --tt-radius-sm: 4px;
  --tt-radius-md: 8px;
  --tt-radius-lg: 12px;
  --tt-radius-pill: 999px;

  --sidebar-width: 224px;
  --font-sans: "TikTok Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Motion Design System (lottiefiles/motion-design-skill) */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-exit: cubic-bezier(0.3, 0, 1, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --dur-quick: 120ms;
  --dur-standard: 240ms;
  --dur-slow: 360ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background-color: var(--tt-bg);
  color: var(--tt-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* Shell Layout */
.app-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--tt-bg);
}

/* Left Sidebar — TikTok Explore Rail */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 16px;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo-img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--tt-text-bright);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: var(--tt-primary);
  background: rgba(255, 59, 92, 0.08);
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--tt-radius-pill);
  background: var(--tt-pill-bg);
  color: var(--tt-text-bright);
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Main Stage & Integrated Views */
.main-stage {
  position: relative;
  flex: 1;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

.view-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

/* Parallax Video Background Wall (GPU-optimized) */
.parallax-stage {
  position: absolute;
  inset: -48px;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  contain: strict;
}

.parallax-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  gap: 10px;
  padding: 0 12px;
  transform: rotate(-3deg) scale(1.08);
  will-change: transform;
}

.parallax-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform;
  contain: layout style;
}

.parallax-track {
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform;
}

.parallax-col.dir-up .parallax-track {
  animation: driftUp var(--drift-duration, 38s) linear infinite;
  animation-delay: var(--drift-delay, 0s);
}

.parallax-col.dir-down .parallax-track {
  animation: driftDown var(--drift-duration, 42s) linear infinite;
  animation-delay: var(--drift-delay, 0s);
}

/* Suspend all background animations & GPU layers when tab/window is inactive or modal/Recentes is open */
.parallax-stage.is-suspended .parallax-track {
  animation-play-state: paused !important;
  will-change: auto;
}

.parallax-stage.is-suspended .parallax-grid,
.parallax-stage.is-suspended .parallax-col {
  will-change: auto;
}

body.is-page-inactive *,
body.is-page-inactive *::before,
body.is-page-inactive *::after {
  animation-play-state: paused !important;
}

@keyframes driftUp {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, -50%, 0); }
}

@keyframes driftDown {
  0% { transform: translate3d(0, -50%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.bg-video-card {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 15;
  border-radius: 10px;
  overflow: hidden;
  background: #141414;
  contain: layout style paint;
}

.bg-video-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.78;
}

.bg-video-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 55%, rgba(0, 0, 0, 0.65) 100%);
}

.bg-card-meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.parallax-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 0, 0, 0.58) 0%, rgba(0, 0, 0, 0.82) 56%, rgba(0, 0, 0, 0.95) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.18) 22%, rgba(0, 0, 0, 0.22) 78%, rgba(0, 0, 0, 0.88) 100%);
  z-index: 2;
}

/* Top Bar */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 20px 28px;
}

.mobile-nav {
  display: none;
  align-items: center;
  gap: 14px;
  margin-right: auto;
}

.mobile-switch-btn {
  border: none;
  background: transparent;
  color: var(--tt-text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-switch-btn:hover {
  color: #ffffff;
}

/* Toggle Switch for Recortar trecho */
.trim-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.trim-toggle-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.16s ease;
}

.trim-toggle:hover .trim-toggle-label {
  color: #ffffff;
}

.trim-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.trim-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: var(--tt-radius-pill);
  background: rgba(255, 255, 255, 0.2);
  transition: background var(--dur-quick) var(--ease-standard);
  flex-shrink: 0;
}

.trim-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  transition: transform 180ms var(--ease-spring), width 120ms var(--ease-standard);
}

.trim-toggle:active .trim-toggle-thumb {
  width: 21px;
}

.trim-toggle-input:checked + .trim-toggle-track {
  background: var(--tt-primary);
}

.trim-toggle-input:checked + .trim-toggle-track .trim-toggle-thumb {
  transform: translateX(18px);
}

.trim-toggle:active .trim-toggle-input:checked + .trim-toggle-track .trim-toggle-thumb {
  transform: translateX(15px);
}

.trim-toggle-input:focus-visible + .trim-toggle-track {
  outline: 2px solid var(--tt-cyan);
  outline-offset: 2px;
}

/* Centered Hero */
.hero-center {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 56px;
  overflow-y: auto;
}

.hero-content {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  font-size: clamp(2.2rem, 4.6vw, 3.55rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #ffffff;
  margin-bottom: 24px;
  text-shadow: 0 6px 32px rgba(0, 0, 0, 0.75);
  animation: heroLeadIn 320ms var(--ease-enter) both;
}

@keyframes heroLeadIn {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.tiktok-accent {
  position: relative;
  color: #ffffff;
  text-shadow: -2px 0 0 var(--tt-cyan), 2px 0 0 var(--tt-primary);
}

.hero-subtitle {
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.74);
  margin-bottom: 28px;
}

/* Centered Glassmorphic Paste Bar */
.paste-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.paste-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 7px 7px 18px;
  border-radius: var(--tt-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  animation: heroFollowIn 320ms var(--ease-enter) 70ms both;
}

@keyframes heroFollowIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.paste-bar.is-shake {
  animation: errorShake 340ms ease-in-out both;
}

@keyframes errorShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-10px, 0, 0); }
  36% { transform: translate3d(9px, 0, 0); }
  54% { transform: translate3d(-6px, 0, 0); }
  72% { transform: translate3d(4px, 0, 0); }
  88% { transform: translate3d(-2px, 0, 0); }
}

.paste-icon {
  color: var(--tt-text-muted);
  display: inline-flex;
  flex-shrink: 0;
}

.paste-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
}

.paste-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* Inline MP4 / MP3 selector (borderless, pure color change) */
.format-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  flex-shrink: 0;
}

.format-opt {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.48);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 4px;
  cursor: pointer;
  transition: color 0.16s ease;
}

.format-opt:hover {
  color: rgba(255, 255, 255, 0.86);
}

.format-opt.active {
  color: var(--tt-primary);
}

.format-sep {
  color: rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
  user-select: none;
}

.download-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  min-width: 124px;
  padding: 0 26px;
  border-radius: var(--tt-radius-pill);
  border: none;
  background: var(--tt-primary);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-quick) var(--ease-standard), transform 180ms var(--ease-spring), opacity var(--dur-quick) var(--ease-standard);
}

.download-cta:hover {
  background: var(--tt-primary-hover);
}

.download-cta:active {
  transform: scale(0.95);
  transition-duration: 60ms;
}

.download-cta:disabled {
  opacity: 0.72;
  cursor: wait;
}

.cta-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2.2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.download-cta.loading .cta-spinner {
  display: inline-block;
}

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

/* Optional Trim Row — Acrylic Glass */
.trim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 7px 16px;
  border-radius: var(--tt-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  animation: trimDropIn 220ms var(--ease-enter) both;
}

@keyframes trimDropIn {
  from {
    opacity: 0;
    transform: translate3d(0, -8px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.trim-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.trim-input {
  width: 136px;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--tt-radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.84rem;
  outline: none;
}

.trim-input:focus {
  border-color: rgba(255, 255, 255, 0.36);
}

.feedback-msg {
  padding: 9px 16px;
  border-radius: var(--tt-radius-md);
  font-size: 0.86rem;
  font-weight: 600;
  background: rgba(255, 59, 92, 0.16);
  border: 1px solid rgba(255, 59, 92, 0.45);
  color: #ff99aa;
  animation: trimDropIn 200ms var(--ease-enter) both;
}

/* Result & Progress Card — Authentic TikTok TUX Dark Card */
.result-card {
  margin-top: 20px;
  width: 100%;
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(30, 30, 30, 0.94);
  border: none;
  backdrop-filter: blur(16px);
  text-align: left;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: cardArrive 280ms var(--ease-enter) both;
}

@keyframes cardArrive {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.result-thumb-wrap {
  position: relative;
  width: 86px;
  height: 122px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
}

.result-thumb-wrap.is-skeleton::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
  animation: tuxShimmer 1.35s ease-in-out infinite;
}

@keyframes tuxShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.result-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
}

.result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.result-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.result-creator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.result-avatar {
  width: 24px;
  height: 24px;
}

.result-author {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-stats {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.56);
  white-space: nowrap;
}

.result-title {
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.84);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.progress-track {
  width: 100%;
  height: 4px;
  border-radius: var(--tt-radius-pill);
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  border-radius: var(--tt-radius-pill);
  background: #fe2c55;
  overflow: hidden;
  transition: width 240ms var(--ease-standard);
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  animation: progressShimmer 1.4s linear infinite;
}

.progress-fill.is-done::after {
  animation: none;
  opacity: 0;
}

@keyframes progressShimmer {
  to { transform: translateX(100%); }
}

.success-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #25f4ee;
  font-weight: 600;
  animation: successPop 220ms var(--ease-spring) both;
}

.success-check svg path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkDraw 220ms var(--ease-enter) 60ms forwards;
}

@keyframes successPop {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.56);
  font-variant-numeric: tabular-nums;
}

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

/* Authentic TikTok TUX Capsule Buttons (borderless) */
.tux-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 18px;
  border-radius: var(--tt-radius-pill);
  border: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tux-btn-primary {
  background: #fe2c55;
  color: #ffffff;
}

.tux-btn-primary:hover {
  background: #ef2950;
}

.tux-btn-secondary {
  background: rgba(255, 255, 255, 0.13);
  color: #f6f6f6;
}

.tux-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------------- Integrated Recentes View (TikTok Explore Minimalist Cards) ---------------- */
.recent-view {
  background: var(--tt-bg);
  overflow-y: auto;
  padding: 28px 36px 48px;
}

.recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.recent-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.recent-subtitle {
  font-size: 0.85rem;
  color: var(--tt-text-muted);
  margin-top: 3px;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px 16px;
}

.tt-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: gridCardIn 260ms var(--ease-enter) var(--stagger-delay, 0ms) both;
}

@keyframes gridCardIn {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.tt-card.is-removing {
  animation: cardCollapseOut 180ms var(--ease-exit) forwards;
  pointer-events: none;
}

@keyframes cardCollapseOut {
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

.tt-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 14;
  border-radius: 12px;
  overflow: hidden;
  background: #141414;
  cursor: pointer;
}

.tt-card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

.tt-card-media:hover video {
  transform: scale(1.03);
}

.tt-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.tt-audio-cover {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 25% 25%, rgba(37, 244, 238, 0.24), rgba(255, 59, 92, 0.22) 60%, #121212);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 700;
}

.tt-card-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tt-card-play-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
}

.tt-card-dl-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease, transform 0.14s ease;
}

.tt-card-dl-btn:hover {
  background: var(--tt-primary);
  transform: scale(1.08);
}

.tt-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
  min-width: 0;
}

.tt-avatar {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--tt-cyan), var(--tt-primary));
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.tt-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tt-creator-wrap {
  min-width: 0;
  flex: 1;
}

.tt-creator-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-caption {
  font-size: 0.76rem;
  color: var(--tt-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 16px;
  color: var(--tt-text-muted);
  font-size: 0.94rem;
}

/* TikTok-style Floating Player Modal (choreographed open + fast collapse exit) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
  animation: backdropIn 200ms var(--ease-enter) both;
}

.modal-backdrop.is-closing {
  animation: backdropOut 160ms var(--ease-exit) forwards;
}

.tt-player-card {
  position: relative;
  width: fit-content;
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  user-select: none;
  animation: modalEmergentIn 280ms var(--ease-enter) 30ms both;
}

.modal-backdrop.is-closing .tt-player-card {
  animation: modalCollapseOut 160ms var(--ease-exit) forwards;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes backdropOut {
  to { opacity: 0; }
}

@keyframes modalEmergentIn {
  from {
    opacity: 0;
    transform: scale(0.94) translate3d(0, 10px, 0);
  }
  to {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
  }
}

@keyframes modalCollapseOut {
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

.tt-player-card video {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 86vh;
  cursor: pointer;
}

.tt-player-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 28px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  pointer-events: none;
}

.tt-player-creator {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  pointer-events: auto;
}

.tt-player-avatar {
  width: 30px;
  height: 30px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.tt-player-username {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-player-close {
  pointer-events: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.16s ease;
  flex-shrink: 0;
}

.tt-player-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.tt-player-center-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.tt-player-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 28px 14px 12px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tt-player-progress {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: height 0.14s ease;
}

.tt-player-progress:hover {
  height: 6px;
}

.tt-player-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--tt-primary);
  pointer-events: none;
}

.tt-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tt-player-left,
.tt-player-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tt-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.14s ease;
}

.tt-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.tt-player-time {
  font-size: 0.76rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  font-variant-numeric: tabular-nums;
}

/* Legal & Awareness Footer */
.legal-footer {
  position: relative;
  z-index: 10;
  padding: 10px 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.legal-notice {
  max-width: 680px;
  font-size: 0.74rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.44);
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.36);
}

.legal-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  transition: color var(--dur-quick) var(--ease-standard);
}

.legal-link-btn:hover {
  color: rgba(255, 255, 255, 0.92);
}

.legal-dot {
  color: rgba(255, 255, 255, 0.24);
  user-select: none;
}

.legal-copy {
  color: rgba(255, 255, 255, 0.4);
}

/* Legal Modal */
.legal-modal-card {
  width: 100%;
  max-width: 500px;
  border-radius: 20px;
  background: #1e1e1e;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  animation: modalEmergentIn 260ms var(--ease-enter) both;
}

.modal-backdrop.is-closing .legal-modal-card {
  animation: modalCollapseOut 160ms var(--ease-exit) forwards;
}

.legal-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
}

.legal-modal-body {
  padding: 18px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.legal-modal-body strong {
  color: #ffffff;
}

/* Card Right-Click Context Menu — TikTok Native TUX Popover */
.tt-context-menu {
  position: fixed;
  z-index: 90;
  min-width: 218px;
  padding: 6px 0;
  border-radius: 10px;
  background: #252525;
  border: none;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.78), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: top left;
  animation: tuxPopoverIn 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes tuxPopoverIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tt-context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 16px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.tt-context-item svg {
  flex-shrink: 0;
  opacity: 0.88;
}

.tt-context-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.tt-context-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.08);
}

.tt-context-item.danger {
  color: #fe2c55;
}

.tt-context-item.danger svg {
  opacity: 1;
}

.tt-context-item.danger:hover {
  background: rgba(254, 44, 85, 0.1);
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .mobile-nav {
    display: flex;
  }
  .parallax-grid {
    grid-template-columns: repeat(4, minmax(90px, 1fr));
  }
  .top-bar {
    padding: 14px 16px;
  }
  .recent-view {
    padding: 20px 16px 36px;
  }
}

@media (max-width: 600px) {
  .paste-bar {
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 10px 12px;
  }
  .paste-input {
    width: 100%;
    flex-basis: calc(100% - 30px);
  }
  .download-cta {
    flex: 1;
  }
  .result-card {
    flex-direction: column;
  }
  .result-thumb-wrap {
    width: 100%;
    height: 160px;
  }
}
