/* ====== Retro007 Radio · diseño de panel (casete + historial + artistas + tabla de radios) ====== */
:root {
  --rosa: #ff2e97;                 /* acento: cambia con el color de cada radio */
  --cian: #37d6ff;
  --fondo-1: #2a2c44; --fondo-2: #262b55; --fondo-3: #2d3f7e;
  --panel: rgba(16, 20, 52, .74);
  --panel-borde: rgba(55, 214, 255, .26);
  --texto: #f2f5ff; --texto-2: #c9d2f5; --tenue: #8c97bf; --rotulo: #aab6e0;
  --barra-alto: 78px;
  --radio: 14px;
}
* { box-sizing: border-box; margin: 0; }
html { scrollbar-color: var(--cian) transparent; }
body {
  min-height: 100vh; color: var(--texto);
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--fondo-1) 0%, var(--fondo-2) 55%, var(--fondo-3) 100%) fixed;
  padding-bottom: calc(var(--barra-alto) + env(safe-area-inset-bottom));
  transition: padding-bottom .5s cubic-bezier(.22,.8,.3,1);
}
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
select:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--cian); outline-offset: 2px; }

/* piso de neón en perspectiva, de fondo */
/* malla inclinada estilo synthwave: líneas cian/rosa que avanzan hacia el frente y se pierden en el horizonte */
/* El plano inclinado y el desvanecido quedan fijos; solo se desliza la malla interior (transform en GPU,
   sin repintar), y la zona lejana —donde las líneas se vuelven más finas que un píxel y titilan— se desvanece antes. */
.piso { position: fixed; left: -60%; right: -60%; bottom: -2px; height: 150vh; z-index: -1; pointer-events: none; overflow: hidden;
  transform: perspective(1000px) rotateX(52deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0 18%, rgba(0,0,0,.55) 42%, transparent 66%);
          mask-image: linear-gradient(to top, #000 0 18%, rgba(0,0,0,.55) 42%, transparent 66%); }
.piso::before { content: ""; position: absolute; left: 0; right: 0; top: -70px; bottom: 0; will-change: transform; backface-visibility: hidden;
  background:
    linear-gradient(transparent 0 calc(100% - 3px), rgba(55,214,255,.25) calc(100% - 3px), rgba(55,214,255,.55) calc(100% - 1.5px), rgba(55,214,255,.25) 100%) 0 0 / 100% 70px,
    linear-gradient(90deg, transparent 0 calc(100% - 3px), color-mix(in srgb, var(--rosa) 30%, transparent) calc(100% - 3px), color-mix(in srgb, var(--rosa) 60%, transparent) calc(100% - 1.5px), color-mix(in srgb, var(--rosa) 30%, transparent) 100%) 50% 0 / 90px 100%;
  animation: avanza 2.4s linear infinite; }
@keyframes avanza { from { transform: translateY(0); } to { transform: translateY(70px); } }
/* resplandor del horizonte */
body::before { content: ""; position: fixed; left: 0; right: 0; bottom: 42vh; height: 30vh; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, color-mix(in srgb, var(--rosa) 22%, transparent), transparent 70%); }

/* ====== estructura ====== */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; padding: 18px; max-width: 1640px; margin: 0 auto; }
.tarjeta { background: var(--panel); border: 1px solid var(--panel-borde); border-radius: var(--radio);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.03); backdrop-filter: blur(6px); }
main { min-width: 0; display: flex; flex-direction: column; gap: 18px; transition: opacity .3s; }

/* ====== menú lateral ====== */
.lado { position: sticky; top: 18px; align-self: start; display: flex; flex-direction: column; gap: 8px;
  height: calc(100vh - 36px - var(--barra-alto)); padding: 12px; background: var(--panel); border: 1px solid var(--panel-borde); border-radius: var(--radio); }
