/* =========================================================
   PROXYFI — estilos v2
   Paleta: dial de radio nocturno
   ink:#12141A panel:#181B24 panel2:#1F2330 line:#2A2E3B
   amber:#E8A33D amber-dim:#8A5F22 text:#EDEAE2 sub:#8B90A0
   ========================================================= */

:root{
  --ink:#12141A;
  --panel:#181B24;
  --panel-2:#1F2330;
  --line:#2A2E3B;
  --amber:#E8A33D;
  --amber-dim:#8A5F22;
  --text:#EDEAE2;
  --sub:#8B90A0;
  --danger:#E0654F;
  --ok:#6FBF8B;

  --font-display:'Big Shoulders Display', sans-serif;
  --font-body:'Work Sans', sans-serif;
  --player-h:84px;
}

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

/* Blindaje: cualquier elemento marcado hidden se oculta SIEMPRE,
   aunque otra regla más abajo le ponga display:flex/grid/etc.
   (esto es lo que causaba que el modal de premium no se cerrara) */
[hidden]{ display:none !important; }

html,body{ height:100%; background:var(--ink); color:var(--text); font-family:var(--font-body); }
body{ padding-bottom:var(--player-h); overflow-x:hidden; }
a{ color:inherit; }
button{ font-family:inherit; }

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

.dial-noise{
  position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.03; mix-blend-mode:overlay;
  background-image:radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
  background-size:3px 3px;
}

