/* ==========================================================================
   لالایی — design system
   Pastel cards · ink line art · black pills · Yekan Bakh
   ========================================================================== */

/* ---------- fonts ---------- */

@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "YekanBakh"; src: url("../assets/fonts/YekanBakhFaNum-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
/* Latin editions (only downloaded when a page uses it) */
@font-face { font-family: "Nunito"; src: url("../assets/fonts/Nunito-Variable.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

/* ---------- tokens ---------- */

:root {
  --font: "YekanBakh", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --bg: #f3f2f7;
  --surface: #ffffff;
  --surface-2: #f7f6fb;
  --ink: #17161d;
  --ink-2: #3c3b47;
  --muted: #8e8c9b;
  --line: rgba(23, 22, 29, 0.08);
  --paper: #ffffff;
  --on-ink: #ffffff;
  --mint: #9fe6cf;
  --blush: #f4a7b0;
  --danger: #ef5b5b;
  --shadow-sm: 0 2px 8px rgba(23, 22, 29, 0.05);
  --shadow: 0 12px 32px rgba(23, 22, 29, 0.08);
  --shadow-lg: 0 24px 60px rgba(23, 22, 29, 0.16);

  --lavender: #e6e2f7; --lavender-tone: #cfc7f1;
  --mint-c: #d3f1e6;   --mint-tone: #a9e4cf;
  --pink: #fbe0dc;     --pink-tone: #f6bdb5;
  --peach: #fde9d3;    --peach-tone: #f8cfa0;
  --sky: #dceafb;      --sky-tone: #b5d2f5;
  --butter: #fbf2cf;   --butter-tone: #f3dd8c;

  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  --safe-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
  --nav-h: 76px;
  --gutter: 20px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e0e13;
  --surface: #18181f;
  --surface-2: #202029;
  --ink: #f1f0f6;
  --ink-2: #c9c7d6;
  --muted: #8b8a99;
  --line: rgba(255, 255, 255, 0.08);
  --paper: #25252f;
  --on-ink: #17161d;
  --mint: #7fd9bd;
  --blush: #c97a86;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  --lavender: #26233a; --lavender-tone: #3c3660;
  --mint-c: #1b302b;   --mint-tone: #2b4c43;
  --pink: #33232a;     --pink-tone: #573a42;
  --peach: #33291f;    --peach-tone: #59442f;
  --sky: #1c2738;      --sky-tone: #2e4260;
  --butter: #312c1c;   --butter-tone: #554a2a;
  color-scheme: dark;
}

.tone-lavender { --card: var(--lavender); --tone: var(--lavender-tone); }
.tone-mint     { --card: var(--mint-c);   --tone: var(--mint-tone); }
.tone-pink     { --card: var(--pink);     --tone: var(--pink-tone); }
.tone-peach    { --card: var(--peach);    --tone: var(--peach-tone); }
.tone-sky      { --card: var(--sky);      --tone: var(--sky-tone); }
.tone-butter   { --card: var(--butter);   --tone: var(--butter-tone); }

/* ---------- base ---------- */

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

body { overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 2.5px solid var(--ink); outline-offset: 3px; border-radius: 12px; }

.ltr { direction: ltr; }
.press { transition: transform 0.25s var(--spring); }
.press:active { transform: scale(0.95); }

/* ---------- type scale ---------- */

.t-display { font-weight: 900; font-size: 32px; line-height: 1.15; letter-spacing: -0.4px; margin: 0; }
.t-h1 { font-weight: 800; font-size: 24px; line-height: 1.25; margin: 0; }
.t-h2 { font-weight: 800; font-size: 19px; line-height: 1.3; margin: 0; }
.t-title { font-weight: 700; font-size: 16px; line-height: 1.35; margin: 0; }
.t-label { font-weight: 600; font-size: 14px; }
.t-meta { font-weight: 300; font-size: 13px; color: var(--muted); }
.t-body { font-weight: 400; font-size: 14px; color: var(--ink-2); line-height: 1.75; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.25s var(--spring), background-color 0.3s, opacity 0.3s;
}
.btn:active { transform: scale(0.96); }
.btn svg { width: 20px; height: 20px; }
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-soft { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-ghost { background: var(--line); color: var(--ink); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 13px; border-radius: 19px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.icon-btn {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--spring), background-color 0.3s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.flat { box-shadow: none; background: transparent; }
.icon-btn.on { background: var(--ink); color: var(--on-ink); }

.chip-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  font-weight: 600;
  font-size: 13px;
}
.chip-time svg { width: 16px; height: 16px; }

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

#app { position: relative; height: 100%; z-index: 1; }

.screens { position: absolute; inset: 0; }

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: calc(var(--safe-top) + 18px) var(--gutter) calc(var(--safe-bottom) + var(--nav-h) + 110px);
  scrollbar-width: none;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}
.screen::-webkit-scrollbar { display: none; }
.screen.active { opacity: 1; transform: none; pointer-events: auto; }

@media (min-width: 720px) {
  .screen { padding-inline: calc(50% - 320px); }
}

.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.screen-head .grow { flex: 1; min-width: 0; }

.boot { height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot .art { width: 120px; height: 120px; border-radius: 36px; }

/* ---------- home ---------- */

.hello { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.hello .avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; overflow: hidden; }
.hello .avatar .art { width: 100%; height: 100%; border-radius: 50%; }
.hello .grow { flex: 1; min-width: 0; }
.hello h1 { font-weight: 800; font-size: 21px; line-height: 1.25; margin: 0; }
.hello p { margin: 0; }

/* hero carousel */
.hero-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1);
  padding: 0 var(--gutter) 6px;
  scrollbar-width: none;
}
.hero-rail::-webkit-scrollbar { display: none; }

.hero {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  min-height: 340px;
  border-radius: var(--r-xl);
  background: var(--card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s var(--spring);
}
.hero:active { transform: scale(0.985); }
.hero .top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 2; }
.hero .kicker { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.hero .dedication { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 10px; border-radius: 14px; background: var(--ink); color: var(--on-ink); font-weight: 700; font-size: 13px; box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 25%, transparent); }
.hero .dedication svg { width: 15px; height: 15px; color: #ff8fab; }
.hero .art-wrap { flex: 1; display: grid; place-items: center; margin: -6px 0 -10px; }
.hero .art { width: min(220px, 62vw); height: min(220px, 62vw); background: transparent; }
.hero .bottom { display: flex; align-items: flex-end; gap: 12px; position: relative; z-index: 2; }
.hero .bottom .grow { flex: 1; min-width: 0; }
.hero h2 { font-weight: 800; font-size: 22px; line-height: 1.3; margin: 0; }

.dots { display: flex; justify-content: center; gap: 6px; margin: 12px 0 4px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); transition: width 0.35s var(--ease), background 0.35s; }
.dots i.on { width: 20px; background: var(--ink); }

/* section heading */
.section { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 28px 0 14px; }
.section .t-h2 { flex: 1; }
.link { font-weight: 600; font-size: 13px; color: var(--muted); }

/* tool cards */
.tools {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 calc(var(--gutter) * -1);
  padding: 2px var(--gutter) 6px;
  scrollbar-width: none;
}
.tools::-webkit-scrollbar { display: none; }
.tool {
  flex: 0 0 132px;
  height: 150px;
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: start;
  position: relative;
  transition: transform 0.25s var(--spring);
}
.tool:active { transform: scale(0.96); }
.tool .ti { width: 46px; height: 46px; border-radius: 16px; background: var(--paper); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.tool .ti svg { width: 24px; height: 24px; }
.tool b { font-weight: 700; font-size: 15px; display: block; }
.tool small { font-weight: 300; font-size: 12px; color: var(--ink-2); }
.tool .live-dot { position: absolute; top: 16px; inset-inline-end: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 50% { transform: scale(0.6); opacity: 0.5; } }

/* black pill tabs */
.pilltabs {
  position: sticky;
  top: calc(var(--safe-top) * -1 - 18px);
  z-index: 5;
  display: flex;
  gap: 4px;
  padding: 6px;
  margin: 30px 0 20px;
  border-radius: 30px;
  background: var(--ink);
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}
.pilltabs::-webkit-scrollbar { display: none; }
.pilltabs button {
  position: relative;
  flex: 1 0 auto;
  height: 46px;
  padding: 0 14px 6px;
  border-radius: 24px;
  color: color-mix(in srgb, var(--on-ink) 50%, transparent);
  font-weight: 600;
  font-size: 14px;
  transition: color 0.3s;
}
.pilltabs button.on { color: var(--on-ink); }
.pilltabs button::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 9px;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: var(--on-ink);
  transform: scale(0);
  transition: transform 0.35s var(--spring);
}
.pilltabs button.on::after { transform: scale(1); }
.pilltabs .count { font-weight: 300; font-size: 11px; margin-inline-start: 3px; opacity: 0.8; }

.list-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }

/* song list */
.songs { display: grid; gap: 6px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 22px;
  text-align: start;
  width: calc(100% + 16px);
  transition: background-color 0.25s, transform 0.25s var(--spring);
  animation: rise 0.55s var(--ease) both;
  content-visibility: auto;
  contain-intrinsic-size: auto 80px;
}
.row:active { transform: scale(0.98); background: var(--line); }
.row.current { background: var(--surface); box-shadow: var(--shadow-sm); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.row .thumb { position: relative; width: 64px; height: 64px; flex: none; }
.row .thumb .art { width: 100%; height: 100%; border-radius: 18px; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-weight: 700; font-size: 16px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { display: flex; align-items: center; gap: 6px; font-weight: 300; font-size: 13px; color: var(--muted); }
.row .t small svg { width: 14px; height: 14px; }
.row .badge-new { font-weight: 700; font-size: 10px; padding: 1px 7px; border-radius: 8px; background: var(--ink); color: var(--on-ink); }
.row .more { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.row .more svg { width: 20px; height: 20px; }
.row .fav-on { color: var(--danger); }

.eqbars {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 55%, transparent);
}
.row.current .eqbars { display: flex; }
.eqbars i { width: 4px; height: 8px; border-radius: 2px; background: #fff; animation: eq 1.2s ease-in-out infinite; }
.eqbars i:nth-child(2) { animation-delay: -0.4s; }
.eqbars i:nth-child(3) { animation-delay: -0.8s; }
.paused .eqbars i { animation-play-state: paused; }
@keyframes eq { 50% { height: 22px; } }

.empty { text-align: center; padding: 26px 16px 10px; }
.empty .art { width: 150px; height: 150px; margin: 0 auto 16px; border-radius: 40px; }
.empty p { margin: 6px 0 18px; }

/* ---------- bottom nav ---------- */

.nav {
  position: fixed;
  z-index: 25;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 10px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
@media (min-width: 720px) { .nav { width: 560px; margin: 0 auto; } }

.nav button {
  flex: 1;
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  transition: color 0.3s;
}
.nav button svg { width: 24px; height: 24px; transition: transform 0.35s var(--spring); }
.nav button.on { color: var(--ink); }
.nav button.on svg { transform: translateY(-2px); }
.nav .center { position: relative; }
.nav .center .bubble {
  width: 58px;
  height: 58px;
  margin-top: -30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: #17161d;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--mint) 60%, transparent), 0 0 0 6px var(--bg);
  transition: transform 0.35s var(--spring);
}
.nav .center:active .bubble { transform: scale(0.9) rotate(-12deg); }
.nav .center .bubble svg { width: 26px; height: 26px; }

/* ---------- mini player (black capsule) ---------- */

.mini {
  position: fixed;
  z-index: 24;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + var(--nav-h) + 18px);
  height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 10px;
  border-radius: 26px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow-lg);
  transform: translateY(160%);
  opacity: 0;
  transition: transform 0.55s var(--spring), opacity 0.4s;
  overflow: hidden;
  touch-action: none;
}
@media (min-width: 720px) { .mini { width: 560px; margin: 0 auto; } }
.mini.show { transform: none; opacity: 1; }
.mini .thumb { width: 48px; height: 48px; flex: none; }
.mini .thumb .art { width: 100%; height: 100%; border-radius: 15px; }
.mini .t { flex: 1; min-width: 0; text-align: start; }
.mini b { display: block; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { display: flex; align-items: center; gap: 5px; font-weight: 300; font-size: 12px; opacity: 0.65; }
.mini small svg { width: 13px; height: 13px; }
.mini .play { width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--on-ink); color: var(--ink); transition: transform 0.25s var(--spring); }
.mini .play:active { transform: scale(0.88); }
.mini .play svg { width: 20px; height: 20px; }
.mini .bar { position: absolute; left: 22px; right: 22px; bottom: 7px; height: 2.5px; border-radius: 2px; background: color-mix(in srgb, var(--on-ink) 18%, transparent); direction: ltr; }
.mini .bar i { display: block; height: 100%; width: 0; border-radius: 2px; background: var(--on-ink); }

/* ---------- player sheet ---------- */

.sheet-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(10, 10, 15, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.4s; }
.sheet-scrim.show { opacity: 1; pointer-events: auto; }

.player {
  position: fixed;
  z-index: 40;
  inset: 0;
  top: calc(var(--safe-top) + 10px);
  display: flex;
  flex-direction: column;
  padding: 10px 22px calc(var(--safe-bottom) + 16px);
  border-radius: 34px 34px 0 0;
  background: var(--card);
  box-shadow: var(--shadow-lg);
  transform: translateY(105%);
  transition: transform 0.6s var(--ease), background-color 0.6s ease;
  overflow: hidden;
  will-change: transform;
}
.player.open { transform: none; }
.player.parked, .screen.parked { visibility: hidden; content-visibility: hidden; }
.player.dragging { transition: none; }
@media (min-width: 720px) { .player { width: 560px; margin: 0 auto; } }

.player .grab { width: 44px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 25%, transparent); margin: 0 auto 10px; flex: none; }
.player .head { display: flex; align-items: center; gap: 10px; flex: none; }
.player .head .mid { flex: 1; text-align: center; }
.player .head .mid b { display: block; font-weight: 700; font-size: 14px; }
.player .head .mid small { font-weight: 300; font-size: 12px; color: var(--ink-2); }
.player .head .icon-btn { background: color-mix(in srgb, var(--paper) 75%, transparent); box-shadow: none; }

.stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; padding: 10px 0; }

.stage-card {
  position: relative;
  width: min(100%, 44vh, 360px);
  aspect-ratio: 1;
  border-radius: 40px;
  background: color-mix(in srgb, var(--paper) 55%, var(--card));
  display: grid;
  place-items: center;
  box-shadow: 0 20px 50px color-mix(in srgb, var(--tone) 60%, transparent);
  isolation: isolate;
}
.stage-card::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 48px;
  background: color-mix(in srgb, var(--tone) 55%, transparent);
  transform: scale(calc(0.96 + var(--e, 0) * 0.08));
  transition: transform 0.3s ease-out;
  will-change: transform;
}
.stage-card .art { width: 86%; height: 86%; background: transparent; }

