/* ==================================================================
   RADIO GRACIA Y PAZ — Estilo "Consola Radial"
   ================================================================== */

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

:root {
  --bg: #0c0608;
  --panel: #1a0e14;
  --panel-2: #22131a;
  --coral: #ff5a5f;
  --coral-bright: #ff7b7f;
  --amber: #f5a623;
  --amber-bright: #ffc04d;
  --cyan: #4dd0e1;
  --text: #f5ebe0;
  --text-dim: #8a7a72;
  --text-soft: #c8b8ab;
  --border: rgba(245, 166, 35, 0.15);
  --border-hi: rgba(245, 166, 35, 0.4);
  --mono: 'SF Mono', Consolas, Monaco, 'Courier New', monospace;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-x: hidden;
  position: relative;
}

/* ---- FONDO ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(245, 166, 35, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 166, 35, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 80%);
}
.bg-lights { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.light {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: lightMove 25s ease-in-out infinite;
}
.light-1 { width: 500px; height: 500px; background: radial-gradient(circle, #ff5a5f, transparent 70%); top: -180px; left: -150px; }
.light-2 { width: 400px; height: 400px; background: radial-gradient(circle, #f5a623, transparent 70%); bottom: -150px; right: -120px; animation-delay: -8s; }
.light-3 { width: 350px; height: 350px; background: radial-gradient(circle, #4dd0e1, transparent 70%); top: 50%; left: 60%; opacity: 0.15; animation-delay: -16s; }
@keyframes lightMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(50px, -40px) scale(1.1); }
}

/* ---- BOTÓN INSTALAR ---- */
.btn-install {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  color: #1a0e14;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 6px 25px rgba(255, 90, 95, 0.4);
  transition: all 0.25s ease;
  animation: installPulse 2.4s ease-in-out infinite;
}
.btn-install:hover { transform: translateY(-2px); }
@keyframes installPulse {
  0%, 100% { box-shadow: 0 6px 25px rgba(255,90,95,.4), 0 0 0 0 rgba(255,90,95,.5); }
  50%      { box-shadow: 0 6px 25px rgba(255,90,95,.4), 0 0 0 10px rgba(255,90,95,0); }
}

/* 🛡️ Forzar ocultamiento del botón si ya estamos en la app instalada (CSS a prueba de fallos) */
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
  .btn-install {
    display: none !important;
  }
}

/* ════════ CONSOLA ════════ */
.console {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 900px;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 2px 0 rgba(255, 200, 130, 0.1) inset,
    0 -2px 0 rgba(0, 0, 0, 0.5) inset;
  overflow: hidden;
}

/* ---- TOP BAR ---- */
.console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.1));
  border-bottom: 1px solid var(--border);
}
.brand-tag { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-tag img {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid var(--border-hi);
  background: #000;
}
.brand-tag strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--amber-bright);
  white-space: nowrap;
}
.brand-tag small {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-top: 2px;
}

.status-bar { display: flex; align-items: center; gap: 14px; }
.status-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-soft);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}
.led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4a1a1a;
  box-shadow: inset 0 0 4px #000;
  transition: all 0.3s;
}
.led.on {
  background: #ff2d2d;
  box-shadow: 0 0 10px #ff2d2d, 0 0 20px rgba(255,45,45,0.5);
  animation: ledPulse 1.4s ease-in-out infinite;
}
@keyframes ledPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ---- BODY ---- */
.console-body {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  border-bottom: 1px solid var(--border);
}

/* ▓ ZONA INFO ▓ */
.zone-info {
  padding: 22px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.track-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--coral);
  margin-bottom: 8px;
}
.track-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}
.track-artist {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--amber);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spectrum {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  box-shadow: inset 0 0 20px rgba(255, 90, 95, 0.08);
}
.spec-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
#waveform { width: 100%; height: 48px; display: block; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}
.stat-value {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--amber-bright);
  letter-spacing: 1px;
  line-height: 1;
}
.stat-unit {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.stat--whatsapp {
  padding: 0;
  background: transparent;
  border: none;
}
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 1px;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
  transition: all 0.25s ease;
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}
.btn-whatsapp:active {
  transform: scale(0.96);
}

