:root{
  --bg:#0b0710;
  --panel:rgba(18,12,26,.68);
  --panel2:rgba(14,10,18,.72);
  --stroke:rgba(255,255,255,.10);

  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.70);
  --faint:rgba(255,255,255,.52);

  --rose:#ffb7c5;
  --pink:#ff4d6d;
  --lav:#b89cff;

  --shadow:0 18px 70px rgba(0,0,0,.60);
  --radius:18px;
  --radius2:24px;

  --maxw:1100px;     /* page content */
  --topw:1500px;     /* topbar can be wider so nothing gets hidden */
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(255,77,109,.22), transparent 60%),
    radial-gradient(900px 650px at 10% 10%, rgba(255,183,197,.18), transparent 60%),
    radial-gradient(700px 700px at 70% 70%, rgba(184,156,255,.14), transparent 62%),
    var(--bg);
  color:var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  overflow-x:hidden;
}

a{ color:inherit; text-decoration:none; }
button,input{ font:inherit; }
img{ max-width:100%; display:block; }
:focus-visible{ outline:2px solid rgba(255,183,197,.7); outline-offset:3px; border-radius:12px; }
body.modal-open{ overflow:hidden; }

/* =========================
   Boot
   ========================= */
.boot{
  position:fixed; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:#05040a;
  z-index:9999;
}
.boot-card{
  width:min(560px, calc(100% - 28px));
  padding:26px;
  border-radius:22px;
  border:1px solid rgba(255,183,197,.22);
  background:
    radial-gradient(900px 500px at 50% 0%, rgba(255,183,197,.14), transparent 55%),
    rgba(10,8,14,.75);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
}
.boot-title{
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:rgba(255,183,197,.92);
  font-size:.82rem;
}
.boot-line{
  margin-top:12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color:rgba(255,255,255,.88);
  font-size:.98rem;
}
.boot-bar{
  margin-top:16px;
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.09);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
}
.boot-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(255,183,197,.9), rgba(255,77,109,.85));
  box-shadow:0 0 22px rgba(255,183,197,.35);
}
.boot-sub{
  margin-top:12px;
  color:rgba(255,255,255,.66);
  letter-spacing:.10em;
  text-transform:uppercase;
  font-size:.72rem;
}

/* =========================
   Topbar (fixed: no hidden, no overlap, straight line on desktop)
   ========================= */
.topbar{
  position:sticky;
  top:0;
  z-index:2000;
  backdrop-filter: blur(12px);
  background:rgba(8,6,10,.58);
  border-bottom:1px solid rgba(255,255,255,.08);
}

.topbar-inner{
  max-width:var(--topw);
  margin:0 auto;
  padding:12px 18px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
}

.brand{
  flex:0 0 auto;
  min-width:220px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.brand-kicker{
  font-weight:800;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:rgba(255,183,197,.92);
  font-size:.74rem;
}
.brand-title{
  font-family: Fraunces, serif;
  font-weight:700;
  letter-spacing:.03em;
  color:rgba(255,255,255,.92);
  font-size:1.06rem;
}

/* actions row uses remaining space; search expands, buttons stay visible */
.topbar-actions{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}

/* Search */
.search-wrap{
  flex:1 1 360px;
  min-width:220px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
}
.search{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color:rgba(255,255,255,.92);
  font-size:.95rem;
}
.search::placeholder{ color:rgba(255,255,255,.45); }

/* Buttons */
.iconbtn{
  border:none;
  background:rgba(255,255,255,.10);
  color:rgba(255,255,255,.90);
  padding:9px 11px;
  border-radius:999px;
  cursor:pointer;
  transition: transform .12s ease, background .18s ease;
}
.iconbtn:hover{ background:rgba(255,255,255,.14); }
.iconbtn:active{ transform:scale(.98); }

.btn{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.08);
  color:rgba(255,255,255,.92);
  padding:9px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:800;
  letter-spacing:.02em;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, filter .18s ease;
  white-space:nowrap;
  font-size:.92rem;
}
.btn:hover{ background:rgba(255,255,255,.12); }
.btn:active{ transform:scale(.98); }
.btn.primary{
  background:linear-gradient(90deg, rgba(255,183,197,.95), rgba(255,77,109,.85));
  color:#0b0710;
  border-color:rgba(255,183,197,.35);
  box-shadow:0 14px 48px rgba(255,77,109,.18);
}
.btn.primary:hover{ filter:brightness(1.03); }
.btn.ghost{ background:rgba(255,255,255,.06); }
.btn.tiny{ padding:8px 12px; font-size:.86rem; }

