:root {
  /* Paleta oficial extraída de logo_6.png (Radio La Voz Celestial) */
  --color-oficial: #1B8A1E;
  --color-oficial-oscuro: #115E14;
  --color-secundario: #B6E116;
  --color-acento-dorado: #FACC15;
  --color-texto: #FFFFFF;
  --color-texto-suave: rgba(255, 255, 255, 0.88);
  --color-superficie: rgba(14, 42, 16, 0.76);
  --color-borde-sutil: rgba(255, 255, 255, 0.22);
}

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

html,
body {
  height: 100%;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #091d0b;
  color: var(--color-texto);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

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

/* Contenedor principal responsivo */
.app-shell {
  width: 100%;
  max-width: 460px;
  height: 100dvh;
  max-height: 920px;
  display: flex;
  flex-direction: column;
  background-color: #0e2c11;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.85);
}

@media (min-width: 500px) {
  .app-shell {
    height: 94dvh;
    border-radius: 24px;
    border: 1px solid var(--color-borde-sutil);
  }
}

/* 1. Borde superior con el color oficial extraído del logo */
.top-brand-border {
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--color-oficial) 0%, var(--color-secundario) 50%, var(--color-oficial) 100%);
  flex-shrink: 0;
  z-index: 10;
}

/* 2. Barra superior (Header) */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(14, 44, 17, 0.95);
  border-bottom: 1px solid var(--color-borde-sutil);
  flex-shrink: 0;
  z-index: 10;
}

.station-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #6b7280;
  flex-shrink: 0;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.live-dot.is-playing {
  background-color: #a3e635;
  box-shadow: 0 0 10px #a3e635;
}

.station-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, var(--color-oficial), var(--color-oficial-oscuro));
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(27, 138, 30, 0.55);
  transition: transform 0.15s ease, filter 0.2s ease;
}

.install-btn:hover {
  filter: brightness(1.12);
}

.install-btn:active {
  transform: scale(0.96);
}

.install-btn.hidden {
  display: none !important;
}

/* 3. Área central con imagen de fondo (fondo.png) vinculada correctamente desde /css/ */
.center-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image: url('../assets/fondo.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.stage-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 30, 12, 0.34) 0%,
    rgba(27, 138, 30, 0.22) 45%,
    rgba(9, 29, 11, 0.76) 100%
  );
  pointer-events: none;
  z-index: 1;
}

.stage-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 14px 18px 12px;
  text-align: center;
}

/* Logo circular destacado */
.logo-ring {
  width: 152px;
  height: 152px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--color-oficial), var(--color-secundario), var(--color-acento-dorado));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.logo-ring.is-playing {
  box-shadow: 0 0 30px rgba(182, 225, 22, 0.75), 0 0 18px rgba(27, 138, 30, 0.65);
}

.station-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background-color: #ffffff;
  padding: 6px;
}

/* Visualizador de ondas de audio */
.visualizer-wrap {
  width: 100%;
  max-width: 340px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#waveCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Visor de metadatos */
.metadata-card {
  width: 100%;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--color-superficie);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-borde-sutil);
}

.metadata-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: 999px;
  background-color: rgba(182, 225, 22, 0.25);
  color: var(--color-secundario);
  border: 1px solid rgba(182, 225, 22, 0.55);
  margin-bottom: 5px;
}

.track-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.78rem;
  color: var(--color-texto-suave);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4. Controles del reproductor (On/Off y Volumen) */
.player-controls {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 6px 10px;
}

.play-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, var(--color-oficial), var(--color-oficial-oscuro));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(27, 138, 30, 0.65);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(182, 225, 22, 0.75);
}

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

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

.volume-control {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-superficie);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--color-borde-sutil);
  padding: 10px 14px;
  border-radius: 999px;
}

.mute-btn {
  background: none;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-secundario);
  border: 2px solid #ffffff;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-secundario);
  border: 2px solid #ffffff;
  cursor: pointer;
}

/* 5. Barra de redes sociales */
.social-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 4px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-superficie);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--color-borde-sutil);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.social-link:hover {
  transform: translateY(-2px);
  background-color: var(--color-oficial);
  border-color: var(--color-secundario);
}

/* 6. Pie de página */
.app-footer {
  padding: 10px 14px;
  text-align: center;
  background: rgba(14, 44, 17, 0.96);
  border-top: 1px solid var(--color-borde-sutil);
  flex-shrink: 0;
  z-index: 10;
}

.app-footer a {
  font-size: 0.76rem;
  color: var(--color-texto-suave);
  text-decoration: none;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--color-secundario);
  text-decoration: underline;
}

/* Modal de instalación */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  background: #115e14;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 4px solid var(--color-secundario);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-texto-suave);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 18px;
}

.modal-body ol {
  padding-left: 20px;
  margin-top: 8px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-ok-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--color-oficial);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.hidden {
  display: none !important;
}
