/* musio — one dark theme, flat surfaces, no gradients, no shadows. */

:root {
  --bg: #090f1b;
  /* Cards sit DARKER than the page, never lighter. */
  --card: #05090f;
  --card-hover: #070d16;
  --line: #16202f;
  --line-strong: #223044;
  --text: #eef3fb;
  --muted: #93a4bd;
  --faint: #64748b;
  --accent: #1668f0;
  --accent-high: #3b8bff;
  --danger: #fb7185;
  --radius: 8px;
  --radius-sm: 6px;
  --app: 520px;
  --body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --brand: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

* { box-sizing: border-box; }

/* Grid and flex beat the hidden attribute, so it is forced here. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3 { font-family: var(--brand); letter-spacing: -0.02em; }
img { max-width: 100%; }
button { font: inherit; }
::selection { background: rgba(22, 104, 240, 0.4); }

:focus-visible { outline: 2px solid var(--accent-high); outline-offset: 2px; }

/* ---------- the app shell ---------- */

/* Everything lives in one phone-wide column, centred on a big screen:
   it is a website that behaves like an app. */
.app {
  max-width: var(--app);
  margin: 0 auto;
  padding: 14px 18px calc(150px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 46px;
}

.logo { height: 26px; width: auto; display: block; object-fit: contain; }

.page-title { margin: 18px 0 0; font-size: 27px; font-weight: 700; text-align: center; }
.page-sub { margin: 5px 0 0; color: var(--muted); font-size: 14.5px; text-align: center; }

/* Every heading is centred, with whatever goes with it underneath. */
.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 26px 0 12px;
  text-align: center;
}
.section h2 { margin: 0; font-size: 17px; font-weight: 600; }
.count { color: var(--faint); font-size: 13px; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-high);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link svg { width: 15px; height: 15px; }

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.notice {
  margin: 14px 0 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(59, 139, 255, 0.4);
  background: var(--card);
  color: var(--accent-high);
  font-size: 14px;
}

.empty {
  display: block;
  padding: 26px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.loading { padding: 26px 0; color: var(--faint); text-align: center; font-size: 14px; }
.none { margin: 0; padding: 16px 0; color: var(--faint); font-size: 14px; }

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}
.button:hover { background: var(--accent-high); }
.button:disabled { opacity: 0.55; cursor: default; }
.button.wide { width: 100%; }
.button svg { width: 18px; height: 18px; }

.button.quiet {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
}
.button.quiet:hover { background: var(--card-hover); }
.button.danger { background: var(--card); border: 1px solid var(--line); color: var(--danger); }

/* Round icon buttons, always circles. */
.round {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.round:hover { background: var(--card-hover); color: var(--text); }
.round.on { color: var(--accent-high); }
.round svg { width: 20px; height: 20px; }

.round.big {
  width: 62px;
  height: 62px;
  background: var(--accent);
  color: #fff;
}
.round.big:hover { background: var(--accent-high); }
.round.big svg { width: 24px; height: 24px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.pill svg { width: 13px; height: 13px; }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- fields ---------- */

.field { display: block; margin-top: 14px; }
.label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="search"],
input[type="password"],
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font: inherit;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }

.with-icon {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
}
.with-icon:focus-within { border-color: var(--accent); }
.with-icon .glyph {
  display: grid;
  place-items: center;
  width: 46px;
  height: 48px;
  flex: none;
  color: var(--faint);
  border-right: 1px solid var(--line);
}
.with-icon input { border: 0; background: none; border-radius: 0; }
.with-icon input:focus { outline: none; }

.error { min-height: 18px; margin-top: 8px; color: var(--danger); font-size: 13px; }

.search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.search svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.search input { border: 0; background: none; padding: 12px 0; }
.search input:focus { outline: none; }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 6px; margin-top: 16px; }
.tabs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.tabs button svg { width: 16px; height: 16px; }
.tabs button[aria-selected="true"] { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ---------- track rows ---------- */

.tracks { display: flex; flex-direction: column; gap: 8px; }

.track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
}
.track:hover { background: var(--card-hover); }
.track.playing { border-color: rgba(59, 139, 255, 0.5); }
.track.dragging { opacity: 0.8; border-color: var(--accent); }