.view-switch { position: absolute; top: 14px; inset-inline-start: 14px; display: flex; padding: 3px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 80%, transparent); z-index: 2; }
.view-switch button { height: 30px; padding: 0 12px; border-radius: 13px; font-weight: 600; font-size: 12px; color: var(--muted); }
.view-switch button.on { background: var(--ink); color: var(--on-ink); }

/* big karaoke lyrics */
.biglyrics {
  position: absolute;
  inset: 0;
  border-radius: 40px;
  padding: 56px 24px 24px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, transparent 0, transparent 15%, #000 32%, #000 78%, transparent 97%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 15%, #000 32%, #000 78%, transparent 97%);
}
.biglyrics .rail { transition: transform 0.7s var(--ease); }
.biglyrics .line { font-weight: 900; font-size: 25px; line-height: 1.4; padding: 6px 0; color: color-mix(in srgb, var(--ink) 22%, transparent); transition: color 0.5s, transform 0.5s var(--ease); transform-origin: right center; }
.biglyrics .line.now { color: var(--ink); transform: scale(1.04); }
.biglyrics .line .w { transition: color 0.3s; }
.biglyrics .line.now .w:not(.sung) { color: color-mix(in srgb, var(--ink) 45%, transparent); }

.player .info { display: flex; align-items: center; gap: 12px; margin: 6px 0 10px; flex: none; }
.player .info .grow { flex: 1; min-width: 0; }
.player .info h2 { font-weight: 900; font-size: 26px; line-height: 1.25; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .info .fav { background: color-mix(in srgb, var(--paper) 75%, transparent); box-shadow: none; }
.player .info .fav.on { color: var(--danger); }

/* tick ruler timeline */
.ruler { direction: ltr; flex: none; margin: 4px 0 2px; }
.ruler .track { position: relative; height: 38px; touch-action: none; cursor: pointer; }
.ruler .ticks { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; }
.ruler .ticks i { width: 2px; height: 10px; border-radius: 1px; background: color-mix(in srgb, var(--ink) 22%, transparent); transition: background-color 0.2s, height 0.2s; }
.ruler .ticks i.major { height: 18px; }
.ruler .ticks i.past { background: var(--ink); }
.ruler .head-mark { position: absolute; top: 2px; bottom: 2px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); left: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--card) 80%, transparent); }
.ruler .times { display: flex; justify-content: space-between; font-weight: 600; font-size: 12px; color: var(--ink-2); }

