:root {
  --fondo: #f2f2f2;
  --carta: #ffffff;
  --bordo: rgba(0, 0, 0, 0.07);
  --testo: #111113;
  --testo-2: #6e6e76;
  --testo-3: #a1a1aa;
  --pista: #e7e7ea;
  --pieno: #18181b;
  --accento: #5b5bf6;
  --scia: #c9c9f8;
  --maniglia: #ffffff;
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  user-select: none;
  -webkit-user-select: none;
}

.card {
  width: min(380px, 100%);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 24px;
  padding: clamp(16px, 4.4vmin, 22px) clamp(16px, 4.4vmin, 22px) clamp(14px, 3.6vmin, 18px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 40px -18px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 3.4vh, 20px);
}

.card__head { display: flex; align-items: center; gap: 12px; }

.cover {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, #1e1b4b 0%, #4338ca 55%, #a5b4fc 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.cover span {
  position: absolute; left: 50%; top: 58%; width: 140%; height: 70%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  filter: blur(4px);
}

.track-info { flex: 1; min-width: 0; }
.track-info__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.track-info__meta { font-size: 12.5px; color: var(--testo-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.value {
  font-size: 22px; font-weight: 620; letter-spacing: -0.02em;
  height: 1.15em; line-height: 1.15em; overflow: hidden;
  display: flex; align-items: flex-start; flex: none;
  min-width: 2.6ch; justify-content: flex-end;
}
.value__digits { display: flex; }
.col { display: block; overflow: hidden; height: 1.15em; transition: width 0.25s; }
.col__strip { display: flex; flex-direction: column; will-change: transform; }
.col__strip span { height: 1.15em; display: block; text-align: center; }

.row { display: flex; align-items: center; gap: 12px; }

.speaker {
  width: 34px; height: 34px; flex: none;
  border: 0; padding: 0; border-radius: 10px;
  background: transparent; color: var(--testo);
  display: grid; place-items: center; cursor: pointer;
}
.speaker:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.speaker svg { width: 24px; height: 24px; overflow: visible; }
.speaker svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.speaker__body { fill: currentColor !important; fill-opacity: 0.08; }
.speaker__wave { transform-box: fill-box; transform-origin: 0% 50%; }
.speaker__slash { stroke-dasharray: 1; stroke-dashoffset: 1; }

.slider {
  position: relative; flex: 1; min-width: 0;
  padding: 14px 0 12px;
  touch-action: none;
  cursor: pointer;
  outline: none;
}
.slider:focus-visible .handle__dot { box-shadow: 0 0 0 3px rgba(91, 91, 246, 0.35), 0 2px 6px rgba(0, 0, 0, 0.18); }

.rail { position: relative; height: 22px; }

.rail__track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 6px; margin-top: -3px;
  border-radius: 999px;
  background: var(--pista);
  overflow: hidden;
  transform-origin: 0% 50%;
  will-change: transform;
}
.rail__trail, .rail__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  width: 0;
}
.rail__trail { background: var(--scia); }
.rail__fill { background: var(--pieno); }

.handle {
  position: absolute; top: 50%; left: 0;
  width: 22px; height: 22px; margin: -11px 0 0 -11px;
  will-change: transform;
}
.handle__dot {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: var(--maniglia);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.16), 0 8px 18px -8px rgba(0, 0, 0, 0.25);
}

.ticks {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 6px;
}
.tick {
  position: absolute; bottom: 0; width: 1px; height: 4px;
  margin-left: -0.5px;
  background: #d4d4d8;
  transform-origin: 50% 100%;
}

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

@media (max-width: 380px) {
  .value { font-size: 19px; }
  .track-info__meta { font-size: 12px; }
}

/* on large screens the card grows, as in a real player panel */
@media (min-width: 1000px) and (min-height: 680px) {
  .card { transform: scale(1.3); }
}