.art {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
}

/* The play glyph can sit on top of the cover, used only in the studio. */
button.art {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 0 0 999px rgba(4, 8, 14, 0.45);
}
button.art svg { width: 18px; height: 18px; }
button.art:hover { box-shadow: inset 0 0 0 999px rgba(4, 8, 14, 0.62); }

.track .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.track .name,
.player-queue .name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track .by { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .time { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; flex: none; }

.handle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  flex: none;
  color: var(--faint);
  cursor: grab;
  touch-action: none;
}
.handle svg { width: 18px; height: 18px; }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.bars i { width: 3px; border-radius: 2px; background: var(--accent-high); animation: bounce 0.9s ease-in-out infinite; }
.bars i:nth-child(1) { height: 7px; }
.bars i:nth-child(2) { height: 13px; animation-delay: 0.15s; }
.bars i:nth-child(3) { height: 9px; animation-delay: 0.3s; }
@keyframes bounce { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .bars i { animation: none; } }

/* ---------- pagination ---------- */

.pages { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; color: var(--muted); font-size: 13px; }
.pages button {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.pages button:disabled { opacity: 0.4; cursor: default; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--card) url('/wave-wide.jpg') center/cover no-repeat;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}
.hero p { margin: 0; font-family: var(--brand); font-size: 17px; font-weight: 700; max-width: 62%; line-height: 1.25; }
/* The play-all button sits on the right, under the line. */
.hero .button { align-self: flex-end; white-space: nowrap; padding: 12px 18px; }

/* ---------- bottom navigation ---------- */

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav .inner { max-width: var(--app); margin: 0 auto; display: flex; }
.nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 0 10px;
  color: var(--faint);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.nav a svg { width: 21px; height: 21px; }
.nav a[aria-current="page"] { color: var(--accent-high); }

/* ---------- mini player ---------- */

.mini {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(63px + env(safe-area-inset-bottom));
  z-index: 41;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: var(--app);
  margin: 0 auto;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.mini .art { width: 40px; height: 40px; }
.mini .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mini .name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .by { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .line { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--line-strong); }
.mini .line i { display: block; height: 100%; border-radius: 2px; background: var(--accent-high); width: 0; }

/* ---------- full player / detail screen ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform 0.26s ease;
}
.screen.open { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .screen { transition: none; } }

.screen .inner {
  position: relative;
  max-width: var(--app);
  margin: 0 auto;
  padding: 14px 18px calc(110px + env(safe-area-inset-bottom));
}

/* The artwork is a band at the top; the text always sits on the dark. */
.band {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--app), 100%);
  height: 208px;
  background: url('/wave-wide.jpg') center/cover no-repeat;
}
.band-space { height: 170px; }

.screen .head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 46px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 9, 15, 0.7);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.back svg { width: 18px; height: 18px; }