/* ---------- STATUS BANNER ---------- */
.status-banner{
  position:sticky; top:0; z-index:60;
  display:flex; align-items:center; gap:14px;
  background:#2A1B14; border-bottom:1px solid var(--amber-dim);
  color:var(--amber); font-size:13px; padding:10px 20px;
}
.status-banner.ok{ background:#132A1D; border-color:#2E6B47; color:var(--ok); }
.status-retry, .status-close{
  background:none; border:1px solid currentColor; color:inherit; border-radius:6px;
  padding:4px 10px; font-size:12px; cursor:pointer;
}
.status-close{ margin-left:auto; border:none; font-size:14px; }

/* ---------- LAYOUT ---------- */
.app{
  position:relative; z-index:1;
  max-width:1280px;
  margin:0 auto;
  padding:20px 24px 0;
}

/* ---------- TOP BAR ---------- */
.topbar{
  display:flex; align-items:center; gap:22px;
  padding-bottom:16px; border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.brand{ display:flex; align-items:center; gap:8px; color:var(--amber); }
.brand h1{ font-family:var(--font-display); font-weight:800; font-size:24px; color:var(--text); text-transform:lowercase; }
.brand-dot{ color:var(--amber); }
#needle{ transform-origin:20px 20px; animation:sweep 6s ease-in-out infinite; }
@keyframes sweep{ 0%,100%{ transform:rotate(-22deg); } 50%{ transform:rotate(22deg); } }

.tabs{ display:flex; gap:4px; }
.tab{
  background:none; border:none; color:var(--sub); font-size:13.5px; font-weight:500;
  padding:8px 13px; border-radius:20px; cursor:pointer; transition:all .15s ease;
  white-space:nowrap;
}
.tab:hover{ color:var(--text); }
.tab.active{ background:var(--panel); color:var(--amber); }

.searchbar{
  display:flex; align-items:center;
  background:var(--panel); border:1px solid var(--line); border-radius:8px;
  padding:0 6px 0 12px; min-width:180px; flex:1; max-width:340px;
  transition:border-color .15s ease, background .15s ease;
}
.searchbar:focus-within{ border-color:var(--amber-dim); background:var(--panel-2); }
.searchbar input{ flex:1; background:none; border:none; outline:none; color:var(--text); font-size:13.5px; padding:10px 6px; }
.searchbar input::placeholder{ color:var(--sub); }
.searchbar button{ background:none; border:none; color:var(--sub); cursor:pointer; padding:7px; display:flex; border-radius:6px; }
.searchbar button:hover{ color:var(--amber); background:rgba(232,163,61,.08); }

.plan-badge{
  display:flex; align-items:center; gap:8px; font-size:12px; color:var(--amber);
  background:none; border:1px solid var(--amber-dim); border-radius:20px; padding:7px 14px;
  white-space:nowrap; cursor:pointer; transition:all .15s ease;
}
.plan-badge:hover{ background:rgba(232,163,61,.08); }
.plan-badge .dot{ width:6px; height:6px; border-radius:50%; background:var(--amber); }

/* ---------- VIEWS ---------- */
.views{ padding:28px 0 40px; min-height:60vh; }
.view{ display:none; animation:fadeUp .25s ease; }
.view.active{ display:block; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(6px);} to{ opacity:1; transform:translateY(0);} }

.view-head{ margin-bottom:24px; }
.view-head h2{ font-family:var(--font-display); font-size:32px; font-weight:700; }
.view-head p{ color:var(--sub); font-size:13.5px; margin-top:4px; }

/* ---------- HERO (home) ---------- */
.hero{ padding:20px 0 40px; max-width:640px; }
.eyebrow{ font-size:12px; letter-spacing:.5px; color:var(--amber); margin-bottom:10px; }
.hero-title{ font-family:var(--font-display); font-weight:800; font-size:46px; line-height:1.08; margin-bottom:16px; }
.hero .accent{ color:var(--amber); }
.hero-sub{ color:var(--sub); font-size:15px; line-height:1.6; margin-bottom:26px; max-width:480px; }
.hero-stats{ display:flex; gap:34px; }
.hero-stats div{ display:flex; flex-direction:column; gap:2px; }
.hero-stats strong{ font-family:var(--font-display); font-size:26px; font-weight:700; }
.hero-stats span{ font-size:11.5px; color:var(--sub); }

.row-head{ display:flex; align-items:baseline; justify-content:space-between; margin:34px 0 14px; }
.row-head h3{ font-family:var(--font-display); font-weight:700; font-size:19px; }
.linklike{ background:none; border:none; color:var(--amber); font-size:12.5px; cursor:pointer; }
.linklike:hover{ text-decoration:underline; }
.linklike.small{ font-size:11px; color:var(--sub); margin-left:10px; }

/* ---------- GRIDS / CARDS ---------- */
.hgrid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:16px; }
.tcard{
  background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px;
  cursor:pointer; transition:transform .15s ease, border-color .15s ease, background .15s ease;
}
.tcard:hover{ transform:translateY(-3px); border-color:var(--amber-dim); background:var(--panel-2); }
.tcard img{ width:100%; aspect-ratio:1; object-fit:cover; border-radius:6px; margin-bottom:10px; background:var(--panel-2); }
.tcard .tt{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tcard .ta{ font-size:11.5px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.skel-row{ height:150px; border-radius:10px; background:linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%); background-size:400% 100%; animation:shimmer 1.4s ease infinite; grid-column:1/-1; }
@keyframes shimmer{ 0%{ background-position:100% 0;} 100%{ background-position:0 0;} }

/* ---------- CHIPS ---------- */
.chip-row, .chip-grid{ display:flex; flex-wrap:wrap; gap:10px; }
.chip-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(140px,1fr)); }
.chip{
  background:var(--panel); border:1px solid var(--line); color:var(--text);
  padding:10px 16px; border-radius:20px; font-size:13px; cursor:pointer;
  transition:all .15s ease; text-align:center;
}
.chip:hover{ border-color:var(--amber-dim); color:var(--amber); background:var(--panel-2); }