.lado-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(10,12,32,.45); border: 1px solid rgba(255,255,255,.08); color: var(--texto-2); font-size: .92rem; transition: border-color .2s, color .2s, box-shadow .2s; }
.lado-btn svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lado-btn:hover { border-color: var(--cian); color: #fff; }
.lado-btn.activo { color: #fff; border-color: var(--rosa); box-shadow: 0 0 10px color-mix(in srgb, var(--rosa) 45%, transparent), inset 0 0 8px color-mix(in srgb, var(--rosa) 18%, transparent); }
.lado-btn[hidden] { display: none; }
.lado-abajo { margin-top: auto; }

/* ====== fila de arriba ====== */
.arriba { display: grid; grid-template-columns: minmax(300px, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.tarjeta-casete { position: relative; padding: 46px 22px 14px; text-align: center; }
/* cabecera de la página con el logo, centrada arriba de todo */
.cabecera { display: flex; justify-content: center; padding: 18px 16px 2px; }
.logo { position: relative; display: inline-block; padding: 6px 34px 14px; white-space: nowrap;
  --l: .5; }                        /* --l = intensidad del brillo (0..1), la pone js/pulso.js al ritmo de la música */
.chrome { display: block; font: italic 900 2.42rem/1 "Arial Black", "Helvetica Neue", Impact, sans-serif; letter-spacing: .04em;
  /* encima del cromo, el reflejo del neón "Radio" sobre el 007: mismo color que su brillo (el de la radio), late con la música */
  background: radial-gradient(ellipse 26% 75% at 90% 100%,
      color-mix(in srgb, color-mix(in srgb, var(--rosa) 80%, #fff) calc(45% + var(--l) * 50%), transparent),
      color-mix(in srgb, var(--rosa) calc(12% + var(--l) * 30%), transparent) 45%, transparent 75%),
    linear-gradient(180deg, #fdfdff 0%, #b8c4e4 34%, #4f5d86 50%, #dfe6fa 52%, #8fa2d0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #121528) drop-shadow(0 0 10px rgba(130,170,255,.35)); }
.neon { position: absolute; z-index: 1; right: 12px; bottom: 5px; font: italic 400 1.87rem/1 "Brush Script MT", "Segoe Script", "Snell Roundhand", "Lucida Handwriting", cursive;
  color: color-mix(in srgb, #fff calc(35% + var(--l) * 65%), color-mix(in srgb, var(--rosa) 45%, #fff)); transform: rotate(-9deg);
  text-shadow: 0 0 calc(2px + var(--l) * 4px) #fff,
    0 0 10px color-mix(in srgb, var(--rosa) calc(45% + var(--l) * 55%), transparent),
    0 0 calc(16px + var(--l) * 12px) color-mix(in srgb, var(--rosa) calc(30% + var(--l) * 70%), transparent),
    0 0 calc(26px + var(--l) * 28px) color-mix(in srgb, var(--rosa) calc(15% + var(--l) * 85%), transparent); }
/* casete plano original sobre una escena suave: fondo con los colores de la radio (degradados amplios, sin filtro blur)
   y, encima, los puntitos y la banda de luz de js/pulso.js */
.tarjeta-casete { overflow: hidden; isolation: isolate; }
.tarjeta-casete::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .32;
  background: radial-gradient(ellipse 60% 55% at 22% 28%, var(--rosa), transparent 70%), radial-gradient(ellipse 60% 55% at 82% 72%, var(--cian), transparent 72%); }
#escena { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#tape { position: relative; z-index: 1; display: block; width: 100%; max-width: 440px; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.5)); }
.estacion-actual, #espectro { position: relative; z-index: 1; }
/* barras del espectro en una franja bajo el casete (las dibuja js/pulso.js con el color de la radio) */
#espectro { display: block; width: 100%; max-width: 440px; height: 56px; margin: 12px auto 2px; pointer-events: none; }
#art { transition: opacity .6s; opacity: 0; }
.reel { transform-box: fill-box; transform-origin: center; }
.estacion-actual { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--rotulo); }
.estacion-actual i { width: 10px; height: 10px; border-radius: 50%; background: var(--rosa); box-shadow: 0 0 8px var(--rosa); }

.hist, .artistas { padding: 16px 16px 14px; }
.hist h2, .artistas h2 { margin: 0 0 10px; text-align: center; font-size: .68rem; font-weight: 400; letter-spacing: .28em; text-transform: uppercase; color: var(--rotulo); }
.hist ul, .artistas ul { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid rgba(55,214,255,.3); border-radius: 10px;
  background: rgba(0,0,0,.22); scrollbar-width: thin; scrollbar-color: var(--cian) transparent; }
.hist li, .artistas li { display: flex; gap: 10px; padding: 8px 12px; font-size: .82rem; line-height: 1.3; color: #dfe6ff; border-bottom: 1px solid rgba(255,255,255,.06); }
.hist li:last-child, .artistas li:last-child { border-bottom: 0; }
.hist li time { flex: none; color: var(--cian); font-variant-numeric: tabular-nums; }
.hist li span, .artistas li span { min-width: 0; overflow-wrap: anywhere; }
.artistas li { justify-content: space-between; }
.artistas li b { flex: none; font-weight: 400; color: var(--cian); font-variant-numeric: tabular-nums; }
.artistas li.suena { background: color-mix(in srgb, var(--cian) 16%, transparent); color: #fff; }
.hist li.vacio, .artistas li.vacio { color: var(--tenue); justify-content: center; }

/* ====== tabla de radios ====== */
.tabla-radios { padding: 6px 0 4px; overflow: hidden; }
.tabla-radios table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tabla-radios th { padding: 10px 10px; text-align: left; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--rotulo);
  border-bottom: 1px solid rgba(255,255,255,.1); vertical-align: top; }
.th-fila { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.filtro-btn { flex: none; width: 24px; height: 24px; padding: 3px; border-radius: 6px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--tenue); }
.filtro-btn svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.filtro-btn:hover, .filtro-btn.on { color: var(--cian); border-color: rgba(55,214,255,.4); }
.filtro { display: block; width: 100%; margin-top: 6px; padding: 5px 8px; font: inherit; font-size: .8rem; letter-spacing: 0; text-transform: none;
  color: var(--texto); background: rgba(10,12,32,.7); border: 1px solid rgba(55,214,255,.4); border-radius: 6px; }
.filtro[hidden] { display: none; }
.c-play { width: 52px; } .c-punto { width: 26px; } .c-radio { width: 22%; } .c-genero { width: 30%; } .c-oyentes { width: 56px; text-align: center !important; }
.tabla-radios td { padding: 7px 10px; font-size: .88rem; color: var(--texto-2); border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabla-radios tbody tr { cursor: pointer; transition: background .15s; }
.tabla-radios tbody tr:hover { background: rgba(255,255,255,.04); }
.tabla-radios tbody tr.actual { background: color-mix(in srgb, var(--rosa) 13%, transparent); }
.tabla-radios tbody tr.actual td { color: #fff; }
.tabla-radios td.c-radio { font-weight: 700; color: #fff; }
.tabla-radios td.c-oyentes { text-align: center; color: var(--cian); font-variant-numeric: tabular-nums; }
.fila-play { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(10,12,32,.5); border: 1px solid rgba(255,255,255,.25); transition: border-color .2s, box-shadow .2s; }
.fila-play svg { width: 14px; height: 14px; fill: currentColor; }
.fila-play:hover, tr.actual .fila-play { border-color: var(--rosa); box-shadow: 0 0 8px color-mix(in srgb, var(--rosa) 60%, transparent); }
.punto { display: block; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 6px currentColor; background: currentColor; }
.etiqueta { display: inline-block; margin: 0 6px 0 0; padding: 2px 9px; font-size: .74rem; border-radius: 999px; color: var(--texto-2);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); cursor: pointer; }
.etiqueta:hover { border-color: var(--cian); color: #fff; }
.sin-filas { padding: 16px; text-align: center; color: var(--tenue); }
.ecualizador { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; margin-left: 8px; vertical-align: middle; }
.ecualizador i { width: 3px; background: var(--rosa); animation: eq .9s ease-in-out infinite; }
.ecualizador i:nth-child(2) { animation-delay: -.3s; } .ecualizador i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* ====== barra de reproducción ====== */
.barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999; height: calc(var(--barra-alto) + env(safe-area-inset-bottom));
  padding: 0 22px env(safe-area-inset-bottom); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px;
  background: linear-gradient(180deg, rgba(20,24,60,.96), rgba(12,15,40,.98)); border-top: 1px solid color-mix(in srgb, var(--rosa) 55%, transparent);
  box-shadow: 0 -6px 24px color-mix(in srgb, var(--rosa) 18%, transparent); }
.barra-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
#mini-art { flex: none; width: 54px; height: 54px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255,255,255,.15); }
.barra-textos { min-width: 0; }
.name { font-weight: 700; font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 10px rgba(160,190,255,.35); }
.time { margin-top: 2px; font-style: italic; font-weight: 700; font-size: .85rem; }
.time b { letter-spacing: .05em; text-shadow: 0 0 10px rgba(160,190,255,.55); }
.time span { margin-left: 6px; color: var(--cian); text-shadow: 0 0 8px var(--cian); }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
#play { flex: none; width: 58px; height: 58px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: color-mix(in srgb, var(--rosa) 14%, rgba(10,12,32,.8)); border: 2px solid var(--rosa);
  box-shadow: 0 0 16px var(--rosa), inset 0 0 12px color-mix(in srgb, var(--rosa) 35%, transparent); transition: transform .12s; }
#play:hover { transform: scale(1.07); } #play:active { transform: scale(.95); }
#play svg { width: 24px; height: 24px; fill: currentColor; }
#play .i-pause, .playing #play .i-play { display: none; }
.playing #play .i-pause { display: block; }
/* anterior / siguiente: solo en las radios a la carta (body.carta) */
body:not(.carta) .nav, #prev[hidden], #next[hidden] { display: none !important; }
.nav { flex: none; width: 42px; height: 42px; padding: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: rgba(10,14,40,.6); border: 2px solid #4b5a9a; transition: border-color .2s, box-shadow .2s; }
.nav:hover { border-color: var(--rosa); box-shadow: 0 0 8px var(--rosa); }
.nav svg { width: 18px; height: 18px; fill: currentColor; }
.barra-acciones { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
/* botones agrupados: letras y karaoke · favorito y lista · descargar · volumen */
#ly-btn { order: 1; } #kar-btn { order: 2; } #fav-btn { order: 3; margin-left: 10px !important; } #favl-btn { order: 4; }
.barra-acciones .vol { order: 6; }
.offl-box { display: none !important; }
.vol { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.vol svg { width: 18px; height: 18px; fill: none; stroke: var(--rotulo); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.vol input[type=range] { width: 110px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 24px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--rosa), var(--cian)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--rosa), var(--cian)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--cian); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--cian); }

/* botones redondos de la barra (letras, favoritos, karaoke, instalar) */
#ly-btn, .xbtn { flex: none; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center;
  border: 2px solid #4b5a9a; background: rgba(10,14,40,.6); color: #9fa8ff; font-size: 16px; line-height: 1; transition: border-color .2s, box-shadow .2s, color .2s; }
.xbtn svg { width: 17px; height: 17px; } .xbtn svg path { fill: none; }
#ly-btn:hover, .xbtn:hover { border-color: var(--cian); color: #fff; }
#ly-btn.on { border-color: var(--cian); color: #fff; box-shadow: 0 0 8px var(--cian), inset 0 0 6px rgba(55,214,255,.35); }
.xbtn.on { border-color: var(--rosa); color: #ffb3d9; box-shadow: 0 0 8px var(--rosa); }
.xbtn.on svg path { fill: currentColor; }
.xbtn[hidden] { display: none; }

/* ====== letras (panel que sube sobre la barra) y karaoke ====== */
#ly-panel { display: block; visibility: hidden; transform: translateY(105%); position: fixed; left: 0; right: 0; bottom: calc(var(--barra-alto) + env(safe-area-inset-bottom));
  height: 44vh; z-index: 9998; overflow-y: auto; scrollbar-width: none; text-align: center;
  background: linear-gradient(to bottom, rgba(14,18,46,.97), rgba(10,14,40,.99)); border-top: 1px solid rgba(55,214,255,.5); box-shadow: 0 -6px 22px rgba(55,214,255,.18);
  transition: transform .5s cubic-bezier(.22,.8,.3,1), visibility 0s linear .5s, height .45s cubic-bezier(.22,.8,.3,1); }
#ly-panel::-webkit-scrollbar { display: none; }
body.ly-open #ly-panel { visibility: visible; transform: none; transition: transform .5s cubic-bezier(.22,.8,.3,1), visibility 0s, height .45s cubic-bezier(.22,.8,.3,1); }
body.ly-open { padding-bottom: calc(44vh + var(--barra-alto)); }
#ly-lista { width: min(620px, 92vw); margin: 0 auto; padding: 16vh 0; }
#ly-lista .ly-l { padding: 7px 0; font-size: 1.1rem; line-height: 1.35; color: #9fa8ff; opacity: .4; transition: opacity .3s, color .3s, font-size .3s; }
#ly-lista .ly-on { opacity: 1; color: #fff; font-size: 1.4rem; font-weight: 600; text-shadow: 0 0 10px var(--cian); }
#ly-lista .ly-msg { padding: 7px 0; color: #9fa8ff; font-size: 1rem; }
#ly-lista.ly-plano { white-space: pre-wrap; padding: 18px 0; color: #c5caff; font-size: .95rem; line-height: 1.5; }
body.ly-full #ly-panel { top: 0; bottom: 0; height: 100vh !important; z-index: 10000; border-top: none; background: linear-gradient(to bottom, #0b0e2c, #0a0d28); }
body.ly-full #ly-lista { width: min(900px, 94vw); padding: 44vh 0; }
body.ly-full #ly-lista .ly-l { font-size: clamp(1.4rem, 3.4vw, 2.4rem); padding: 10px 0; }
body.ly-full #ly-lista .ly-on { font-size: clamp(1.8rem, 4.4vw, 3.2rem); }
body.ly-full .app { opacity: 0; pointer-events: none; }
#kar-x { display: none; position: fixed; top: 14px; right: 14px; z-index: 10002; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--cian);
  background: rgba(10,14,40,.85); color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 0 8px var(--cian); }
body.ly-full #kar-x { display: block; }

/* ====== favoritos ====== */
#fav-fondo { display: none; position: fixed; inset: 0; z-index: 10001; background: rgba(6,8,24,.7); align-items: center; justify-content: center; }
#fav-fondo.abierto { display: flex; }
#fav-tarjeta { width: min(460px, 92vw); max-height: 70vh; overflow-y: auto; padding: 16px 18px; border-radius: var(--radio); border: 1px solid rgba(55,214,255,.5);
  background: rgba(14,18,46,.97); box-shadow: 0 0 18px rgba(55,214,255,.25); color: #c5caff; font-size: .95rem; }
#fav-tarjeta h3 { margin: 0 0 10px; text-align: center; color: #fff; letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; }
.fav-fila { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid rgba(155,165,255,.15); }
.fav-txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.fav-fila a { color: var(--cian); text-decoration: none; font-size: .8rem; border: 1px solid var(--cian); border-radius: 10px; padding: 2px 8px; }
.fav-fila button { background: none; border: none; color: #ff7ec0; cursor: pointer; font-size: 1rem; }
.fav-vacio { text-align: center; opacity: .7; padding: 10px 0; }
.fav-cuenta { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(155,165,255,.15); text-align: center; font-size: .82rem; color: var(--tenue); }
.fav-cuenta button { background: none; border: none; padding: 0; color: var(--cian); cursor: pointer; text-decoration: underline; font-size: inherit; }

/* ====== cuenta: entrar con Google / vincular la app con un código (js/cuenta.js) ====== */
#cuenta-fondo { display: none; position: fixed; inset: 0; z-index: 10004; background: rgba(6,8,24,.72); align-items: center; justify-content: center; padding: 16px; }
#cuenta-fondo.abierto { display: flex; }
#cuenta-tarjeta { width: min(400px, 92vw); padding: 18px 20px; border-radius: var(--radio); border: 1px solid rgba(55,214,255,.5);
  background: rgba(14,18,46,.97); box-shadow: 0 0 18px rgba(55,214,255,.25); color: #c5caff; font-size: .95rem; text-align: center; }
#cuenta-tarjeta h3 { margin: 0 0 10px; color: #fff; letter-spacing: .2em; text-transform: uppercase; font-size: .85rem; }
.cuenta-motivo { margin-bottom: 14px; line-height: 1.4; }
.cuenta-motivo:empty { display: none; }
.cuenta-caja { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 44px; line-height: 1.4; }
.cuenta-caja b { color: var(--cian); overflow-wrap: anywhere; }
.cuenta-codigo { font: 700 1.9rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; color: #fff; padding: 8px 16px;
  border: 2px dashed var(--rosa); border-radius: 12px; text-shadow: 0 0 10px var(--rosa); user-select: all; }
.cuenta-tenue { color: var(--tenue); font-size: .8rem; }
.cuenta-otro, .cuenta-no { background: none; border: 1px solid var(--cian); color: var(--cian); border-radius: 18px; padding: 5px 16px; cursor: pointer; }
.cuenta-no { margin-top: 14px; border-color: rgba(155,165,255,.35); color: var(--tenue); }

/* ====== pantallas medianas ====== */
@media (max-width: 1180px) {
  .arriba { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tarjeta-casete { grid-column: 1 / -1; }
  .tarjeta-casete #tape { max-width: 400px; }
  /* barra en 2 filas: canción y controles arriba, botones abajo centrados (no se amontonan) */
  :root { --barra-alto: 124px; }
  .barra { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto; row-gap: 6px; padding: 8px 18px calc(8px + env(safe-area-inset-bottom)); }
  .barra-info { grid-column: 1; grid-row: 1; }
  .controls { grid-column: 2; grid-row: 1; }
  .barra-acciones { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 12px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .lado { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; scrollbar-width: none; }
  .lado::-webkit-scrollbar { display: none; }
  .lado-btn { width: auto; flex: none; padding: 8px 12px; font-size: .85rem; }
  .lado-abajo { margin-top: 0; }
  main { gap: 12px; }
  .arriba { gap: 12px; }
  .c-genero { width: 34%; }
  .vol { display: none; }
  /* en pantallas angostas la tabla de radios va justo debajo del casete */
  .arriba { display: contents; }
  .tarjeta-casete { order: 1; } .tabla-radios { order: 2; } .hist { order: 3; } .artistas { order: 4; }
}

/* ====== teléfono ====== */
@media (max-width: 640px) {
  :root { --barra-alto: 124px; }
  .arriba { grid-template-columns: minmax(0, 1fr); }
  .hist ul, .artistas ul { max-height: 190px; }
  .chrome { font-size: 1.98rem; } .neon { font-size: 1.54rem; right: 10px; bottom: 4px; }
  .tarjeta-casete { padding: 38px 14px 12px; }
  .cabecera { padding: 12px 12px 0; }
  /* tabla → tarjetas: cada radio en 2-3 líneas (nombre + oyentes / sonando ahora / géneros), todo visible */
  .tabla-radios table, .tabla-radios thead, .tabla-radios tbody { display: block; width: 100%; }
  .tabla-radios thead tr { display: flex; flex-wrap: wrap; gap: 0 4px; padding: 0 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .tabla-radios thead th { display: block; width: auto; flex: 1 1 0; min-width: 0; padding: 8px 6px; border: 0; letter-spacing: .06em; font-size: .68rem; white-space: nowrap; }
  .tabla-radios thead th.c-play, .tabla-radios thead th.c-punto, .tabla-radios thead th.c-oyentes { display: none; }
  .tabla-radios thead th.c-suena { flex-grow: 1.4; }
  .tabla-radios thead th:has(.filtro:not([hidden])) { flex-basis: 100%; order: -1; }   /* el filtro abierto usa todo el ancho */
  .tabla-radios tbody tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 3px; align-items: center;
    grid-template-areas: "play radio oy" "play suena suena" "play genero genero"; padding: 9px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
  .tabla-radios tbody tr[hidden] { display: none; }
  .tabla-radios tbody td { display: block; width: auto; padding: 0; border: 0; }
  .tabla-radios td.c-play { grid-area: play; align-self: center; }
  .tabla-radios td.c-punto { display: none; }
  .tabla-radios td.c-radio { grid-area: radio; display: flex; align-items: center; gap: 7px; font-size: .95rem; }
  .tabla-radios td.c-radio::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--punto, var(--rosa)); box-shadow: 0 0 6px var(--punto, var(--rosa)); }
  .tabla-radios td.c-suena { grid-area: suena; font-size: .84rem; }
  .tabla-radios td.c-genero { grid-area: genero; white-space: normal; line-height: 1.9; }
  .tabla-radios td.c-genero:empty { display: none; }
  .tabla-radios td.c-genero .etiqueta { font-size: .7rem; padding: 1px 8px; }
  .tabla-radios td.c-oyentes { grid-area: oy; font-size: .8rem; }
  .tabla-radios td.c-oyentes::before { content: "🎧 "; }
  #mini-art { width: 46px; height: 46px; }
  #play { width: 52px; height: 52px; }
  #ly-panel { height: 40vh; }
  body.ly-open { padding-bottom: calc(40vh + var(--barra-alto)); }
}
@media (prefers-reduced-motion: reduce) { .piso { animation: none; } #ly-panel, body, #ficha, #ficha-fondo { transition: none !important; } .ecualizador i { animation: none; height: 8px; } }

/* ====== ficha de la canción y compartir (ficha.js) ====== */
#compartir-radio { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 50%; cursor: pointer;
  background: rgba(10,14,40,.6); border: 1px solid var(--panel-borde); color: var(--texto-2); }
#compartir-radio svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#compartir-radio:hover { border-color: var(--cian); color: #fff; box-shadow: 0 0 8px rgba(55,214,255,.35); }
#ficha-fondo { display: flex; visibility: hidden; opacity: 0; position: fixed; inset: 0; z-index: 10002; background: rgba(6,8,24,.72); align-items: center; justify-content: center; padding: 16px;
  transition: opacity .4s ease, visibility 0s linear .5s; }   /* aparece y se va con suavidad, como el panel de la letra */
#ficha-fondo.abierto { visibility: visible; opacity: 1; transition: opacity .35s ease, visibility 0s; }
#ficha { transform: translateY(60px) scale(.96); opacity: 0; transition: transform .5s cubic-bezier(.22,.8,.3,1), opacity .35s ease; }
#ficha-fondo.abierto #ficha { transform: none; opacity: 1; }
#ficha { position: relative; width: min(400px, 100%); max-height: 88vh; overflow-y: auto; padding: 18px 18px 16px; border-radius: var(--radio);
  border: 1px solid color-mix(in srgb, var(--color-radio, var(--rosa)) 60%, transparent);
  background: rgba(14,18,46,.97); box-shadow: 0 0 24px color-mix(in srgb, var(--color-radio, var(--rosa)) 30%, transparent); color: var(--texto-2); text-align: center; }
#ficha-x { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; border: 0; background: none; color: var(--tenue); font-size: 1.5rem; line-height: 1; cursor: pointer; }
#ficha-x:hover { color: #fff; }
#ficha-art { width: min(260px, 70vw); aspect-ratio: 1; margin: 6px auto 12px; border-radius: 12px; overflow: hidden; background: #0d0e11;
  box-shadow: 0 10px 28px rgba(0,0,0,.5), 0 0 18px color-mix(in srgb, var(--color-radio, var(--rosa)) 35%, transparent); }
#ficha-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
#ficha-radio { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rotulo); }
#ficha-radio i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-radio, var(--rosa)); box-shadow: 0 0 6px var(--color-radio, var(--rosa)); }
#ficha-cancion { margin: 8px 0 2px; color: #fff; font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
#ficha-artista { margin: 0 0 10px; color: var(--cian); font-size: .98rem; }
#ficha-datos { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 auto 12px; max-width: 300px; text-align: left; font-size: .86rem; }
#ficha-datos dt { color: var(--tenue); }
#ficha-datos dd { margin: 0; color: var(--texto); overflow-wrap: anywhere; }
#ficha-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#ficha-acciones a, #ficha-acciones button { padding: 7px 13px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem; text-decoration: none;
  color: #fff; background: rgba(10,14,40,.7); border: 1px solid var(--panel-borde); }
#ficha-acciones a:hover, #ficha-acciones button:hover { border-color: var(--cian); box-shadow: 0 0 8px rgba(55,214,255,.3); }
#ficha-aviso { position: fixed; left: 50%; bottom: calc(var(--barra-alto, 90px) + 14px); transform: translate(-50%, 10px); z-index: 10003; max-width: 92vw;
  padding: 8px 14px; border-radius: 999px; background: rgba(14,18,46,.96); border: 1px solid var(--cian); color: #fff; font-size: .85rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; overflow-wrap: anywhere; }
#ficha-aviso.visible { opacity: 1; transform: translate(-50%, 0); }
/* controles de la ficha, abajo como en Spotify */
#ficha-ctrl { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(155,165,255,.15); }
#ficha-avance { display: flex; align-items: center; gap: 10px; font-size: .75rem; color: var(--tenue); font-variant-numeric: tabular-nums; }
#ficha-barra { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
#ficha-barra i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .4s linear;
  background: linear-gradient(90deg, var(--color-radio, var(--rosa)), var(--cian)); box-shadow: 0 0 6px var(--color-radio, var(--rosa)); }
#ficha-botones { display: flex; align-items: center; justify-content: center; gap: 22px; margin-top: 12px; }
#ficha-botones button { display: grid; place-items: center; padding: 0; cursor: pointer; border-radius: 50%; color: #fff; background: none; border: 1px solid transparent; }
#ficha-botones button[hidden] { display: none; }
#ficha-prev, #ficha-next { width: 44px; height: 44px; border-color: rgba(155,165,255,.3) !important; }
#ficha-prev svg, #ficha-next svg { width: 20px; height: 20px; fill: currentColor; }
#ficha-play { width: 62px; height: 62px; background: var(--color-radio, var(--rosa)) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--color-radio, var(--rosa)) 60%, transparent); }
#ficha-play svg { width: 28px; height: 28px; fill: #fff; }
#ficha-play .i-pause, #ficha.sonando #ficha-play .i-play { display: none; }
#ficha.sonando #ficha-play .i-pause { display: block; }
#ficha-botones button:hover { filter: brightness(1.15); border-color: var(--cian); }

/* ====== modo Radio / Reproductor (modo.js): interruptor arriba a la derecha del casete ====== */
#modo-btn { position: absolute; top: 12px; right: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  border-radius: 999px; cursor: pointer; font: inherit; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--tenue); background: rgba(10,14,40,.72); border: 1px solid var(--panel-borde); }
#modo-btn i { position: relative; width: 30px; height: 16px; border-radius: 999px; background: rgba(255,255,255,.12); transition: background .3s; }
#modo-btn i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px var(--cian); transition: transform .3s cubic-bezier(.22,.8,.3,1); }
#modo-btn .modo-txt:first-child { color: #fff; }
#modo-btn[aria-checked="true"] i { background: var(--rosa); }
#modo-btn[aria-checked="true"] i::after { transform: translateX(14px); box-shadow: 0 0 8px var(--rosa); }
#modo-btn[aria-checked="true"] .modo-txt:first-child { color: var(--tenue); }
#modo-btn[aria-checked="true"] .modo-txt:last-child { color: #fff; }
#modo-btn:hover { border-color: var(--cian); }
@media (max-width: 560px) { #modo-btn { top: 8px; right: 8px; padding: 4px 8px; font-size: .6rem; } }
/* barra de la ficha: en modo reproductor se puede tocar/arrastrar */
#ficha.buscable #ficha-barra { cursor: pointer; height: 7px; touch-action: none; position: relative; overflow: visible; }
#ficha.buscable #ficha-barra::before { content: ""; position: absolute; inset: -10px 0; }   /* zona de toque más grande */
#ficha.buscable #ficha-barra i { position: relative; }
#ficha.buscable #ficha-barra i::after { content: ""; position: absolute; right: -6px; top: 50%; width: 13px; height: 13px; margin-top: -6.5px;
  border-radius: 50%; background: #fff; box-shadow: 0 0 8px var(--color-radio, var(--rosa)); }

/* ====== canción bajo el casete (tabla.js) ====== */
.casete-cancion { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 10px; padding: 0 8px; min-width: 0; }
.casete-cancion b { max-width: 100%; color: #fff; font-size: 1.08rem; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 0 10px color-mix(in srgb, var(--rosa) 45%, transparent); }
.casete-cancion span { max-width: 100%; color: var(--cian); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casete-cancion + .estacion-actual { margin-top: 8px; }

/* ====== páginas de la tabla de radios (5 por página en PC) ====== */
.paginas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.paginas[hidden] { display: none; }
.paginas-botones { display: flex; align-items: center; gap: 6px; }
.paginas button { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; cursor: pointer; font: inherit; font-size: .88rem;
  color: var(--texto-2); background: rgba(10,12,32,.5); border: 1px solid rgba(255,255,255,.14); transition: border-color .2s, box-shadow .2s, color .2s; }
.paginas button:hover:not([disabled]) { border-color: var(--cian); color: #fff; }
.paginas button.on { color: #fff; border-color: var(--rosa); background: color-mix(in srgb, var(--rosa) 22%, rgba(10,12,32,.6)); box-shadow: 0 0 10px color-mix(in srgb, var(--rosa) 45%, transparent); }
.paginas button[disabled] { opacity: .35; cursor: default; }
.paginas-info { color: var(--tenue); font-size: .8rem; letter-spacing: .04em; }

/* ====== pie de página ====== */
.pie { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 10px; padding: 6px 12px 4px; color: var(--tenue); font-size: .78rem; letter-spacing: .04em; text-align: center; }
.pie a { color: var(--texto-2); text-decoration: none; }
.pie a:hover { color: var(--cian); }
.pie-sep { opacity: .5; }
