/* stereoStyles.css — Cratoora Stereo v4.1
   Separation of Concerns: All presentation logic (colors, layout, animations)
   No HTML, no JavaScript — pure CSS

   v4.1 — mobile scroll fix: body.stereo-layout + .stereo-shell unlocked
   on mobile so the needle SPA can scroll normally.
*/

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ *
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.stereo-layout {
  background: #0a0a0a;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ═══════════════════════════════════════════════════════════════
   STEREO SHELL — TWO-PANEL LAYOUT
═══════════════════════════════════════════════════════════════ *
.stereo-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #0a0a0a;
}

/* Sidebar *
.stereo-sidebar {
  width: 320px;
  background: #121212;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.stereo-sidebar::-webkit-scrollbar { width: 6px; }
.stereo-sidebar::-webkit-scrollbar-track { background: transparent; }
.stereo-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Main panel *
.stereo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: #121212;
  border-radius: 10px;
  overflow: hidden;
}

/* Dynamic view outlet *
#stereoContent {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   YOUR LIBRARY SECTION
═══════════════════════════════════════════════════════════════ *
.sp-your-library {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(1.25rem, env(safe-area-inset-top, 1.25rem)) 1.25rem 1rem;
  flex-shrink: 0;
}

.sp-your-library-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: color 0.15s;
}

.sp-your-library-title:hover { color: #fff; }

/* Create pill button *
.btn-sp-create-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem 0.3rem 0.6rem;
  background: #2a2a2a;
  border: none;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-sp-create-pill:hover { background: #3a3a3a; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR NAV OPTIONS
═══════════════════════════════════════════════════════════════ *
.sp-lib-options {
  display: flex;
  flex-direction: column;
  padding: 0 0.5rem 0.5rem;
  flex-shrink: 0;
}

.sp-lib-opt {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.sp-lib-opt:hover,
.sp-lib-opt.active {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

.sp-lib-opt-caret {
  margin-left: auto;
  opacity: 0.45;
  transition: transform 0.2s ease, opacity 0.15s;
}

.sp-lib-opt-parent:hover .sp-lib-opt-caret {
  opacity: 0.8;
}

/* Crates row *
.sp-lib-crates-row {
  display: flex;
  align-items: center;
  padding-right: 0.5rem;
}

.sp-lib-crates-row .sp-lib-opt--crates {
  flex: 1;
}

.sp-lib-crates-actions {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.sp-lib-crates-row:hover .sp-lib-crates-actions {
  opacity: 1;
}

.sp-lib-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: none;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.sp-lib-action-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ═══════════════════════════════════════════════════════════════
   COLLECTION FLYOUT
═══════════════════════════════════════════════════════════════ *
.sp-lib-submenu {
  position: fixed;
  width: 200px;
  background: #282828;
  border-radius: 8px;
  padding: 0.35rem 0;
  box-shadow: 0 16px 48px rgba(0,0,0,0.75);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-6px);
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.23,1,0.32,1);
  z-index: 1001;
}

.sp-lib-submenu.flyout-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.sp-lib-sub-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 1.1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.sp-lib-sub-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   GUEST CARDS
═══════════════════════════════════════════════════════════════ *
.sp-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem;
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.sp-card {
  background: #121212;
  border-radius: 10px;
  padding: 1.25rem;
}

.sp-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.sp-card-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 1rem;
}

.btn-sp-card {
  display: inline-flex;
  padding: 0.48rem 1.15rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.btn-sp-card:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.07);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR FOOTER
═══════════════════════════════════════════════════════════════ *
.sp-sidebar-footer {
  padding: 1.5rem 1.25rem 1.25rem;
  flex-shrink: 0;
  margin-top: auto;
}

.sp-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin-bottom: 1.25rem;
}

.sp-footer-links a {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.15s;
}

.sp-footer-links a:hover { color: #fff; }

.btn-sp-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 1rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-sp-lang:hover { border-color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   HEADER / TOPBAR (Web Component support)
═══════════════════════════════════════════════════════════════ *
cratoora-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 900;
  flex-shrink: 0;
}

.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.topbar-nav-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.topbar-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.topbar-nav-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.topbar-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  padding: 0.5rem 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.07);
}

/* ═══════════════════════════════════════════════════════════════
   SITE FOOTER
═══════════════════════════════════════════════════════════════ *
.site-footer {
  background: #111;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-brand img {
  border-radius: 10px;
  margin-bottom: 0.75rem;
}

.footer-tagline {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}

.footer-origin {
  font-size: 0.77rem;
  color: rgba(255,255,255,0.35);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1.5rem;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 0.85rem;
}

.footer-col a {
  display: block;
  font-size: 0.83rem;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
}

.footer-social {
  display: flex;
  gap: 0.5rem;
}

.btn-social {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: none;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-social:hover {
  border-color: #fff;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER BAR
═══════════════════════════════════════════════════════════════ *
.player-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 300;
  background: #181818;
  border-top: 1px solid #2a2a2a;
  height: 90px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}

.player-bar.visible { transform: translateY(0); }
body.player-active { padding-bottom: 90px; }

.player-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: #8B5CF6;
  transition: width 0.5s linear;
  pointer-events: none;
}

.player-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(135deg, #8B5CF6, #D97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.player-info { flex: 1; min-width: 0; }
.player-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.1s;
}

.player-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.player-btn.play-pause {
  width: 42px;
  height: 42px;
  background: #fff;
  color: #080808;
}

.player-btn.play-pause:hover {
  background: rgba(255,255,255,0.88);
}

/* ═══════════════════════════════════════════════════════════════
   MODALS & OVERLAYS
═══════════════════════════════════════════════════════════════ *
.create-crate-overlay,
.crate-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.create-crate-overlay.open,
.crate-auth-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.create-crate-modal,
.crate-auth-modal {
  background: #282828;
  border-radius: 16px;
  padding: 1.5rem;
  width: min(360px, 100%);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.23,1,0.32,1);
}

.create-crate-overlay.open .create-crate-modal,
.crate-auth-overlay.open .crate-auth-modal {
  transform: scale(1);
}

.create-crate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.create-crate-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.create-crate-close,
.crate-auth-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.create-crate-close:hover,
.crate-auth-close:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.create-crate-input {
  width: 100%;
  background: #3e3e3e;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  color: #fff;
  margin-bottom: 0.65rem;
}

.create-crate-input::placeholder { color: rgba(255,255,255,0.3); }

.create-crate-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-crate-cancel,
.btn-crate-create {
  flex: 1;
  padding: 0.68rem;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-crate-cancel {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
}

.btn-crate-cancel:hover { background: rgba(255,255,255,0.07); }

.btn-crate-create {
  background: #fff;
  border: none;
  color: #080808;
}

.btn-crate-create:hover { background: rgba(255,255,255,0.88); }

/* Auth modal specific *
.crate-auth-modal {
  text-align: center;
  padding: 2rem;
}

.crate-auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  margin-bottom: 1.25rem;
}

.crate-auth-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.crate-auth-sub {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.75rem;
}

.crate-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-crate-auth-signup,
.btn-crate-auth-login {
  width: 100%;
  padding: 0.82rem;
  border-radius: 999px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
}

.btn-crate-auth-signup {
  background: #fff;
  color: #080808;
}

.btn-crate-auth-signup:hover { background: rgba(255,255,255,0.88); }

.btn-crate-auth-login {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.btn-crate-auth-login:hover { background: rgba(255,255,255,0.14); }

/* ═══════════════════════════════════════════════════════════════
   PREVIEW BANNER
═══════════════════════════════════════════════════════════════ *
.cr-preview-banner {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 250;
  background: #1d1d1d;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.85rem 1.5rem;
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.23,1,0.32,1);
}

.cr-preview-banner.visible { transform: translateY(0); }

.cr-preview-banner-text { flex: 1; min-width: 0; }
.cr-preview-banner-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.cr-preview-banner-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
}

.cr-preview-banner-actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}

.cr-preview-btn-signup {
  padding: 0.48rem 1.2rem;
  background: #fff;
  color: #080808;
  font-weight: 800;
  border-radius: 999px;
  text-decoration: none;
}

.cr-preview-btn-login {
  padding: 0.45rem 1rem;
  background: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  text-decoration: none;
}

.cr-preview-banner-dismiss {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: none;
  color: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════════ *
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #8B5CF6;
  color: #fff;
  padding: 0.75rem;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.update-banner.visible { transform: translateY(0); }

/* Skeleton loading animation *
@keyframes crSkPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.8; }
}

@keyframes crSkSpin {
  to { transform: rotate(360deg); }
}

.cr-sk {
  background: rgba(255,255,255,0.07);
  border-radius: 8px;
  animation: crSkPulse 1.4s ease-in-out infinite;
}

.cr-sk-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(139,92,246,0.18);
  border-top-color: #8B5CF6;
  animation: crSkSpin 0.65s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE — scroll unlock + sidebar drawer
   Overrides the desktop overflow:hidden lock on body and shell
   so the Needle SPA can scroll normally on mobile.
   Must be at the bottom to win the cascade.
═══════════════════════════════════════════════════════════════ *
@media (max-width: 768px) {

  body.stereo-layout {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }

  .stereo-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    flex-direction: column;  
    padding: 0;
    gap: 0;
  }

  .stereo-main {
    height: auto;
    overflow: visible;
    border-radius: 0;
  }

  #stereoContent {
    overflow: visible;
    height: auto;
  }

  /* Sidebar becomes a fixed off-screen drawer *
  .stereo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100%;
    border-radius: 0;
    -webkit-transform: translateX(-100%);
            transform: translateX(-100%);
    -webkit-transition: -webkit-transform 0.32s cubic-bezier(0.23,1,0.32,1);
            transition: transform 0.32s cubic-bezier(0.23,1,0.32,1);
    z-index: 200;
    overflow-y: auto;
  }

  /* needleShell adds .open class — slides drawer in *
  .stereo-sidebar.open {
    -webkit-transform: translateX(0);
            transform: translateX(0);
  }

  /* Backdrop *
  #sidebarBackdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.3s;
            transition: opacity 0.3s;
  }

  #sidebarBackdrop.visible { 
    opacity: 1;
    pointer-events: all;
  }
}

/* Desktop — ensure backdrop never shows *
@media (min-width: 769px) {
  #sidebarBackdrop { display: none !important; }
}*/
/*------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------*/
/* stereoStyles.css — Cratoora Needle v5.0
   Mobile-first layout layer for the Needle surface.
   Handles:
     - Shell layout
     - Sidebar drawer
     - Player bar
     - Modals
     - Preview banner
     - Update banner
     - Mobile Tab Bar (NEW)
   Pure CSS — no HTML, no JS.
*/

