/* WRNTY — Now Playing. Black and white only. */

@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/PressStart2P-latin.woff2") format("woff2");
}

@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/VT323-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/Inter-SemiBold-latin.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: auto;
  min-height: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 8px;
  line-height: 1.6;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeSpeed;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.window {
  width: min(420px, 100%);
  height: auto;
  background: #fff;
  border: 3px solid #000;
  display: flex;
  flex-direction: column;
  min-height: 0;
  user-select: none;
}

.window.is-min {
  height: auto;
}

.window.is-min .body {
  display: none;
}

.titlebar {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  background: #000;
  color: #fff;
  font-family: Inter, "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: auto;
}

.title-label {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.title-total {
  grid-column: 1;
  justify-self: start;
  margin: 0;
  min-width: 0;
  font-family: "VT323", "Press Start 2P", monospace;
  font-weight: 400;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-font-smoothing: none;
}

.title-logo {
  height: 14px;
  width: auto;
  display: block;
  flex: none;
}

.title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-buttons {
  grid-column: 3;
  justify-self: end;
  display: flex;
  gap: 5px;
  flex: none;
}

.win-btn {
  width: 18px;
  height: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  box-shadow: 0 0 0 1px #fff;
}

.titlebar :focus-visible {
  outline-color: #fff;
}

.body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: auto;
}

.now {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex: none;
}

.art {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
  border: 2px solid #000;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
}

.art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  padding: 8px;
  line-height: 1.45;
}

.corner {
  position: absolute;
  width: 12px;
  height: 12px;
  pointer-events: none;
  z-index: 1;
}

.corner::before,
.corner::after {
  content: "";
  position: absolute;
  background: #000;
}

.tl { top: 3px; left: 3px; }
.tr { top: 3px; right: 3px; }
.bl { bottom: 3px; left: 3px; }
.br { bottom: 3px; right: 3px; }

.tl::before, .tr::before, .bl::before, .br::before { height: 2px; width: 12px; }
.tl::after, .tr::after, .bl::after, .br::after { width: 2px; height: 12px; }

.tl::before, .tl::after { top: 0; left: 0; }
.tr::before, .tr::after { top: 0; right: 0; }
.bl::before, .bl::after { bottom: 0; left: 0; }
.br::before, .br::after { bottom: 0; right: 0; }

.meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.titles {
  min-width: 0;
}

.track-title {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.track-artist {
  margin: 8px 0 0;
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.artist-row {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 2px;
}

.artist-row .track-artist {
  margin: 0;
}

.band-ig {
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.04em;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
  user-select: text;
}

.band-ig:hover,
.band-ig:focus-visible {
  background: #000;
  color: #fff;
  outline: none;
}

.share-btn {
  margin-left: auto;
  align-self: center;
  padding: 4px 6px 3px;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 0;
}

.share-btn:hover,
.share-btn:focus-visible,
.share-btn.is-done {
  background: #000;
  color: #fff;
  outline: none;
}

.share-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.track-plays {
  margin: 6px 0 0;
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.06em;
}

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

.time {
  flex: none;
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 20px;
  line-height: 1;
  min-width: 42px;
  letter-spacing: 0.02em;
}

.time-dur {
  text-align: right;
}

.time.is-error {
  font-family: "Press Start 2P", monospace;
  font-size: 7px;
  line-height: 1.3;
  min-width: 52px;
}

.slider {
  position: relative;
  height: 22px;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  touch-action: none;
  cursor: pointer;
}

.slider-vol {
  flex: none;
  width: 112px;
}

.slider-groove {
  position: relative;
  width: 100%;
  height: 10px;
  border: 2px solid #000;
  background: #fff;
}

.slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #000;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 12px;
  height: 18px;
  margin-left: -6px;
  transform: translateY(-50%);
  background: #fff;
  border: 2px solid #000;
  pointer-events: none;
}

.viz {
  position: relative;
  flex: none;
  height: 112px;
  background: #000;
  border: 3px solid #000;
  overflow: hidden;
}

.viz canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.transport {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.buttons {
  display: flex;
  gap: 6px;
  flex: none;
}

.transport-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: #000;
  border: 2px solid #000;
}

.transport-btn svg {
  display: block;
}

.transport-btn .icon-pause {
  display: none;
}

.transport-btn.is-playing {
  background: #000;
  color: #fff;
}

.transport-btn.is-playing .icon-play {
  display: none;
}

.transport-btn.is-playing .icon-pause {
  display: block;
}

.transport-btn:hover,
.transport-btn:focus-visible {
  background: #000;
  color: #fff;
}

.transport-btn.is-playing:hover,
.transport-btn.is-playing:focus-visible {
  background: #fff;
  color: #000;
}

.transport-btn[aria-disabled="true"] {
  cursor: default;
}

.volume {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.vol-label {
  flex: none;
  font-size: 8px;
  line-height: 1;
}

.playlist {
  flex: none;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  border: 2px solid #000;
  background: #fff;
  overflow: hidden;
}

.playlist-head {
  flex: none;
  background: #000;
  color: #fff;
  padding: 7px 8px 6px;
  font-size: 8px;
  line-height: 1.5;
  border-bottom: 2px solid #fff;
}

.playlist-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
}

.playlist-rows li {
  margin: 0;
}

.row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px 6px;
  border: 0;
  border-bottom: 1px solid #000;
  background: #fff;
  color: #000;
  text-align: left;
  font-size: 8px;
  line-height: 1.55;
}

