:root {
  --bg-top: #091018;
  --bg-bottom: #04070d;
  --panel: rgba(12, 18, 30, 0.88);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #edf4ff;
  --muted: rgba(237, 244, 255, 0.62);
  --mint: #7de1c4;
  --mint-2: #c8ffe0;
  --gold: #ffc86b;
  --gold-2: #ffe5ac;
  --rose: #ffb2a2;
  --radius-xl: 38px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --shadow: 0 38px 100px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(17px, 1.18vw, 22px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 12%, rgba(125, 225, 196, 0.18), transparent 18%),
    radial-gradient(circle at 84% 18%, rgba(255, 200, 107, 0.16), transparent 18%),
    radial-gradient(circle at 50% 88%, rgba(183, 255, 215, 0.08), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

input {
  min-width: 0;
  color: inherit;
}

input::placeholder {
  color: transparent;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  place-items: center;
}

.hud-shell,
.queue-panel,
.player-panel,
.composer-dock,
.status-strip,
.icon-button,
.progress-shell,
.queue-item,
.toast {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hud-shell {
  position: relative;
  width: min(94vw, calc(100vh - 36px), 1080px);
  aspect-ratio: 1;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(17, 24, 36, 0.92), rgba(7, 11, 19, 0.96)),
    radial-gradient(circle at center, rgba(125, 225, 196, 0.06), transparent 55%);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
  overflow: hidden;
}

.hud-shell::before,
.hud-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hud-shell::before {
  top: -110px;
  left: -96px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(125, 225, 196, 0.18), transparent 70%);
  filter: blur(12px);
}

.hud-shell::after {
  right: -110px;
  bottom: -120px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(255, 200, 107, 0.14), transparent 70%);
  filter: blur(10px);
}

.chrome-row,
.utility-row {
  display: flex;
  align-items: center;
}

.chrome-row {
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.utility-row {
  gap: 12px;
}

.status-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
  opacity: 0.5;
}

.status-dot.is-good {
  background: var(--mint);
  box-shadow: 0 0 18px rgba(125, 225, 196, 0.65);
  opacity: 1;
}

.status-dot.is-warn {
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 200, 107, 0.55);
  opacity: 1;
}

.status-dot.is-error {
  background: var(--rose);
  box-shadow: 0 0 18px rgba(255, 178, 162, 0.55);
  opacity: 1;
}

.status-dot.is-active {
  transform: scale(1.18);
  opacity: 1;
}

.hud-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.96fr) minmax(360px, 1.04fr);
  gap: 18px;
  position: relative;
  z-index: 1;
}

.queue-panel,
.player-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
}

.queue-panel {
  padding: 16px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.composer-dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.045);
}

.composer-fields {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.composer-field {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.composer-field:focus-within {
  border-color: rgba(125, 225, 196, 0.42);
  box-shadow: 0 0 0 4px rgba(125, 225, 196, 0.12);
}

.field-icon,
.field-icon svg {
  width: 28px;
  height: 28px;
}

.field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.field-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-field input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 1.02rem;
}

#sourceButton {
  align-self: stretch;
  width: 90px;
  height: 100%;
  min-height: 168px;
}

.queue-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.queue-list::-webkit-scrollbar {
  width: 8px;
}

.queue-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.queue-empty {
  flex: 1;
  min-height: 260px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 18%, rgba(125, 225, 196, 0.09), transparent 22%),
    radial-gradient(circle at 82% 76%, rgba(255, 200, 107, 0.08), transparent 26%),
    rgba(255, 255, 255, 0.025);
  display: grid;
  place-items: center;
  gap: 18px;
}

.queue-empty span {
  display: block;
  width: min(68%, 220px);
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12));
}

.queue-empty span:nth-child(2) {
  width: min(54%, 170px);
}