.transport { direction: ltr; display: flex; align-items: center; justify-content: space-between; margin: 10px 0 16px; flex: none; }
.transport button { display: grid; place-items: center; border-radius: 50%; transition: transform 0.25s var(--spring); }
.transport button:active { transform: scale(0.9); }
.transport .skip { width: 46px; height: 46px; color: var(--ink); }
.transport .skip svg { width: 26px; height: 26px; }
.transport .jump { width: 58px; height: 58px; background: color-mix(in srgb, var(--paper) 70%, var(--tone)); }
.transport .jump svg { width: 28px; height: 28px; stroke-width: 1.8; }
.transport .big { width: 92px; height: 92px; background: var(--ink); color: var(--on-ink); box-shadow: 0 16px 34px color-mix(in srgb, var(--ink) 30%, transparent); }
.transport .big svg { width: 34px; height: 34px; }
.transport .big.loading svg { animation: spin 1s linear infinite; }

.pdock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; flex: none; }
.pdock button {
  height: 54px;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-2);
  transition: transform 0.25s var(--spring), background-color 0.3s;
}
.pdock button:active { transform: scale(0.94); }
.pdock button svg { width: 20px; height: 20px; }
.pdock button.on { background: var(--ink); color: var(--on-ink); }

@media (max-height: 700px) {
  .player .info h2 { font-size: 22px; }
  .transport .big { width: 78px; height: 78px; }
  .pdock button { height: 46px; }
}

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

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 15, 0.42); opacity: 0; transition: opacity 0.35s; }
.scrim.show { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 51;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px 22px calc(var(--safe-bottom) + 22px);
  border-radius: 32px 32px 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateY(105%);
  transition: transform 0.5s var(--ease);
}
@media (min-width: 720px) { .sheet { width: 560px; margin: 0 auto; } }
.sheet.show { transform: none; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 16px; }
.sheet .sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.sheet .sheet-head .grow { flex: 1; }
.sheet .sub { margin: 4px 0 18px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 20px; }
.sheet .actions .btn { flex: 1; }

