:root {
  --bg: #08080c;
  --surface: #121218;
  --elevated: #1b1b24;
  --border: #22222c;
  --text: #f4f4f8;
  --text-2: #9b9ba9;
  --muted: #66666f;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --heart: #f43f5e;
  --danger: #f87171;
  --success: #34d399;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --nav-h: 62px;
  --radius: 14px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow: hidden; }

#app { position: fixed; inset: 0; }
#overlays { position: absolute; inset: 0; pointer-events: none; z-index: 60; }
#overlays > * { pointer-events: auto; }

/* One-time shell entrance revealed as the boot splash fades */
#shell.entering #panes { animation: panesin 0.5s 0.06s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
#shell.entering #bottomnav { animation: navup 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
@keyframes panesin { from { opacity: 0; transform: translateY(12px); } }
@keyframes navup { from { transform: translateY(100%); } }

/* Sign-in success: auth host fades away before the shell entrance */
.authhost.out { animation: authout 0.26s ease both; }
@keyframes authout { to { opacity: 0; transform: scale(0.98); } }

/* Desktop: center a phone-width column with side borders */
@media (min-width: 700px) {
  #app {
    left: 0; right: 0;
    margin: 0 auto;
    max-width: 560px;
    box-shadow: 0 0 0 1px var(--border), 0 0 60px rgba(0, 0, 0, 0.55);
  }
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
button:active { opacity: 0.75; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 14px;
  outline: none;
  width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--violet); }
input::placeholder, textarea::placeholder { color: var(--muted); }

::-webkit-scrollbar { width: 0; height: 0; }

/* ---------- App shell: tab panes + pushed page + bottom nav ---------- */

#shell { position: absolute; inset: 0; }

#panes {
  position: absolute;
  inset: 0 0 var(--nav-h) 0;
}

.pane {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  padding-top: var(--safe-top);
}
.pane.active { visibility: visible; }

#page {
  position: absolute;
  inset: 0 0 var(--nav-h) 0;
  overflow-y: auto;
  background: var(--bg);
  visibility: hidden;
  transform: translateX(28px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
  padding-top: var(--safe-top);
  z-index: 5;
}
#page.open { visibility: visible; transform: translateX(0); opacity: 1; }

#bottomnav {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(11, 11, 17, 0.96);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 10;
}

.navslot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 244, 248, 0.45);
  position: relative;
}
.navslot svg { width: 25px; height: 25px; transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1); }
.navslot:active svg { transform: scale(0.78); }
.navslot.selected { color: var(--text); }
.navslot.selected svg { animation: navpop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes navpop {
  0% { transform: scale(0.6); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.navslot.selected::after {
  content: "";
  position: absolute;
  bottom: 9px;
  width: 4px; height: 4px;
  border-radius: 2px;
  background: #fff;
}
.navslot .badge {
  position: absolute;
  top: calc(50% - 15px);
  right: calc(50% - 17px);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--violet);
}

/* Create = a bare vinyl disc icon, same muted color as the other nav icons */
.navcreate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(244, 244, 248, 0.45);
}
.navcreate .disc {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.navcreate:active .disc { transform: scale(0.8) rotate(-10deg); }
.navcreate .disc svg { width: 30px; height: 30px; }
.navcreate .disc .badge {
  position: absolute;
  top: -2px; right: -4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--violet);
}

/* ---------- Overlay pages (create sheet, auth) ---------- */

.sheet {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 53; /* above .fullplayer (52) - Extend opens Create over the player */
  overflow-y: auto;
  padding-top: var(--safe-top);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.sheet.open { transform: translateY(0); }
.sheet.closing { transform: translateY(100%); }