/* ---------- MOODS ---------- */
.mood-row{ display:flex; gap:14px; overflow-x:auto; padding-bottom:6px; }
.mood-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:16px; }
.mood-card{
  position:relative; min-width:190px; height:110px; border-radius:12px; overflow:hidden;
  cursor:pointer; border:1px solid var(--line);
  display:flex; align-items:flex-end; padding:14px;
  background:linear-gradient(135deg, var(--mood-a, #2a2e3b), var(--mood-b, #181b24));
  transition:transform .15s ease;
}
.mood-grid .mood-card{ min-width:0; height:130px; }
.mood-card:hover{ transform:translateY(-3px); }
.mood-card span{ font-family:var(--font-display); font-weight:700; font-size:18px; color:#fff; text-shadow:0 2px 8px rgba(0,0,0,.4); }

/* ---------- CHART LIST ---------- */
.chart-list{ list-style:none; display:flex; flex-direction:column; gap:2px; }
.chart-item{
  display:flex; align-items:center; gap:14px; padding:10px 12px; border-radius:8px;
  cursor:pointer; transition:background .12s ease;
}
.chart-item:hover{ background:var(--panel); }
.chart-item .cnum{ font-family:var(--font-display); font-weight:700; font-size:18px; color:var(--sub); width:28px; text-align:right; flex-shrink:0; }
.chart-item.active .cnum{ color:var(--amber); }
.chart-item img{ width:44px; height:44px; border-radius:6px; object-fit:cover; background:var(--panel-2); flex-shrink:0; }
.chart-item .ci-title{ font-size:14px; font-weight:600; }
.chart-item .ci-artist{ font-size:12px; color:var(--sub); }
.chart-item .ci-dur{ margin-left:auto; font-size:12px; color:var(--sub); font-family:var(--font-display); }

/* ---------- SUBTABS ---------- */
.subtabs{ display:flex; gap:6px; margin-bottom:20px; border-bottom:1px solid var(--line); }
.subtabs.small{ margin:12px 0; }
.subtab{
  background:none; border:none; color:var(--sub); font-size:13px; padding:9px 4px; margin-right:18px;
  cursor:pointer; border-bottom:2px solid transparent; transition:all .15s ease;
}
.subtab:hover{ color:var(--text); }
.subtab.active{ color:var(--amber); border-color:var(--amber); }

/* ---------- LIBRARY ---------- */
.lib-panel{ display:none; }
.lib-panel.active{ display:block; animation:fadeUp .2s ease; }
.inline-form{ display:flex; gap:10px; margin-bottom:20px; max-width:420px; }
.inline-form input{
  flex:1; background:var(--panel); border:1px solid var(--line); border-radius:8px;
  color:var(--text); font-size:13px; padding:10px 12px; outline:none;
}
.inline-form input:focus{ border-color:var(--amber-dim); }
.inline-form button{
  background:var(--amber); color:var(--ink); border:none; border-radius:8px; padding:10px 16px;
  font-weight:600; font-size:13px; cursor:pointer; white-space:nowrap;
}
.inline-form button:hover{ background:#f0b25c; }

.playlist-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(170px,1fr)); gap:16px; }
.plcard{ background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; cursor:pointer; transition:all .15s ease; }
.plcard:hover{ border-color:var(--amber-dim); background:var(--panel-2); }
.plcard .plicon{ width:40px; height:40px; border-radius:8px; background:var(--panel-2); display:flex; align-items:center; justify-content:center; color:var(--amber); margin-bottom:12px; }
.plcard .pltitle{ font-weight:600; font-size:14px; margin-bottom:2px; }
.plcard .plcount{ font-size:11.5px; color:var(--sub); }

.dropzone{
  display:flex; flex-direction:column; align-items:center; gap:10px;
  border:1.5px dashed var(--line); border-radius:12px; padding:34px 20px; margin-bottom:24px;
  color:var(--sub); cursor:pointer; transition:all .15s ease; text-align:center; font-size:13px;
}
.dropzone:hover, .dropzone.dragover{ border-color:var(--amber-dim); color:var(--amber); background:var(--panel); }

/* ---------- QUEUE LIST (usado en cola, subidas, likes) ---------- */
.queue-list{ list-style:none; display:flex; flex-direction:column; gap:2px; }
.queue-empty{ color:var(--sub); font-size:13px; line-height:1.5; padding:8px 0; }
.queue-item{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:6px; cursor:pointer; transition:background .12s ease; }
.queue-item:hover{ background:var(--panel); }
.queue-item.active{ background:var(--panel-2); }
.queue-item .qnum{ font-family:var(--font-display); font-weight:600; font-size:13px; color:var(--sub); width:18px; flex-shrink:0; text-align:right; }
.queue-item.active .qnum{ color:var(--amber); }
.queue-item .qthumb{ width:32px; height:32px; border-radius:4px; object-fit:cover; flex-shrink:0; background:var(--panel-2); }
.queue-item .qinfo{ min-width:0; flex:1; }
.queue-item .qtitle{ font-size:13px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.queue-item .qartist{ font-size:11px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.queue-item .qdel{ background:none; border:none; color:var(--sub); cursor:pointer; padding:4px; flex-shrink:0; }
.queue-item .qdel:hover{ color:var(--danger); }
.queue-item .qplaying{ width:14px; flex-shrink:0; display:flex; align-items:center; justify-content:center; gap:2px; }
.eqbar{ width:2.5px; background:var(--amber); border-radius:1px; animation:eq .9s ease-in-out infinite; }
.eqbar:nth-child(1){ height:6px; } .eqbar:nth-child(2){ height:11px; animation-delay:.15s; } .eqbar:nth-child(3){ height:8px; animation-delay:.3s; }
@keyframes eq{ 0%,100%{ transform:scaleY(.4);} 50%{ transform:scaleY(1);} }

/* ---------- RESULTS STRIP ---------- */
.results-strip{ border-top:1px solid var(--line); padding:20px 0 30px; margin-top:10px; }
.panel-head{ display:flex; align-items:baseline; justify-content:space-between; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid var(--line); }
.panel-head h2{ font-family:var(--font-display); font-weight:700; font-size:14px; letter-spacing:1px; text-transform:uppercase; color:var(--sub); display:flex; align-items:center; gap:8px; }
.results-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px,1fr)); gap:16px; }
.closepanel{ background:none; border:none; color:var(--sub); cursor:pointer; font-size:13px; }
.closepanel:hover{ color:var(--text); }
.tape-count{ font-family:var(--font-display); color:var(--amber); font-size:14px; }

/* ---------- DRAWERS (cola / letras) ---------- */
.queue-drawer, .lyrics-drawer{
  position:fixed; top:0; right:-360px; width:340px; height:100%;
  background:var(--panel); border-left:1px solid var(--line); z-index:55;
  padding:20px; overflow-y:auto; transition:right .25s ease;
}
.queue-drawer.open, .lyrics-drawer.open{ right:0; }
.lyrics-body{ display:flex; flex-direction:column; gap:12px; }
.lyrics-empty{ font-size:12.5px; color:var(--sub); line-height:1.6; }
#lyricsInput{
  min-height:300px; background:var(--panel-2); border:1px solid var(--line); border-radius:8px;
  color:var(--text); font-size:13px; line-height:1.6; padding:12px; resize:vertical; outline:none;
}
#lyricsInput:focus{ border-color:var(--amber-dim); }