.queue-empty span:nth-child(3) {
  width: min(42%, 130px);
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  transition:
    transform 160ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.queue-item.is-current {
  border-color: rgba(255, 200, 107, 0.28);
  background: linear-gradient(135deg, rgba(255, 200, 107, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.queue-item.is-playing {
  border-color: rgba(125, 225, 196, 0.34);
  background: linear-gradient(135deg, rgba(125, 225, 196, 0.14), rgba(255, 255, 255, 0.04));
}

.queue-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.queue-main:hover,
.queue-item:hover {
  transform: translateY(-1px);
}

.queue-order {
  width: 44px;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  text-align: center;
}

.queue-copy {
  min-width: 0;
  display: flex;
  align-items: center;
}

.queue-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-title,
.queue-note-tag {
  display: inline-flex;
  min-width: 0;
}

.queue-note-tag {
  flex: 0 0 auto;
  max-width: 42%;
  padding: 7px 12px;
  border: 1px solid rgba(255, 200, 107, 0.22);
  border-radius: 999px;
  background: rgba(255, 200, 107, 0.12);
  color: var(--gold-2);
  font-size: 0.82rem;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-title-marquee {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, black 6%, black 94%, transparent 100%);
}

.queue-title-static {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1.18;
}

.queue-title-track {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 42px;
  padding-right: 42px;
  white-space: nowrap;
  animation: queueMarquee 13s linear infinite;
}

.queue-item:hover .queue-title-track,
.queue-main:focus-visible .queue-title-track {
  animation-play-state: paused;
}

.queue-title {
  display: inline-block;
  font-size: 1rem;
  line-height: 1.18;
}

.queue-title-ghost {
  opacity: 0.72;
}

.queue-mark {
  width: 26px;
  text-align: center;
  color: var(--mint-2);
  font-size: 1rem;
}

.queue-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.queue-tool {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.queue-tool:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.queue-tool svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-panel {
  padding: 18px;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 18px;
}

.stage-shell {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

.orbital-frame {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.disc-shadow,
.disc,
.pulse {
  position: absolute;
  border-radius: 50%;
}

.disc-shadow {
  inset: 10%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.42), transparent 70%);
  filter: blur(20px);
}

.disc {
  inset: 13%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 42% 35%, rgba(255, 255, 255, 0.14), transparent 22%),
    linear-gradient(135deg, rgba(255, 200, 107, 0.26), rgba(125, 225, 196, 0.1) 38%, rgba(255, 255, 255, 0.03) 100%),
    linear-gradient(180deg, rgba(36, 47, 69, 0.98), rgba(13, 19, 30, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 32px 86px rgba(0, 0, 0, 0.36);
}

.disc-ring,
.disc-core {
  position: absolute;
  inset: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.disc-ring-outer {
  width: 76%;
  height: 76%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.disc-ring-middle {
  width: 52%;
  height: 52%;
  border: 1px solid rgba(255, 200, 107, 0.18);
}

.disc-ring-inner {
  width: 28%;
  height: 28%;
  border: 1px solid rgba(125, 225, 196, 0.22);
}

.disc-core {
  width: 10%;
  height: 10%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 0 24px rgba(255, 200, 107, 0.55);
}

.needle {
  position: absolute;
  right: 16%;
  top: 16%;
  width: 34%;
  height: 34%;
  transform-origin: 8% 8%;
  transform: rotate(-18deg);
  transition: transform 260ms ease;
}

.needle-arm {
  position: absolute;
  left: 12%;
  top: 18%;
  width: 70%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.42), rgba(125, 225, 196, 0.22));
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}

.needle-head {
  position: absolute;
  right: 8%;
  top: 12%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.pulse {
  inset: 0;
  border: 1px solid rgba(125, 225, 196, 0.1);
  opacity: 0;
}

.pulse-a {
  animation: pulseLoop 4s linear infinite;
}

.pulse-b {
  animation: pulseLoop 4s linear 2s infinite;
}

.stage-shell.is-ready .pulse {
  opacity: 1;
}

.stage-shell.is-playing .disc {
  animation: spinDisc 7s linear infinite;
}

.stage-shell.is-playing .needle {
  transform: rotate(8deg);
}

.stage-shell.is-playing .disc-core {
  box-shadow: 0 0 24px rgba(125, 225, 196, 0.5);
}

.progress-shell {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
}

.progress-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--mint));
  box-shadow: 0 0 24px rgba(125, 225, 196, 0.25);
}

#progressBar {
  width: 100%;
  margin-top: -12px;
  opacity: 0;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
}

.icon-button:active {
  transform: scale(0.985);
}

.icon-button:disabled,
.queue-tool:disabled {
  opacity: 0.38;
  cursor: default;
  transform: none;
}

.icon-button-primary {
  background: linear-gradient(135deg, rgba(125, 225, 196, 0.28), rgba(183, 255, 215, 0.22));
  box-shadow: 0 12px 34px rgba(125, 225, 196, 0.18);
}

.icon-button-secondary {
  width: 70px;
  height: 70px;
}

.icon-button-large {
  width: 118px;
  height: 118px;
  border-radius: 34px;
}

.icon-button svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button-large svg {
  width: 48px;
  height: 48px;
}

.control-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding-bottom: 2px;
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

.toast {
  min-width: 240px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(13, 18, 28, 0.96);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

.toast.is-error {
  border-color: rgba(255, 178, 162, 0.4);
  color: #ffe1db;
}

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

@keyframes spinDisc {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseLoop {
  0% {
    transform: scale(0.78);
    opacity: 0;
  }

  18% {
    opacity: 0.3;
  }

  100% {
    transform: scale(1.16);
    opacity: 0;
  }
}

@keyframes queueMarquee {
  0% {
    transform: translateX(0);
  }

  12% {
    transform: translateX(0);
  }

  88% {
    transform: translateX(calc(-50% - 21px));
  }

  100% {
    transform: translateX(calc(-50% - 21px));
  }
}

@media (max-width: 920px) {
  .hud-shell {
    width: min(100%, 880px);
    aspect-ratio: auto;
    min-height: calc(100vh - 36px);
  }

  .hud-grid {
    grid-template-columns: 1fr;
  }

  .player-panel {
    min-height: 420px;
  }
}

@media (max-width: 720px) {
  :root {
    font-size: 16px;
  }

  .app-shell {
    padding: 10px;
  }

  .hud-shell {
    min-height: calc(100vh - 20px);
    padding: 14px;
    border-radius: 26px;
    gap: 14px;
  }

  .chrome-row {
    gap: 10px;
  }

  .utility-row {
    gap: 8px;
  }

  .status-strip {
    padding: 10px 12px;
  }

  .icon-button {
    width: 66px;
    height: 66px;
    border-radius: 20px;
  }

  .icon-button-secondary {
    width: 62px;
    height: 62px;
  }

  .icon-button-large {
    width: 102px;
    height: 102px;
    border-radius: 30px;
  }

  .icon-button svg {
    width: 30px;
    height: 30px;
  }

  .icon-button-large svg {
    width: 42px;
    height: 42px;
  }

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

  #sourceButton {
    width: 100%;
    min-height: 82px;
  }

  .composer-field {
    min-height: 70px;
  }

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

  .queue-tools {
    justify-content: flex-end;
  }

  .control-row {
    gap: 12px;
    flex-wrap: wrap;
  }
}