/* Scanner */
.scan-container{ display:inline-block; flex:0 0 auto; }
.scan-btn{
  position:relative;
  width:200px;                 /* slightly tighter so your whole nav fits */
  height:40px;
  border-radius:999px;
  border:1px solid rgba(255,77,109,.55);
  background:rgba(255,77,109,.10);
  color:rgba(255,255,255,.90);
  cursor:pointer;
  overflow:hidden;
  user-select:none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.scan-btn:active{ transform:scale(.98); }
.scan-fill{
  position:absolute; inset:0;
  width:0%;
  background:linear-gradient(90deg, rgba(255,183,197,.75), rgba(255,77,109,.65));
  opacity:.35;
}
.scan-text{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
  font-size:.72rem;
  width:100%;
  height:100%;
}
.scan-btn.unlocked{
  background:rgba(255,183,197,.85);
  color:#0b0710;
  border-color:rgba(255,183,197,.65);
  box-shadow:0 0 30px rgba(255,183,197,.28);
}

/* If screen is smaller, wrap (better than hiding) */
@media (max-width: 1200px){
  .topbar-inner{ flex-wrap:wrap; }
  .topbar-actions{ flex-wrap:wrap; }
  .search-wrap{ flex:1 1 100%; min-width: 240px; }
}

/* =========================
   Hero
   ========================= */
.main{ padding-bottom:30px; }

.hero{
  position:relative;
  min-height:70vh;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.hero-bg{
  position:absolute; inset:0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.10), rgba(11,7,16,.86)),
    radial-gradient(900px 520px at 70% 10%, rgba(255,183,197,.18), transparent 60%),
    url("https://images.unsplash.com/photo-1483794344563-d27a8d18014e?auto=format&fit=crop&w=2400&q=80");
  background-size:cover;
  background-position:center;
  filter:saturate(1.05);
  transform:scale(1.03);
}
.hero-inner{
  position:relative;
  padding:56px 14px 28px;
  max-width:var(--maxw);
  width:100%;
  margin:0 auto;
}
.hero-chip{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,183,197,.22);
  background:rgba(14,10,18,.55);
  backdrop-filter:blur(10px);
  box-shadow:0 16px 70px rgba(0,0,0,.45);
  color:rgba(255,255,255,.86);
  font-weight:700;
}
.hero-chip .dot{
  width:10px; height:10px;
  border-radius:50%;
  background:rgba(255,183,197,.92);
  box-shadow:0 0 18px rgba(255,183,197,.35);
}
.hero-title{
  margin:18px 0 10px;
  font-family: Fraunces, serif;
  font-size:clamp(2rem, 4.6vw, 3.5rem);
  line-height:1.05;
}
.glow{
  color:rgba(255,183,197,.96);
  text-shadow:0 0 20px rgba(255,183,197,.18);
}
.hero-sub{
  margin:0 0 18px;
  color:rgba(255,255,255,.75);
  font-size:1.06rem;
  max-width:72ch;
}
.hero-hints{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:18px;
}
.hint-card{
  display:flex;
  gap:12px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(12,10,15,.58);
  backdrop-filter:blur(10px);
}
.hint-emoji{ font-size:1.35rem; }
.hint-title{ font-weight:900; }
.hint-sub{ color:rgba(255,255,255,.70); font-size:.92rem; }

@media (max-width: 980px){
  .hero-hints{ grid-template-columns:1fr; }
}

/* =========================
   Shelves
   ========================= */
.shelves{
  max-width:var(--maxw);
  margin:0 auto;
  padding:18px 14px 56px;
}
.shelf{ margin-top:18px; }
.shelf-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.shelf-title{
  margin:0;
  font-weight:900;
  letter-spacing:.01em;
  font-size:1.15rem;
}
.shelf-sub{
  color:rgba(255,255,255,.62);
  font-size:.92rem;
  margin-top:4px;
}
.shelf-controls{ display:flex; gap:8px; }

