/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:       #f59e0b;
  --gold-dark:  #d97706;
  --gold-light: #fcd34d;
  --glow:       rgba(245, 158, 11, 0.28);
  --bg:         #080b14;
  --card:       rgba(255,255,255,0.04);
  --border:     rgba(255,255,255,0.07);
  --text:       #f1f5f9;
  --sub:        #64748b;
  --radius:     28px;
}

html { height: 100%; font-size: 16px; }

body {
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ============================================================
   ANIMATED BACKGROUND
   ============================================================ */
.backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  /* Layered: dark tint + photo background (place fondo.jpg in this folder) */
  background:
    linear-gradient(rgba(8, 11, 20, 0.80), rgba(8, 11, 20, 0.80)),
    url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR585x7oLBdXW0sg6ah26Gcxn6QyJy1gW0rh6h1REq8EO4VXbyCi-zZgVg&s=10') center / cover no-repeat,
    #080b14;
}

.sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: float 20s ease-in-out infinite alternate;
}

.s1 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #d97706 0%, transparent 70%);
  top: -160px; left: -160px;
  animation-duration: 22s;
}
.s2 {
  width: 360px; height: 360px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  bottom: -100px; right: -100px;
  animation-duration: 26s;
  animation-delay: -8s;
  opacity: 0.35;
}
.s3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #0ea5e9 0%, transparent 70%);
  top: 50%; left: 60%;
  animation-duration: 18s;
  animation-delay: -4s;
  opacity: 0.22;
}

@keyframes float {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(60px, -40px) scale(1.05); }
  66%  { transform: translate(-30px, 50px) scale(0.97); }
  100% { transform: translate(40px, 20px) scale(1.03); }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem env(safe-area-inset-bottom);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--gold);
}

.topbar-live {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--sub);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  transition: color 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.topbar-live.active {
  color: var(--gold);
  border-color: rgba(245,158,11,0.4);
  box-shadow: 0 0 14px rgba(245,158,11,0.15);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sub);
  flex-shrink: 0;
  transition: background 0.4s;
}

.topbar-live.active .pulse-dot {
  background: var(--gold);
  animation: blink 1.4s ease-in-out infinite;
}

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

/* ============================================================
   PLAYER SECTION
   ============================================================ */
.player {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 2rem 0 1.5rem;
}

/* ============================================================
   VINYL
   ============================================================ */
.vinyl-stage {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Tone arm */
.vinyl-arm {
  position: absolute;
  top: -10px;
  right: -32px;
  width: 6px;
  height: 110px;
  background: linear-gradient(to bottom, #94a3b8, #475569);
  border-radius: 3px;
  transform-origin: top center;
  transform: rotate(28deg);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.vinyl-arm::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(15deg);
  width: 14px;
  height: 14px;
  background: #334155;
  border-radius: 2px;
}

.vinyl-arm::after {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #94a3b8, #475569);
  border-radius: 50%;
}

.vinyl-arm.playing {
  transform: rotate(18deg);
}

/* Glow behind vinyl */
.vinyl-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-dark) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.6s ease;
  filter: blur(30px);
}

.vinyl-glow.active {
  opacity: 0.5;
}

/* The disc */
.vinyl {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  animation: none;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.7),
    0 0 0 2px rgba(255,255,255,0.06);
  background:
    repeating-radial-gradient(
      circle at center,
      transparent 0px,
      transparent 5px,
      rgba(0,0,0,0.35) 5px,
      rgba(0,0,0,0.35) 6px
    ),
    radial-gradient(circle at 38% 35%, #1e2035, #06070e);
}

.vinyl.spinning {
  animation: spin 2.4s linear infinite;
}

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

.vinyl-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at center,
      transparent 0px,
      transparent 8px,
      rgba(255,255,255,0.03) 8px,
      rgba(255,255,255,0.03) 9px
    );
}

.vinyl-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.vinyl-label::before {
  content: '';
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #d97706, #f59e0b, #fcd34d, #f59e0b, #d97706);
  box-shadow: 0 0 20px rgba(245,158,11,0.4);
}

.label-text {
  position: relative;
  z-index: 1;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.05rem;
  color: #0a0600;
  letter-spacing: 0.12em;
}

.label-pin {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0a0600;
}

.vinyl-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 55%);
  pointer-events: none;
}

/* ============================================================
   INFO BLOCK
   ============================================================ */
.info-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.station-name {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.station-sub {
  font-size: 0.82rem;
  color: var(--sub);
  letter-spacing: 0.08em;
  font-weight: 400;
  text-transform: uppercase;
}

/* ============================================================
   CANVAS VISUALIZER
   ============================================================ */
.visualizer {
  width: 100%;
  max-width: 380px;
  height: 56px;
  display: block;
  border-radius: 12px;
}

/* ============================================================
   CONTROLS
   ============================================================ */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
}

/* Icon buttons (mute, etc.) */
.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon:hover {
  color: var(--text);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

/* Play button */
.play-btn {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #080b14;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow:
    0 6px 24px rgba(245,158,11,0.4),
    0 2px 8px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, box-shadow 0.3s ease;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow:
    0 10px 36px rgba(245,158,11,0.55),
    0 2px 8px rgba(0,0,0,0.5);
}

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

.play-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(245,158,11,0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.play-btn.playing .play-ring {
  opacity: 1;
  animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%       { transform: scale(1.12); opacity: 0.2; }
}

.ic { width: 30px; height: 30px; }

/* Spinner */
.spin { animation: spinner 0.8s linear infinite; }
@keyframes spinner { to { transform: rotate(360deg); } }

/* Volume group */
.vol-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-width: 180px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: rgba(255,255,255,0.1);
  background-image: linear-gradient(var(--gold), var(--gold));
  background-size: 80% 100%;
  background-repeat: no-repeat;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245,158,11,0.55);
  transition: transform 0.15s;
}
.vol-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }

.vol-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(245,158,11,0.55);
}

.vol-pct {
  font-size: 0.7rem;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ============================================================
   STATUS TEXT
   ============================================================ */
.status-text {
  font-size: 0.8rem;
  color: var(--sub);
  text-align: center;
  letter-spacing: 0.03em;
  min-height: 1.2em;
  transition: color 0.3s;
}
.status-text.error { color: #f87171; }
.status-text.ok    { color: var(--gold); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
  font-size: 0.7rem;
  color: rgba(100,116,139,0.5);
  text-align: center;
  letter-spacing: 0.04em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 380px) {
  .vinyl, .vinyl-stage { width: 190px; height: 190px; }
  .vinyl-label::before { width: 76px; height: 76px; }
  .station-name { font-size: 1.65rem; }
  .play-btn { width: 70px; height: 70px; }
  .controls { gap: 0.9rem; }
  .vol-group { max-width: 150px; }
}

@media (min-height: 800px) {
  .player { gap: 2rem; padding-top: 2.5rem; }
  .vinyl-stage { width: 260px; height: 260px; }
  .vinyl { width: 240px; height: 240px; }
  .vinyl-arm { height: 120px; }
}
