/* ==========================================================
   Radio G On Line · estilos
   Colores tomados del logo
   ========================================================== */
:root {
  --cyan: #4BC6D8;
  --teal: #20AEB8;
  --teal-dark: #127a83;
  --ink: #0B3F45;
  --lime: #C3E17A;
  --lime-dark: #9EB556;
  --gray: #8A8A8A;
  --mist: #B9C0C3;
  --bg: #EAF8FA;
  --text: #2F3A3D;
  --muted: #6C7A7E;
}

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

body {
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  font-family: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(70vmax 70vmax at 100% -10%, rgba(75, 198, 216, .45), transparent 60%),
    radial-gradient(60vmax 60vmax at -10% 110%, rgba(195, 225, 122, .5), transparent 60%),
    var(--bg);
}

.wrap { max-width: 1000px; margin: 0 auto; }

/* ---------- Cabecera ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.top__logo { height: 84px; width: auto; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 99px; background: #fff;
  font-size: .85rem; font-weight: 600; color: var(--teal-dark);
  box-shadow: 0 6px 18px -8px rgba(32, 174, 184, .6);
}
.badge__dot { width: 9px; height: 9px; border-radius: 50%; background: #e5484d; }
.is-playing .badge__dot { background: var(--teal); animation: pulse 1.5s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(32, 174, 184, .7); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* ---------- Tarjeta principal ---------- */
.card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 380px) 1fr; gap: 40px; align-items: center;
  padding: 40px; border-radius: 36px; color: #fff;
  box-shadow: 0 40px 70px -30px rgba(11, 63, 69, .7);
}
/* fondo desenfocado con la carátula */
.card::before {
  content: ""; position: absolute; inset: -60px; z-index: -2;
  background: var(--art, none) center / cover;
  filter: blur(44px) saturate(1.3); transform: scale(1.2);
}
.card::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg, rgba(11, 63, 69, .80), rgba(18, 122, 131, .78));
}

/* ---------- Carátula ---------- */
.cover {
  aspect-ratio: 1; overflow: hidden; border-radius: 28px; background: #fff;
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, .6);
  transition: transform .5s, opacity .4s;
}
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover.is-fallback img { object-fit: contain; padding: 12%; }
.cover.is-changing { opacity: .35; }
.is-playing .cover { transform: scale(1.02); }

/* ---------- Información ---------- */
.info { min-width: 0; }
.now { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .9rem; font-weight: 500; opacity: .85; }

.eq { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq i { width: 4px; height: 4px; border-radius: 2px; background: var(--lime); }
.is-playing .eq i { animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .4s; }
.eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { to { height: 16px; } }

.info__title  { margin-bottom: 8px; font-size: clamp(1.7rem, 4.2vw, 2.8rem); font-weight: 800; line-height: 1.12; overflow-wrap: anywhere; }
.info__artist { font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 600; color: var(--lime); overflow-wrap: anywhere; }
.info__album  { margin-top: 4px; font-size: .95rem; opacity: .8; overflow-wrap: anywhere; }

/* ---------- Controles ---------- */
.controls { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 30px; }

.play {
  display: grid; place-items: center; flex: none;
  width: 92px; height: 92px; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(145deg, var(--lime), #a9cf5a);
  box-shadow: 0 14px 30px -10px rgba(195, 225, 122, .9);
  transition: transform .15s;
}
.play:hover  { transform: scale(1.06); }
.play:active { transform: scale(.95); }
.play.is-loading { opacity: .65; }
.play__icon { width: 38px; height: 38px; fill: var(--ink); }
.play__icon--pause, .is-playing .play__icon--play { display: none; }
.is-playing .play__icon--pause { display: block; }

.vol { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 150px; max-width: 260px; }
.vol__btn { display: grid; background: none; border: 0; cursor: pointer; }
.vol__btn svg { width: 24px; height: 24px; fill: #fff; }

.vol__range {
  -webkit-appearance: none; appearance: none; flex: 1; height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--lime) var(--v, 80%), rgba(255, 255, 255, .25) var(--v, 80%));
}
.vol__range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 4px solid var(--lime); cursor: pointer; }
.vol__range::-moz-range-thumb     { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 4px solid var(--lime); cursor: pointer; }

.status { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; font-size: .85rem; opacity: .8; }

button:focus-visible, input:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Parte baja ---------- */
.lower { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.box { padding: 22px; border-radius: 26px; background: #fff; box-shadow: 0 18px 40px -26px rgba(32, 174, 184, .8); }
.box__title { margin-bottom: 12px; font-size: 1rem; font-weight: 700; color: var(--teal-dark); }

.hist { display: grid; gap: 10px; list-style: none; }
.hist li { display: flex; align-items: center; gap: 12px; }
.hist img { flex: none; width: 46px; height: 46px; border-radius: 10px; object-fit: cover; background: #eef5f6; }
.hist__text { min-width: 0; }
.hist__text b { display: block; overflow: hidden; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.hist__text span { font-size: .8rem; color: var(--muted); }
.hist__empty { font-size: .88rem; color: var(--muted); }

.build {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(195, 225, 122, .55), rgba(75, 198, 216, .25));
  border: 2px dashed var(--lime-dark);
}
.build__icon  { flex: none; width: 44px; height: 44px; fill: var(--teal-dark); }
.build__title { display: block; font-size: 1.15rem; color: var(--ink); }
.build__text  { margin-top: 2px; font-size: .88rem; color: var(--muted); }

/* ---------- Depuración (?debug) ---------- */
.debug {
  display: none; max-height: 260px; margin-top: 14px; padding: 14px; overflow: auto;
  border-radius: 14px; background: #0b2326; color: #b8f1f6;
  font-size: .75rem; white-space: pre-wrap; word-break: break-all;
}

/* ---------- Celulares y tablets ---------- */
@media (max-width: 820px) {
  .top__logo { height: 64px; }
  .card { grid-template-columns: 1fr; gap: 24px; padding: 24px; border-radius: 30px; text-align: center; }
  .cover { width: 100%; max-width: 300px; margin: 0 auto; }
  .now, .controls, .status { justify-content: center; }
  .vol { max-width: none; }
  .lower { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Caja Play Store (parte baja) ---------- */
.lower .box:not(.build) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lower .box:not(.build) a {
  display: inline-block;
  line-height: 0;              /* quita el espacio extra bajo la imagen */
  transition: transform .15s;
}
.lower .box:not(.build) a:hover  { transform: scale(1.04); }
.lower .box:not(.build) a:active { transform: scale(.97); }

.lower .box:not(.build) img {
  display: block;
  width: 100%;
  /*max-width: 220px; */           /* tamaño máximo en PC: ajústalo a tu gusto */
  height: auto;                /* mantiene la proporción */
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .lower .box:not(.build) { padding: 16px; }
  .lower .box:not(.build) img { max-width: 100%; }
}

@media (max-width: 420px) {
  .lower .box:not(.build) img { max-width: 100%; }
}
