:root {
  --ink: #fff6f7;
  --muted: rgba(255, 246, 247, .68);
  --soft: rgba(255, 246, 247, .18);
  --night: #110713;
  --night-2: #230b27;
  --plum: #6f2a84;
  --violet: #a33bdf;
  --pink: #fb4ca3;
  --peach: #ffd0a8;
  --cream: #fff2d2;
  --line: rgba(255, 141, 204, .34);
  --shadow: rgba(7, 3, 10, .46);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

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

body {
  color: var(--ink);
  background: var(--night);
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", "PingFang SC", sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.site-nav {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(-50%);
  padding: 8px;
  border: 1px solid rgba(255, 141, 204, .24);
  border-radius: 999px;
  background: rgba(16, 7, 18, .68);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  backdrop-filter: blur(18px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cream);
  color: #2b1431;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -.08em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-button,
.nav-link,
.primary-action {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 850;
}

.nav-button.active,
.nav-button:hover,
.nav-link:hover,
.primary-action {
  color: #2b1431;
  background: var(--cream);
}

.screen {
  display: none;
  min-height: 100svh;
}

.screen.active {
  display: block;
}

.home-screen {
  position: relative;
  overflow: hidden;
  background: #f3e2ba url("public/cuimao/bg.png") center / cover no-repeat fixed;
  cursor: none;
}

.home-screen::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 36%, rgba(255, 215, 169, .22) 58%, rgba(54, 17, 43, .18) 100%);
}

.home-label {
  position: fixed;
  top: 30px;
  left: 50%;
  z-index: 5;
  transform: translateX(-50%);
  padding: 10px 20px;
  border: 1px solid rgba(80, 50, 30, .18);
  border-radius: 999px;
  background: rgba(255, 240, 210, .62);
  color: #2a1a0e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.cuimao-stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.cuimao-portrait {
  position: relative;
  width: min(72vmin, 600px);
  height: min(72vmin, 600px);
  border-radius: 50%;
  background: url("public/cuimao/sprite.webp") 0% 0% / 1100% 1100% no-repeat;
  box-shadow: 0 24px 68px rgba(40, 24, 12, .34), 0 3px 10px rgba(40, 24, 12, .16);
  will-change: background-position;
}

.cuimao-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.cuimao-front.show {
  opacity: 1;
}

.custom-cursor {
  position: fixed;
  z-index: 40;
  width: 56px;
  height: 56px;
  pointer-events: none;
  background: url("public/cuimao/cursor.png") center / contain no-repeat;
  filter: drop-shadow(0 5px 12px rgba(60, 24, 55, .36));
  transform: translate3d(-100px, -100px, 0);
}

.home-copy {
  position: fixed;
  left: clamp(24px, 7vw, 96px);
  bottom: clamp(24px, 8vh, 86px);
  z-index: 4;
  max-width: 360px;
  padding: 26px;
  border: 1px solid rgba(80, 50, 30, .14);
  border-radius: 26px;
  background: rgba(255, 240, 210, .58);
  color: #2a1a0e;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--pink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.home-copy h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 72px);
  line-height: .86;
  letter-spacing: 0;
}

.home-copy p:not(.eyebrow) {
  margin: 16px 0 22px;
  line-height: 1.5;
}

.fm-screen {
  padding: 96px 22px 28px;
  background:
    radial-gradient(circle at 10% 20%, rgba(251, 76, 163, .28), transparent 30%),
    radial-gradient(circle at 78% 10%, rgba(255, 208, 168, .22), transparent 28%),
    linear-gradient(145deg, #100612, #2c0e33 55%, #4c155f 100%);
}

.fm-shell {
  width: min(1260px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 42px;
  background: rgba(13, 5, 16, .82);
  box-shadow: 0 34px 110px var(--shadow);
  padding: clamp(18px, 3vw, 34px);
}

.fm-header,
.player-dock,
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.fm-header h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .92;
}

.signal-chip {
  min-width: 112px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--cream);
  color: #2b1431;
  font-weight: 950;
  text-align: center;
}

.signal-chip.playing {
  background: var(--pink);
  color: var(--ink);
}

.signal-chip.error {
  background: #ff5f72;
  color: var(--ink);
}

.fm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(18px, 3vw, 28px);
  margin-top: 28px;
}

.radio-stage {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(240px, .82fr) minmax(320px, 1fr);
  gap: 24px;
}

.track-card,
.disc-zone,
.companion-panel,
.player-dock,
.queue-zone {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(8, 3, 12, .78);
}