.drawer-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:50; }

/* ---------- FOOT ---------- */
.tinyfoot{ text-align:center; font-size:11px; color:var(--sub); padding:18px 0 30px; border-top:1px solid var(--line); }
.tinyfoot a{ color:var(--sub); } .tinyfoot a:hover{ color:var(--amber); }

/* ---------- PLAYER BAR ---------- */
.player{
  position:fixed; bottom:0; left:0; right:0; height:var(--player-h); z-index:45;
  background:var(--panel); border-top:1px solid var(--line);
  display:grid; grid-template-columns:280px 1fr 280px; align-items:center;
  padding:0 20px; gap:16px;
}
.player-track{ display:flex; align-items:center; gap:12px; min-width:0; }
.art-wrap{ position:relative; width:52px; height:52px; flex-shrink:0; }
.art{ width:52px; height:52px; border-radius:6px; object-fit:cover; background:var(--panel-2); position:relative; z-index:2; }
.vinyl-ring{ position:absolute; inset:-4px; border-radius:50%; border:1px dashed transparent; z-index:1; }
.art-wrap.playing .vinyl-ring{ animation:spin 10s linear infinite; border-color:var(--amber-dim); }
@keyframes spin{ from{ transform:rotate(0);} to{ transform:rotate(360deg);} }
.player-meta{ min-width:0; }
.player-title{ font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.player-artist{ font-size:11.5px; color:var(--sub); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.iconbtn{ background:none; border:none; color:var(--sub); cursor:pointer; padding:7px; border-radius:50%; display:flex; flex-shrink:0; transition:color .15s ease, background .15s ease; }
.iconbtn:hover{ color:var(--amber); background:rgba(232,163,61,.08); }
.iconbtn[aria-pressed="true"]{ color:var(--amber); }

.player-center{ display:flex; flex-direction:column; align-items:center; gap:6px; min-width:0; }
.transport{ display:flex; align-items:center; gap:14px; }
.tbtn{ background:none; border:none; color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; position:relative; transition:all .15s ease; }
.tbtn:hover{ color:var(--amber); background:rgba(232,163,61,.08); }
.tbtn[aria-pressed="true"]{ color:var(--amber); }
.tbtn.play{ width:36px; height:36px; background:var(--amber); color:var(--ink); }
.tbtn.play:hover{ background:#f0b25c; color:var(--ink); }
.loop-one{ position:absolute; bottom:-1px; right:-1px; font-size:7px; font-weight:700; background:var(--amber); color:var(--ink); width:11px; height:11px; border-radius:50%; display:none; align-items:center; justify-content:center; }
.tbtn[data-loop="one"] .loop-one{ display:flex; }

.scrubber{ display:flex; align-items:center; gap:8px; width:100%; max-width:480px; }
.time{ font-family:var(--font-display); font-size:11px; color:var(--sub); width:30px; flex-shrink:0; }
.time:last-child{ text-align:right; }
.bar-track{ position:relative; flex:1; height:18px; display:flex; align-items:center; cursor:pointer; }
.bar-fill{ position:absolute; left:0; top:50%; transform:translateY(-50%); height:3px; width:0%; border-radius:2px; background:var(--amber); z-index:1; }
.bar-track::before{ content:''; position:absolute; left:0; right:0; top:50%; transform:translateY(-50%); height:3px; border-radius:2px; background:var(--line); }
.bar-handle{ position:absolute; top:50%; left:0%; transform:translate(-50%,-50%); width:10px; height:10px; border-radius:50%; background:var(--amber); opacity:0; transition:opacity .15s ease; z-index:2; }
.bar-track:hover .bar-handle{ opacity:1; }

.player-right{ display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.pillbtn{ display:flex; align-items:center; gap:6px; background:var(--panel-2); border:1px solid var(--line); color:var(--sub); font-size:11.5px; padding:6px 11px; border-radius:20px; cursor:pointer; transition:all .15s ease; white-space:nowrap; }
.pillbtn:hover{ color:var(--text); border-color:var(--amber-dim); }
.volume{ display:flex; align-items:center; gap:6px; color:var(--sub); }
.volume input[type="range"]{ width:70px; accent-color:var(--amber); cursor:pointer; }

/* ---------- MODAL ---------- */
.modal-backdrop{ position:fixed; inset:0; background:rgba(10,11,15,.7); display:flex; align-items:center; justify-content:center; z-index:70; padding:20px; animation:fadeUp .2s ease; }
.modal{ background:var(--panel); border:1px solid var(--line); border-radius:14px; max-width:400px; width:100%; padding:30px 26px; position:relative; }
.modal-close{ position:absolute; top:14px; right:14px; background:none; border:none; color:var(--sub); cursor:pointer; font-size:14px; }
.modal-close:hover{ color:var(--text); }
.modal h2{ font-family:var(--font-display); font-size:22px; font-weight:700; margin:4px 0 12px; }
.modal-copy{ font-size:13px; color:var(--sub); line-height:1.6; }
.picker-list{ display:flex; flex-direction:column; gap:4px; max-height:220px; overflow-y:auto; margin:14px 0; }
.picker-item{ display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:8px; background:var(--panel-2); cursor:pointer; font-size:13px; }
.picker-item:hover{ background:var(--line); }

/* ---------- SCROLLBARS ---------- */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--line); border-radius:4px; }
::-webkit-scrollbar-thumb:hover{ background:var(--amber-dim); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px){
  .tabs{ order:3; width:100%; overflow-x:auto; }
  .searchbar{ max-width:none; }
  .player{ grid-template-columns:1fr auto; grid-template-areas:"track right" "center center"; height:auto; padding:10px 14px; row-gap:8px; }
  .player-track{ grid-area:track; }
  .player-right{ grid-area:right; }
  .player-center{ grid-area:center; }
  body{ padding-bottom:120px; }
  .queue-drawer, .lyrics-drawer{ width:100%; right:-100%; }
  .hero-title{ font-size:34px; }
}

:focus-visible{ outline:2px solid var(--amber); outline-offset:2px; }
