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

:root {
  --accent: #22d3ee;
  --accent-dim: rgba(34, 211, 238, 0.15);
  --accent-border: rgba(34, 211, 238, 0.25);
  --bg: #050a0f;
  --bg-card: rgba(15, 25, 35, 0.85);
  --text: #cbd5e1;
  --text-bright: #ffffff;
  --text-muted: #64748b;
}

html {
  background: var(--bg);
}

html, body {
  height: 100%;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 0.5rem 2rem 2rem 2rem;
  background: transparent;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(34,211,238,0.08) 0%, transparent 70%);
  position: relative;
}

.player-wrap {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  margin-top: 1rem; /* Pequena margem apenas para não colar na borda */
  z-index: 1;
}

.player-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 80px rgba(34,211,238,0.1), 0 8px 40px rgba(0,0,0,0.6);
}

.brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--accent-border);
}

.logo-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-wrapper .footer-link {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.logo-glow {
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0.5;
  border-radius: 50%;
  animation: pulse 2s infinite;
  filter: blur(30px);
  transform: scale(1.15);
}

.logo-glow.pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.logo-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-label {
  font-family: 'Inter', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-bright);
  background: linear-gradient(135deg, var(--accent) 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent); }
  50%       { opacity: 0.4; box-shadow: none; }
}

.now-playing {
  margin-bottom: 2rem;
  min-height: auto;
}

.np-artist {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1.25rem;
  padding: 1.25rem 1rem;
  background: rgba(30, 200, 280, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 0.75rem;
  backdrop-filter: blur(100px); /* Aumentado para melhor legibilidade */
  height: 6.5rem;
}

.np-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
}

.np-title-label {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.2rem, 5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-bright);
  line-height: 1.3;
  word-break: break-word;
  overflow: hidden;
}

.np-artist-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
  line-height: 1.3;
  word-break: break-word;
  overflow: hidden;
}

.np-idle {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
}

#visualizer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background: var(--bg);
}

.btn-viz {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
  outline: none;
}

.btn-viz:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}

.btn-viz.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.3);
}

.btn-viz svg { width: 22px; height: 22px; stroke: currentColor; }

.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px; /* Mantém a altura fixa mesmo sem volume */
}

.btn-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  outline: none;
}

.btn-play:hover {
  background: rgba(34,211,238,0.25);
  box-shadow: 0 0 20px rgba(34,211,238,0.3);
}

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

.btn-play svg { width: 28px; height: 28px; fill: currentColor; }

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

/* Esconde o volume no iOS mantendo o alinhamento do botão play */
body.is-ios .volume-wrap {
  display: none;
}

.vol-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.vol-icon svg { width: 16px; height: 16px; fill: currentColor; display: block; }

input[type=range] {
  -webkit-appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--accent-border);
  outline: none;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(34,211,238,0.6);
  cursor: pointer;
}

input[type=range]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.listeners {
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  min-height: 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text);
  letter-spacing: 0.05em;
  text-align: center;
}

.listeners span { color: var(--accent); }

.footer-link {
  display: block;
  text-align: center;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.footer-link:hover { color: var(--accent); }

.led-panel {
  margin-top: 1.75rem;
  background: #000;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  overflow: hidden;
  position: relative;
  height: 2.5rem;
  border: 1px solid #0a4a4a;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(34, 211, 238, 0.05);
  display: flex;
  align-items: center;
}

.led-text {
  white-space: nowrap;
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 20px rgba(34, 211, 238, 0.6);
  animation: led-scroll linear infinite;
  padding-left: 100%;
}

@keyframes led-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
