/* next.css — the design after v3: motion the way Apple's apps move (owner,
   2026-10-23). Read with motion.js, which works out the springs and sets
   --spring-smooth / --spring-snappy / --spring-bouncy (as CSS linear()
   curves, where the WebView knows them) and their lengths; the
   cubic-beziers after each var() stand in elsewhere. Everything is under
   html.v3, and nothing here moves unless something was done. */

/* ---- presses: quick down, then a real spring back (app.css's press, with
   the spring in place of its one-overshoot curve) */
html.v3 { --spring: var(--spring-snappy, cubic-bezier(.3,1.35,.5,1)); }
html.v3 .hcard .hcv, html.v3 .dbtn, html.v3 .fmix, html.v3 .chbtn, html.v3 .grow .rart {
  transition: transform var(--spring-snappy-d, .55s) var(--spring), background-color .2s;
}
html.v3 .hcard:active .hcv, html.v3 .dbtn:active, html.v3 .fmix:active, html.v3 .chbtn:active,
html.v3 .grow:active .rart { transition-duration: .1s; }
html.v3 .grow:active { opacity: 1; }
html.v3 .grow:active .rart { transform: scale(.94); }

/* ---- sheets rise on a spring, and follow the finger (motion.js) */
html.v3 .sh { transition: transform var(--spring-smooth-d, .45s) var(--spring-smooth, cubic-bezier(.32,.72,0,1)); }
html.v3 .sbg { transition: opacity .3s ease; }

/* ---- the toast comes in on a spring */
html.v3 .toast { transition: opacity .2s ease, transform var(--spring-snappy-d, .45s) var(--spring-snappy, cubic-bezier(.3,1.35,.5,1)); }

/* ---- page changes (motion.js): the page that was there is a frozen copy
   laid over the same spot; the new one comes in over it (a push) or the
   copy leaves over it (back). The fixed bars stay above both. */
html.v3.motion .view.enter { animation: none; }
/* the copy: one screenful, its own layer, nothing inside it running */
.vsnap { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; overflow: hidden; pointer-events: none;
  background: var(--bg); contain: strict; will-change: transform, opacity; }
.vsnap * { animation: none !important; transition: none !important; }
.vsnap.vover { z-index: 4; }
/* the page coming in: opaque (or the copy shows through) and, while it
   moves, cut to one screenful by motion.js */
html.v3 .view.vtop { z-index: 3; background: var(--bg); will-change: transform, opacity; }
/* the shade over the page underneath */
.vdim { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 3; pointer-events: none;
  background: rgba(0, 0, 0, .45); opacity: 0; }
/* a cover going back into its card */
.vghost { position: fixed; z-index: 5; margin: 0; pointer-events: none; border-radius: 10px; overflow: hidden; }
.vghost img { width: 100%; height: 100%; object-fit: cover; }

/* ---- the player's bar: while it is held it thickens on a spring and the
   times brighten, as in Apple Music (app.css only changed its height) */
