﻿/* Inter variable (wght 100-900, latin subset, 48KB) - the app's display face.
   Everything inherits it; headings keep their per-rule tracking. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --surface: #0b0b0d;
  --elevated: #16161a;
  --border: rgba(255, 255, 255, 0.09);
  --text: #fff;
  --text-2: #8e8e93;
  --muted: #5a5a5f;
  /* Brand accents survive ONLY on splash/auth logo surfaces - in-app is mono */
  --violet: #8b5cf6;
  --pink: #ec4899;
  --heart: #fff;
  --danger: #f87171;
  --success: #34d399;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --nav-h: 68px;
  --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: "Inter", "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: rgba(255, 255, 255, 0.45); }
input::placeholder, textarea::placeholder { color: var(--muted); }

::-webkit-scrollbar { width: 0; height: 0; }
/* Android WebView ignores ::-webkit-scrollbar for its PLATFORM overlay thumb -
   the fading bar users see flash at the right edge on scroll/overscroll
   (desktop hides it via the rule above, phones don't). scrollbar-width: none
   hides the overlay thumb on Chromium 121+; harmless where unsupported. */
* { scrollbar-width: none; }

/* ---------- 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;
  overscroll-behavior-y: none; /* clamp hard at edges: no pull-to-refresh, no scroll chaining */
  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;
  overscroll-behavior-y: none;
  padding-top: var(--safe-top);
  z-index: 5;
}
#page.open { visibility: visible; transform: translateX(0); opacity: 1; }

/* While the mini player floats above the nav, lists keep clear of it: the
   last rows / settings rows scroll out from under the card instead of hiding
   behind it (mini top edge sits ~66px + safe-area above the pane bottom). */
body.mini-open .pane,
body.mini-open #page {
  padding-bottom: calc(76px + var(--safe-bottom));
}

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

.navslot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  position: relative;
}
.navslot .nlabel {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}
.navslot svg { width: 24px; height: 24px; transition: transform 0.16s cubic-bezier(0.34, 1.1, 0.64, 1); }
.navslot:active svg { transform: scale(0.94); }
.navslot.selected { color: var(--text); }
.navslot.selected svg { animation: navpop 0.26s cubic-bezier(0.34, 1.1, 0.64, 1); }
@keyframes navpop {
  0% { transform: scale(0.92); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.navslot .badge {
  position: absolute;
  top: calc(50% - 19px);
  right: calc(50% - 19px);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: badgein 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgein {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
/* While generating, the dot emits a soft expanding halo (transform/opacity
   only, one tiny element). Reduced motion: the solid dot stands alone. */
.navslot .badge::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  animation: badgehalo 1.6s ease-out infinite;
}
@keyframes badgehalo {
  0% { transform: scale(1); opacity: 0.65; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .navslot .badge::after { animation: none; opacity: 0; }
}

/* Create = a bare vinyl disc icon, same monochrome treatment as the other slots */
.navcreate {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
}
.navcreate .nlabel {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}
.navcreate .disc {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.34, 1.2, 0.64, 1);
}
.navcreate:active .disc { transform: scale(0.96) rotate(-2deg); }
.navcreate .disc svg { width: 27px; height: 27px; }

/* ---------- 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);
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
}
.sheet > * { flex-shrink: 0; }
.sheet.open { transform: translateY(0); }
.sheet.closing { transform: translateY(100%); }

/* Pricing modal (Oct 2026 REBUILD): the old .paysheet shell (slide transition
   + bindSwipeDown drag in every variant) was rejected five times - "scaley",
   "snapping", "glitches out" - so this shell has ZERO transforms and ZERO
   gesture handling by construction: it fades in/out (opacity transition only)
   and closes via its back button / Android-browser back. Scrolling is native
   and clamped. Do not add drag/slide/press-scale interactions here. */
.pmodal {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 56;
  overflow-y: auto;
  padding-top: var(--safe-top);
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.pmodal > * { flex-shrink: 0; }
.pmodal.open { opacity: 1; }
.pmodal.closing { opacity: 0; }
