@font-face {
  font-family: Pixel;
  src: url('https://poisonp1nk.art/interests/fonts/PixdorTwo.ttf');
  font-display: swap;
}

:root {
  color-scheme: light;
  --pink: #ff66c4;
  --light: #ffeaf8;
  --shadow: #9d688c;
  --ink: #330033;
  --accent: #ff0099;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 40px 20px;
  min-height: 100svh;
  background: radial-gradient(circle at center, #ff66c4 0%, #ffe4f4 70%);
  background-attachment: fixed;
  color: var(--ink);
  font: 12px Tahoma, Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  color: var(--ink);
  background: linear-gradient(#ff99cc, #ff66c4);
  border: 2px solid;
  border-color: #fff #986888 #986888 #fff;
  box-shadow: 1px 1px 0 #633951;
  padding: 7px 10px;
  border-radius: 0;
}

button:hover {
  background: linear-gradient(#fbd4e3, #f8c1d5);
}

button:active,
button[aria-pressed=true] {
  border-color: #986888 #fff #fff #986888;
  background: #ff99cc;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #a50066;
  outline-offset: 3px;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.desktop {
  max-width: 1040px;
  margin: auto;
}

.desktop-top,
.desktop-bottom {
  font: 11px Pixel, monospace;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  margin: 0 3px 12px;
}

.desktop-top a {
  color: inherit;
  text-decoration: none;
}

.desktop-bottom {
  justify-content: center;
  margin-top: 20px;
  color: #895473;
}

.window {
  padding: 4px;
  background: linear-gradient(125deg, #ffeaf8, #ffd6ed);
  border: 2px solid;
  border-color: #fff #68475d #68475d #fff;
  box-shadow: inset -1px -1px #bc8ba7, 5px 5px 0 #bd7c9d66, 15px 20px 45px #843f7222;
}

.titlebar {
  background: linear-gradient(90deg, #ff66c4 0%, #ff99cc 100%);
  color: white;
  text-shadow: 1px 1px #723052;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 14px Pixel, Tahoma, sans-serif;
  letter-spacing: 1px;
}

.titlebar > div {
  display: flex;
  gap: 4px;
}

.titlebar button {
  font: 11px Tahoma;
  min-width: 25px;
  padding: 2px 5px;
  box-shadow: none;
}

.menubar {
  display: flex;
  justify-content: space-between;
  font: 11px Pixel, monospace;
  padding: 12px 12px 5px;
  color: #794567;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: 22px;
  padding: 15px;
}

.panel-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 11px Pixel, monospace;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.power {
  color: #986488;
}

.is-playing .power {
  color: #ff0099;
  text-shadow: 0 0 7px #ff0099;
}

.caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 6px 0;
  font: 12px Pixel, Tahoma;
  min-height: 24px;
}

.deck {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lcd {
  background: repeating-linear-gradient(0deg, #291d2b 0px, #291d2b 2px, #2c202f 3px);
  color: #ff99cc;
  padding: 17px;
  border: 3px solid;
  border-color: #79566d #fff1fa #fff1fa #79566d;
  box-shadow: inset 3px 3px 7px #0009;
  min-height: 198px;
}

.lcd-top,
.lcd-bottom {
  display: flex;
  justify-content: space-between;
  font: 10px monospace;
  letter-spacing: 1px;
  color: #ff99cc;
}

h1 {
  font: 20px/1.25 Pixel, Tahoma, sans-serif;
  margin: 17px 0 7px;
  overflow-wrap: anywhere;
}

#artist {
  font: 12px/1.4 Tahoma;
  margin: 0 0 15px;
  color: #d4adc5;
}

.time-display {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font: 42px/1 monospace;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 9px #ff99cc33;
}

.duration {
  font: 15px monospace;
  letter-spacing: 0;
  color: #b78aa6;
}

.lcd-bottom {
  margin-top: 14px;
  font-size: 9px;
}

.seek-row,
.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.seek-row span {
  font: 10px monospace;
  width: 34px;
  text-align: right;
}

input[type=range] {
  min-width: 0;
  width: 100%;
  accent-color: #d32b8d;
  height: 16px;
  cursor: pointer;
}

.transport {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.transport button {
  height: 42px;
  font-size: 16px;
}

.transport .play {
  background: linear-gradient(#ffeaf8, #ff66c4);
  color: #9f005d;
}

.volume-row button {
  font: 10px monospace;
  padding: 4px 6px;
}

.volume-row output {
  font: 10px monospace;
  width: 35px;
  flex: none;
}

.mode-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.mode-row button {
  flex: 1;
  font: 10px monospace;
  padding: 8px 5px;
}

.vents {
  height: 16px;
  max-width: 170px;
  margin: 22px auto 0;
  width: 100%;
  background: repeating-linear-gradient(90deg, #a7799444 0, #a7799444 2px, #fff8 2px, #fff8 3px, transparent 3px, transparent 6px);
}

#error {
  font-size: 12px;
  line-height: 1.5;
  color: #8c074d;
  margin-bottom: 0;
}

.playlist-panel {
  margin: 0 15px 15px;
  border: 2px solid;
  border-color: #a57992 #fff2fa #fff2fa #a57992;
  background: #2b202b;
}

.list-header {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(90deg, #ff66c4 0%, #ff99cc 100%);
  color: #fff;
  padding: 7px 10px;
  font: 11px Pixel, monospace;
  text-shadow: 1px 1px #7c3b60;
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  background: #ffeaf8;
  font: 10px monospace;
}

.list-tools input {
  flex: 1;
  min-width: 0;
  background: #ffeaf8;
  color: var(--ink);
  border: 2px inset #efd1e3;
  padding: 6px 8px;
  font: 12px Tahoma;
}

.list-tools button {
  font: 9px monospace;
  padding: 5px 7px;
}

#playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 258px;
  overflow: auto;
  scrollbar-color: #d18eb8 #322431;
  scrollbar-width: thin;
}

.track {
  width: 100%;
  display: grid;
  grid-template-columns: 30px 34px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #ffffff09;
  box-shadow: none;
  background: transparent;
  color: #ff99cc;
  padding: 8px 12px;
  min-height: 51px;
}

.track:hover {
  background: #503448;
}

.track[aria-current=true] {
  background: #5d254b;
  color: #ffeaf8;
  box-shadow: inset 3px 0 #ff66c4;
  border-color: #ffffff09;
}

.track .number {
  font: 11px monospace;
  color: #b389a2;
}

.track img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.track .track-name {
  font: 12px/1.35 Tahoma;
  display: block;
}

.track .track-artist {
  display: block;
  font-size: 10px;
  color: #be9bae;
  margin-top: 3px;
}

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

.statusbar {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border: 1px inset #f0c9e1;
  padding: 6px 9px;
  margin: 0 2px 2px;
  font: 10px Tahoma;
  color: #75405f;
}

#empty {
  color: #edbed9;
  padding: 10px 15px;
}

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

@media (max-width: 700px) {
  body {
    padding: 18px 10px;
  }

  .desktop-top {
    font-size: 9px;
  }

  .desktop-top > span {
    display: none;
  }

  .main-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 24px;
  }

  .art-panel {
    max-width: 430px;
    width: 100%;
    margin: auto;
  }

  .art-stage {
    padding-right: 18px;
  }

  .playlist-panel {
    margin: 0 12px 12px;
  }

  .lcd {
    min-height: 180px;
  }

  .list-tools button {
    font-size: 8px;
  }

  .desktop-bottom {
    font-size: 9px;
  }

  .menubar {
    font-size: 9px;
  }

  h1 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jewel {
    transition: none !important;
  }

  * {
    scroll-behavior: auto !important;
  }
}

body.embedded {
  padding: 10px;
  min-height: 100%;
  background: transparent;
}

.embedded .desktop {
  max-width: none;
}

.embedded .desktop-top,
.embedded .desktop-bottom,
.embedded .titlebar {
  display: none;
}

.embedded .window {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.embedded .menubar {
  padding-top: 6px;
}

.embedded .main-grid {
  padding: 10px;
  gap: 16px;
}

.embedded .playlist-panel {
  margin: 0 10px 10px;
}

@media (max-width: 700px) {
  body.embedded {
    padding: 4px;
  }

  .embedded .art-panel {
    max-width: 300px;
  }

  .embedded .main-grid {
    gap: 16px;
  }
}

.art-stage {
  position: relative;
  perspective: 1000px;
  perspective-origin: 50% 45%;
  padding: 35px 34px 42px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.art-stage:focus-visible {
  outline: none;
}

.art-stage.dragging {
  cursor: grabbing;
}

.jewel {
  --half-depth: 10px;
  position: relative;
  width: 100%;
  aspect-ratio: 1.12;
  transform-style: preserve-3d;
  transform: rotateX(-8deg) rotateY(-18deg);
  transition: transform 0.35s ease;
  will-change: transform;
}

.dragging .jewel {
  transition: none;
}

.case-face {
  position: absolute;
  inset: 0;
  border: 1px solid #fffc;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px #ffeafa77, inset 0 0 0 5px #8d7a8e55;
}

.case-front {
  display: flex;
  background: linear-gradient(125deg, #ffeafb99, #c3a8c066);
  transform: translateZ(var(--half-depth));
  padding: 6px 6px 6px 0;
  overflow: hidden;
}

.spine {
  width: 8%;
  flex: none;
  background: repeating-linear-gradient(90deg, #867b8977 0, #ebd4e9bb 1px, #a495ad88 3px);
  border-right: 2px solid #fff9;
  margin-right: 5px;
}

.cover-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #442638;
  box-shadow: 0 0 0 1px #514251;
  overflow: hidden;
}

.cover-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

#cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffc8e5;
  font-size: 80px;
}

.case-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(118deg, #fff5, transparent 26%, transparent 65%, #fff2 66%, transparent 69%);
  box-shadow: inset 2px 2px 2px #fff9, inset -3px -3px 2px #0002;
}

.case-back {
  transform: rotateY(180deg) translateZ(var(--half-depth));
  background: linear-gradient(120deg, #fff2, transparent 38%, #ffbde51a 75%, #fff4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px;
  color: #6e4961;
  font: 8px monospace;
  letter-spacing: 1px;
}

.back-brand {
  font-weight: bold;
}

.back-caption {
  text-align: right;
  font-size: 6px;
}

.case-side,
.case-edge {
  position: absolute;
  background: repeating-linear-gradient(0deg, #d6c5d499 0, #fff9 2px, #9c8c9f99 3px);
  border: 1px solid #fff9;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.case-side {
  top: 0;
  height: 100%;
  width: calc(var(--half-depth) * 2);
}

.case-left {
  left: 0;
  transform: translateX(-50%) rotateY(-90deg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #c7b0c9, #ffe3f3, #b8a2ba);
}

.case-right {
  right: 0;
  transform: translateX(50%) rotateY(90deg);
}

#spine-title {
  writing-mode: vertical-rl;
  max-height: 94%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #633750;
  font: 9px monospace;
  letter-spacing: 0.8px;
}

.case-edge {
  left: 0;
  width: 100%;
  height: calc(var(--half-depth) * 2);
}

.case-top {
  top: 0;
  transform: translateY(-50%) rotateX(90deg);
}

.case-bottom {
  bottom: 0;
  transform: translateY(50%) rotateX(-90deg);
}

.case-tray {
  position: absolute;
  inset: 5%;
  transform: rotateY(180deg) translateZ(-7px);
  backface-visibility: hidden;
  background: #d2b7cc88;
  border: 1px solid #fff6;
  border-radius: 3px;
}

.tray-ring {
  position: absolute;
  inset: 0 5%;
  border: 4px double #947b9266;
  border-radius: 50%;
  box-shadow: inset 0 0 12px #66556c55;
}

.case-disc {
  position: absolute;
  left: 13%;
  top: 5%;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: rotateY(180deg) translateZ(2px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid #f5eff8;
  background: conic-gradient(from 10deg, #e2d7e9, #ac9bb7 15%, #fff 20%, #d3e9ed 25%, #f9bfea 32%, #e8e7cb 37%, #c6b9d3 45%, #fff 51%, #beb0c6 63%, #e4eafb 71%, #e9b8d9 80%, #e4d9e7 90%, #e2d7e9);
  box-shadow: 0 2px 5px #3d234955, inset 0 0 0 3px #ffffff66;
}

.disc-rings {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0, transparent 2px, #fff3 2.5px, transparent 3px);
  border: 1px solid #a295b477;
}

.disc-label {
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  overflow: hidden;
  background: #e47ab2;
  border: 1px solid #fff8;
}

.disc-label img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.disc-hub {
  position: absolute;
  inset: 43%;
  border-radius: 50%;
  background: radial-gradient(circle, #bca5bc 0 35%, #fff6 38% 55%, #8d799455 58% 65%, #eee5f3 68%);
  border: 1px solid #fff8;
  box-shadow: 0 0 0 2px #66576d44;
}

.case-shadow {
  position: absolute;
  left: 20%;
  right: 15%;
  height: 12%;
  bottom: 12px;
  background: radial-gradient(ellipse, #69355144, transparent 70%);
  pointer-events: none;
}

.case-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 5px 12px;
}

.case-controls span {
  font: 10px monospace;
  color: #81516e;
  margin-right: auto;
}

.case-controls button {
  font: 10px monospace;
  padding: 5px 8px;
  min-height: 28px;
}

@media (max-width: 700px) {
  .art-stage {
    padding: 25px 24px 32px;
  }

  .case-controls {
    gap: 4px;
  }

  .case-controls span {
    font-size: 9px;
  }

  .case-controls button {
    padding: 5px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jewel {
    transition: none !important;
  }
}

#art-stage {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

#art-stage.dragging {
  cursor: grabbing;
}

#art-stage img {
  pointer-events: none;
  -webkit-user-drag: none;
}

#art-stage.dragging #jewel {
  transition: none;
}
