/* ═══════════════════════════════════════════════════════════
   LOWEGATE STUDIO — NEON PLAYER
   ═══════════════════════════════════════════════════════════ */

.lw-player {
  --neon:      var(--gold);
  --neon-soft: rgba(201,146,42,0.5);
  --neon-dim:  rgba(201,146,42,0.14);

  margin-top: 2.5rem;
  position: relative;
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(201,146,42,0.07) 0%, transparent 55%),
    linear-gradient(180deg, #131313 0%, #0c0c0c 100%);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.6s, box-shadow 0.6s;
}

/* alone neon che pulsa quando suona */
.lw-player::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, var(--neon-soft), transparent 40%, transparent 60%, var(--neon-soft));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
.lw-player.is-playing::before { opacity: 1; }
.lw-player.is-playing {
  box-shadow: 0 0 60px -18px var(--neon-soft), 0 30px 70px -40px #000;
}

/* linea scanner in cima */
.lw-player__scan {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  opacity: 0; transition: opacity 0.5s;
}
.lw-player.is-playing .lw-player__scan {
  opacity: 1;
  animation: lw-scan 4s ease-in-out infinite;
}
@keyframes lw-scan {
  0%, 100% { transform: translateX(-40%) scaleX(0.5); }
  50%      { transform: translateX(40%)  scaleX(1); }
}

/* ── HEADER ───────────────────────────────────────────── */
.lw-player__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.012);
}
.lw-player__brand {
  display: flex; align-items: center; gap: 0.7rem;
}
.lw-player__pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
}
.lw-player.is-playing .lw-player__pulse {
  background: var(--neon);
  box-shadow: 0 0 0 0 var(--neon-soft);
  animation: lw-pulse 2s ease-out infinite;
}
@keyframes lw-pulse {
  0%   { box-shadow: 0 0 0 0 var(--neon-soft); }
  100% { box-shadow: 0 0 0 12px rgba(201,146,42,0); }
}
.lw-player__ptitle {
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--white); line-height: 1.3;
}
.lw-player__psub {
  font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em;
}
.lw-player__count {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--neon);
  padding: 0.28rem 0.65rem; border-radius: 999px;
  border: 1px solid var(--neon-dim);
  background: rgba(201,146,42,0.06);
  white-space: nowrap;
}

/* nota sotto l'header: cos'è questa playlist */
.lw-player__note {
  margin: 0;
  padding: 0.7rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.24);
  font-size: 0.74rem; line-height: 1.5; color: var(--muted);
  border-left: 2px solid var(--neon-dim);
  transition: border-color 0.6s;
}
.lw-player.is-playing .lw-player__note { border-left-color: var(--neon-soft); }

/* ── STAGE (cover + info) ─────────────────────────────── */
.lw-player__stage {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.8rem;
  padding: 1.8rem 1.5rem;
  align-items: center;
}

/* ── COVER ────────────────────────────────────────────── */
.lw-cover {
  position: relative;
  width: 190px; height: 190px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card2);
  border: 1px solid var(--blight);
  flex-shrink: 0;
  transition: transform 0.5s cubic-bezier(0.2,0.9,0.3,1), box-shadow 0.5s;
}
.lw-player.is-playing .lw-cover {
  transform: translateY(-3px);
  box-shadow: 0 0 42px -10px var(--neon-soft), 0 20px 40px -22px #000;
}
.lw-cover__art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.5s, transform 6s ease-out;
}
.lw-player.is-playing .lw-cover__art { transform: scale(1.06); }

/* cover procedurale (quando manca l'immagine) */
.lw-cover__gen {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(90% 90% at 25% 15%, var(--neon-dim) 0%, transparent 60%),
    repeating-linear-gradient(115deg, rgba(255,255,255,0.028) 0 2px, transparent 2px 9px),
    linear-gradient(150deg, #1b1b1b 0%, #0a0a0a 100%);
}
.lw-cover__initials {
  font-size: 3.1rem; font-weight: 800; letter-spacing: -0.04em;
  color: var(--neon);
  text-shadow: 0 0 26px var(--neon-soft);
  opacity: 0.85;
}
/* onde concentriche dietro le iniziali */
.lw-cover__gen::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 62%; aspect-ratio: 1; transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 1px solid var(--neon-dim);
  box-shadow: 0 0 0 14px rgba(201,146,42,0.045), 0 0 0 30px rgba(201,146,42,0.022);
}

