:root {
  --accent: #74aea6;
  --accent-deep: #4a978d;
  --accent-soft: rgba(116, 174, 166, 0.18);
  --coffee: #74492d;
  --coffee-deep: #5f3920;
  --coffee-soft: #96735a;
  --paper: rgba(255, 250, 243, 0.98);
  --line: rgba(187, 149, 120, 0.28);
  --text: #8d7a6b;
  --text-strong: #74492d;
  --label: rgba(116, 73, 45, 0.72);
  --shadow-soft: 0 20px 34px rgba(191, 148, 115, 0.14);
  --shadow-card: 0 30px 54px rgba(186, 143, 110, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 248, 241, 0.84), transparent 24%),
    radial-gradient(circle at 86% 14%, rgba(233, 244, 241, 0.72), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 221, 199, 0.56), transparent 30%),
    linear-gradient(180deg, #f9ebde 0%, #f8e6d7 46%, #f5dbc7 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

.music-app {
  min-height: 100vh;
  padding: 0;
}

.music-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0;
}

.panel-card {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  border-radius: 0;
  border: none;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 255, 255, 0.7), transparent 18%),
    radial-gradient(circle at 84% 16%, rgba(219, 241, 238, 0.44), transparent 18%),
    linear-gradient(180deg, rgba(251, 238, 224, 0.92) 0%, rgba(249, 231, 216, 0.96) 100%);
}

.panel-card--music {
  padding: max(18px, env(safe-area-inset-top, 0px)) 18px calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.panel-card--music {
  padding: max(18px, env(safe-area-inset-top, 0px)) 18px calc(env(safe-area-inset-bottom, 0px) + 34px);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 241, 225, 0.7) 0%, rgba(255, 241, 225, 0.22) 22%, rgba(255, 241, 225, 0) 44%),
    radial-gradient(circle at 82% 10%, rgba(228, 240, 233, 0.26) 0%, rgba(228, 240, 233, 0.08) 18%, rgba(228, 240, 233, 0) 40%),
    linear-gradient(180deg, rgba(253, 247, 239, 0.96) 0%, rgba(251, 239, 226, 0.98) 100%);
}

.music-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 0;
}

.top-menu {
  position: relative;
  z-index: 10;
  display: flex;
  width: min(92vw, 680px);
  flex-direction: column;
  align-items: flex-end;
}

.top-menu__button {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(181, 126, 96, 0.24);
  border-radius: 50%;
  background: rgba(255, 250, 245, 0.76);
  color: rgba(116, 73, 45, 0.88);
  box-shadow: 0 10px 20px rgba(184, 141, 111, 0.12);
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.top-menu__button:active {
  transform: translateY(1px);
}

.top-menu__button span {
  display: block;
  margin-top: -8px;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
}

.top-menu__panel {
  min-width: 136px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid rgba(181, 126, 96, 0.2);
  border-radius: 8px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 18px 34px rgba(95, 57, 32, 0.14);
}

.top-menu__item {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--coffee);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.top-menu__item:active {
  background: rgba(255, 197, 171, 0.2);
}

.disc-stage {
  position: relative;
  display: flex;
  width: 100%;
  min-height: clamp(300px, 86vw, 410px);
  align-items: center;
  justify-content: center;
}

.disc-stage__base {
  position: absolute;
  top: 38px;
  width: min(90vw, 420px);
  height: min(90vw, 420px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 247, 237, 0.78) 0%, rgba(255, 247, 237, 0.52) 48%, rgba(255, 247, 237, 0) 72%);
  filter: blur(3px);
}

.disc-stage__glow {
  position: absolute;
  width: min(90vw, 420px);
  height: min(90vw, 420px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 228, 205, 0.34) 0%, rgba(255, 228, 205, 0.14) 46%, rgba(255, 228, 205, 0) 76%);
  filter: blur(16px);
}

.disc-shell {
  position: relative;
  display: grid;
  place-items: center;
  width: min(82vw, 382px);
  height: min(82vw, 382px);
}

.disc {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 28px 54px rgba(39, 24, 32, 0.22);
  transform: translateZ(0);
  transform-origin: center center;
}

.disc__spin-layer {
  width: 100%;
  height: 100%;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  transform-origin: center center;
}

.disc__spin-layer--spinning {
  animation: spin 4.8s linear infinite;
}

.disc__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.disc-cursor {
  position: absolute;
  z-index: 3;
  top: -40px;
  right: -38px;
  width: min(45vw, 206px);
  transform-origin: 78% 10%;
  transform: rotate(7deg);
  transition: transform 260ms ease, filter 260ms ease;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 16px 22px rgba(199, 162, 132, 0.22));
}