/* ═══════════════════════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════════════════════ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.stereo-layout {
  background: #0a0a0a;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* ═══════════════════════════════════════════════════════════════
   SHELL LAYOUT — DESKTOP
═══════════════════════════════════════════════════════════════ */
.stereo-shell {
  display: flex;
  height: 100vh;
  height: 100dvh;
  gap: 0.5rem;
  padding: 0.5rem;
  background: #0a0a0a;
}

/* Sidebar */
.stereo-sidebar {
  width: 320px;
  background: #121212;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

.stereo-sidebar::-webkit-scrollbar { width: 6px; }
.stereo-sidebar::-webkit-scrollbar-track { background: transparent; }
.stereo-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Main panel */
.stereo-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  background: #121212;
  border-radius: 10px;
  overflow: hidden;
}

/* Dynamic view outlet */
#stereoContent {
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════
   PLAYER BAR
═══════════════════════════════════════════════════════════════ */
.player-bar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 300;
  background: #181818;
  border-top: 1px solid #2a2a2a;
  height: 90px;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.23,1,0.32,1);
}

.player-bar.visible { transform: translateY(0); }
body.player-active { padding-bottom: 90px; }

.player-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  cursor: pointer;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: #8B5CF6;
  transition: width 0.5s linear;
  pointer-events: none;
}