/* velo neon + badge */
.lw-cover__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}
.lw-cover__badge {
  position: absolute; top: 0.6rem; right: 0.6rem;
  font-size: 0.58rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem; border-radius: 4px;
  color: #0a0a0a; background: var(--neon);
  box-shadow: 0 0 18px -2px var(--neon-soft);
}
.lw-cover__badge:empty { display: none; }

/* anello rotante che appare in play */
.lw-cover__ring {
  position: absolute; left: 50%; top: 50%;
  width: 74%; aspect-ratio: 1;
  transform: translate(-50%,-50%) scale(0.85);
  border-radius: 50%;
  border: 1px dashed var(--neon-dim);
  opacity: 0;
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}
.lw-player.is-playing .lw-cover__ring {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
  animation: lw-spin 14s linear infinite;
}
@keyframes lw-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── INFO ─────────────────────────────────────────────── */
.lw-now { min-width: 0; }
.lw-now__eyebrow {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--neon);
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.lw-now__eyebrow::before {
  content: ''; width: 1.1rem; height: 1px; background: var(--neon);
}
.lw-now__title {
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  color: var(--white);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lw-player.is-playing .lw-now__title {
  text-shadow: 0 0 34px rgba(201,146,42,0.28);
}
.lw-now__artist {
  font-size: 0.85rem; color: var(--soft); margin-top: 0.25rem;
}

.lw-chips {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem;
}
.lw-chip {
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--soft);
  padding: 0.22rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.lw-chip--neon {
  color: var(--neon); border-color: var(--neon-dim);
  background: rgba(201,146,42,0.06);
}

/* ── VISUALIZER ───────────────────────────────────────── */
.lw-viz {
  display: block; width: 100%; height: 54px;
  margin-top: 1.1rem;
  opacity: 0.28;
  transition: opacity 0.6s;
}
.lw-player.is-playing .lw-viz { opacity: 1; }

/* ── SEEK ─────────────────────────────────────────────── */
.lw-seek { margin-top: 0.9rem; }
.lw-seek__bar {
  position: relative; height: 22px;
  display: flex; align-items: center;
  cursor: pointer;
  touch-action: none;
}
.lw-seek__track {
  position: relative;
  width: 100%; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: visible;
}
.lw-seek__buf {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  width: 0%; border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.lw-seek__fill {
  position: absolute; inset: 0 auto 0 0; height: 100%;
  width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, rgba(201,146,42,0.55), var(--lgold));
  box-shadow: 0 0 14px -1px var(--neon-soft);
}
.lw-seek__knob {
  position: absolute; top: 50%; left: 0;
  width: 11px; height: 11px; border-radius: 50%;
  transform: translate(-50%,-50%) scale(0.6);
  background: var(--lgold);
  box-shadow: 0 0 12px 1px var(--neon-soft);
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.lw-seek__bar:hover .lw-seek__knob,
.lw-seek__bar:focus-visible .lw-seek__knob,
.lw-seek__bar.is-scrubbing .lw-seek__knob {
  opacity: 1; transform: translate(-50%,-50%) scale(1);
}
.lw-seek__bar:focus-visible { outline: none; }
.lw-seek__bar:focus-visible .lw-seek__track {
  box-shadow: 0 0 0 3px rgba(201,146,42,0.22);
}
.lw-seek__times {
  display: flex; justify-content: space-between;
  font-size: 0.68rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-top: 0.15rem;
}

/* ── CONTROLS ─────────────────────────────────────────── */
.lw-ctrl {
  display: flex; align-items: center; gap: 0.45rem;
  margin-top: 1rem; flex-wrap: wrap;
}
.lw-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 10px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--soft); cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.lw-btn svg { width: 16px; height: 16px; fill: currentColor; pointer-events: none; }
.lw-btn:hover {
  color: var(--white); border-color: var(--blight);
  background: rgba(255,255,255,0.05);
}
.lw-btn:active { transform: scale(0.93); }
.lw-btn:focus-visible {
  outline: none; color: var(--neon);
  box-shadow: 0 0 0 3px rgba(201,146,42,0.22);
}
.lw-btn.is-active {
  color: var(--neon); border-color: var(--neon-dim);
  background: rgba(201,146,42,0.08);
  box-shadow: 0 0 16px -4px var(--neon-soft);
}
.lw-btn[disabled] { opacity: 0.3; pointer-events: none; }

/* play/pause centrale */
.lw-btn--play {
  width: 52px; height: 52px; border-radius: 50%;
  color: #0a0a0a;
  background: linear-gradient(145deg, var(--lgold), var(--neon));
  border: none;
  box-shadow: 0 0 26px -6px var(--neon-soft), 0 10px 24px -14px #000;
  margin: 0 0.25rem;
}
.lw-btn--play svg { width: 19px; height: 19px; }
.lw-btn--play:hover {
  color: #0a0a0a;
  box-shadow: 0 0 40px -6px var(--neon-soft), 0 12px 28px -14px #000;
}
.lw-btn--play .lw-ico-pause { display: none; }
.lw-player.is-playing .lw-btn--play .lw-ico-play  { display: none; }
.lw-player.is-playing .lw-btn--play .lw-ico-pause { display: block; }

.lw-ctrl__spacer { flex: 1; }

/* repeat-one marker */
.lw-btn--repeat { position: relative; }
.lw-btn--repeat .lw-one {
  position: absolute; top: 3px; right: 4px;
  font-size: 0.5rem; font-weight: 800; line-height: 1;
  opacity: 0;
}
.lw-btn--repeat.is-one .lw-one { opacity: 1; }

/* volume */
.lw-vol { display: flex; align-items: center; gap: 0.5rem; }
.lw-vol__slider {
  -webkit-appearance: none; appearance: none;
  width: 88px; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,0.09);
  cursor: pointer; outline: none;
}
.lw-vol__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--lgold); border: none;
  box-shadow: 0 0 10px 0 var(--neon-soft);
  cursor: pointer;
}
.lw-vol__slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--lgold); border: none;
  box-shadow: 0 0 10px 0 var(--neon-soft);
  cursor: pointer;
}
.lw-vol__slider:focus-visible { box-shadow: 0 0 0 3px rgba(201,146,42,0.22); }

