/* ============================================================
   RADIO MEGA — versión app para móviles
   (usa los colores y fuentes de styles.css)
   ============================================================ */
html, body.app { height: 100%; }
body.app {
  padding: 0; margin: 0; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
.app button:not(.btn) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.app a { text-decoration: none !important; }

.shell {
  position: fixed; inset: 0; margin: 0 auto; max-width: 520px;
  display: grid; grid-template-rows: auto 1fr auto auto; overflow: hidden;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 31, 154, .22), transparent 60%), var(--bg);
}

/* ---------- barra superior ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; font: 500 1rem var(--font-display); }
.topbar-brand b { font-weight: 900; margin-left: 3px; }
.topbar-brand img { border-radius: 50%; background: #000; box-shadow: 0 0 14px -2px rgba(255, 31, 154, .8); }

/* ---------- pantallas ---------- */
.screens { position: relative; overflow: hidden; }
.screen {
  position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  padding: 6px 18px 24px; scrollbar-width: none;
  animation: screenIn .28s cubic-bezier(.2, .8, .2, 1);
}
.screen::-webkit-scrollbar { display: none; }
.screen[hidden] { display: none; }
.screen-full { padding: 0; overflow: hidden; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.screen-h { font: 900 1.9rem/1.1 var(--font-display); margin: 8px 0 4px; letter-spacing: -.02em; }
.screen-sub { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.loading { color: var(--muted); text-align: center; padding: 40px 0; }
.loading[hidden] { display: none; }

/* ---------- reproductor ---------- */
.player { position: relative; display: grid; justify-items: center; text-align: center; padding-top: 4px; isolation: isolate; }
.player-bg {
  position: absolute; z-index: -1; left: 50%; top: 40px; width: 90%; aspect-ratio: 1; transform: translateX(-50%);
  background-size: cover; background-position: center; filter: blur(60px) saturate(170%); opacity: .55; border-radius: 50%;
}
.tagline {
  font-family: var(--font-script); font-size: 1.35rem; color: #fff4fb; margin-bottom: 14px;
  text-shadow: 0 0 4px #ff8fd0, 0 0 12px #ff1f9a, 0 0 26px rgba(255, 31, 154, .75);
  transform: rotate(-2deg);
}
.art {
  position: relative; width: min(78vw, 340px, 42dvh); aspect-ratio: 1; border-radius: 28px; overflow: hidden;
  background: #000; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  transform: scale(.94);
}
.is-playing .art { transform: scale(1); box-shadow: 0 30px 70px -20px rgba(255, 31, 154, .55), 0 0 0 1px rgba(255, 79, 184, .25); }
.art-img { width: 100%; height: 100%; object-fit: cover; transition: opacity .5s; }
.art-img.is-loading { opacity: 0; }
.art .eq { left: 12px; bottom: 12px; }

.on-air { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; padding: 6px 12px; border-radius: 999px; background: rgba(255, 31, 154, .14); border: 1px solid rgba(255, 79, 184, .35); color: #ffd1ea; }
.on-air[hidden] { display: none; }
.track { margin-top: 14px; width: 100%; min-width: 0; }
.track-title { font: 800 1.45rem/1.2 var(--font-display); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; }
.track-artist { color: var(--muted); font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.controls { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: 20px; }
.ctl { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(255, 255, 255, .06) !important; transition: transform .15s; }
.ctl:active { transform: scale(.9); }
.ctl svg { width: 22px; height: 22px; }
.ctl-play {
  position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: var(--grad) !important; box-shadow: var(--glow); transition: transform .15s;
}
.ctl-play:active { transform: scale(.92); }
.ctl-play svg { width: 34px; height: 34px; }
.ctl-play .ico-play { margin-left: 4px; }
.is-playing .ctl-play { animation: pulsePlay 2.4s ease-in-out infinite; }
@keyframes pulsePlay { 50% { box-shadow: 0 0 0 10px rgba(255, 31, 154, .12), 0 10px 40px -10px rgba(255, 31, 154, .8); } }
.live-line { margin-top: 18px; color: var(--muted); font-size: .8rem; display: inline-flex; align-items: center; gap: 8px; }

/* redes en la pantalla de radio */
.social-row { display: flex; justify-content: center; gap: 14px; margin-top: 22px; }
.social-row a { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); transition: transform .15s; }
.social-row a:active { transform: scale(.9); }
.social-row svg { width: 22px; height: 22px; }
.social-row .fb { color: #4c8dff; } .social-row .ig { color: #ff5fa2; } .social-row .dc { color: #8b93ff; } .social-row .tt { color: #fff; }

/* tarjetas */
.card { margin-top: 26px; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.card-h { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hist li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.hist li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

/* ---------- programación ---------- */
.now-next { display: grid; gap: 10px; margin-bottom: 18px; }
.nn { padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.nn.now { background: linear-gradient(135deg, rgba(255, 31, 154, .2), rgba(162, 77, 255, .1)); border-color: rgba(255, 79, 184, .4); }
.nn-l { font-size: .7rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.nn.now .nn-l { color: var(--accent); }
.nn h3 { font: 800 1.35rem/1.15 var(--font-display); margin: 6px 0 2px; overflow-wrap: anywhere; }
.nn p { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.nn .row-bar { margin-top: 12px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 10px; padding: 2px 18px 6px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 9px 14px; border-radius: 999px; background: var(--surface) !important; border: 1px solid var(--line) !important; color: var(--muted) !important; font-weight: 700 !important; font-size: .85rem !important; text-transform: capitalize; }
.chip[aria-selected="true"] { background: var(--grad) !important; color: #fff !important; border-color: transparent !important; }

.slots { list-style: none; margin: 0; padding: 0; }
.slot { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.slot time { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .92rem; }
.slot b { font: 700 1rem var(--font-display); overflow-wrap: anywhere; }
.slot small { color: var(--muted); font-size: .78rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.slot.is-live time, .slot.is-live small { color: var(--accent); }
.slot.is-auto b { font: italic 400 .95rem var(--font); color: var(--muted); }
.slot.is-past { opacity: .38; }

.cal-fallback { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #141416; }
.cal-fallback[hidden] { display: none; }
.cal-fallback iframe { display: block; width: 100%; height: 62dvh; border: 0; filter: invert(.92) hue-rotate(180deg) saturate(1.4); }
.cal-fallback iframe[hidden] { display: none; }

/* ---------- chat ---------- */
.chat { position: absolute; inset: 0; display: grid; }
.chat iframe { width: 100%; height: 100%; border: 0; background: #36393e; }
.chat iframe[hidden] { display: none; }
.app .gate { min-height: 0; height: 100%; padding: 28px; gap: 14px; }
.app .gate .btn { width: 100%; max-width: 300px; }

/* ---------- más ---------- */
.install { display: flex; align-items: center; gap: 14px; padding: 16px; margin-bottom: 22px; border-radius: 20px; background: linear-gradient(135deg, rgba(255, 31, 154, .2), rgba(162, 77, 255, .12)); border: 1px solid rgba(255, 79, 184, .4); }
.install[hidden] { display: none; }
.install img { border-radius: 14px; flex: none; }
.install > div { flex: 1; min-width: 0; }
.install-t { font: 800 1rem var(--font-display); }
.install .muted { font-size: .82rem; }
.install .btn { padding: .7em 1.1em; font-size: .88rem; }

.group-h { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 22px 4px 8px; }
.group { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.item { width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px 16px; color: var(--text) !important; text-align: left; border-bottom: 1px solid var(--line) !important; }
.group > .item:last-child { border-bottom: 0 !important; }
.item:active { background: rgba(255, 255, 255, .05) !important; }
.item-ico { width: 22px; height: 22px; color: var(--accent); }
.item-ico.ig { color: #ff5fa2; } .item-ico.tt { color: #fff; } .item-ico.fb { color: #4c8dff; } .item-ico.dc { color: #8b93ff; }
.item-t { flex: 1; font-weight: 600; }
.chev { width: 18px; height: 18px; color: var(--muted); }
.item select { max-width: 52%; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: 600 .85rem var(--font); }
.item-note { padding: 0 16px 14px; color: var(--accent); font-size: .85rem; font-weight: 600; }
.clock-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.clock-row > div { padding: 16px; display: grid; gap: 2px; }
.clock-row > div + div { border-left: 1px solid var(--line); }
.clock-row .muted { font-size: .8rem; }
.clock-row b { font: 700 1.6rem var(--font-display); font-variant-numeric: tabular-nums; }
.foot { text-align: center; font-size: .78rem; margin: 26px 0 8px; }

/* ---------- mini reproductor ---------- */
.mini {
  display: flex; align-items: center; gap: 10px; margin: 0 10px 8px; padding: 8px 8px 8px 8px;
  border-radius: 18px; background: rgba(30, 26, 58, .92); border: 1px solid rgba(255, 79, 184, .25);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: screenIn .25s ease;
}
.mini[hidden] { display: none; }
.mini-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.mini-open img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #000; flex: none; }
.mini-meta { min-width: 0; display: grid; }
.mini-meta b, .mini-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta b { font-size: .92rem; }
.mini-meta span { font-size: .8rem; color: var(--muted); }
.mini-play { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad) !important; }
.mini-play svg { width: 20px; height: 20px; }
.mini-play .ico-play { margin-left: 2px; }
.mini-play .spinner, .ctl-play .spinner { position: absolute; }

/* ---------- barra de pestañas ---------- */
.tabbar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: rgba(8, 7, 15, .92); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tab { display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--muted) !important; font-size: .7rem !important; font-weight: 700 !important; letter-spacing: .02em; transition: color .2s; }
.tab svg { width: 24px; height: 24px; transition: transform .2s; }
.tab.is-active { color: #fff !important; }
.tab.is-active svg { color: var(--accent); transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 8px rgba(255, 31, 154, .7)); }

/* ---------- hoja inferior ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet { width: min(520px, 100%); padding: 10px 22px calc(env(safe-area-inset-bottom) + 22px); border-radius: 26px 26px 0 0; background: var(--bg-2); border-top: 1px solid var(--line); animation: sheetUp .3s cubic-bezier(.2, .8, .2, 1); display: grid; gap: 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); justify-self: center; }
.sheet h3 { font: 800 1.2rem var(--font-display); }
.steps { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; color: #c9cfee; }
.inline-ico { width: 18px; height: 18px; vertical-align: -3px; color: #4ea3ff; }

/* ---------- splash ---------- */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); transition: opacity .4s ease, visibility .4s; }
.splash img { width: 132px; height: 132px; border-radius: 50%; box-shadow: 0 0 60px rgba(255, 31, 154, .6); animation: splashIn .7s cubic-bezier(.2, .8, .2, 1); }
.splash.is-gone { opacity: 0; visibility: hidden; }
@keyframes splashIn { from { transform: scale(.7); opacity: 0; } }

/* aviso de cookies y toast encima de la barra de pestañas */
.app .cc-banner { bottom: calc(env(safe-area-inset-bottom) + 76px); left: 10px; right: 10px; flex-direction: column; align-items: stretch; padding: 16px; max-width: 500px; }
.app .cc-actions .btn { flex: 1 1 0; min-width: 0; }
.app .toast { bottom: calc(env(safe-area-inset-bottom) + 150px); }

/* pantallas bajas (móviles pequeños) */
@media (max-height: 700px) {
  .tagline { font-size: 1.1rem; margin-bottom: 8px; }
  .controls { margin-top: 14px; gap: 26px; }
  .ctl-play { width: 72px; height: 72px; }
  .live-line { display: none; }
}

/* en ordenador: se muestra como un móvil centrado */
@media (min-width: 640px) {
  body.app { background: radial-gradient(60% 60% at 50% 0%, rgba(255, 31, 154, .18), transparent 70%), #050409; }
  .shell { inset: 20px auto; left: 50%; transform: translateX(-50%); width: 420px; height: min(880px, calc(100dvh - 40px)); border-radius: 40px; border: 1px solid var(--line); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .9); }
  .splash { border-radius: 0; }
  .app .cc-banner { left: 50%; right: auto; width: 396px; transform: translateX(-50%); bottom: 110px; }
  .app .toast { bottom: 180px; }
}