.disc-cursor--active {
  transform: rotate(2deg) translate(-4px, 6px);
}

.track-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(92vw, 680px);
  text-align: center;
}

.track-copy__title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

.track-copy__note,
.track-copy__heart {
  width: clamp(30px, 7vw, 42px);
  height: clamp(30px, 7vw, 42px);
  flex: 0 0 auto;
}

.track-copy__note {
  fill: none;
  stroke: rgba(249, 190, 165, 0.94);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track-copy__heart {
  fill: rgba(249, 190, 165, 0.94);
}

.track-copy__title {
  margin: 0;
  font-size: clamp(24px, 6.4vw, 36px);
  line-height: 1.12;
  font-weight: 800;
  color: var(--coffee);
}

.track-copy__subtitle {
  margin: 0;
  font-size: clamp(15px, 3.8vw, 22px);
  line-height: 1.2;
  color: rgba(180, 143, 116, 0.96);
  font-weight: 700;
}

.track-copy__song-name {
  margin: 8px 0 0;
  font-size: clamp(13px, 3vw, 17px);
  line-height: 1.3;
  color: var(--accent-deep);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.progress-block {
  width: min(88vw, 640px);
}

.progress-decor {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.progress-wave {
  display: flex;
  align-items: center;
  opacity: 0.54;
}

.progress-wave--mirrored {
  transform: scaleX(-1);
}

.progress-wave__svg {
  width: 100%;
  height: 28px;
  fill: none;
  stroke: rgba(255, 184, 157, 0.84);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.progress-heart {
  display: flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 252, 248, 0.86);
  box-shadow: 0 8px 18px rgba(212, 183, 154, 0.14);
}

.progress-heart__icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: rgba(255, 184, 157, 0.96);
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.progress-track-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}

.progress-track-shell {
  position: relative;
  height: 26px;
  min-width: 0;
}

.progress-track,
.progress-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
}

.progress-track {
  background: rgba(255, 197, 171, 0.34);
}

.progress-fill {
  right: auto;
  background: linear-gradient(90deg, rgba(255, 183, 156, 0.94) 0%, rgba(255, 154, 120, 0.96) 100%);
  box-shadow: 0 4px 10px rgba(244, 160, 129, 0.24);
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd4c2 0%, #ffb08d 100%);
  box-shadow: 0 4px 12px rgba(242, 162, 130, 0.32);
}

.progress-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.progress-slider::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
}

.progress-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
}

.progress-slider:disabled {
  cursor: default;
}

.progress-track-row [data-role="current-time"],
.progress-track-row [data-role="duration-time"] {
  color: rgba(128, 83, 51, 0.92);
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.transport-control {
  display: flex;
  justify-content: center;
  margin-top: 2px;
}

.transport-button {
  display: inline-flex;
  width: 76px;
  height: 76px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffbb9c 0%, #ffa57e 100%);
  box-shadow:
    0 0 0 8px rgba(255, 243, 233, 0.96),
    0 14px 24px rgba(241, 164, 132, 0.24);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.transport-button:active {
  transform: translateY(1px);
}

.transport-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.transport-icon--pause {
  gap: 9px;
}

.transport-icon--pause span {
  display: block;
  width: 9px;
  height: 34px;
  border-radius: 999px;
  background: #fffdf9;
}

.transport-icon--play span {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 29px solid #fffdf9;
}

.button {
  width: 100%;
  min-height: 66px;
  border: 1.5px solid rgba(158, 114, 82, 0.34);
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(255, 246, 236, 0.98) 100%);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button--primary {
  color: var(--accent-deep);
  box-shadow:
    0 8px 0 rgba(139, 103, 76, 0.46),
    0 18px 28px rgba(194, 151, 120, 0.2);
  font-size: 18px;
  font-weight: 700;
}

.button--secondary {
  color: var(--coffee);
  background: rgba(255, 250, 245, 0.9);
  border: 1.5px solid rgba(181, 126, 96, 0.66);
  box-shadow:
    0 6px 0 rgba(181, 126, 96, 0.24),
    0 16px 24px rgba(184, 141, 111, 0.12);
  font-size: 18px;
  font-weight: 700;
}

.feedback-actions {
  width: 100%;
  max-width: 340px;
}

.music-footer {
  display: flex;
  width: min(92vw, 680px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  color: rgba(190, 150, 123, 0.96);
  font-size: clamp(15px, 3.8vw, 20px);
  font-weight: 700;
  text-align: center;
}

.music-footer__caption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  line-height: 1.35;
}

.music-footer__caption span {
  min-width: 0;
  max-width: calc(100% - 56px);
}

.music-footer__note,
.music-footer__heart {
  width: 20px;
  height: 20px;
}

.music-footer__note {
  fill: none;
  stroke: rgba(249, 190, 165, 0.96);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.music-footer__heart {
  fill: rgba(249, 190, 165, 0.96);
}

.music-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  z-index: 20;
  min-width: 168px;
  max-width: min(80vw, 320px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(95, 57, 32, 0.9);
  color: #fffaf6;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 18px 34px rgba(95, 57, 32, 0.24);
}

.feedback-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px calc(env(safe-area-inset-bottom, 0px) + 24px);
  text-align: center;
}

.feedback-title {
  color: var(--text-strong);
  font-family: "Iowan Old Style", "Baskerville", "Songti SC", "Noto Serif SC", serif;
  font-size: 34px;
  line-height: 1.16;
  font-weight: 700;
}

.feedback-desc {
  max-width: 280px;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text);
}

.loader {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(116, 73, 45, 0.14);
  border-top-color: rgba(74, 151, 141, 0.92);
  animation: spin 1s linear infinite;
}

.feedback-card--loading {
  gap: 22px;
}

/* Loading visual */
.loading-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.loading-heart-shell {
  position: relative;
  display: flex;
  width: 160px;
  height: 160px;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.loading-heart-shell::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 188, 156, 0.34) 0%, rgba(245, 188, 156, 0.14) 40%, rgba(245, 188, 156, 0) 76%);
  filter: blur(20px);
}