/* ── PLAYLIST ─────────────────────────────────────────── */
.lw-list {
  border-top: 1px solid var(--border);
  max-height: 340px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,146,42,0.3) transparent;
}
.lw-list::-webkit-scrollbar { width: 6px; }
.lw-list::-webkit-scrollbar-track { background: transparent; }
.lw-list::-webkit-scrollbar-thumb {
  background: rgba(201,146,42,0.25); border-radius: 999px;
}
.lw-list::-webkit-scrollbar-thumb:hover { background: rgba(201,146,42,0.45); }

.lw-row {
  display: grid;
  /* 6 colonne = idx · cover · meta · tags · time · ext
     (l'ultima è sempre presente, anche vuota, per non mandare a capo) */
  grid-template-columns: 30px 40px 1fr auto auto 26px;
  align-items: center; gap: 0.9rem;
  padding: 0.6rem 1.5rem;
  border: none; width: 100%;
  background: none; cursor: pointer;
  text-align: left; color: inherit; font: inherit;
  border-left: 2px solid transparent;
  border-top: 1px solid rgba(255,255,255,0.03);
  transition: background 0.2s, border-color 0.2s;
}
.lw-row:first-child { border-top: none; }
.lw-row:hover { background: rgba(255,255,255,0.028); }
.lw-row:focus-visible {
  outline: none; background: rgba(201,146,42,0.06);
  border-left-color: var(--neon-soft);
}
.lw-row.is-current {
  background: rgba(201,146,42,0.055);
  border-left-color: var(--neon);
}

.lw-row__idx {
  font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
  height: 16px;
}
.lw-row.is-current .lw-row__idx { color: var(--neon); }