.row{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:12px;
  scroll-behavior:smooth;
}
.row::-webkit-scrollbar{ height:10px; }
.row::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.14);
  border-radius:999px;
}

/* Cards (back to clean original proportions) */
.card{
  position:relative;
  flex:0 0 260px;
  height:160px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  cursor:pointer;
  background:rgba(255,255,255,.06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, filter .18s ease, opacity .18s ease;
}
.card:hover{
  transform: translateY(-3px) scale(1.02);
  border-color:rgba(255,183,197,.35);
  box-shadow:0 18px 80px rgba(0,0,0,.55);
}
.card .cover{
  position:absolute; inset:0;
  background-size:cover;
  background-position:center;
  filter:saturate(1.05);
}
.card .shade{
  position:absolute; inset:0;
  background:linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.12));
}
.card .inner{
  position:absolute; inset:0;
  padding:14px;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  gap:6px;
}


.modal-head { position: relative; }

.modal-nav{
  position:absolute;
  top:12px;
  left:12px;
  display:flex;
  gap:8px;
  z-index:5;
}

.modal-nav .iconbtn.nav[disabled]{
  opacity:.45;
  pointer-events:none;
}

.badge{
  position:absolute;
  top:12px;
  left:12px;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(10,8,14,.55);
  backdrop-filter:blur(10px);
}
.title{ font-weight:900; font-size:1.02rem; }
.meta{
  display:flex;
  justify-content:space-between;
  color:rgba(255,255,255,.70);
  font-size:.86rem;
}
.desc{
  color:rgba(255,255,255,.66);
  font-size:.86rem;
  line-height:1.35;
  max-height:2.6em;
  overflow:hidden;
}

/* Locked */
.card.locked{ filter:grayscale(.75); opacity:.72; }
.card.locked:hover{ filter:grayscale(.35); opacity:.95; }
.lock-icon{
  position:absolute;
  left:50%;
  top:44%;
  transform:translate(-50%,-50%);
  font-size:26px;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.65));
}

@media (max-width: 520px){
  .card{ flex:0 0 84vw; }
}

/* =========================
   Modal (player never clipped)
   ========================= */
.modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:2200;
  padding:16px;
}
.modal.on{
  display:flex;
  align-items:center;
  justify-content:center;
}
.modal-scrim{
  position:absolute; inset:0;
  background:rgba(0,0,0,.72);
}
.modal-card{
  position:relative;
  width:min(920px, 100%);
  max-height:calc(100vh - 32px);
  min-height:0;
  border-radius:22px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(10,8,14,.86);
  backdrop-filter: blur(14px);
  box-shadow:0 24px 100px rgba(0,0,0,.70);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal-head{
  position:relative;
  flex:0 0 clamp(180px, 26vh, 240px);
}
.modal-cover{
  position:absolute; inset:0;
  background-size:cover;
  background-position:center;
  filter:saturate(1.1);
}
.modal-cover::after{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(to top, rgba(10,8,14,.95), rgba(10,8,14,.10));
}
.iconbtn.close{
  position:absolute;
  top:12px;
  right:12px;
  z-index:20;
}
.modal-head-inner{
  position:absolute;
  left:18px;
  right:64px;
  bottom:18px;
}
.modal-meta{
  color:rgba(255,183,197,.92);
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:.78rem;
}
.modal-title{
  margin:8px 0 10px;
  font-family: Fraunces, serif;
  font-size:2.1rem;
  line-height:1.05;
}
.modal-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.tag{
  padding:7px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(255,255,255,.82);
  font-weight:800;
  font-size:.82rem;
}
.modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:18px;
}
.modal-desc{
  color:rgba(255,255,255,.86);
  line-height:1.65;
  font-size:1.05rem;
}

.lyric-box{
  margin-top:14px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(255,183,197,.18);
  background:rgba(255,183,197,.06);
}
.lyric-kicker{
  color:rgba(255,183,197,.92);
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:.72rem;
}
.lyric{ margin-top:8px; font-weight:900; }
.clipnote{ margin-top:6px; color:rgba(255,255,255,.70); font-size:.92rem; }