html.v3 .strack { transform-origin: 50% 50%; transition: transform var(--spring-snappy-d, .45s) var(--spring-snappy, cubic-bezier(.3,1.35,.5,1)); }
html.v3 .scrub.drag .strack { height: 6px; transform: scaleY(1.75); }
html.v3 .stime { transition: color .2s ease; }
html.v3 .scrub.drag + .stime { color: #fff; }

/* ---- hold a song for its menu (app.js): no phone menu of its own over the
   picture, no text selection, and the card lifts a little as it opens */
html.v3 [data-act="play"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
html.v3 .card .cvw, html.v3 .row .cvw, html.v3 .lrow .cvw { transition: transform var(--spring-snappy-d, .45s) var(--spring); }
html.v3 .card.held .cvw, html.v3 .hcard.held .hcv, html.v3 .grow.held .rart { transform: scale(1.04); }
html.v3 .row.held, html.v3 .lrow.held { background: var(--card); }

/* ---- Home opens with where they were: six tiles in two columns */
html.v3 .phead + .quick { margin: 6px 0 24px; }

/* ---- Home's picks: a mix's four covers fill its big card too */
html.v3 .hcv > .cv { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border-radius: 0; }
html.v3 .hcv .cv.mosaic img { position: static; width: 100%; height: 100%; }

/* ---- a first open: pick a few singers (app.js maybeOnboard). It rises as a
   sheet over everything; a pick sinks a little under a check, the way Apple
   Music's own artist picker does. */
.onb { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 110; display: flex; flex-direction: column;
  background: var(--bg); transform: translateY(100%);
  transition: transform var(--spring-smooth-d, .5s) var(--spring-smooth, cubic-bezier(.32,.72,0,1)); }
.onb.open { transform: none; }
.onbh { position: relative; padding: calc(56px + env(safe-area-inset-top)) 20px 12px; }
.onbskip { position: absolute; top: calc(14px + env(safe-area-inset-top)); padding: 8px 4px; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 16px; }
html[dir="rtl"] .onbskip { left: 16px; }
html[dir="ltr"] .onbskip { right: 16px; }
.onbh h1 { margin: 0 0 8px; font-size: 28px; font-weight: 800; line-height: 1.3; }
.onbh p { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.onbseg { display: flex; padding: 3px; border-radius: 10px; background: var(--card); }
.onbseg button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; }
.onbseg button.on { background: var(--segon, #636366); }
.onbg { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 14px; align-content: start; padding: 10px 20px calc(110px + env(safe-area-inset-bottom)); }
.onba { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0; border: 0;
  background: none; color: var(--text); font: inherit; cursor: pointer; }
/* square by padding, not aspect-ratio: Android's old WebViews (Chrome 70) lack it */
.onbi { position: relative; display: block; width: 100%; border-radius: 50%; overflow: hidden; background: var(--card);
  transition: transform var(--spring-bouncy-d, .5s) var(--spring-bouncy, cubic-bezier(.34,1.56,.64,1)); }
.onbi::before { content: ''; display: block; padding-top: 100%; }
.onbi img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.onba:active .onbi { transform: scale(.92); transition-duration: .1s; }
.onba.on .onbi { transform: scale(.88); }
.onbc { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s ease; }
.onbc svg { width: 38%; height: 38%; color: #fff; }
.onba.on .onbc { opacity: 1; }
/* two lines, not an ellipsis: a Latin name cut in a right-to-left page lost
   its first letters ("…man Garshasbi") */
.onbn { max-width: 100%; margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.3; text-align: center;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.onbf { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); }
.onbgo { width: 100%; height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: var(--onacc, #fff);
  font: inherit; font-size: 17px; font-weight: 700;
  transition: transform var(--spring-snappy-d, .45s) var(--spring), background-color .2s; }
.onbgo:active { transform: scale(.97); transition-duration: .1s; }
.onbgo:disabled { background: var(--card); color: var(--muted); }

/* ---- the library's chips (app.js libraryHTML, v3) */
html.v3 .chips.libf { padding: 0 20px 14px; }
html.v3 .chips.libf .chip { padding: 0 14px; font-size: 14px; font-weight: 600; }
html.v3 .lrow .cvw.round { border-radius: 50%; overflow: hidden; }


/* ---- out faster than in (Apple's sheets and banners): a sheet rises on the
   spring and leaves in 240 ms; the toast leaves in 200 ms */
html.v3 .sw:not(.open) .sh { transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1); }
html.v3 .sw:not(.open) .sbg { transition: opacity 200ms ease; }
html.v3 .toast:not(.show) { transition: opacity 150ms ease, transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }

/* ---- presses as Apple's: an icon dims and gives a little; buttons and chips
   barely shrink (app.css took icons to .86, which read as a jolt) */
html.v3 .ib { transition: transform var(--spring-snappy-d, .45s) var(--spring), opacity .2s ease, background-color .2s; }
html.v3 .ib:active { transform: scale(.94); opacity: .55; transition-duration: .1s; }
html.v3 .fab:active, html.v3 .playbig:active { transform: scale(.95); }
html.v3 .pill:active, html.v3 .chip:active { transform: scale(.96); }

/* ---- a sheet's page behind it (motion.js recede): one screenful copy */
.vrecede { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; overflow: hidden; pointer-events: none;
  background: var(--bg); contain: strict; transform-origin: 50% 0; will-change: transform; }
.vrecede * { animation: none !important; transition: none !important; }

/* ---- swipe back from the edge (motion.js): the page underneath and the copy
   of the page leaving over it */
.vswipe { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; overflow: hidden; pointer-events: none;
  background: var(--bg); contain: strict; will-change: transform; }
.vswipe * { animation: none !important; transition: none !important; }
.vswipe.vswipetop { z-index: 4; }
/* its edge casts a shadow on the page coming out from under it */
html[dir="ltr"] .vswipe.vswipetop { box-shadow: -10px 0 24px rgba(0, 0, 0, .45); }
html[dir="rtl"] .vswipe.vswipetop { box-shadow: 10px 0 24px rgba(0, 0, 0, .45); }

/* ---- why a For You song is there (app.js whyLine): under the singer, quieter
   but as readable, on two lines at most -- on one, a card's width cut even
   «چون «Ebi» رو دوست داری» short */
html.v3 .card .cw { margin-top: 3px; font-size: 12px; line-height: 1.4; color: var(--muted);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---- a tab's own page (app.js watchTitle): the bar is empty and lets taps
   through until the big title has gone up under it, then shows the same
   title small in its middle. A scroll does this tens of times a day: a fade,
   nothing moving. */
html.v3 .topbar.root { pointer-events: none; transition: background-color 150ms ease; }
html.v3 .topbar.root.titled { pointer-events: auto; }
/* (.ib.glass too: the copy behind a sheet, motion.js recede, has no ids) */
html.v3 .topbar.root #tback, html.v3 .topbar.root > .ib.glass { display: none; }
html.v3 .topbar.root .tbt { text-align: center; font-size: 17px; font-weight: 700; transform: none; transition: opacity 150ms ease; }

/* ---- a held song's menu, iOS's context menu (app.js contextMenu): the song
   lifted where it was, the page dimmed, the menu grown out of the song's
   corner. In fast, out faster. */
.cm { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 105; }
.cmbg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity 200ms ease; }
.cm.open .cmbg { opacity: 1; }
.cm.out .cmbg { transition-duration: 150ms; }
.cmprev { position: fixed; margin: 0; pointer-events: none; transition: transform 250ms cubic-bezier(0.23, 1, 0.32, 1); }
.cm.out .cmprev { transition-duration: 200ms; }
/* a row has no ground of its own: lifted, it gets the platter iOS gives it */
.cmprev.row, .cmprev.lrow, .cmprev.grow { background: var(--card); border-radius: 12px; }
.cmenu { position: fixed; width: 250px; max-width: calc(100vw - 24px); padding: 6px 0; border-radius: 14px;
  background: var(--card2); opacity: 0; transform: scale(.92);
  transition: opacity 150ms ease-out, transform 250ms cubic-bezier(0.23, 1, 0.32, 1); }
.cm.open .cmenu { opacity: 1; transform: none; }
.cm.out .cmenu { transform: scale(.96); transition-duration: 150ms; }
.cmi { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 16px; border: 0;
  background: none; color: var(--text); font: inherit; font-size: 16px; text-align: start; }
.cmi .ell { flex: 1; min-width: 0; }
.cmi svg { flex: none; width: 20px; height: 20px; }
/* no flex gap: Android's old WebViews (Chrome 70) lack it */
html[dir="rtl"] .cmi svg { margin-right: 14px; }
html[dir="ltr"] .cmi svg { margin-left: 14px; }
.cmi:active { background: var(--s3); }
.cmi.hot svg { color: var(--accent); }
.cmi.danger { color: #ff5a67; }

/* ---- pull Home down to refresh (app.js): the spinner above the page turns
   with the pull and spins only while new picks are on their way */
.ptr { position: fixed; z-index: 39; top: calc(14px + env(safe-area-inset-top)); left: 50%; width: 24px; height: 24px;
  margin-left: -12px; color: var(--muted); opacity: 0; pointer-events: none; }
.ptr .spin { animation-play-state: paused; }
.ptr.busy .spin { animation-play-state: running; }

/* ---- the toast drops from the top, as iOS's banners do, and a flick up
   puts it away (app.js); it leaves the way it came */
html.v3 .toast { top: calc(10px + env(safe-area-inset-top)); bottom: auto; transform: translateY(-140%); touch-action: none; }
html.v3 .toast.show { transform: none; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  /* less motion: these fade in place instead of moving */
  html.v3 .toast { transform: none; }
  .cmenu, .cm.out .cmenu { transform: none; transition-property: opacity; }
  .cmprev { transition: none; }
}

/* ---- a genre's tile (app.js fanHTML; owner, 2026-10-27: "the category
   icons are AI slop, start over, Apple-like"): its own colour, its name, and
   its two top records fanned at the corner like sleeves dealt on a table.
   Pressed, the fan opens (the answer to the press); the first time the grid
   comes into sight in a visit, the sleeves are dealt in one tile after
   another. Nothing moves on its own after that. */
html.v3 .bt { height: 108px; padding: 14px 16px; }
html.v3 .bt > span { max-width: 60%; line-height: 1.3; }
.bt .fan { position: absolute; bottom: -18px; width: 104px; height: 96px; pointer-events: none; }
html[dir="rtl"] .bt .fan { left: -4px; }
html[dir="ltr"] .bt .fan { right: -4px; }
.bt .fan img { position: absolute; bottom: 0; width: 72px; height: 72px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .35);
  transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1), opacity .35s ease; }
/* the back sleeve leans away, the front one (its number one) the other way */
html[dir="rtl"] .bt .fan img:first-child { left: 30px; transform: rotate(14deg); }
html[dir="rtl"] .bt .fan img:last-child { left: 0; transform: rotate(-12deg); }
html[dir="ltr"] .bt .fan img:first-child { right: 30px; transform: rotate(-14deg); }
html[dir="ltr"] .bt .fan img:last-child { right: 0; transform: rotate(12deg); }
@media (prefers-reduced-motion: no-preference) {
  html[dir="rtl"] .bt:active .fan img:first-child { transform: translateX(10px) rotate(24deg); }
  html[dir="rtl"] .bt:active .fan img:last-child { transform: translateY(-8px) rotate(-20deg); }
  html[dir="ltr"] .bt:active .fan img:first-child { transform: translateX(-10px) rotate(-24deg); }
  html[dir="ltr"] .bt:active .fan img:last-child { transform: translateY(-8px) rotate(20deg); }
}
/* dealt in: they wait below the tile, then come up, the back one first
   (app.js dealCovers; never with less motion asked for) */
.browse.deal .bt .fan img { transform: translateY(80px) rotate(0deg) !important; opacity: 0; transition: none; }
.browse.dealt .bt .fan img { transition-duration: 450ms; transition-delay: calc(var(--i, 0) * 40ms); }
.browse.dealt .bt .fan img:last-child { transition-delay: calc(var(--i, 0) * 40ms + 70ms); }

/* ---- small controls get a finger-sized place to land, the look unchanged:
   the search box's clear (28 px) and a section's round button (30 px) */
html.v3 .sclr, html.v3 .sec .all { position: relative; }
html.v3 .sclr::before, html.v3 .sec .all::before { content: ''; position: absolute; top: -8px; right: -8px; bottom: -8px; left: -8px; }

/* ---- no focus ring on a text field: a field being typed in is always
   "focused", and the ring drew a red box over the search bar every time
   (owner, 2026-10-23); the caret says where the typing goes, as in Apple's
   apps. Buttons and links keep the ring for a keyboard. */
html.v3 input:focus-visible, html.v3 textarea:focus-visible { outline: none; }
