/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

:root {
  --accent-a: #FF3CAC;
  --accent-b: #784BA0;
  --accent-c: #2B86C5;
  --grad-main: linear-gradient(135deg, var(--accent-a), var(--accent-b), var(--accent-c));
  --bg: #0a0a0f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text-primary: #f4f2ff;
  --text-secondary: rgba(244,242,255,0.55);
  --text-muted: rgba(244,242,255,0.3);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Panel dimensions */
  --pp-width: 360px;
  --pp-mobile-height: 72vh;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.5rem 4rem;
  position: relative;
  overflow-x: hidden;
}

body.panel-open { overflow: hidden; }

/* ── Atmospheric Background ───────────────────────────── */
.noise {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,60,172,0.22) 0%, transparent 70%);
  top: -120px; left: -100px;
  animation-duration: 22s;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(120,75,160,0.2) 0%, transparent 70%);
  top: 30%; right: -140px;
  animation-duration: 18s; animation-delay: -6s;
}
.orb-3 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(43,134,197,0.18) 0%, transparent 70%);
  bottom: 5%; left: 10%;
  animation-duration: 26s; animation-delay: -12s;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.08); }
}

/* ── Header ───────────────────────────────────────────── */
.site-header {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 0 0;
  position: relative;
  z-index: 10;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pill-badge {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
}

/* ── Header right (auth) ──────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sign-in-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px 6px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.sign-in-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.sign-in-btn svg { flex-shrink: 0; }

.user-profile {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.user-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sign-out-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.sign-out-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
}

/* ── Main Layout ──────────────────────────────────────── */
.main-content {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  margin-top: 5rem;
  position: relative;
  z-index: 10;
}

/* ── Hero Text ────────────────────────────────────────── */
.hero-text {
  text-align: center;
  animation: fadeUp 0.8s ease both;
}

.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}

.hero-text h1 em {
  font-style: normal;
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto;
}

/* ── Input Card ───────────────────────────────────────── */
.input-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeUp 0.9s 0.1s ease both;
  transition: border-color 0.3s;
}

.input-card:focus-within {
  border-color: var(--border-hover);
}

.input-row { width: 100%; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.input-wrapper:focus-within {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,60,172,0.5);
  box-shadow: 0 0 0 3px rgba(255,60,172,0.12), 0 0 30px rgba(255,60,172,0.06);
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  pointer-events: none;
}

input[type="text"] {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: 15px 50px 15px 46px;
  font-weight: 300;
}

input::placeholder { color: var(--text-muted); }

.clear-btn {
  position: absolute;
  right: 12px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  padding: 0;
}

.clear-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-primary); }

.btn-row {
  display: flex;
  gap: 0.75rem;
}

.btn-primary, .btn-secondary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: var(--grad-main);
  color: #fff;
  flex: 1;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(255,60,172,0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 6px 32px rgba(255,60,172,0.35);
  transform: translateY(-1px);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding-left: 18px; padding-right: 18px;
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-secondary:active { transform: scale(0.98); }

/* ── Shuffle Row ──────────────────────────────────────── */
.shuffle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 0.15rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}

.shuffle-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 14px 7px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition:
    background 0.25s,
    border-color 0.25s,
    color 0.25s,
    box-shadow 0.3s,
    transform 0.15s;
  position: relative;
  overflow: hidden;
}

.shuffle-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-main);
  opacity: 0;
  transition: opacity 0.3s;
  border-radius: inherit;
}

.shuffle-toggle.shuffle-on {
  border-color: rgba(255, 60, 172, 0.45);
  color: var(--text-primary);
  box-shadow:
    0 0 0 2px rgba(255,60,172,0.15),
    0 0 20px rgba(255,60,172,0.12);
}

.shuffle-toggle.shuffle-on::before { opacity: 0.12; }

.shuffle-toggle:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.shuffle-toggle:active { transform: scale(0.97); }

.shuffle-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.25s;
}

.shuffle-toggle.shuffle-on .shuffle-icon-wrap {
  background: rgba(255, 60, 172, 0.18);
}

.shuffle-icon {
  position: relative;
  z-index: 1;
  transition: color 0.25s, stroke 0.25s;
}