.track-card {
  padding: clamp(24px, 4vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.track-kicker {
  margin: 0;
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.track-card h3 {
  margin: auto 0 14px;
  font-size: clamp(54px, 8vw, 98px);
  line-height: .82;
  letter-spacing: 0;
  white-space: pre-line;
}

.track-card p:last-child {
  margin: 0;
  color: var(--muted);
}

.disc-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 420px;
  overflow: hidden;
  color: inherit;
}

.wave-bars {
  position: absolute;
  top: 38px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.wave-bars span {
  width: 8px;
  height: var(--h);
  border-radius: 999px;
  background: var(--c);
  opacity: .82;
  animation: wave 1.6s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes wave {
  0%, 100% { transform: scaleY(.62); opacity: .52; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

.disc-core {
  width: min(68%, 320px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 141, 204, .32);
  border-radius: 50%;
  background:
    radial-gradient(circle, #100612 0 18%, var(--pink) 19% 27%, var(--violet) 28% 41%, transparent 42%),
    repeating-radial-gradient(circle, transparent 0 28px, rgba(255, 246, 247, .22) 29px, transparent 30px);
  box-shadow: 0 0 80px rgba(251, 76, 163, .18), inset 0 0 0 30px rgba(0, 0, 0, .16);
}

.playing .disc-core {
  animation: spin 11s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.companion-panel {
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
}

.sprite-wrap {
  min-height: 360px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 242, 210, .95), rgba(255, 208, 168, .82));
  overflow: hidden;
}

.companion-sprite {
  width: 192px;
  height: 208px;
  image-rendering: pixelated;
  transform: scale(1.36);
  transform-origin: center bottom;
  background-image: url("public/foundry/companion-spritesheet.webp");
  background-repeat: no-repeat;
  background-size: 800% 900%;
  background-position: 0% 0%;
}

.companion-lines {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.companion-lines p:last-child {
  margin: 0;
}

.player-dock {
  margin-top: 24px;
  padding: 18px;
}

.now-mini {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.now-mini strong,
.now-mini span {
  display: block;
}

.now-mini span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mini-orb {
  width: 60px;
  height: 60px;
  border-radius: 22px;
  background: radial-gradient(circle at 50% 50%, var(--pink) 0 24%, var(--violet) 25% 62%, var(--peach) 63% 100%);
}

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

.icon-button,
.play-button {
  min-width: 46px;
  min-height: 46px;
  border-radius: 17px;
  background: rgba(255, 246, 247, .1);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.play-button {
  min-width: 92px;
  background: var(--cream);
  color: #2b1431;
  font-size: 14px;
}

.progress-box {
  flex: 1;
  min-width: 220px;
}

.progress {
  width: 100%;
  height: 10px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(to right, var(--pink) 0 var(--progress, 0%), rgba(255, 246, 247, .18) var(--progress, 0%) 100%);
}

.progress::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 4px solid var(--cream);
  border-radius: 50%;
  background: var(--pink);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.queue-zone {
  margin-top: 24px;
  padding: 18px;
}

.queue-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.queue-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.queue-item {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: rgba(255, 246, 247, .06);
  color: var(--ink);
  text-align: left;
}

.queue-item.active {
  border-color: rgba(255, 141, 204, .62);
  background: rgba(251, 76, 163, .24);
}

.queue-num {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 246, 247, .1);
  font-weight: 900;
}

.queue-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.queue-artist {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

@media (hover: none) {
  .home-screen {
    cursor: auto;
  }

  .custom-cursor {
    display: none;
  }
}

@media (max-width: 980px) {
  .fm-layout,
  .radio-stage {
    grid-template-columns: 1fr;
  }

  .companion-panel {
    min-height: 0;
  }

  .queue-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .site-nav {
    top: 14px;
    width: calc(100vw - 24px);
    justify-content: space-between;
  }

  .nav-button,
  .nav-link {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .home-label {
    display: none;
  }

  .home-copy {
    left: 16px;
    right: 16px;
    bottom: 18px;
    max-width: none;
    padding: 18px;
  }

  .cuimao-portrait {
    width: min(82vmin, 440px);
    height: min(82vmin, 440px);
    transform: translateY(-42px);
  }

  .fm-screen {
    padding: 82px 10px 12px;
  }

  .fm-shell {
    border-radius: 28px;
  }

  .fm-header {
    align-items: flex-start;
  }

  .signal-chip {
    min-width: 84px;
    padding: 10px 12px;
  }

  .radio-stage {
    min-height: 0;
  }

  .track-card h3 {
    font-size: 58px;
  }

  .disc-zone {
    min-height: 340px;
  }

  .companion-panel {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
  }

  .sprite-wrap {
    min-height: 150px;
  }

  .companion-sprite {
    transform: scale(.72);
  }

  .player-dock {
    display: grid;
    grid-template-columns: 1fr;
  }

  .transport {
    width: 100%;
  }

  .transport .play-button {
    flex: 1;
  }

  .progress-box {
    min-width: 0;
  }

  .queue-list {
    grid-template-columns: 1fr;
  }
}
