:root {
  color-scheme: light dark;

  --bg-0: #f8f6f5;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-bg-2: rgba(255, 255, 255, 0.5);
  --card-border: rgba(20, 15, 30, 0.08);
  --card-shadow: 0 20px 50px rgba(20, 15, 20, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  --pill-bg: rgba(20, 15, 30, 0.05);
  --text: #17131f;
  --text-dim: #6e6a80;
  --red: #ff0016;
  --red-2: #ff4d3d;
  --red-deep: #b8000f;
  --navy: #020088;
  --navy-2: #2f1ecf;
  --live: #ff0016;
  --accent-text: #b8000f;
  --connecting: #8a5a00;
  --connecting-dot: #f5b942;
  --offline: #a8a4b8;
  --logo-shadow: 0 16px 40px rgba(255, 0, 22, 0.28), 0 4px 14px rgba(20, 15, 30, 0.18);
  --glow-opacity-red: 0.16;
  --glow-opacity-navy: 0.14;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-0: #060512;
    --card-bg: rgba(255, 255, 255, 0.045);
    --card-bg-2: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.09);
    --card-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    --pill-bg: rgba(255, 255, 255, 0.05);
    --text: #f5f4fa;
    --text-dim: #9c98b5;
    --live: #ff0016;
    --accent-text: #ff4d3d;
    --connecting: #f5b942;
    --connecting-dot: #f5b942;
    --offline: #6f6b8a;
    --logo-shadow: 0 16px 40px rgba(255, 0, 22, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4);
    --glow-opacity-red: 0.55;
    --glow-opacity-navy: 0.5;
  }
}

:root[data-theme="dark"] {
  --bg-0: #060512;
  --card-bg: rgba(255, 255, 255, 0.045);
  --card-bg-2: rgba(255, 255, 255, 0.02);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --pill-bg: rgba(255, 255, 255, 0.05);
  --text: #f5f4fa;
  --text-dim: #9c98b5;
  --live: #ff0016;
  --accent-text: #ff4d3d;
  --connecting: #f5b942;
  --connecting-dot: #f5b942;
  --offline: #6f6b8a;
  --logo-shadow: 0 16px 40px rgba(255, 0, 22, 0.35), 0 4px 14px rgba(0, 0, 0, 0.4);
  --glow-opacity-red: 0.55;
  --glow-opacity-navy: 0.5;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  transition: background 0.2s ease, color 0.2s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.glow-red {
  width: 520px;
  height: 520px;
  top: -160px;
  left: -140px;
  background: radial-gradient(circle, var(--red) 0%, transparent 70%);
  opacity: var(--glow-opacity-red);
}

.glow-navy {
  width: 620px;
  height: 620px;
  bottom: -220px;
  right: -180px;
  background: radial-gradient(circle, var(--navy-2) 0%, transparent 70%);
  opacity: var(--glow-opacity-navy);
}

.theme-switch {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theme-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.theme-btn svg {
  width: 16px;
  height: 16px;
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
}

.card {
  width: 100%;
  max-width: 400px;
  background: linear-gradient(180deg, var(--card-bg), var(--card-bg-2));
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 44px 34px 36px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.logo-frame {
  width: 128px;
  height: 128px;
  border-radius: 26px;
  background: #fff;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--logo-shadow);
  margin-bottom: 6px;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.tagline {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--card-border);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 30px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--offline);
  flex-shrink: 0;
}

.status[data-state="live"] .status-dot {
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255, 0, 22, 0.6);
  animation: pulse 1.6s infinite;
}

.status[data-state="live"] .status-text {
  color: var(--accent-text);
}

.status[data-state="connecting"] .status-dot {
  background: var(--connecting-dot);
  animation: blink 1s infinite;
}

.status[data-state="connecting"] .status-text {
  color: var(--connecting);
}

.status[data-state="error"] .status-dot {
  background: var(--offline);
}

.status[data-state="error"] .status-text {
  color: var(--text-dim);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 22, 0.55); }
  70% { box-shadow: 0 0 0 9px rgba(255, 0, 22, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 22, 0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.play-btn {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--red), var(--red-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(255, 0, 22, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-btn-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 0, 22, 0.35);
  pointer-events: none;
}

.play-btn:hover {
  transform: scale(1.045);
  box-shadow: 0 16px 40px rgba(255, 0, 22, 0.5);
}

.play-btn:active {
  transform: scale(0.97);
}

.play-btn svg {
  width: 36px;
  height: 36px;
}

.play-btn svg.icon-hidden {
  display: none;
}

.play-btn #iconPlay {
  margin-left: 4px;
}

.spin {
  animation: spin 0.9s linear infinite;
}

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

.bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
  margin-top: 22px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bars.active {
  opacity: 1;
}

.bars span {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--red-2), var(--red));
  animation: bar 1.1s ease-in-out infinite;
  height: 6px;
}

.bars.active span {
  height: auto;
}

.bars span:nth-child(1) { animation-delay: 0s; }
.bars span:nth-child(2) { animation-delay: 0.15s; }
.bars span:nth-child(3) { animation-delay: 0.3s; }
.bars span:nth-child(4) { animation-delay: 0.1s; }
.bars span:nth-child(5) { animation-delay: 0.25s; }

@keyframes bar {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

.volume {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 26px;
  color: var(--text-dim);
}

.vol-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.volume input[type="range"] {
  flex: 1;
  accent-color: var(--red);
  cursor: pointer;
}

.hint {
  margin: 20px 0 0;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-height: 1.2em;
}

.retry-btn {
  margin-top: 12px;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 0, 22, 0.3);
  background: rgba(255, 0, 22, 0.08);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.retry-btn:hover {
  background: rgba(255, 0, 22, 0.16);
  border-color: rgba(255, 0, 22, 0.5);
}

.footer {
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  margin: 0;
  text-transform: uppercase;
}

.footer .dot {
  opacity: 0.5;
  margin: 0 2px;
}

@media (max-width: 420px) {
  .card {
    padding: 36px 24px 30px;
  }
}