.shuffle-toggle.shuffle-on .shuffle-icon {
  stroke: var(--accent-a);
  filter: drop-shadow(0 0 4px rgba(255,60,172,0.6));
  animation: shuffleSpin 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes shuffleSpin {
  from { transform: rotate(-20deg) scale(0.85); opacity: 0.4; }
  to   { transform: rotate(0deg) scale(1); opacity: 1; }
}

.shuffle-label {
  position: relative;
  z-index: 1;
  transition: color 0.25s;
}

/* ── Toggle pill ──────────────────────────────────────── */
.shuffle-pill {
  width: 30px; height: 17px;
  border-radius: 100px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  padding: 0 3px;
  position: relative;
  z-index: 1;
  transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}

.shuffle-pip {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), background 0.3s;
}

.shuffle-pill.on {
  background: rgba(255, 60, 172, 0.28);
  border-color: rgba(255, 60, 172, 0.5);
}

.shuffle-pill.on .shuffle-pip {
  transform: translateX(13px);
  background: var(--accent-a);
  box-shadow: 0 0 6px rgba(255,60,172,0.7);
}

.shuffle-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  margin-left: auto;
}

/* ── Video Section ────────────────────────────────────── */
.video-section {
  width: 100%;
  animation: fadeUp 0.5s ease both;
}

.video-section.hidden { display: none; }

.video-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.video-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.video-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* ── Browse Playlist Button ───────────────────────────── */
.browse-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 28px;
  padding: 0 10px;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.browse-btn:hover {
  background: rgba(255,60,172,0.12);
  border-color: rgba(255,60,172,0.35);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.browse-btn:active { transform: scale(0.97); }

.close-video {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: background 0.2s, color 0.2s;
}

.close-video:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

.video-frame-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.video-frame-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

/* ── Recommendations ─────────────────────────────────── */
.rec-section {
  margin-top: 1rem;
  animation: fadeUp 0.4s ease both;
}

.rec-section.hidden { display: none; }

.rec-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rec-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Status message (loading / error) */
.rec-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  text-align: center;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rec-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent-a);
  border-radius: 50%;
  animation: recSpin 0.7s linear infinite;
}

.rec-link {
  color: var(--accent-a);
  text-decoration: underline;
}

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

/* Recommendation item */
.rec-item {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

.rec-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}

.rec-thumb-wrap {
  position: relative;
  width: 120px;
  height: 68px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.rec-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}

.rec-item:hover .rec-thumb { transform: scale(1.05); }

.rec-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.rec-item:hover .rec-thumb-overlay { opacity: 1; }

.rec-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0,0,0,0.75);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  pointer-events: none;
}

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

.rec-title {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-channel {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Category Bar ───────────────────────────────────────── */
.cat-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 10px;
  animation: fadeUp 0.7s 0.15s ease both;
}
.cat-bar::-webkit-scrollbar { display: none; }
.cat-bar.collapsed { display: none; }

.cat-bar-wrap {
  width: 100%;
  position: relative;
}

.cat-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 24px;
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 6px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.cat-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.cat-toggle svg { transition: transform 0.25s; }
.cat-toggle.collapsed svg { transform: rotate(180deg); }

.cat-btn {
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}
.cat-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
  transform: translateY(-1px);
}
.cat-btn:active { transform: scale(0.97); }
.cat-btn.active {
  background: var(--grad-main);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 16px rgba(255,60,172,0.3);
}

/* ── Video Feed (Trending) ────────────────────────────── */
.feed-section {
  width: 100%;
  animation: fadeUp 0.6s ease both;
}
.feed-section.collapsed { display: none; }

.feed-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

.feed-status {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  text-align: center;
  padding: 2.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.feed-card {
  cursor: pointer;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.feed-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.feed-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
}

.feed-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}

.feed-card:hover .feed-thumb { transform: scale(1.06); }

.feed-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.feed-card:hover .feed-thumb-overlay { opacity: 1; }

.feed-duration {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0,0,0,0.8);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.4;
  pointer-events: none;
}

