*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #14141f;
  --bg-card-border: #1e1e2e;
  --text: #e0e0e8;
  --text-dim: #6b6b80;
  --accent: #00b0ff;
  --accent-dim: rgba(0, 176, 255, 0.15);
  --accent-glow: rgba(0, 176, 255, 0.3);
  --danger: #ff5252;
  --radius: 16px;
  --radius-sm: 10px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Header */
.header {
  padding: 24px 0 8px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-img {
  max-width: 220px;
  height: auto;
}

/* Main */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  padding: 8px 0 20px;
}

/* Player Card */
.player-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  position: relative;
  padding-top: 60px;
}

.card-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 10px 24px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-dim);
  border-bottom: 1px solid var(--bg-card-border);
  border-radius: var(--radius) var(--radius) 0 0;
}

/* Status Block */
.status-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Listeners */
.listeners {
  display: flex;
  align-items: center;
  gap: 6px;
}

.listeners-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
}

.listeners-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* Status */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background 0.3s;
}

.status.live .status-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  animation: pulse 1.5s ease-in-out infinite;
}

.status.live {
  color: var(--accent);
}

.status.error .status-dot {
  background: var(--danger);
}

.status.error {
  color: var(--danger);
}

.status.buffering .status-dot {
  background: #ffc107;
  animation: pulse 0.8s ease-in-out infinite;
}

.status.buffering {
  color: #ffc107;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Play Button */
.play-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.play-btn:hover {
  background: rgba(0, 176, 255, 0.25);
  transform: scale(1.05);
}

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

.play-btn.playing {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 30px var(--accent-glow), 0 0 60px rgba(0, 176, 255, 0.1);
}

.hidden {
  display: none !important;
}

/* Controls */
.controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.balance-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-buttons {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.balance-btn {
  flex: 1;
  padding: 12px 6px;
  border: 2px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.balance-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.balance-btn:active {
  transform: scale(0.95);
}

.balance-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.slider-value {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}

/* Range Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-card-border);
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s;
}

.slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
  cursor: pointer;
}

.slider-balance {
  flex: 1;
}

/* Install Button */
.install-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.install-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Responsive */
@media (min-width: 600px) {
  .app {
    justify-content: center;
  }

  .player-card {
    padding: 40px 32px;
  }
}