/* equalizer animato sulla riga in play */
.lw-eq { display: none; align-items: flex-end; gap: 2px; height: 13px; }
.lw-row.is-current.is-playing .lw-eq  { display: flex; }
.lw-row.is-current.is-playing .lw-num { display: none; }
.lw-eq span {
  width: 2px; background: var(--neon); border-radius: 1px;
  box-shadow: 0 0 6px var(--neon-soft);
  animation: lw-eq 0.9s ease-in-out infinite;
}
.lw-eq span:nth-child(1) { height: 40%; animation-delay: -0.5s; }
.lw-eq span:nth-child(2) { height: 90%; animation-delay: -0.2s; }
.lw-eq span:nth-child(3) { height: 60%; animation-delay: -0.7s; }
.lw-eq span:nth-child(4) { height: 30%; animation-delay: -0.35s; }
@keyframes lw-eq {
  0%, 100% { transform: scaleY(0.35); }
  50%      { transform: scaleY(1); }
}

.lw-row__cover {
  position: relative;
  width: 40px; height: 40px; border-radius: 6px;
  overflow: hidden; background: var(--card2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.lw-row__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-row__cover .lw-cover__gen::after { display: none; }
.lw-row__cover .lw-cover__initials {
  font-size: 0.82rem; text-shadow: 0 0 10px var(--neon-soft);
}
.lw-row.is-current .lw-row__cover {
  border-color: var(--neon-dim);
  box-shadow: 0 0 14px -4px var(--neon-soft);
}

.lw-row__meta { min-width: 0; }
.lw-row__title {
  font-size: 0.88rem; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lw-row.is-current .lw-row__title { color: var(--white); }
.lw-row__sub {
  font-size: 0.7rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 0.1rem;
}

.lw-row__tags { display: flex; gap: 0.35rem; }
.lw-row__tag {
  font-size: 0.6rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  padding: 0.14rem 0.4rem; border-radius: 3px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.lw-row.is-current .lw-row__tag { color: var(--soft); border-color: var(--neon-dim); }

.lw-row__time {
  font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px; text-align: right;
}

/* link Spotify nella riga */
.lw-row__ext {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px;
  color: var(--muted); opacity: 0;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
}
.lw-row:hover .lw-row__ext,
.lw-row__ext:focus-visible { opacity: 1; }
.lw-row__ext:hover { color: var(--neon); background: rgba(201,146,42,0.08); }
.lw-row__ext svg { width: 13px; height: 13px; fill: currentColor; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.lw-empty {
  padding: 3.2rem 1.5rem; text-align: center;
  border-top: 1px solid var(--border);
}
.lw-empty__ico {
  width: 40px; height: 40px; margin: 0 auto 1rem;
  color: var(--neon); opacity: 0.55;
}
.lw-empty__ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.4; }
.lw-empty__t {
  font-size: 0.9rem; font-weight: 600; color: var(--soft);
  margin-bottom: 0.3rem;
}
.lw-empty__d { font-size: 0.8rem; color: var(--muted); }

/* ── SHORTCUT HINT ────────────────────────────────────── */
.lw-hint {
  padding: 0.7rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.66rem; color: var(--muted);
  display: flex; gap: 1rem; flex-wrap: wrap;
  background: rgba(0,0,0,0.24);
}
.lw-hint kbd {
  font-family: inherit; font-size: 0.62rem; font-weight: 700;
  color: var(--soft); background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.05rem 0.3rem; margin-right: 0.25rem;
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 720px) {
  .lw-player__stage {
    grid-template-columns: 1fr;
    justify-items: center; text-align: center;
    gap: 1.3rem; padding: 1.5rem 1.1rem;
  }
  .lw-cover { width: 168px; height: 168px; }
  .lw-now { width: 100%; }
  .lw-now__eyebrow, .lw-chips { justify-content: center; }
  .lw-ctrl { justify-content: center; }
  .lw-ctrl__spacer { display: none; }
  .lw-vol { display: none; }
  .lw-hint { display: none; }

  .lw-player__head { padding: 1rem 1.1rem; }
  .lw-row {
    grid-template-columns: 24px 36px 1fr auto;
    padding: 0.6rem 1.1rem; gap: 0.7rem;
  }
  /* tags ed ext spariscono: restano 4 celle per 4 colonne */
  .lw-row__tags { display: none; }
  .lw-row__ext  { display: none; }
}

/* ── REDUCED MOTION ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .lw-player__scan,
  .lw-player.is-playing .lw-player__pulse,
  .lw-player.is-playing .lw-cover__ring,
  .lw-eq span {
    animation: none;
  }
  .lw-player.is-playing .lw-cover__art { transform: none; }
  .lw-cover, .lw-btn, .lw-viz { transition: none; }
}
