:root {
  --bg-top: #0d1119;
  --bg-bottom: #070a11;
  --panel: rgba(12, 17, 27, 0.88);
  --line: rgba(255, 255, 255, 0.09);
  --text: #edf3ff;
  --muted: rgba(237, 243, 255, 0.6);
  --mint: #7de1c4;
  --mint-2: #b7ffd7;
  --gold: #ffc86b;
  --gold-2: #ffe1a3;
  --rose: #ffb2a2;
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 12%, rgba(125, 225, 196, 0.16), transparent 18%),
    radial-gradient(circle at 84% 20%, rgba(255, 200, 107, 0.14), 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;
}

.app-shell {
  min-height: 100vh;
  padding: 16px;
}

.hud-shell,
.source-dock,
.icon-button,
.progress-shell,
.status-strip {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hud-shell {
  position: relative;
  max-width: 860px;
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(17, 22, 33, 0.92), rgba(8, 12, 20, 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 auto 1fr auto auto;
  gap: 16px;
  overflow: hidden;
}

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

.hud-shell::before {
  top: -90px;
  left: -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(125, 225, 196, 0.18), transparent 70%);
  filter: blur(10px);
}

.hud-shell::after {
  right: -100px;
  bottom: -110px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255, 200, 107, 0.12), transparent 70%);
  filter: blur(8px);
}

.status-strip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 14px;
  height: 14px;
  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 16px rgba(125, 225, 196, 0.65);
  opacity: 1;
}

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

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

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

.source-dock {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 66px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.source-dock input {
  min-height: 66px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.source-dock input:focus {
  outline: none;
  border-color: rgba(125, 225, 196, 0.42);
  box-shadow: 0 0 0 3px rgba(125, 225, 196, 0.12);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  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;
}

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

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

.icon-button-primary {
  background: linear-gradient(135deg, rgba(125, 225, 196, 0.26), rgba(183, 255, 215, 0.2));
  box-shadow: 0 10px 30px rgba(125, 225, 196, 0.16);
}

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

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

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

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

.orbital-frame {
  position: relative;
  width: min(54vw, 360px);
  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(18px);
}

.disc {
  inset: 13%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 42% 35%, rgba(255, 255, 255, 0.12), transparent 22%),
    linear-gradient(135deg, rgba(255, 200, 107, 0.24), rgba(125, 225, 196, 0.08) 35%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(180deg, rgba(33, 43, 63, 0.98), rgba(12, 17, 27, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 30px 80px 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 22px 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: 10px;
  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: 24px;
  height: 24px;
  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 .disc {
  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.12) 38%, rgba(255, 255, 255, 0.03) 100%),
    linear-gradient(180deg, rgba(36, 47, 69, 0.98), rgba(13, 19, 30, 0.98));
}

.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 {
  position: relative;
  z-index: 1;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.progress-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  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 22px rgba(125, 225, 196, 0.25);
}

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

.control-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding-bottom: 2px;
}

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

.toast {
  min-width: 220px;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 16px;
  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;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 10px;
  }

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

  .source-dock {
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    padding: 8px;
  }

  .icon-button {
    width: 58px;
    height: 58px;
  }

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

  .stage-shell {
    min-height: 240px;
  }

  .orbital-frame {
    width: min(72vw, 320px);
  }

  .control-row {
    gap: 14px;
  }
}
