:root {
  --fondo: #f2f2f2;
  --carta: #ffffff;
  --inchiostro: #111113;
  --testo-2: #6b6b72;
  --testo-3: #a1a1a8;
  --bordo: rgba(17, 17, 19, 0.08);
  --accento: #5b5bf0;
  --anello-fondo: rgba(17, 17, 19, 0.08);
  --font: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
}

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

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 16px;
}

.ep {
  position: relative;
  width: min(460px, 92vw);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px 16px 16px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 18px 40px -18px rgba(17, 17, 19, 0.22);
}

/* the cover, drawn in CSS: a dusk gradient, a low sun and a band of water */
.ep__cover {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(160deg, #2b2d6e 0%, #6156d8 48%, #f0a37a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.ep__sun {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #fff3df, #ffc69a 70%);
}
.ep__wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(20, 18, 60, 0.55), rgba(20, 18, 60, 0.85));
  z-index: 1;
}
.ep__mark {
  position: absolute;
  left: 7px;
  top: 5px;
  z-index: 2;
  font-weight: 800;
  font-stretch: 125%;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.ep__text { min-width: 0; }
.ep__show {
  font-size: 12px;
  font-weight: 600;
  color: var(--accento);
}
.ep__show span { color: var(--testo-3); font-weight: 500; margin-left: 4px; }
.ep__title {
  margin-top: 3px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ep__meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--testo-2);
}
.ep__left {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--testo-3);
}

/* the equaliser: three thin bars that only move while playing */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 0;
  height: 12px;
  margin-right: -7px;
  overflow: hidden;
  transition: width 0.3s ease, margin-right 0.3s ease;
}
.eq.is-on { width: 12px; margin-right: 0; }
.eq i {
  display: block;
  width: 2.4px;
  height: 100%;
  border-radius: 2px;
  background: var(--accento);
  transform-origin: 50% 100%;
  transform: scaleY(0.3);
}

/* the button and its ring */
.play {
  position: relative;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  touch-action: manipulation;
}
.ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.ring circle { fill: none; stroke-width: 2.2; }
.ring__track { stroke: var(--anello-fondo); }
.ring__fill {
  stroke: var(--accento);
  stroke-linecap: round;
  stroke-dasharray: 0 100;
}

.play__btn {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--inchiostro);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 6px 14px -6px rgba(17, 17, 19, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.play__btn:focus-visible { outline: 2px solid var(--accento); outline-offset: 6px; }
.play__icon { width: 24px; height: 24px; fill: currentColor; }

.play__speed-tag {
  position: absolute;
  right: -6px;
  bottom: -6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  font-size: 10.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accento);
  opacity: 0;
  box-shadow: 0 4px 10px -4px rgba(17, 17, 19, 0.25);
}

/* the speed picker that slides out of the button */
.speed {
  position: absolute;
  right: -8px;
  bottom: calc(100% + 14px);
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--inchiostro);
  box-shadow: 0 14px 30px -12px rgba(17, 17, 19, 0.55);
  opacity: 0;
  visibility: hidden;
  transform-origin: 85% 100%;
}
.speed__pill {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.speed__opt {
  position: relative;
  min-width: 46px;
  padding: 7px 10px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  font: 600 13px/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  border-radius: 999px;
}
.speed__opt[aria-checked="true"] { color: #fff; }
.speed__opt:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

.hint {
  font-size: 12px;
  color: var(--testo-3);
}

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

@media (max-width: 420px) {
  .ep { gap: 12px; padding: 13px 14px 13px 13px; border-radius: 20px; }
  .ep__cover { width: 54px; height: 54px; border-radius: 12px; }
  .ep__title { font-size: 14.5px; }
  .ep__meta { font-size: 11.5px; }
  .speed__opt { min-width: 40px; padding: 7px 8px; font-size: 12px; }
}

@media (max-height: 330px) {
  .hint { display: none; }
}
