:root {
  --fondo: #f4f4f5;
  --schermo: #ffffff;
  --inchiostro: #111113;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --bordo: rgba(17, 17, 19, 0.08);
  --traccia: rgba(17, 17, 19, 0.1);
  --accento: #f2542d;
  --foglio: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 12px;
}

/* the app screen: a phone-sized surface, measured on height too so it fits a low, wide box */
.screen {
  position: relative;
  width: min(340px, calc(100vw - 24px), 62vh);
  height: min(620px, calc(100vh - 24px), 128vw);
  background: var(--schermo);
  border: 1px solid var(--bordo);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 24px 60px -24px rgba(17, 17, 19, 0.22);
  isolation: isolate;
}

/* the library behind the player */
.lib {
  position: absolute;
  inset: 0;
  padding: clamp(14px, 6%, 22px) clamp(14px, 6%, 20px) 0;
  transform-origin: 50% 0;
}
.lib__app {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--grigio);
}
.lib__app svg { width: 15px; height: 15px; fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; }
.lib__title {
  margin-top: 4px;
  font-size: clamp(20px, 7.5vmin, 26px);
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}
.lib__tabs { display: flex; gap: 6px; margin-top: 10px; }
.lib__tabs span {
  font-size: 11.5px; font-weight: 600; color: var(--grigio);
  padding: 5px 10px; border-radius: 999px; background: #f4f4f5;
}
.lib__tabs span.is-on { background: var(--inchiostro); color: #fff; }
.lib__label { margin: clamp(10px, 3.4vmin, 16px) 0 4px; font-size: 11px; font-weight: 600; color: var(--grigio-chiaro); letter-spacing: 0.02em; }

.rows { list-style: none; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile b { display: block; margin-top: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__art { display: block; aspect-ratio: 1; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: clamp(5px, 1.6vmin, 7px) 0;
  border-bottom: 1px solid rgba(17, 17, 19, 0.05);
}
.row__art { width: clamp(30px, 9vmin, 38px); aspect-ratio: 1; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.row__t { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__a { font-size: 11px; color: var(--grigio); margin-top: 1px; }
.row__d { font-size: 11px; color: var(--grigio-chiaro); }
.row.is-now .row__t { color: var(--accento); }
.eq { display: none; gap: 2px; align-items: flex-end; height: 12px; width: 14px; }
.row.is-now .eq { display: flex; }
.row.is-now .row__d { display: none; }
.eq i { display: block; width: 3px; height: 100%; border-radius: 1.5px; background: var(--accento); transform-origin: 50% 100%; }

/* the player: absolutely placed pieces, their boxes written by the script for every value of the morph */
.player {
  position: absolute;
  left: 0; top: 0;
  background: var(--foglio);
  border: 1px solid var(--bordo);
  overflow: hidden;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
  outline: none;
}
.player:focus-visible { box-shadow: 0 0 0 3px rgba(242, 84, 45, 0.35); }
.player > * { position: absolute; left: 0; top: 0; }

.player__grip { width: 36px; height: 4px; border-radius: 2px; background: rgba(17, 17, 19, 0.16); }
.player__top { display: flex; align-items: center; justify-content: space-between; }
.player__from { text-align: center; line-height: 1.2; }
.player__from span { display: block; font-size: 10px; color: var(--grigio); letter-spacing: 0.04em; }
.player__from b { font-size: 12px; font-weight: 650; }

.icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--inchiostro);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.add { color: var(--grigio); position: absolute; }
.add__check { opacity: 0; }
.add.is-on { color: var(--accento); }
.add.is-on .add__plus { opacity: 0; }
.add.is-on .add__check { opacity: 1; }

.cover {
  overflow: hidden;
  background: #eee;
  will-change: transform;
}
.cover__art { position: absolute; inset: 0; }
.cover__shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 40%); }

/* the covers: soft gradients with a drawn shape and a little grain, no images */
.art-0 { background: radial-gradient(120% 90% at 20% 15%, #ffcf8a 0%, rgba(255, 207, 138, 0) 55%), radial-gradient(90% 90% at 85% 90%, #e2334f 0%, rgba(226, 51, 79, 0) 60%), linear-gradient(150deg, #ff8a4c, #c2275b); }
.art-1 { background: radial-gradient(110% 80% at 80% 20%, #b9c8ff 0%, rgba(185, 200, 255, 0) 55%), radial-gradient(100% 100% at 10% 95%, #3a2b8f 0%, rgba(58, 43, 143, 0) 65%), linear-gradient(160deg, #7d7cf0, #2d2a78); }
.art-2 { background: radial-gradient(100% 90% at 25% 80%, #f5c95c 0%, rgba(245, 201, 92, 0) 55%), radial-gradient(90% 80% at 85% 15%, #1e6d63 0%, rgba(30, 109, 99, 0) 65%), linear-gradient(170deg, #4fa38d, #1d4d4a); }
.art-3 { background: radial-gradient(100% 90% at 70% 25%, #f1e4d3 0%, rgba(241, 228, 211, 0) 60%), linear-gradient(160deg, #b9a48c, #5d4e43); }
.cover__art svg, .row__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.row__art { position: relative; overflow: hidden; }

.meta { overflow: hidden; }
.meta p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta__title { font-weight: 650; letter-spacing: -0.01em; }
.meta__artist { color: var(--grigio); margin-top: 1px; }
.meta span { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }

.bar { background: var(--traccia); border-radius: 2px; overflow: visible; }
.bar__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--inchiostro); }
.bar__knob { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--inchiostro); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.times { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 550; color: var(--grigio); }

.ctrl {
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--inchiostro);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ctrl svg { width: 52%; height: 52%; fill: currentColor; }
.ctrl--play { background: var(--inchiostro); color: #fff; }
.ctrl--play svg { width: 46%; height: 46%; }
.ctrl.is-hover, .icon.is-hover { background: rgba(17, 17, 19, 0.06); }
.ctrl--play.is-hover { background: #2a2a2e; }
@media (hover: hover) {
  .ctrl:hover, .icon:hover { background: rgba(17, 17, 19, 0.06); }
  .ctrl--play:hover { background: #2a2a2e; }
}

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