.feed-info {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.feed-title {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-channel {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Feature Chips ────────────────────────────────────── */
.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  animation: fadeUp 1s 0.2s ease both;
}

.feature-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
}

.feature-chip svg { color: var(--accent-a); flex-shrink: 0; }

/* ── Footnote ─────────────────────────────────────────── */
.footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   ── Playlist Panel ──────────────────────────────────────
   ══════════════════════════════════════════════════════════ */

/* Backdrop */
.pp-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pp-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Panel — slides in from right on desktop */
.pp-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--pp-width);
  height: 100dvh;
  height: 100vh;
  background: #111118;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.pp-panel.open {
  transform: translateX(0);
  box-shadow: -12px 0 60px rgba(0, 0, 0, 0.6);
}

/* Panel Header */
.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pp-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pp-header-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.pp-header-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.pp-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px 10px;
  letter-spacing: 0.04em;
}

.pp-close-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.pp-close-btn:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }

/* Subheader */
.pp-subheader {
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pp-subtext {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
  font-style: italic;
}

/* Scrollable items list */
.pp-items {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.pp-items::-webkit-scrollbar { width: 4px; }
.pp-items::-webkit-scrollbar-track { background: transparent; }
.pp-items::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}

/* Individual video card */
.pp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
}

.pp-item:hover {
  background: rgba(255,255,255,0.05);
  border-color: var(--border);
}

.pp-item.now-playing {
  background: rgba(255, 60, 172, 0.06);
  border-color: rgba(255, 60, 172, 0.2);
}

.pp-item.selected {
  background: rgba(43, 134, 197, 0.1);
  border-color: rgba(43, 134, 197, 0.35);
}

.pp-item.now-playing.selected {
  background: rgba(120, 75, 160, 0.12);
  border-color: rgba(120, 75, 160, 0.4);
}

/* Thumbnail */
.pp-thumb-wrap {
  position: relative;
  width: 80px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.04);
}

.pp-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s;
}

.pp-item:hover .pp-thumb { transform: scale(1.05); }

/* Thumbnail overlay (play icon on hover) */
.pp-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}

.pp-item:hover .pp-thumb-overlay { opacity: 1; }

/* Number badge */
.pp-num {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.6rem;
  color: rgba(255,255,255,0.7);
  font-weight: 400;
  line-height: 1;
  background: rgba(0,0,0,0.55);
  border-radius: 3px;
  padding: 1px 4px;
}

/* "NOW" badge */
.pp-now-badge {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--accent-a);
  border-radius: 3px;
  padding: 2px 5px;
  line-height: 1;
  box-shadow: 0 0 8px rgba(255,60,172,0.6);
}

/* Text info */
.pp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pp-title {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pp-item.now-playing .pp-title { color: #fff; }

.pp-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 1em;
}

.pp-item.now-playing .pp-meta { color: var(--accent-a); }
.pp-item.selected .pp-meta    { color: var(--accent-c); }
.pp-item.now-playing.selected .pp-meta { color: var(--accent-b); }

/* Check mark indicator */
.pp-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(43,134,197,0.15);
  border: 1px solid rgba(43,134,197,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-c);
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.pp-check.visible {
  opacity: 1;
  transform: scale(1);
}

/* Overflow note */
.pp-overflow-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 300;
  font-style: italic;
  text-align: center;
  padding: 10px 0 4px;
}

/* (confirm footer removed — cards play directly on tap) */

/* ── Animations ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 600px) {
  .main-content { margin-top: 3rem; gap: 2rem; }
  .btn-row { flex-direction: column; }
  .btn-secondary { justify-content: center; }
  .input-card { padding: 1.2rem; border-radius: var(--radius-lg); }
  .video-shell { border-radius: var(--radius-lg); }
  .feature-row { gap: 0.5rem; }
  .shuffle-hint { display: none; }
  .shuffle-row { gap: 8px; }

  /* Mobile: panel rises from bottom as a sheet */
  .pp-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--pp-mobile-height);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }

  .pp-panel.open {
    transform: translateY(0);
    box-shadow: 0 -12px 60px rgba(0, 0, 0, 0.6);
  }

  /* Drag handle visual cue */
  .pp-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.15);
  }

  .pp-header { position: relative; padding-top: 22px; }

  .pp-thumb-wrap { width: 72px; height: 40px; }

  .rec-thumb-wrap { width: 100px; height: 56px; }

  .feed-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .pp-items {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}
