:root {
  --bg: #0f1020;
  --card: #1a1b33;
  --line: #2c2e52;
  --text: #f1f1f8;
  --muted: #9a9cc0;
  --accent-a: #ff6ec4;
  --accent-b: #7873f5;
  --danger: #ff7a8a;
  --value: 70%;
}

* {
  box-sizing: border-box;
}

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

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 100vh;
  padding: 24px 16px;
  background: radial-gradient(circle at 20% 0%, #2a1c4a 0%, transparent 55%),
    radial-gradient(circle at 100% 100%, #1b2a55 0%, transparent 50%), var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 20px 60px rgb(0 0 0 / 40%);
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: url("/favicon.svg") center / 60% no-repeat, linear-gradient(135deg, var(--accent-a), var(--accent-b));
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
}

.status {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.ok {
  color: #7ee2a8;
}

section {
  margin-top: 24px;
}

button {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.2s ease;
}

button:hover {
  filter: brightness(1.08);
}

button:active {
  transform: scale(0.98);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-a);
  outline-offset: 3px;
}

button.secondary {
  margin-top: 12px;
  background: var(--line);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.now {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgb(255 255 255 / 4%);
}

.track {
  min-width: 0;
}

.track p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title {
  font-weight: 600;
}

.artist,
.license {
  color: var(--muted);
  font-size: 0.9rem;
}

.license:empty {
  display: none;
}

.bars {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 3px;
  width: 28px;
  height: 28px;
}

.bars span {
  flex: 1;
  height: 20%;
  border-radius: 2px;
  background: linear-gradient(var(--accent-a), var(--accent-b));
}

.bars.playing span {
  animation: level 0.9s ease-in-out infinite;
}

.bars.playing span:nth-child(2) {
  animation-delay: -0.3s;
}

.bars.playing span:nth-child(3) {
  animation-delay: -0.6s;
}

.bars.playing span:nth-child(4) {
  animation-delay: -0.15s;
}

@keyframes level {
  0%,
  100% {
    height: 20%;
  }
  50% {
    height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bars.playing span {
    animation: none;
    height: 70%;
  }
}

.volume {
  display: grid;
  grid-template-columns: auto 1fr 3.5em;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.volume output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-a), var(--accent-b)) 0 / var(--value) 100% no-repeat, var(--line);
  appearance: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.problem p {
  margin: 0;
  color: var(--danger);
}

footer {
  max-width: 420px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.8;
}

[hidden] {
  display: none !important;
}