.menu { display: grid; gap: 4px; }
.menu button { display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 12px; border-radius: 18px; text-align: start; font-weight: 600; transition: background-color 0.2s; }
.menu button:active { background: var(--line); }
.menu button .mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); }
.menu button .mi svg { width: 20px; height: 20px; }
.menu button .grow { flex: 1; }

.song-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.song-head .art { width: 64px; height: 64px; border-radius: 18px; flex: none; }

/* timer grid */
.timer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.timer-grid button { height: 76px; border-radius: 22px; background: var(--surface-2); display: grid; place-content: center; transition: transform 0.25s var(--spring), background-color 0.3s; }
.timer-grid button:active { transform: scale(0.95); }
.timer-grid b { font-weight: 900; font-size: 24px; line-height: 1; }
.timer-grid small { font-weight: 300; font-size: 12px; color: var(--muted); }
.timer-grid button.on { background: var(--ink); color: var(--on-ink); }
.timer-grid button.on small { color: inherit; opacity: 0.7; }

.timer-live { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 24px; background: var(--lavender); margin-bottom: 14px; }
.timer-live .ring { width: 60px; height: 60px; flex: none; }
.timer-live .grow { flex: 1; }
.timer-live b { font-weight: 900; font-size: 26px; display: block; line-height: 1.2; }

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

.card { border-radius: var(--r-lg); background: var(--surface); padding: 6px 16px; box-shadow: var(--shadow-sm); margin-bottom: 14px; }
.card.pad { padding: 18px; }
.card-title { font-weight: 800; font-size: 16px; margin: 0 0 4px; }

.opt { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt .oi { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--card, var(--surface-2)); flex: none; }
.opt .oi svg { width: 22px; height: 22px; }
.opt .grow { flex: 1; min-width: 0; }
.opt b { display: block; font-weight: 700; font-size: 15px; }
.opt small { display: block; font-weight: 300; font-size: 12px; color: var(--muted); line-height: 1.55; }
.opt.clickable { cursor: pointer; }
.opt .chev { color: var(--muted); }
.opt .chev svg { width: 18px; height: 18px; transform: scaleX(-1); }

.switch { width: 52px; height: 32px; border-radius: 16px; background: var(--line); position: relative; flex: none; transition: background-color 0.3s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); transition: transform 0.35s var(--spring); }
:root[data-theme="dark"] .switch::after { background: #fff; }
:root[data-theme="dark"] .switch.on::after { background: var(--on-ink); }
.switch.on { background: var(--ink); }
.switch.on::after { transform: translateX(-20px); background: var(--on-ink); }

.segmented { display: flex; padding: 4px; border-radius: 18px; background: var(--surface-2); gap: 4px; }
.segmented button { flex: 1; height: 40px; border-radius: 14px; font-weight: 600; font-size: 13px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: background-color 0.3s, color 0.3s; }
.segmented button svg { width: 17px; height: 17px; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
:root[data-theme="dark"] .segmented button.on { background: var(--ink); color: var(--on-ink); }

.range { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; direction: ltr; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--ink) var(--p, 50%), var(--line) var(--p, 50%)); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--ink); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 40px; padding: 0 16px; border-radius: 20px; background: var(--surface-2); font-weight: 600; font-size: 13px; transition: background-color 0.3s, color 0.3s; }
.chip.on { background: var(--ink); color: var(--on-ink); }