/* ▓ ZONA DIAL ▓ */
.zone-dial {
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-right: 1px solid var(--border);
  background: radial-gradient(circle at center, rgba(255,90,95,0.05), transparent 70%);
}
.dial {
  position: relative;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #2a1a20, #0a0608 70%);
  border: 3px solid rgba(0, 0, 0, 0.6);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.7),
    0 0 0 1px var(--border) inset,
    0 0 60px rgba(255, 90, 95, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.dial-inner {
  width: 130px; height: 130px;
  border-radius: 50%;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 0 0 3px rgba(245, 166, 35, 0.4),
    0 0 0 6px rgba(0, 0, 0, 0.6),
    inset 0 0 30px #000;
  animation: discSpin 30s linear infinite paused;
}
.console.playing .dial-inner { animation-play-state: running; }
@keyframes discSpin { 100% { transform: rotate(360deg); } }
.dial-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.dial-ticks { position: absolute; inset: 0; pointer-events: none; }
.tick {
  position: absolute;
  top: 50%; left: 50%;
  width: 2px; height: 8px;
  background: var(--text-dim);
  transform-origin: center;
  border-radius: 1px;
}
.tick.major {
  width: 2px; height: 12px;
  background: var(--amber);
  box-shadow: 0 0 4px rgba(245, 166, 35, 0.6);
}

.dial-needle {
  position: absolute;
  top: 8px; left: 50%;
  width: 3px; height: 16px;
  background: linear-gradient(to bottom, var(--coral), #8b0000);
  border-radius: 2px;
  transform: translateX(-50%) rotate(0deg);
  transform-origin: 50% 105px;
  box-shadow: 0 0 10px rgba(255, 90, 95, 0.8);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3;
}

.dial-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.dial-caption-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

/* ▓ ZONA CONTROLES ▓ */
.zone-controls {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.controls-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.btn-power {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 16px;
  background: linear-gradient(180deg, #2c1a1c 0%, #1a0e10 100%);
  border: 2px solid var(--border-hi);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  box-shadow:
    0 6px 0 rgba(0, 0, 0, 0.4),
    0 8px 25px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: all 0.2s ease;
}
.btn-power:hover { border-color: var(--coral); }
.btn-power:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(0,0,0,0.4), 0 4px 15px rgba(0,0,0,0.4);
}
.btn-power svg {
  width: 32px; height: 32px;
  fill: var(--amber);
  transition: fill 0.3s;
}
.btn-power.playing {
  border-color: var(--coral);
  background: linear-gradient(180deg, #3c1a1e 0%, #200e10 100%);
}
.btn-power.playing svg { fill: var(--coral-bright); filter: drop-shadow(0 0 8px var(--coral)); }
.power-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-soft);
}
.btn-power.playing .power-label { color: var(--coral-bright); }
.btn-power .spinner {
  position: absolute;
  width: 44px; height: 44px;
  border: 3px solid transparent;
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  display: none;
}
.btn-power.loading .spinner { display: block; }
.btn-power.loading svg { opacity: 0.2; }
@keyframes spin { 100% { transform: rotate(360deg); } }

.ctl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ctl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--mono);
}
.ctl-btn span { font-size: 0.55rem; letter-spacing: 1.5px; font-weight: 700; }
.ctl-btn:hover { border-color: var(--amber); color: var(--amber-bright); }
.ctl-btn:active { transform: scale(0.95); }
.ctl-btn.muted { color: var(--coral); border-color: var(--coral); }