.eyebrow { text-align: center; margin: 0 0 6px; font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.now { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; text-align: center; }
.now .info { flex: 1; min-width: 0; }
.now h2 { margin: 0; font-size: 25px; font-weight: 700; line-height: 1.15; }
.now .by { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
/* The heart keeps its corner, so the title stays centred on the screen. */
.now .info { padding-left: 38px; }
.now .round.on { color: var(--accent-high); }

.timeline { display: flex; align-items: center; gap: 11px; }
.timeline .t { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; }
.bar { position: relative; flex: 1; height: 4px; border-radius: 3px; background: var(--line-strong); cursor: pointer; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent-high); width: 0; }
.bar b { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #fff; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 22px 0 18px; }

.chips { display: flex; gap: 10px; }
.chips .chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chips .chip.on { border-color: var(--accent); color: var(--accent-high); }
.chips .chip svg { width: 17px; height: 17px; }
.chips .ab { font-size: 11px; letter-spacing: 0.06em; color: var(--muted); }

/* ---------- sheets ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(2, 5, 10, 0.72);
}
.sheet {
  width: min(var(--app), 100%);
  margin: 10px;
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.sheet .who { padding: 12px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet .who .name { font-size: 15px; font-weight: 600; }
.sheet .who .by { color: var(--muted); font-size: 13px; }
.sheet button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}
.sheet button:hover { background: var(--card-hover); }
.sheet button svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sheet button.on svg { color: var(--accent-high); }
.sheet .lyrics-body { max-height: 54vh; overflow-y: auto; padding: 4px 12px 12px; color: var(--muted); font-size: 14.5px; white-space: pre-wrap; }

/* ---------- studio: upload ---------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 18px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line-strong);
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  cursor: pointer;
}
.drop.over { border-color: var(--accent); color: var(--text); }
.drop svg { width: 26px; height: 26px; color: var(--accent-high); }
.drop .what { color: var(--text); font-weight: 600; }
.drop .kinds { font-size: 12.5px; color: var(--faint); }
.drop input { display: none; }

.room-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
.room-foot .tag { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.room-foot .tag svg { width: 15px; height: 15px; }
.room-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.room-code svg { width: 15px; height: 15px; color: var(--muted); }

/* ---------- song detail in the studio ---------- */

.detail .inner { padding-top: 16px; }
.detail .cover-big {
  display: block;
  width: 180px;
  height: 180px;
  margin: 22px auto 16px;
  border-radius: var(--radius);
  background: url('/wave-square.jpg') center/cover no-repeat;
}
.detail h2 { margin: 0; text-align: center; font-size: 23px; font-weight: 700; }
.detail .by { margin: 5px 0 20px; text-align: center; color: var(--muted); font-size: 14.5px; }

/* ---------- door (entry and studio sign-in) ---------- */

.door-page { background: var(--bg); }

.door {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44% 56%;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'art top'
    'art form';
}

.door-art {
  grid-area: art;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px 48px;
  background: url('/wave-tall.jpg') center/cover no-repeat;
}
.door-art .logo { height: 27px; align-self: flex-start; }
.door-art h2 { margin: 0; font-size: 30px; font-weight: 700; line-height: 1.12; }
.door-art p { margin: 10px 0 0; color: rgba(238, 243, 251, 0.78); font-size: 14.5px; }

.door-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 56px; }
.door-top .logo { height: 24px; }
.help { color: var(--accent-high); font-size: 14px; font-weight: 600; text-decoration: none; }

.door-form {
  grid-area: form;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
  width: 100%;
  margin-inline: auto;
  padding: 0 56px 40px;
  text-align: center;
}
.door-form .pill { align-self: center; margin-bottom: 20px; }
.door-form h1 { margin: 0; font-size: 42px; font-weight: 700; line-height: 1.08; }
.door-form .page-sub { margin: 12px 0 28px; font-size: 15.5px; }
.door-form .label { text-align: left; }
.door-form input { text-align: left; }

.swap { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.swap button { background: none; border: 0; padding: 0; color: var(--accent-high); font-weight: 600; cursor: pointer; }
.swap button:hover { text-decoration: underline; }

.safe { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 16px 0 0; color: var(--muted); font-size: 13.5px; }
.safe svg { width: 15px; height: 15px; flex: none; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 26px 0 20px; }
.ask { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
.answer { margin: 0; color: var(--muted); font-size: 14.5px; }
.sign { margin: auto 0 0; padding-top: 26px; color: var(--faint); font-size: 12.5px; text-align: center; }

.only-wide { display: block; }
.only-narrow { display: none; }
.only-wide-text { display: inline; }
.only-narrow-text { display: none; }

@media (max-width: 860px) {
  .door {
    grid-template-columns: 1fr;
    /* The leftover height goes to the form, never to the artwork band:
       otherwise its row stretches and leaves a dead gap underneath. */
    grid-template-rows: auto auto 1fr;
    grid-template-areas: 'top' 'art' 'form';
  }
  .door-art { height: 170px; padding: 0; background-image: url('/wave-wide.jpg'); }
  .door-art .lead, .door-art .logo { display: none; }
  .door-top { padding: 14px 20px; }
  .door-form {
    padding: 22px 20px 34px;
    justify-content: flex-start;
    max-width: none;
    margin-inline: 0;
  }
  .door-form h1 { font-size: 30px; }
  .only-wide { display: none; }
  .only-narrow { display: block; }
  .only-wide-text { display: none; }
  .only-narrow-text { display: inline; }
}
