:root {
  color-scheme: dark;
  --bg: #07080a;
  --bg-elev: #101218;
  --bg-card: #151820;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --muted2: #6b7385;
  --pink: #fe2c55;
  --pink-soft: rgba(254, 44, 85, 0.16);
  --cyan: #25f4ee;
  --cyan-soft: rgba(37, 244, 238, 0.12);
  --ok: #3ddc97;
  --warn: #f5c542;
  --err: #ff6b7a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(254, 44, 85, 0.18), transparent 55%),
    radial-gradient(700px 420px at -5% 10%, rgba(37, 244, 238, 0.1), transparent 50%),
    radial-gradient(600px 400px at 50% 100%, rgba(80, 90, 255, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  background: rgba(7, 8, 10, 0.65);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), #ff6a8a 55%, var(--cyan));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 8px 24px rgba(254, 44, 85, 0.35);
}

.brand span { font-size: 0.95rem; }
.brand small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.75rem;
  background: rgba(255,255,255,0.03);
}
.badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted2);
}
.badge.live::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.badge.sandbox::before { background: var(--warn); }

.view { display: none; flex: 1; }
.view.active { display: block; }

/* —— Landing —— */
.landing {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; padding-top: 2rem; }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 1rem;
}
.kicker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 12px var(--pink);
}

.landing h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
}
.landing h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--pink), #ff7a95 40%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 36rem;
  margin: 0 0 1.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  font-weight: 650;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #fe2c55, #ff4d6d);
  box-shadow: 0 10px 30px rgba(254, 44, 85, 0.35);
}
.btn-primary:not(:disabled):hover {
  box-shadow: 0 14px 36px rgba(254, 44, 85, 0.45);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-sm { padding: 0.55rem 0.95rem; font-size: 0.85rem; }

.tt-icon {
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
}
.tt-icon svg { width: 18px; height: 18px; display: block; }

.fineprint {
  color: var(--muted2);
  font-size: 0.8rem;
  line-height: 1.45;
  max-width: 28rem;
}
.fineprint strong { color: var(--muted); font-weight: 600; }

.preview-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.preview-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(254,44,85,0.25), transparent 70%);
  pointer-events: none;
}
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}
.mini-video {
  aspect-ratio: 9/14;
  border-radius: 14px;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75)),
    linear-gradient(135deg, #2a3142, #12151c);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.mini-video:nth-child(2) {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75)),
    linear-gradient(135deg, #3a1a28, #12151c);
}
.mini-video:nth-child(3) {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75)),
    linear-gradient(135deg, #16353a, #12151c);
}
.mini-video:nth-child(4) {
  background:
    linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.75)),
    linear-gradient(135deg, #2a2550, #12151c);
}
.mini-meta {
  position: absolute;
  left: 0.65rem; right: 0.65rem; bottom: 0.65rem;
  font-size: 0.7rem;
  color: #fff;
}
.mini-meta strong { display: block; margin-bottom: 0.15rem; }
.mini-stats { color: rgba(255,255,255,0.7); }

.preview-caption {
  margin-top: 0.9rem;
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--cyan));
  flex-shrink: 0;
}
.preview-caption p { margin: 0; font-size: 0.8rem; color: var(--muted); }
.preview-caption strong { color: var(--text); }

/* —— Overlay / toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 50;
  max-width: min(92vw, 420px);
  font-size: 0.88rem;
  transition: transform 0.25s ease;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { border-color: rgba(255,107,122,0.45); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 40;
  padding: 1rem;
}
.overlay.show { display: grid; }
.overlay-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  width: min(100%, 360px);
  text-align: center;
  box-shadow: var(--shadow);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--pink);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.overlay-card p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }

/* —— Dashboard —— */
.dash {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
}

.profile-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  background: linear-gradient(135deg, rgba(254,44,85,0.1), rgba(37,244,238,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.5rem;
}
.avatar-lg {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #333, #111);
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.profile-copy h2 {
  margin: 0 0 0.2rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.profile-copy .handle {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}
.stat-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.stat {
  min-width: 88px;
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
}
.stat b { display: block; font-size: 1rem; }
.stat span { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }

.profile-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .profile-actions { margin-left: 0; width: 100%; }
  .profile-actions .btn { flex: 1; }
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.015em;
}
.section-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.85rem; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
  display: flex;
  flex-direction: column;
}
.video-card:hover {
  border-color: rgba(254, 44, 85, 0.35);
  transform: translateY(-2px);
}
.video-thumb-wrap {
  position: relative;
  aspect-ratio: 9/12;
  background: #0c0e12;
}
.video-thumb-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.video-thumb-fallback {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--muted2);
  font-size: 0.8rem;
  background: linear-gradient(160deg, #1a1f2b, #0c0e12);
}
.video-body {
  padding: 0.75rem 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.video-title {
  font-size: 0.85rem;
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.video-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
  margin-top: auto;
}
.metric {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.metric b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.state-panel {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 2.5rem 1.25rem;
  text-align: center;
  background: rgba(255,255,255,0.02);
}
.state-panel h4 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.state-panel p { margin: 0 auto 1.1rem; color: var(--muted); max-width: 28rem; font-size: 0.9rem; line-height: 1.45; }
.state-panel.err { border-color: rgba(255,107,122,0.35); background: rgba(255,107,122,0.05); }

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.skel {
  border-radius: 16px;
  background: linear-gradient(90deg, #151820 0%, #1c212c 50%, #151820 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border: 1px solid var(--border);
}
.skel-card { aspect-ratio: 9/14; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.footer-note {
  text-align: center;
  color: var(--muted2);
  font-size: 0.75rem;
  padding: 0 1rem 2rem;
}
