/* =============================================================================
   bunker.css — The Bunker como app del teléfono (lo propio, encima de la plantilla)
   Ubicación: /assets/css/bunker.css (lo carga Views/sitio/_cabeza.php en todas las páginas)

   1. La barra de abajo (Inicio · Programación · ▶ · DJs · Menú): solo en pantallas chicas
   2. La hoja del menú
   3. "Toca para escuchar" (cuando el navegador no deja que la radio suene sola)
   4. La pantalla /app: la ruedita grande y centrada, siempre en oscuro
   ========================================================================== */

/* ── 1. Barra de abajo ─────────────────────────────────────────────────── */
.tb-barra, .tb-menu, .tb-toque { display: none; }

@media (max-width: 900px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .tb-barra {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(10, 10, 11, .96); border-top: 1px solid rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .tb-barra a, .tb-barra button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; padding: 4px 2px; border: 0; background: none; color: rgba(255, 255, 255, .62);
    font: 500 10px/1.1 'Archivo', system-ui, sans-serif; letter-spacing: 0; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tb-barra a span, .tb-barra button > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tb-barra a.is-on, .tb-barra a[aria-current="page"] { color: #fff; }
  .tb-barra a.is-on svg { color: #C9502A; }
  .tb-barra a:focus-visible, .tb-barra button:focus-visible { outline: 2px solid #C9502A; outline-offset: -2px; border-radius: 10px; }
  /* el botón del centro: un círculo ember que sube un poco sobre la barra */
  .tb-barra .tb-barra-radio { gap: 4px; padding-top: 0; }
  .tb-barra-circulo {
    width: 58px; height: 58px; margin-top: -26px; border-radius: 50%;
    display: grid; place-items: center; background: #C9502A; color: #fff;
    box-shadow: 0 8px 22px rgba(201, 80, 42, .45), 0 0 0 5px #0a0a0b;
    font: 500 19px/1 'DM Mono', ui-monospace, monospace; transition: transform .15s ease;
  }
  .tb-barra-radio:active .tb-barra-circulo { transform: scale(.94); }
  .tb-barra-radio[aria-pressed="true"] .tb-barra-circulo { animation: tb-latido 1.8s ease-in-out infinite; }
  .tb-barra-radio[aria-pressed="true"] .tb-barra-texto { color: #fff; }
  @keyframes tb-latido {
    0%, 100% { box-shadow: 0 8px 22px rgba(201, 80, 42, .45), 0 0 0 5px #0a0a0b; }
    50%      { box-shadow: 0 8px 30px rgba(201, 80, 42, .75), 0 0 0 5px #0a0a0b; }
  }

  /* ── 2. Menú ── */
  .tb-menu:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 950; }
  .tb-menu-fondo { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
  .tb-menu-hoja {
    position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto;
    background: #141110; color: #f5f4f1; border-radius: 20px 20px 0 0;
    padding: 16px 18px calc(18px + env(safe-area-inset-bottom)); animation: tb-sube .22s ease-out;
  }
  @keyframes tb-sube { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  .tb-menu-cabeza { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .tb-menu-cabeza strong { font: 700 20px/1.1 'Bricolage Grotesque', system-ui, sans-serif; }
  .tb-menu-x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
  .tb-menu-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tb-menu-lista a {
    display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 8px 14px;
    border-radius: 12px; background: rgba(255, 255, 255, .05); color: #f5f4f1; text-decoration: none; font: 600 15px/1.2 'Archivo', system-ui, sans-serif;
  }
  .tb-menu-lista a span { font: 400 11px/1.2 'DM Mono', monospace; color: rgba(255, 255, 255, .5); letter-spacing: .06em; text-transform: uppercase; }
  .tb-menu-lista a.is-on { background: #C9502A; color: #fff; }
  .tb-menu-lista a.is-on span { color: rgba(255, 255, 255, .8); }
  .tb-menu-lista li:first-child { grid-column: 1 / -1; }
  .tb-menu-instalar { width: 100%; min-height: 52px; margin-top: 12px; border: 1px solid #C9502A; border-radius: 12px; background: none; color: #f5f4f1; font: 600 15px 'Archivo', sans-serif; cursor: pointer; }
  html.tb-menu-abierto { overflow: hidden; }
}

/* ── 3. Toca para escuchar ─────────────────────────────────────────────── */
.tb-toque:not([hidden]) {
  display: block; position: fixed; left: 50%; bottom: 24px; z-index: 940; margin: 0;
  transform: translateX(-50%); animation: tb-sube .3s ease-out;
}
.tb-toque button {
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: #C9502A; color: #fff; cursor: pointer;
  font: 500 13px/1 'DM Mono', ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
@media (max-width: 900px) {
  .tb-toque:not([hidden]) { bottom: calc(92px + env(safe-area-inset-bottom)); }
}

/* ── 4. La pantalla /app ───────────────────────────────────────────────── */
.tb-app {
  --tb-blanco: #f5f4f1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: calc(22px + env(safe-area-inset-top)) 20px 28px;
  background: url("../img/tile-dark.jpg") repeat 0 0 / 512px 512px #0a0a0b; color: var(--tb-blanco); text-align: center;
}
.tb-app-arriba { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tb-app-logo { max-height: 40px; max-width: 200px; object-fit: contain; }
.tb-app-marca { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.tb-app-lema { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.tb-app-centro { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 4px; }

/* la ruedita: los colores de la portada oscura de la plantilla, en grande */
.tb-app .dial.tb-app-dial { width: min(76vw, 330px); margin: 0 auto; }
.tb-app .dial-notch { background: repeating-conic-gradient(rgba(255, 255, 255, .4) 0deg .7deg, transparent .7deg 7.5deg); }
.tb-app .dial-cross { background: conic-gradient(rgba(255, 255, 255, .6) 0 1.4deg, transparent 1.4deg 90deg, rgba(255, 255, 255, .6) 90deg 91.4deg, transparent 91.4deg 180deg, rgba(255, 255, 255, .6) 180deg 181.4deg, transparent 181.4deg 270deg, rgba(255, 255, 255, .6) 270deg 271.4deg, transparent 271.4deg 360deg); }
.tb-app .dial-hour { inset: 22px; background: conic-gradient(#C9502A 0 var(--hour, 64%), rgba(255, 255, 255, .14) var(--hour, 64%) 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 13px)); mask: radial-gradient(farthest-side, transparent calc(100% - 13px), #000 calc(100% - 13px)); }
.tb-app .dial-vol { background: conic-gradient(#f5f4f1 0 var(--vol, 72%), rgba(255, 255, 255, .16) var(--vol, 72%) 100%); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); }
.tb-app .dial-btn { background: #141110; color: #C9502A; box-shadow: 0 14px 34px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .14); font-size: 30px; }
.tb-app .dial-btn::after { border-top-color: #C9502A; }
.is-paused .tb-app .dial-btn > span { font-size: 38px; }
.tb-app .dial-pointer { height: 18px; top: -5px; }

.tb-app-linea { margin: 6px 0 0; font-size: 11px; letter-spacing: .2em; color: #C9502A; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
.tb-app-linea .dot { margin-right: 2px; }
.tb-app-oyentes { color: rgba(255, 255, 255, .55); }
.tb-app-estacion { margin: 0; font-size: clamp(30px, 9vw, 44px); line-height: 1; letter-spacing: -.02em; text-transform: uppercase; }
.tb-app-cancion { margin: 0; max-width: 34ch; min-height: 1.4em; font: italic 400 19px/1.35 'Instrument Serif', Georgia, serif; color: rgba(255, 255, 255, .78); }
.tb-app-cancion.is-wait { color: rgba(255, 255, 255, .45); }

.tb-app-programas { width: 100%; max-width: 460px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-app-prog {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; text-align: left;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; background: rgba(255, 255, 255, .03);
}
.tb-app-prog .mono { font-size: 10.5px; letter-spacing: .2em; color: rgba(255, 255, 255, .5); }
.tb-app-prog .mono.accent { color: #C9502A; }
.tb-app-prog strong { font: 700 16px/1.2 'Archivo', sans-serif; }
.tb-app-prog .serif { font: italic 16px/1.2 'Instrument Serif', Georgia, serif; color: rgba(255, 255, 255, .7); }

.tb-app-accesos { width: 100%; max-width: 460px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-app-accesos a {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); color: #f5f4f1; text-decoration: none; font: 600 15px 'Archivo', sans-serif;
}
.tb-app-accesos a .mono { font-size: 11px; color: #C9502A; letter-spacing: .1em; }

/* en la computadora /app se ve igual, centrado */
@media (min-width: 901px) {
  .tb-app { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-barra-radio[aria-pressed="true"] .tb-barra-circulo { animation: none; }
}

/* ── 5. "Escuchar en vivo" del encabezado mientras suena: un punto que late y el botón respira ── */
.btn-live.tb-sonando { animation: tb-respira 2.4s ease-in-out infinite; }
.btn-live.tb-sonando::before {
  content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor;
  animation: tb-punto 1.2s ease-in-out infinite;
}
@keyframes tb-punto { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes tb-respira { 0%, 100% { box-shadow: 0 0 0 0 rgba(201, 80, 42, .55); } 50% { box-shadow: 0 0 0 8px rgba(201, 80, 42, 0); } }
@media (prefers-reduced-motion: reduce) {
  .btn-live.tb-sonando, .btn-live.tb-sonando::before { animation: none; }
}

/* ── 6. "Recorre el dial": cada punto del eje debajo de su tarjeta (1º a 6º canal de la portada) ── */
.axis .axis-dot.tb-punto-1 { left: 4.7%; }
.axis .axis-dot.tb-punto-2 { left: 28.7%; }
.axis .axis-dot.tb-punto-3 { left: 38%; }
.axis .axis-dot.tb-punto-4 { left: 62%; }
.axis .axis-dot.tb-punto-5 { left: 71.3%; }
.axis .axis-dot.tb-punto-6 { left: 95.3%; }

/* ── 7. La página /tv ─────────────────────────────────────────────────── */
.tb-tv { display: flex; flex-direction: column; gap: 28px; padding-top: 48px; padding-bottom: 72px; }
@media (max-width: 900px) { .tb-tv { padding-left: 20px; padding-right: 20px; padding-top: 28px; } }
.tb-tv-cabeza { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tb-tv-cabeza h1 { margin: 6px 0 0; }
.tb-tv-estado { margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: .16em; font-size: 13px; color: var(--i6, rgba(255,255,255,.6)); }
.tb-tv-estado.is-vivo { color: var(--accent); }
.tb-tv-pantalla { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--i14, rgba(255,255,255,.14)); background: #050505 url("../img/tile-dark.jpg") repeat 0 0 / 512px 512px; overflow: hidden; }
.tb-tv-pantalla iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tb-tv-ver { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; border: 0; background: radial-gradient(circle at 50% 45%, rgba(201, 80, 42, .22), transparent 55%); color: #f5f4f1; cursor: pointer; }
.tb-tv-sin { cursor: default; }
.tb-tv-play { width: clamp(72px, 9vw, 112px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: #C9502A; color: #fff; font-size: clamp(24px, 3vw, 38px); box-shadow: 0 14px 40px rgba(201, 80, 42, .45); transition: transform .2s ease; }
.tb-tv-sin .tb-tv-play { background: rgba(255, 255, 255, .12); box-shadow: none; }
.tb-tv-ver:hover .tb-tv-play, .tb-tv-ver:focus-visible .tb-tv-play { transform: scale(1.06); }
.tb-tv-ver:focus-visible { outline: 3px solid #C9502A; outline-offset: -3px; }
.tb-tv-ver-texto { font: 700 clamp(20px, 2.4vw, 32px)/1.1 'Bricolage Grotesque', 'Archivo', sans-serif; text-transform: uppercase; letter-spacing: -.01em; }
.tb-tv-ver-nota { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.tb-tv-ahora { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 16px 0; border-top: 1px solid var(--i14, rgba(255,255,255,.14)); border-bottom: 1px solid var(--i14, rgba(255,255,255,.14)); }
.tb-tv-ahora .mono { letter-spacing: .18em; font-size: 12px; }
.tb-tv-ahora strong { font: 700 22px 'Archivo', sans-serif; }
.tb-tv-ahora .serif { font: italic 20px 'Instrument Serif', Georgia, serif; }
.tb-tv-semana h2 { margin: 0 0 14px; letter-spacing: .18em; }
.tb-tv-semana ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tb-tv-semana li { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--i14, rgba(255,255,255,.14)); background: var(--card); }
.tb-tv-semana li strong { font: 700 18px 'Archivo', sans-serif; }
.tb-tv-semana li .serif { font: italic 17px 'Instrument Serif', Georgia, serif; opacity: .8; }
.tb-tv-semana li .mono { font-size: 11px; letter-spacing: .16em; color: var(--accent); }
.tb-tv-about { font-size: 14px; opacity: .7; }

/* el aviso EN VIVO EN TV (en /app y en el menú del teléfono) */
.tb-tv-aviso[hidden] { display: none !important; }
.tb-tv-aviso { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 460px; min-height: 48px; padding: 0 16px; border-radius: 12px; background: #C9502A; color: #fff; text-decoration: none; font: 600 14px 'Archivo', sans-serif; letter-spacing: .02em; }
.tb-tv-aviso::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; animation: tb-punto 1.2s ease-in-out infinite; }

/* ── 8. Portada: "Hoy" con pocos programas no se estira hasta abajo ── */
.sc-list.tb-pocos .sc-rows { justify-content: flex-start; }

/* ── Fase 7: la cuenta del oyente arriba a la derecha ── */
.tb-cuenta-link { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tb-cuenta-link:hover { color: var(--accent); }
.tb-cuenta-link.is-dentro { color: var(--accent); }
.tb-cuenta-punto { width: 7px; height: 7px; border-radius: 50%; background: #4E9A5A; }
@media (max-width: 640px) { .hd-top .tb-cuenta-link { margin-left: auto; } }
.tb-menu-lista .tb-menu-cuenta a { color: var(--accent); }

/* ── TV en vivo: la tarjeta de la subasta junto a "Esta semana en video" (igual que las otras, con su borde) ── */
.tb-tv-subasta-tarjeta { border-color: var(--accent) !important; }
.tb-tv-subasta-tarjeta a { display: flex; flex-direction: column; gap: inherit; height: 100%; color: inherit; text-decoration: none; }
.tb-tv-subasta-tarjeta .mono { color: var(--accent); }
.tb-tv-subasta-tarjeta.is-vivo .mono:not(.tb-tv-subasta-ir) { animation: tb-late-texto 1.2s ease-in-out infinite alternate; }
@keyframes tb-late-texto { from { opacity: 1; } to { opacity: .55; } }
.tb-tv-subasta-ir { margin-top: auto; padding-top: 10px; letter-spacing: .14em; font-size: 12px; }
.tb-tv-subasta-tarjeta a:hover strong { color: var(--accent); }

/* ── Teléfono: la ruedita de la portada centrada y la barra de arriba en una sola fila ── */
@media (max-width: 760px) {
  .pl-dial-col { flex: 1 1 100%; align-items: center; }
  .pl-readout { justify-content: center; }
  /* "Entrar · Crear cuenta" ya está en el Menú de la barra de abajo */
  .hd-top .tb-cuenta-link { display: none; }
  .hd-top .lang { margin-left: auto; }
}

/* ── El pie: la marca (sin logo todavía), "Crea tu cuenta" en lugar del boletín ── */
.tb-pie-marca { font: 800 clamp(28px, 3.2vw, 46px) / 1 'Orbitron', sans-serif; letter-spacing: .02em; color: #fff; text-transform: uppercase; }
.sheet-brand img.tb-pie-logo { height: clamp(34px, 3.4vw, 52px); width: auto; }
.tb-pie-cuenta { display: flex; align-items: center; gap: 12px; padding: 8px 0 6px; border-bottom: 1px solid rgba(255, 255, 255, .5); color: #fff; font-size: 14px; line-height: 1.35; }
.tb-pie-cuenta .send { flex: none; margin-left: auto; }
.tb-pie-cuenta:hover { color: var(--accent); }
.tb-pie-cuenta:hover .send { background: #fff; color: #141110; }
.tally .of a { color: inherit; }
.tally .of a:hover { color: var(--accent); }
.shift .blk.tb-hueco { background: none; border-color: transparent; }

/* ── La barra de arriba en una sola fila: lo que está al aire solo si cabe ── */
.hd-top .tb-top-aire { display: none; }
@media (min-width: 1360px) { .hd-top .tb-top-aire { display: inline; } }
@media (max-width: 1400px) { .hd-top .tb-top-correo { display: none; } }

/* ── La marca de The Bunker: el logo solo letras (298×56) en la cabecera ── */
.logo img { width: auto; height: 50px; }
@media (max-width: 1600px) { .logo img { width: auto; height: 44px; } }
@media (max-width: 760px) { .logo img { width: auto; height: 36px; } }

/* La onda del reproductor llena todo el ancho (bunker.js dibuja las barras que quepan); la parte sonada va clara */
.pl-wave .wave > span:nth-child(-n+20) { background: var(--h-wave-rest); }
.pl-wave .wave > span.tb-oida { background: var(--h-wave); }
.pg-intro .pl-wave .wave > span:nth-child(-n+20) { background: var(--i28); }
.pg-intro .pl-wave .wave > span.tb-oida { background: var(--i75); }
.pl-wave .wave { justify-content: space-between; }

/* El enlace "misterioso" del pie a thebunker360: apagado, y al pasar se prende como terminal */
.foot-bottom .tb-misterio { color: inherit; opacity: .38; text-decoration: none; letter-spacing: .04em; transition: opacity .3s, color .3s; }
.foot-bottom .tb-misterio span { display: inline-block; margin-left: 1px; opacity: 0; }
.foot-bottom .tb-misterio:hover, .foot-bottom .tb-misterio:focus-visible { opacity: 1; color: var(--accent, #F26B1D); }
.foot-bottom .tb-misterio:hover span, .foot-bottom .tb-misterio:focus-visible span { animation: tb-cursor 1s steps(1) infinite; }
@keyframes tb-cursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* Estaciones → "Pide tu canción" (en lugar del papelito de ejemplo de la plantilla) */
.tb-pedido { display: flex; flex-direction: column; gap: 22px; padding: clamp(24px, 3vw, 40px); background: var(--card); border: 1px solid var(--i14); }
.tb-pedido-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.tb-pedido-pasos li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--i12); font-size: 18px; line-height: 1.45; color: var(--i78); }
.tb-pedido-pasos b { color: var(--accent); font-weight: 400; font-size: 14px; letter-spacing: .16em; }
.tb-pedido-pasos strong { color: var(--ink); }
.tb-pedido-botones { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }

/* Rutas de navegación largas (Graba tu podcast / Mi estudio / …): bajan de línea en el teléfono */
.crumbs { flex-wrap: wrap; row-gap: 6px; }

/* "No hay más programas hoy · Ver la semana": en el celular baja de línea en vez de salirse */
.sc-next > .mono { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
