/* The player that plays: a dark player on a black page, each piece with its own drawn cover and colour. */
:root {
  --page: #000000;          /* the page */
  --card: #111114;
  --ink: #f4f2ee;
  --muted: #85838c;
  --tint: #ffb35c;          /* the colour of the piece playing: the script changes it */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Readex Pro Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 24px 16px;
}

.player {
  width: min(380px, 100%);
  padding: 14px 14px 18px;
  border: 1px solid #222228;
  border-radius: 28px;
  background: var(--card);
}

/* ---------------------------------------------------------------- the cover */
/* square by its padding, not by aspect-ratio */
.cover {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #1b1b20;
}

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

.cover__in svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------------------------------------------------------------- the piece */
.track {
  padding: 16px 6px 6px;
}

.track__title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.track__by {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.roll {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.roll > span {
  display: inline-block;
}

/* ---------------------------------------------------------------- the wave */
.wave {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 56px;
  margin: 8px 6px 0;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.wave span {
  flex: 1 1 0;
  height: 100%;
  border-radius: 2px;
  background: #34333b;
  transform-origin: 50% 50%;
}

.wave span.is-past {
  background: var(--tint);
}

.wave:focus-visible {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink);
}

html[data-using='pointer'] .wave:focus-visible {
  box-shadow: none;
}

.times {
  display: flex;
  justify-content: space-between;
  margin: 6px 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- the buttons */
.buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 10px;
}

.btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--play {
  width: 64px;
  height: 64px;
  background: var(--ink);
  color: var(--card);
}

.btn--play svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.4;
}

@media (hover: hover) {
  .btn:not(.btn--play):hover {
    background: #1c1c22;
  }
}

.btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

html[data-using='pointer'] .btn:focus-visible {
  outline: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