.row.is-current {
  background: #000;
  color: #fff;
  border-bottom-color: #000;
}

.row:hover:not(.is-current),
.row:focus-visible:not(.is-current) {
  background: #000;
  color: #fff;
}

.mark {
  width: 10px;
  height: 12px;
  flex: none;
  display: inline-flex;
  align-items: center;
  margin-top: 1px;
}

.mark::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent;
}

.row.is-current .mark::before,
.row:hover .mark::before,
.row:focus-visible .mark::before {
  border-left-color: currentColor;
}

.num {
  flex: none;
  width: 2.4em;
}

.name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.plays {
  flex: none;
  margin-left: auto;
  padding-left: 6px;
  font-family: "VT323", "Press Start 2P", monospace;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.empty {
  margin: 0;
  padding: 18px 8px;
  text-align: center;
  font-size: 8px;
  line-height: 1.6;
}

.spotify {
  align-self: center;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  gap: 3px;
  padding: 8px 10px 7px;
  background: #fff;
  color: #000;
  border: 2px solid #000;
  text-decoration: none;
  font-size: 8px;
  line-height: 1.45;
}

.spotify:hover,
.spotify:focus-visible {
  background: #000;
  color: #fff;
}

/* credit line, Helvetica like the site */
.credit {
  align-self: center;
  text-align: center;
  flex: none;
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #000;
  -webkit-font-smoothing: antialiased;
  user-select: text;
}
.credit a {
  font-family: inherit;
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-transform: none;
  letter-spacing: .04em;
}
.credit a:hover,
.credit a:focus-visible { background: #000; color: #fff; outline: none; }

audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Fill a short popup (about 420x520). On a tall phone, stay compact. */
@media (max-height: 580px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .window {
    height: 100%;
    max-height: 100%;
  }

  .playlist {
    flex: 1 1 auto;
    min-height: 112px;
  }
}

@media (max-width: 400px) {
  .titlebar {
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 6px;
  }

  .art {
    width: 96px;
    height: 96px;
  }

  .track-title {
    font-size: 12px;
  }

  .track-artist {
    font-size: 20px;
    margin-top: 6px;
  }

  .artist-row {
    margin-top: 6px;
  }

  .slider-vol {
    width: 84px;
  }

  .transport-btn {
    width: 36px;
    height: 36px;
  }

  .now {
    gap: 8px;
  }
}

@media (max-width: 340px) {
  .transport {
    flex-wrap: wrap;
  }

  .volume {
    flex: 1;
  }

  .slider-vol {
    flex: 1;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .viz canvas {
    image-rendering: auto;
  }
}