/* =========================
   Player (matches YOUR HTML: .np-track exists, no clipping)
   ========================= */
.player{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.08);
  background:rgba(8,6,10,.55);
  flex-wrap:wrap;
}

.player-left{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 320px;
  min-width:0;
}
.np-badge{
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:.70rem;
  color:rgba(255,183,197,.92);
  white-space:nowrap;
}
.np-track{
  min-width:0;
}
.np-track-title,
.np-track-artist{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:100%;
}
.np-track-title{ font-weight:900; }
.np-track-artist{ color:rgba(255,255,255,.66); font-size:.92rem; }

.player-mid{
  display:flex;
  align-items:center;
  gap:10px;
  flex:2 1 520px;
  min-width:260px;
  flex-wrap:wrap;              /* critical: prevents clipping inside modal */
  justify-content:flex-start;
}
.time{ width:54px; text-align:right; color:rgba(255,255,255,.70); }

.scrub{
  flex:1 1 320px;
  min-width:220px;
  max-width:560px;
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.10);
  overflow:hidden;
  cursor:pointer;
}
.scrub-fill{
  height:100%;
  width:0%;
  background:linear-gradient(90deg, rgba(255,183,197,.95), rgba(255,77,109,.90));
}

.player-right{ flex:0 0 auto; }

/* Visualizer */
.visualizer{
  display:flex;
  gap:3px;
  align-items:flex-end;
  height:22px;
  width:64px;
  padding:2px 0;
}
.vizbar{
  width:4px;
  height:6px;
  border-radius:4px;
  background:rgba(255,183,197,.85);
  opacity:.9;
  animation: vizBounce 900ms ease-in-out infinite;
}
.vizbar:nth-child(2){ animation-delay:140ms; }
.vizbar:nth-child(3){ animation-delay:260ms; }
@keyframes vizBounce{
  0%,100%{ height:6px; opacity:.55; }
  50%{ height:22px; opacity:1; }
}

/* =========================
   Rain overlay
   ========================= */
.rain-overlay{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:5;
  opacity:0;
  transition: opacity 700ms ease;
  mix-blend-mode: screen;
  background-image:
    repeating-linear-gradient(115deg,
      rgba(255,255,255,.07) 0px,
      rgba(255,255,255,.07) 1px,
      transparent 1px,
      transparent 10px
    );
  background-size:180% 180%;
  animation: rainMove 1.2s linear infinite;
}
.rain-overlay.active{ opacity:.14; }
@keyframes rainMove{
  from{ background-position:0% 0%; }
  to{ background-position:30% 60%; }
}



/* Night Drive video background */
.night-drive{
  position: fixed;
  inset: 0;
  z-index: 0;           /* behind app content; adjust if needed */
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}

.night-drive__vid{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: blur(1px) saturate(1.08) contrast(1.06);
}

/* When Night Drive is ON */
body.night-on .night-drive{
  opacity: .55;         /* tune */
}





/* Petals canvas */
.petals-canvas{
  position:fixed;
  inset:0;
  z-index:4;
  pointer-events:none;
  opacity:1;
  transition: opacity 400ms ease;
}
.petals-canvas.off{ opacity:0; }

/* Toasts */
.toasts{
  position:fixed;
  right:14px;
  bottom:14px;
  z-index:9999;
  display:flex;
  flex-direction:column;
  gap:10px;
  pointer-events:none;
}
.toast{
  pointer-events:none;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,183,197,.22);
  background:rgba(12,10,15,.82);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color:rgba(255,255,255,.92);
  max-width:360px;
  line-height:1.35;
}

/* Red Thread dots (CSS only; JS must create the dots) */
.red-thread-dot{
  position:fixed;
  top:-30px; left:-30px;
  border-radius:999px;
  pointer-events:none;
  z-index:10001;
  width: var(--d, 12px);
  height: var(--d, 12px);
  opacity: var(--o, .55);
  background: var(--c, rgba(255,183,197,.9));
  box-shadow: 0 0 18px rgba(255,77,109,.25);
  transform: translate3d(-30px,-30px,0);
}

@media (prefers-reduced-motion: reduce){
  .rain-overlay{ animation:none !important; }
  .vizbar{ animation:none !important; }
}