/* ---------- sounds screen ---------- */

/* playing-now panel (sticks to the top while scrolling) */
.active-panel { position: sticky; top: 0; z-index: 3; margin: 0 -4px 6px; padding: 12px 14px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 88%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm), 0 0 0 2px var(--ink); }
.sheet .active-panel { top: -10px; }
.ap-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ap-head b { font-weight: 800; font-size: 14px; }
.linkish { font-weight: 700; font-size: 13px; color: var(--muted); padding: 4px 2px; }
.active-rows { display: flex; flex-direction: column; gap: 6px; max-height: 196px; overflow-y: auto; }
.ap-row { display: grid; grid-template-columns: 36px minmax(0, 0.9fr) minmax(0, 1.1fr) 32px; align-items: center; gap: 10px; }
.ap-row .sicon { width: 36px; height: 36px; border-radius: 12px; background: var(--card); display: grid; place-items: center; }
.ap-row .sicon svg { width: 20px; height: 20px; }
.ap-t { min-width: 0; }
.ap-t b { display: block; font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-t small { display: block; font-size: 11px; color: var(--muted); }
.ap-x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); }
.ap-x svg { width: 16px; height: 16px; }

/* colored-noise swatches */
.swatch { border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); }
.swatch.swatch-white { background: radial-gradient(circle at 35% 30%, #fff, #e9e8f1 70%); }
.swatch.swatch-pink { background: radial-gradient(circle at 35% 30%, #ffd6e2, #f39ab4 75%); }
.swatch.swatch-brown { background: radial-gradient(circle at 35% 30%, #d9b08c, #8a5a3b 75%); }
.swatch.swatch-blue { background: radial-gradient(circle at 35% 30%, #cfe6ff, #6aa5e8 75%); }
.ap-row .sicon.swatch, .fx-ico.swatch { width: 26px; height: 26px; margin: 5px; }

.group-sub { margin: -6px 0 12px; }
.noise-cards { display: flex; flex-direction: column; gap: 12px; }
.noise-card { position: relative; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: box-shadow 0.3s, transform 0.25s var(--spring); }
.noise-card:active { transform: scale(0.985); }
.noise-card.on { box-shadow: 0 0 0 2.5px var(--ink), var(--shadow-sm); }
.nc-top { display: flex; align-items: center; gap: 12px; }
.nc-swatch { width: 46px; height: 46px; flex: none; }
.noise-card.on .nc-swatch { animation: breathe 4s ease-in-out infinite; }
.nc-top b { display: block; font-weight: 800; font-size: 16px; }
.nc-top small { display: block; font-size: 12px; color: var(--muted); }
.noise-card p { margin: 10px 0 0; font-size: 13px; line-height: 1.75; color: var(--ink-2); }
.noise-card .toggle { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); box-shadow: var(--shadow-sm); flex: none; }
.noise-card .toggle svg { width: 18px; height: 18px; }
.noise-card.on .toggle { background: var(--ink); color: var(--on-ink); }
.noise-card.loading .toggle svg { animation: spin 1s linear infinite; }
.tip { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md, 18px); background: color-mix(in srgb, var(--butter) 70%, var(--surface)); font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }
.tip svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

/* sound tiles */
.stiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: 20px; background: var(--card); text-align: center; transition: transform 0.25s var(--spring), box-shadow 0.3s; }
.stile:active { transform: scale(0.95); }
.st-ico { width: 46px; height: 46px; border-radius: 15px; background: var(--paper); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.st-ico svg { width: 24px; height: 24px; }
.st-name { font-weight: 700; font-size: 12px; line-height: 1.35; min-height: 2.7em; display: flex; align-items: center; }
.stile.on { box-shadow: 0 0 0 2.5px var(--ink); }
.stile.on .st-ico { background: var(--ink); color: var(--on-ink); animation: breathe 4s ease-in-out infinite; }
.stile .eq { position: absolute; top: 9px; inset-inline-end: 10px; display: none; gap: 2px; align-items: flex-end; height: 14px; }
.stile.on .eq { display: flex; }
.stile .eq i { width: 2.5px; height: 5px; border-radius: 2px; background: var(--ink); animation: eq-s 1.4s ease-in-out infinite; }
@keyframes eq-s { 50% { height: 13px; } }
.stile .eq i:nth-child(2) { animation-delay: -0.4s; }
.stile .eq i:nth-child(3) { animation-delay: -0.8s; }
.stile.loading .st-ico svg { animation: pulse-dot 1s ease-in-out infinite; }
.credit { text-align: center; margin: 22px 0 4px; font-size: 11px; }

/* active sounds under the song title in the player */
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fx-chip { display: inline-flex; align-items: center; border-radius: 16px; background: color-mix(in srgb, var(--paper) 75%, transparent); box-shadow: var(--shadow-sm); }
.fx-open { display: inline-flex; align-items: center; gap: 5px; padding: 4px 4px 4px 0; padding-inline: 10px 2px; font-weight: 700; font-size: 12px; }
.fx-ico { display: grid; place-items: center; }
.fx-ico svg { width: 15px; height: 15px; }
.fx-ico.swatch { width: 13px; height: 13px; margin: 0; }
.fx-x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.fx-x svg { width: 13px; height: 13px; }

@keyframes breathe { 50% { transform: scale(1.06); } }

/* ---------- guard screen ---------- */

.guard-card {
  position: relative;
  border-radius: var(--r-xl);
  background: var(--card);
  padding: 18px 18px 22px;
  text-align: center;
  overflow: hidden;
  transition: background-color 0.6s ease;
}
.guard-card .chip-time { position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; }
.guard-card .guardian { width: min(270px, 74vw); height: min(270px, 74vw); margin: 6px auto 4px; }
.guard-card h2 { font-weight: 900; font-size: 24px; margin: 0; }
.guard-card p { margin: 6px auto 18px; max-width: 320px; }
.room-meter { max-width: 300px; margin: 4px auto 14px; text-align: start; }
.rm-head { display: flex; justify-content: space-between; font-weight: 600; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.room-meter.loud .rm-head span:last-child { color: var(--danger); }
.rm-track { position: relative; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--paper) 70%, transparent); direction: ltr; overflow: visible; }
.rm-track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px; background: var(--ink); transition: width 0.12s linear, background-color 0.3s; }
.room-meter.loud .rm-track .fill { background: var(--danger); }
.rm-track .mark { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--danger); left: 50%; }
.guard-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.guard-meter { display: flex; gap: 4px; justify-content: center; align-items: center; height: 26px; margin: -6px 0 14px; direction: ltr; }
.guard-meter i { width: 5px; border-radius: 3px; background: var(--ink); height: calc(5px + var(--h, 0) * 20px); opacity: calc(0.25 + var(--h, 0) * 0.75); transition: height 0.12s, opacity 0.12s; }

.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 0; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); flex: none; box-shadow: 0 0 0 4px var(--lavender); }
.timeline li.wake::before { background: var(--danger); box-shadow: 0 0 0 4px var(--pink); }
.timeline time { font-weight: 800; font-size: 14px; min-width: 44px; }

/* the owl */
.guardian svg { width: 100%; height: 100%; overflow: visible; }
.guardian .g-eyes-open, .guardian .g-muffs, .guardian .g-bang, .guardian .g-nomic-bubble, .guardian .g-rings, .guardian .g-brows { opacity: 0; transition: opacity 0.4s; }
.guardian .g-eyes-closed, .guardian .g-zz { transition: opacity 0.4s; }
.guardian .g-body { transform-box: fill-box; transform-origin: 50% 100%; animation: breathe-y 8s ease-in-out infinite; }
@keyframes breathe-y { 50% { transform: scale(1.02, 1.035); } }
.guardian .g-zz text { font-family: var(--font); font-weight: 900; font-size: 20px; fill: var(--ink); opacity: 0; animation: zz 4.5s ease-out infinite; }
.guardian .g-zz text:nth-child(2) { animation-delay: 1.5s; font-size: 16px; }
.guardian .g-zz text:nth-child(3) { animation-delay: 3s; font-size: 13px; }
@keyframes zz { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 0.9; } 100% { opacity: 0; transform: translate(12px, -28px); } }
.guardian .g-lantern-glow { fill: var(--tone); opacity: 0; transition: opacity 0.6s; }