.loading-aura {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 250, 244, 0.44);
}

.loading-aura--outer {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 248, 241, 0.06) 0%, rgba(255, 248, 241, 0.02) 52%, rgba(255, 248, 241, 0) 78%);
  opacity: 0.72;
  animation: loadingBreathe 2.8s ease-in-out infinite;
}

.loading-aura--mid {
  width: 86%;
  height: 86%;
  opacity: 0.58;
}

.loading-aura--inner {
  width: 72%;
  height: 72%;
  border: 1px solid rgba(255, 252, 248, 0.72);
  background: radial-gradient(circle, rgba(255, 251, 246, 0.08) 0%, rgba(255, 251, 246, 0.03) 58%, rgba(255, 251, 246, 0) 82%);
  opacity: 0.92;
}

.loading-heart-orb {
  position: relative;
  z-index: 1;
  display: flex;
  width: 60%;
  height: 60%;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 222, 209, 0.34) 0%, rgba(255, 222, 209, 0.12) 18%, rgba(255, 222, 209, 0) 34%),
    linear-gradient(180deg, #ffb59e 0%, #f8a288 46%, #ef967d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 42px rgba(226, 162, 132, 0.24),
    0 0 28px rgba(255, 189, 163, 0.2);
  animation: loadingPulse 1.6s ease-in-out infinite;
}

.loading-heart-orb__icon {
  z-index: 2;
  width: 42%;
  height: 42%;
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 6px rgba(255, 255, 255, 0.08));
}

@keyframes loadingPulse {
  0%,
  100% {
    transform: scale(0.96);
  }
  14% {
    transform: scale(1.12);
  }
  28% {
    transform: scale(0.95);
  }
  42% {
    transform: scale(1.06);
  }
  56% {
    transform: scale(0.98);
  }
  70% {
    transform: scale(1.02);
  }
}

@keyframes loadingBreathe {
  0%,
  100% {
    transform: scale(0.96);
    opacity: 0.62;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.82;
  }
}

.loading-hint {
  max-width: 280px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(155, 118, 89, 0.82);
  font-weight: 500;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.lyrics-block {
  margin-top: 28px;
  padding: 20px clamp(16px, 4vw, 32px);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  border: 1px solid rgba(187, 149, 120, 0.18);
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lyrics-block__header {
  margin: 0 0 12px;
  font-size: clamp(13px, 3vw, 16px);
  font-weight: 700;
  color: var(--accent-deep);
  text-align: center;
  letter-spacing: 0.08em;
}

.lyrics-block__content {
  font-size: clamp(13px, 3.2vw, 17px);
  line-height: 2;
  color: var(--text);
  text-align: center;
  white-space: pre-line;
  word-break: break-word;
}

@media (prefers-reduced-motion: reduce) {
  .loader,
  .disc__spin-layer--spinning,
  .disc-cursor,
  .loading-heart-orb,
  .loading-aura--outer,
  .loading-hint {
    animation: none;
    transition: none;
  }
}