.player-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(135deg, #8B5CF6, #D97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.player-info { flex: 1; min-width: 0; }
.player-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-artist {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.player-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, transform 0.1s;
}

.player-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.player-btn.play-pause {
  width: 42px;
  height: 42px;
  background: #fff;
  color: #080808;
}

.player-btn.play-pause:hover {
  background: rgba(255,255,255,0.88);
}

/* ═══════════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════════ */
.create-crate-overlay,
.crate-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.create-crate-overlay.open,
.crate-auth-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.create-crate-modal,
.crate-auth-modal {
  background: #282828;
  border-radius: 16px;
  padding: 1.5rem;
  width: min(360px, 100%);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.23,1,0.32,1);
}

.create-crate-overlay.open .create-crate-modal,
.crate-auth-overlay.open .crate-auth-modal {
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════
   PREVIEW BANNER
═══════════════════════════════════════════════════════════════ */
.cr-preview-banner {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 250;
  background: #1d1d1d;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.85rem 1.5rem;
  padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.23,1,0.32,1);
}

.cr-preview-banner.visible { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   UPDATE BANNER
═══════════════════════════════════════════════════════════════ */
.update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #8B5CF6;
  color: #fff;
  padding: 0.75rem;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.update-banner.visible { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   MOBILE LAYOUT OVERRIDES
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  body.stereo-layout {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }

  .stereo-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .stereo-main {
    height: auto;
    overflow: visible;
    border-radius: 0;
  }

  #stereoContent {
    overflow: visible;
    height: auto;
  }

  /* Sidebar drawer */
  .stereo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100%;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.23,1,0.32,1);
    z-index: 200;
    overflow-y: auto;
  }

  .stereo-sidebar.open {
    transform: translateX(0);
  }

  /* Backdrop */
  #sidebarBackdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  #sidebarBackdrop.visible {
    opacity: 1;
    pointer-events: all;
  }

  /* ════════════════════════════════════════════════════════════
     MOBILE TAB BAR (NEW)
  ════════════════════════════════════════════════════════════ */
  cratoora-needle-mobile-tabbar {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #111;
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 450;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  cratoora-needle-mobile-tabbar .tabbar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.5rem;
  }

  cratoora-needle-mobile-tabbar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.18s;
  }

  cratoora-needle-mobile-tabbar .tab svg {
    width: 22px;
    height: 22px;
    opacity: 0.55;
    transition: opacity 0.18s;
  }

  cratoora-needle-mobile-tabbar .tab.active {
    color: #fff;
  }

  cratoora-needle-mobile-tabbar .tab.active svg {
    opacity: 1;
  }

  cratoora-needle-mobile-tabbar .tab:active {
    transform: scale(0.94);
  }
}

/* Desktop — hide mobile-only elements */
@media (min-width: 769px) {
  #sidebarBackdrop { display: none !important; }
  cratoora-needle-mobile-tabbar { display: none !important; }
}