/* listening */
.guardian.g-listen .g-eyes-open, .guardian.g-listen .g-rings { opacity: 1; }
.guardian.g-listen .g-eyes-closed, .guardian.g-listen .g-zz { opacity: 0; }
.guardian.g-listen .g-pupils { animation: scan 6s ease-in-out infinite; }
@keyframes scan { 0%, 100% { transform: translateX(0); } 20%, 35% { transform: translateX(-5px); } 60%, 75% { transform: translateX(5px); } }
.guardian.g-listen .g-lids .lid { fill: var(--paper); animation: blink-lid 5s infinite; }
@keyframes blink-lid { 0%, 94%, 100% { height: 0; } 97% { height: 40px; } }
.guardian .g-tuft { transform-box: fill-box; transform-origin: 50% 100%; }
.guardian.g-listen .g-tuft-l { animation: twitch-l 3s ease-in-out infinite; }
.guardian.g-listen .g-tuft-r { animation: twitch-r 3s ease-in-out infinite 0.4s; }
@keyframes twitch-l { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-10deg); } 86% { transform: rotate(4deg); } }
@keyframes twitch-r { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(10deg); } 86% { transform: rotate(-4deg); } }
.guardian .ring { transform-box: fill-box; transform-origin: center; }
.guardian.g-listen .ring { animation: ring 2.4s ease-out infinite; }
.guardian.g-listen .ring.r2 { animation-delay: 0.4s; }
.guardian.g-listen .ring.r3 { animation-delay: 0.8s; }
@keyframes ring { 0% { opacity: 0; transform: scale(0.85); } 30% { opacity: calc(0.35 + var(--lvl, 0) * 0.65); } 100% { opacity: 0; transform: scale(1.12); } }
.guardian.g-listen .g-lantern-glow { opacity: 0.85; animation: glow 3s ease-in-out infinite; }
.guardian.g-listen .g-lantern { animation: swing 4s ease-in-out infinite; }
@keyframes glow { 50% { opacity: 0.45; } }
@keyframes swing { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
.guardian.g-listen .g-body { animation-duration: 5s; }

/* alert */
.guardian.g-alert .g-eyes-open, .guardian.g-alert .g-rings, .guardian.g-alert .g-bang { opacity: 1; }
.guardian.g-alert .g-eyes-closed, .guardian.g-alert .g-zz { opacity: 0; }
.guardian.g-alert .g-pupils { transform: scale(1.15); transform-box: fill-box; transform-origin: center; }
.guardian.g-alert .ring { animation: ring 0.9s ease-out infinite; }
.guardian.g-alert .g-bang { animation: pop 0.6s var(--spring) both, wobble 1s ease-in-out 0.6s infinite; transform-box: fill-box; transform-origin: center bottom; }
.guardian.g-alert .g-body { animation: hop-owl 0.5s ease-in-out 3; }
.guardian.g-alert .g-lantern-glow { opacity: 1; }
@keyframes pop { from { transform: scale(0); } }
@keyframes wobble { 50% { transform: rotate(8deg); } }
@keyframes hop-owl { 50% { transform: translateY(-8px); } }

/* no microphone */
.guardian.g-nomic .g-eyes-open, .guardian.g-nomic .g-muffs, .guardian.g-nomic .g-nomic-bubble, .guardian.g-nomic .g-brows { opacity: 1; }
.guardian.g-nomic .g-eyes-closed, .guardian.g-nomic .g-zz { opacity: 0; }
.guardian.g-nomic .g-pupils { transform: translateY(3px) scale(0.75); transform-box: fill-box; transform-origin: center; }
.guardian.g-nomic .g-body { animation: shake-head 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes shake-head { 0%, 60%, 100% { transform: rotate(0); } 66% { transform: rotate(-4deg); } 74% { transform: rotate(4deg); } 82% { transform: rotate(-3deg); } 90% { transform: rotate(0); } }
.guardian.g-nomic .g-nomic-bubble { animation: pop 0.6s var(--spring) both, float-y 3s ease-in-out 0.6s infinite; transform-box: fill-box; transform-origin: 20% 100%; }
.guardian .g-sweat { opacity: 0; }
.guardian.g-nomic .g-sweat { animation: sweat 2.6s ease-in infinite; }
@keyframes sweat { 0% { opacity: 0; transform: translateY(-4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes float-y { 50% { transform: translateY(-5px); } }

/* ---------- recordings ---------- */

.recorder { display: grid; justify-items: center; gap: 14px; padding: 6px 0; }
.rec-btn { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--on-ink); transition: transform 0.25s var(--spring); }
.rec-btn:active { transform: scale(0.92); }
.rec-btn svg { width: 38px; height: 38px; }
.rec-btn.live { background: var(--danger); color: #fff; animation: rec-pulse 1.6s ease-in-out infinite; }
@keyframes rec-pulse { 0%, 100% { box-shadow: 0 0 0 10px rgba(239, 91, 91, 0.18); } 50% { box-shadow: 0 0 0 22px rgba(239, 91, 91, 0.05); } }
.rec-time { font-weight: 900; font-size: 30px; direction: ltr; }
.wave { width: 100%; height: 56px; }
.field { width: 100%; height: 50px; padding: 0 16px; border-radius: 16px; background: var(--surface-2); border: 1.5px solid transparent; outline: none; font-weight: 600; }
.field:focus { border-color: var(--ink); }
.pick-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pick-row button { width: 48px; height: 48px; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 2.5px transparent; transition: box-shadow 0.25s, transform 0.25s var(--spring); }
.pick-row button .art { width: 100%; height: 100%; }
.pick-row button.on { box-shadow: 0 0 0 2.5px var(--ink); transform: scale(1.05); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  z-index: 95;
  left: 50%;
  top: calc(var(--safe-top) + 14px);
  transform: translate(-50%, -170%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.5s var(--spring);
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { width: 20px; height: 20px; flex: none; }

/* ---------- line art ---------- */

.art { position: relative; background: var(--card); color: var(--ink); overflow: hidden; }
.art-svg { width: 100%; height: 100%; overflow: visible; }
.ln { fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.pf { fill: var(--paper); }
.tf { fill: var(--tone); }
.tonef { fill: var(--tone); stroke: none; }
.tonebg { fill: var(--tone); stroke: none; opacity: 0.55; }
.dotf { fill: currentColor; stroke: none; }
.blush { fill: var(--blush); opacity: 0.6; stroke: none; }
.glow { stroke: var(--tone); stroke-width: 4; }
.glowdot { opacity: 0.8; }

/* draw-in when an illustration appears */
.art.drawing [pathLength] { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s var(--ease) forwards; }
.art.drawing .pf, .art.drawing .tf { fill-opacity: 0; animation: fill-in 0.6s ease 0.9s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fill-in { to { fill-opacity: 1; } }

/* idle animations — run only while the art is "live" */
.art [class*="a-"] { animation-play-state: paused; }
.a-float, .a-drift, .a-breathe, .a-twinkle, .a-fall, .a-ripple, .a-note, .a-lid, .a-glowy, .a-beat, .a-firefly, .a-strum, .a-bird, .a-wave, .a-spin-slow { transform-box: fill-box; }
.a-sway, .a-swing, .a-swing-slow, .a-rock, .a-flap, .a-spin, .a-ear, .a-rays { transform-box: view-box; }
.art.live [class*="a-"] { animation-play-state: running; }
.a-float { animation: a-float 6s ease-in-out infinite; }
.a-drift { animation: a-drift 9s ease-in-out infinite; }
.a-breathe { transform-origin: center; animation: a-breathe 8s ease-in-out infinite; }
.a-twinkle { transform-origin: center; animation: a-twinkle 3.2s ease-in-out infinite; }
.a-sway { animation: a-sway 5s ease-in-out infinite; }
.a-swing { animation: a-swing 4s ease-in-out infinite; }
.a-swing-slow { animation: a-swing 7s ease-in-out infinite; }
.a-rock { animation: a-rock 4.5s ease-in-out infinite; }
.a-fall { animation: a-fall 1.4s linear infinite; }
.a-ripple { transform-origin: center; animation: a-ripple 1.4s ease-out infinite; }
.a-flap { animation: a-flap 1.8s ease-in-out infinite; }
.a-note { animation: a-note 3.2s ease-out infinite; }
.a-lid { transform-origin: 50% 100%; animation: a-lid 3s ease-in-out infinite; }
.a-spin { animation: a-spin 4s linear infinite; }
.a-spin-slow { transform-origin: center; animation: a-spin 60s linear infinite; }
.a-wave { animation: a-wave 4s linear infinite; }
.a-bird { animation: a-bird 6s ease-in-out infinite; }
.a-glowy { transform-origin: center; animation: a-glowy 5s ease-in-out infinite; }
.a-rays { transform-origin: 100px 118px; animation: a-spin 40s linear infinite; }
.a-strum { animation: a-strum 0.18s linear infinite; }
.a-beat { transform-origin: center; animation: a-beat 1.8s ease-in-out infinite; }
.a-ear { animation: a-ear 5s ease-in-out infinite; }
.a-firefly { animation: a-firefly 5s ease-in-out infinite; }

@keyframes a-float { 50% { transform: translateY(-6px); } }
@keyframes a-drift { 50% { transform: translateX(-8px); } }
@keyframes a-breathe { 50% { transform: scale(1.04); } }
@keyframes a-twinkle { 0%, 100% { opacity: 0.3; transform: scale(0.75); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes a-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes a-swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes a-rock { 0%, 100% { transform: rotate(-5deg) translateY(0); } 50% { transform: rotate(5deg) translateY(-3px); } }
@keyframes a-fall { 0% { transform: translateY(-6px); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(34px); opacity: 0; } }
@keyframes a-ripple { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes a-flap { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.72); } }
@keyframes a-note { 0% { transform: translate(0, 6px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(-10px, -26px); opacity: 0; } }
@keyframes a-lid { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@keyframes a-spin { to { transform: rotate(360deg); } }
@keyframes a-wave { to { transform: translateX(-48px); } }
@keyframes a-bird { 50% { transform: translate(-10px, -6px); } }
@keyframes a-glowy { 50% { transform: scale(1.06); opacity: 0.85; } }
@keyframes a-strum { 50% { transform: translateX(0.6px); } }
@keyframes a-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(1); } 45% { transform: scale(1.04); } }
@keyframes a-ear { 0%, 80%, 100% { transform: rotate(0); } 88% { transform: rotate(-6deg); } }
@keyframes a-firefly { 0%, 100% { transform: translate(0, 0); opacity: 0.4; } 50% { transform: translate(6px, -8px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- night light (always dark) ---------- */

.nightlight { position: fixed; inset: 0; z-index: 60; background: #05040f; opacity: 0; pointer-events: none; transition: opacity 1.2s ease; color: #fff; }
.nightlight.show { opacity: 1; pointer-events: auto; }
.nightlight canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.nightlight .nl-ui {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--safe-top) + 14px) calc(var(--safe-right) + 20px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 20px);
  opacity: 0; transition: opacity 0.8s ease; pointer-events: none;
}
.nightlight .nl-ui.show { opacity: 1; pointer-events: auto; }
.nl-top { display: flex; align-items: center; gap: 12px; }
.nl-top .t { flex: 1; font-weight: 300; font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.nl-top .t b { display: block; font-weight: 800; font-size: 18px; color: #fff; }
.nl-scenes { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.nl-scenes button { height: 40px; padding: 0 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 13px; backdrop-filter: blur(8px); }
.nl-scenes button.on { background: #fff; color: #17161d; }
.nightlight .icon-btn { background: rgba(255, 255, 255, 0.1); color: #fff; box-shadow: none; }

/* ---------- play mode ---------- */

.playmode { position: fixed; inset: 0; z-index: 70; background: radial-gradient(120% 80% at 50% 100%, #3b2f8f, #120f33); touch-action: none; }
.playmode canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.playmode .hint { position: absolute; left: 0; right: 0; top: 42%; text-align: center; font-weight: 900; font-size: 22px; color: rgba(255, 255, 255, 0.75); pointer-events: none; transition: opacity 1s; }

/* ---------- child lock ---------- */

.lock { position: fixed; inset: 0; z-index: 80; touch-action: none; background: transparent; }
.lock .badge {
  position: absolute; top: calc(var(--safe-top) + 14px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; border-radius: 26px;
  background: rgba(23, 22, 29, 0.78); color: #fff; backdrop-filter: blur(10px);
  font-weight: 600; font-size: 13px; touch-action: none; white-space: nowrap;
}
.lock .holder { width: 40px; height: 40px; position: relative; display: grid; place-items: center; }
.lock .holder svg.ico { width: 20px; height: 20px; color: #fff; }
.lock .holder svg.prog { position: absolute; inset: 0; width: 40px; height: 40px; transform: rotate(-90deg); }
.lock .holder circle { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; }
.lock.shake .badge { animation: shake 0.5s; }
@keyframes shake { 20%, 60% { transform: translateX(calc(-50% - 6px)); } 40%, 80% { transform: translateX(calc(-50% + 6px)); } }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- left-to-right languages ---------- */

:root:lang(en) { --font: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[dir="ltr"] .switch.on::after { transform: translateX(20px); }
[dir="ltr"] .biglyrics .line { transform-origin: left center; }
