/* ====== 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 */
.piso { position: fixed; left: -50%; right: -50%; bottom: 0; height: 55vh; z-index: -1; pointer-events: none;
  background:
    linear-gradient(transparent 0 calc(100% - 1px), rgba(55,214,255,.22) 0) 0 0 / 100% 60px,
    linear-gradient(90deg, transparent 0 calc(100% - 1px), color-mix(in srgb, var(--rosa) 30%, transparent) 0) 0 0 / 80px 100%;
  transform: perspective(380px) rotateX(62deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 90%); mask-image: linear-gradient(to top, #000 10%, transparent 90%); }

/* ====== 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 16px; text-align: center; }
.logo { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); display: inline-block; padding: 4px 26px 10px;
  background: linear-gradient(180deg, rgba(38,43,85,.98), rgba(26,30,66,.98)); border: 1px solid var(--panel-borde); border-radius: 10px; white-space: nowrap; }
.chrome { display: block; font: italic 900 2.2rem/1 "Arial Black", "Helvetica Neue", Impact, sans-serif; letter-spacing: .04em;
  background: 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; right: 6px; bottom: -4px; font: italic 400 1.7rem/1 "Brush Script MT", "Segoe Script", "Snell Roundhand", "Lucida Handwriting", cursive;
  color: #ffd6ee; transform: rotate(-9deg); text-shadow: 0 0 4px #fff, 0 0 10px var(--rosa), 0 0 22px var(--rosa), 0 0 40px var(--rosa); }
#tape { display: block; width: 100%; max-width: 440px; margin: 0 auto; filter: drop-shadow(0 16px 22px rgba(0,0,0,.55)); }
#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; }
.nav, #prev, #next { display: none !important; }
.barra-acciones { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.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; }

/* ====== 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; }
}
@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; }
  .tarjeta-casete { margin-top: 14px; }
  /* 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.8rem; } .neon { font-size: 1.4rem; }
  .tarjeta-casete { padding: 40px 14px 12px; }
  .c-genero, .c-oyentes { display: none; }
  .c-radio { width: 40%; }
  .tabla-radios th { letter-spacing: .06em; font-size: .68rem; white-space: nowrap; }
  .c-play { width: 46px; } .c-punto { width: 20px; }
  .tabla-radios td { padding: 8px 8px; }
  .barra { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 1fr auto; row-gap: 6px; padding: 8px 14px 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; }
  #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) { #ly-panel, body { transition: none !important; } .ecualizador i { animation: none; height: 8px; } }