.vol-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 8px;
  opacity: 0.4;
  transition: opacity 0.3s, border-color 0.3s;
}
.vol-slider.active { opacity: 1; border-color: var(--amber); }
.vol-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  background: rgba(245, 166, 35, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.vol-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--amber-bright), var(--amber));
  cursor: pointer;
  box-shadow: 0 0 8px rgba(245, 166, 35, 0.6);
}
.vol-slider input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border: none;
  border-radius: 2px;
  background: var(--amber);
  cursor: pointer;
}
.vol-value {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--amber-bright);
  min-width: 28px;
  text-align: right;
}

/* ---- BOTTOM ---- */
.console-bottom {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verse-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-left: 3px solid var(--coral);
  border-radius: 6px;
  overflow: hidden;
}
.verse-icon {
  font-size: 1.3rem;
  color: var(--coral);
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(255, 90, 95, 0.5);
}
.verse-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 1.4em;
}
.verse-scroll p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-soft);
  white-space: nowrap;
  animation: scrollVerse 38s linear infinite;
  position: absolute;
  top: 0;
  left: 100%;
  padding-left: 100%;
}
@keyframes scrollVerse {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-200%); }
}
.verse-ref {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--amber);
  flex-shrink: 0;
  white-space: nowrap;
}

.credits-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.68rem;
}
.ksm {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-dim);
  transition: color 0.25s;
}
.ksm:hover { color: var(--amber); }
.ksm img { height: 20px; width: auto; object-fit: contain; opacity: 0.85; }
.ksm span { font-family: var(--mono); font-weight: 600; letter-spacing: 0.5px; }
.wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 1px;
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.25s ease;
}
.wa:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5); }

/* ---- RESPONSIVE ---- */
@media (max-width: 780px) {
  body { padding: 10px; align-items: center; padding-top: 10px; }

  .console-body { grid-template-columns: 1fr; }
  .zone-info { border-right: none; border-bottom: 1px solid var(--border); padding: 12px; gap: 10px; }
  .zone-dial { border-right: none; border-bottom: 1px solid var(--border); padding: 10px; }
  .dial { width: 120px; height: 120px; }
  .dial-inner { width: 68px; height: 68px; }
  .dial-needle { top: 6px; height: 12px; transform-origin: 50% 55px; }

  .zone-controls { padding: 12px; gap: 8px; }

  .console-top { padding: 10px 14px; }
  .brand-tag strong { font-size: 0.72rem; }
  .brand-tag small { font-size: 0.55rem; }
  .status-item { font-size: 0.6rem; padding: 4px 8px; }

  .console-bottom { padding: 10px 14px; gap: 10px; }
  .verse-scroll p { font-size: 0.75rem; }

  .btn-install { top: 12px; right: 12px; padding: 8px 12px; font-size: 0.62rem; }
}

@media (max-width: 420px) {
  .brand-tag img { width: 30px; height: 30px; }
  .brand-tag strong { font-size: 0.65rem; letter-spacing: 0.5px; }
  
  .zone-info, .zone-controls { padding: 10px 14px; }
  .track-title { font-size: 1.05rem; margin-bottom: 2px; }
  .spectrum { padding: 6px 8px; }
  #waveform { height: 28px; }
  
  .stats-grid { gap: 8px; }
  .stat { padding: 6px 8px; }
  .stat-value { font-size: 0.95rem; }
  .btn-whatsapp { font-size: 0.65rem; padding: 6px; }
  
  .btn-power { padding: 12px 10px; gap: 4px; }
  .btn-power svg { width: 22px; height: 22px; }
  .power-label { font-size: 0.6rem; }
  
  .credits-line { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-height: 650px) {
  /* Extra compactación vertical para pantallas muy cortas */
  .dial { width: 90px; height: 90px; }
  .dial-inner { width: 50px; height: 50px; }
  .dial-needle { top: 4px; height: 10px; transform-origin: 50% 41px; }
  .zone-info, .zone-dial, .zone-controls { padding: 8px 12px; gap: 6px; }
  .btn-power { padding: 8px; }
}