/* =====================================================================
   Sonora - tema "vetro e neon": sfumature profonde, bagliori, superfici
   in vetro smerigliato e micro-animazioni.
   ===================================================================== */

:root {
  --bg: #07070c;
  --bg-2: #0d0b18;
  --bg-side: rgba(19, 18, 30, 0.82);
  --bg-elev: rgba(31, 30, 46, 0.62);
  --bg-elev2: rgba(46, 44, 68, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f3fb;
  --text-dim: #a5a2bd;
  --accent: #8b5cf6;
  --accent-2: #6d28d9;
  --ok: #34d399;
  --danger: #f43f5e;
  --glow: 0 0 26px -6px var(--accent);
  --shadow-lg: 0 22px 50px -18px rgba(0, 0, 0, 0.85);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, 0.7);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  overflow: hidden;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* comportamenti touch: niente rimbalzo, niente evidenziazione blu al tap */
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
}

/* aree scrollabili fluide su iOS */
.main, .dp-list, .search-list, .content { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

/* bersagli comodi al dito su touch */
button, .nav-item, .bn-item, .track-row, .card, .artist-card { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* sfondo vivo: aloni colorati che respirano lentamente */
body::before {
  content: '';
  position: fixed; inset: -20%;
  z-index: -2;
  background:
    radial-gradient(45% 45% at 12% 8%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 62%),
    radial-gradient(40% 40% at 88% 12%, rgba(56, 189, 248, 0.30), transparent 62%),
    radial-gradient(50% 50% at 78% 92%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(45% 45% at 18% 88%, rgba(236, 72, 153, 0.22), transparent 62%),
    linear-gradient(160deg, var(--bg-2), var(--bg));
  filter: blur(46px) saturate(135%);
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.07); }
  100% { transform: translate3d(-2%, 2.5%, 0) scale(1.03); }
}
/* grana finissima per togliere l'effetto "piatto" */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

.hidden { display: none !important; }
button { font-family: inherit; }

.glass {
  background: var(--bg-elev);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* ================= autenticazione ================= */
.auth-view {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.auth-view.hidden { display: none; }
.auth-card {
  position: relative;
  width: 100%; max-width: 400px; padding: 34px 30px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(38, 36, 58, 0.86), rgba(16, 15, 26, 0.92));
  backdrop-filter: blur(26px) saturate(160%);
  -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  animation: rise .5s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
/* bordo luminoso sfumato */
.auth-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: 23px; padding: 1px; z-index: -1;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, transparent), transparent 45%, rgba(56, 189, 248, 0.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 27px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.6px; }
.auth-brand .brand-logo { width: 34px; height: 34px; color: var(--accent); filter: drop-shadow(0 0 12px var(--accent)); }
.auth-brand span {
  background: linear-gradient(100deg, #fff 10%, color-mix(in srgb, var(--accent) 75%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.auth-tagline { color: var(--text-dim); font-size: 13.5px; margin: 0 0 24px; line-height: 1.55; }
.auth-tabs {
  display: flex; gap: 4px; padding: 5px; margin-bottom: 22px; border-radius: 13px;
  background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line);
}
.auth-tab {
  flex: 1; background: none; border: none; color: var(--text-dim);
  padding: 10px; border-radius: 9px; font-size: 13.5px; font-weight: 700; cursor: pointer;
  transition: color .2s, background .25s, box-shadow .25s;
}
.auth-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.auth-form label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 15px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.auth-form input {
  display: block; width: 100%; margin-top: 7px; color: var(--text);
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 13px; font-size: 14px;
  font-weight: 400; text-transform: none; letter-spacing: 0;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-form input:focus {
  outline: none; border-color: var(--accent);
  background: rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
}
.btn-primary {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border: none; border-radius: 11px;
  padding: 12px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 10px 26px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform .15s, box-shadow .25s, filter .2s;
}
.btn-primary::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.30), transparent 70%);
  transform: translateX(-120%); transition: transform .6s;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 14px 32px -10px var(--accent); }
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn-block { width: 100%; margin-top: 6px; }
.remember-row {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  text-transform: none; letter-spacing: 0; margin-bottom: 18px;
}
.remember-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.auth-msg { font-size: 12.5px; min-height: 18px; margin-top: 12px; color: var(--danger); }
.auth-msg.ok { color: var(--ok); }

/* ================= layout ================= */
.app {
  display: grid; grid-template-columns: 268px 1fr; grid-template-rows: 1fr 98px;
  height: 100vh; height: 100dvh;   /* dvh: su Safari mobile esclude la barra indirizzi */
}

.sidebar {
  grid-row: 1 / 2; padding: 22px 16px 14px;
  display: flex; flex-direction: column; overflow-y: auto;
  background: linear-gradient(180deg, rgba(24, 22, 38, 0.86), rgba(11, 10, 20, 0.92));
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 24px; }
.brand-logo { width: 28px; height: 28px; color: var(--accent); filter: drop-shadow(0 0 10px var(--accent)); }
.brand span {
  background: linear-gradient(100deg, #fff, color-mix(in srgb, var(--accent) 70%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.add-form { display: flex; gap: 7px; }
.add-form input {
  flex: 1; min-width: 0; color: var(--text);
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px; font-size: 12.5px;
  transition: border-color .2s, box-shadow .2s;
}
.add-form input::placeholder { color: color-mix(in srgb, var(--text-dim) 80%, transparent); }
.add-form input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.add-form button {
  width: 38px; border: none; border-radius: 11px; color: #fff; font-size: 19px; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform .15s, filter .2s;
}
.add-form button:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.1); }
.add-form button:disabled { opacity: 0.5; transform: none; }
.add-msg { font-size: 11.5px; min-height: 16px; margin: 8px 2px 13px; color: var(--text-dim); line-height: 1.45; }
.add-msg.error { color: var(--danger); }
.add-msg.ok { color: var(--ok); }

.side-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 20px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  background: transparent; border: none; color: var(--text-dim);
  padding: 10px 12px; border-radius: 11px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left; overflow: hidden;
  transition: color .2s, background .25s, transform .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform .25s, filter .25s; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.055); transform: translateX(2px); }
.nav-item:hover svg { transform: scale(1.12); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 32%, transparent), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #38bdf8);
  box-shadow: 0 0 12px var(--accent);
}
.nav-item.active svg { filter: drop-shadow(0 0 7px var(--accent)); }

.playlists-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 1.1px; padding: 6px 8px; font-weight: 800;
}
.playlists-head button {
  background: none; border: none; color: var(--text-dim); font-size: 17px; cursor: pointer; line-height: 1;
  transition: color .2s, transform .2s;
}
.playlists-head button:hover { color: var(--accent); transform: rotate(90deg) scale(1.15); }
.playlist-list { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; }
.playlist-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--text-dim); font-size: 13.5px;
  transition: background .2s, color .2s, transform .15s;
}
.playlist-item::before {
  content: '♬'; margin-right: 2px; opacity: .5; font-size: 12px;
}
.playlist-item:hover { background: rgba(255, 255, 255, 0.055); color: var(--text); transform: translateX(2px); }
.playlist-item.active { background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent); color: #fff; }
.playlist-item .pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.playlist-item .pl-del { opacity: 0; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 12.5px; transition: opacity .2s, color .2s; }
.playlist-item:hover .pl-del { opacity: 1; }
.playlist-item .pl-del:hover { color: var(--danger); }

.side-foot { margin-top: auto; padding-top: 16px; }
.user-chip {
  display: flex; align-items: center; gap: 11px; padding: 10px;
  border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  transition: border-color .25s, box-shadow .25s;
}
.user-chip:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  box-shadow: 0 0 16px -3px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mail { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; transition: color .2s, transform .2s; }
.user-chip button:hover { color: var(--danger); transform: scale(1.15); }

/* ================= contenuto ================= */
.main {
  grid-row: 1 / 2; overflow-y: auto; padding: 26px 34px 46px;
  overflow-x: hidden;   /* niente scorrimento laterale: il contenuto resta nella colonna */
  min-width: 0;         /* senza questo una vista larga allarga la griglia e sborda */
}
.sidebar { min-width: 0; }
.app { overflow: hidden; }
.topbar { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 {
  margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(100deg, #fff 20%, color-mix(in srgb, var(--accent) 60%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.view-sub {
  color: var(--text-dim); font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.view-sub:empty { display: none; }

.empty-state {
  color: var(--text-dim); padding: 46px 28px; font-size: 14px; line-height: 1.8;
  border-radius: var(--radius); border: 1px dashed var(--line-2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent);
  text-align: center;
}
.empty-state b { color: var(--text); }

.section { margin-bottom: 38px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; gap: 12px; }
.section-head h2 {
  font-size: 18px; margin: 0; font-weight: 750; letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ''; width: 4px; height: 17px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #38bdf8);
  box-shadow: 0 0 10px var(--accent);
}
.section-head .link {
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  font-size: 11.5px; cursor: pointer; padding: 5px 12px; border-radius: 20px; font-weight: 600;
  transition: color .2s, border-color .2s, background .2s;
}
.section-head .link:hover { color: #fff; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, transparent); }

/* ---- card ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); gap: 16px; }
.card {
  position: relative; padding: 13px; border-radius: var(--radius); cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), box-shadow .28s, border-color .28s;
}
.card::after {
  content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 26%, transparent), transparent 55%);
  transition: opacity .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), var(--glow); border-color: var(--line-2); }
.card:hover::after { opacity: 1; }
.card img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; margin-bottom: 11px;
  background: rgba(255, 255, 255, 0.05); box-shadow: 0 10px 24px -12px #000;
  transition: transform .35s;
}
.card:hover img { transform: scale(1.04); }
.card .c-title { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative; }
.card .c-sub { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; position: relative; }
/* pulsante play che compare sulla copertina */
.card .c-play {
  position: absolute; right: 20px; top: 122px; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -6px var(--accent);
  opacity: 0; transform: translateY(10px) scale(.85); transition: opacity .28s, transform .28s;
}
.card:hover .c-play { opacity: 1; transform: translateY(0) scale(1); }

/* ---- artisti ---- */
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 16px; }
.artist-card {
  padding: 20px 14px; border-radius: var(--radius); text-align: center; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  transition: transform .28s cubic-bezier(.2, .8, .3, 1), box-shadow .28s, border-color .28s;
}
.artist-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.artist-av {
  position: relative; width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 14px 30px -12px #000, inset 0 2px 0 rgba(255, 255, 255, 0.28);
  transition: transform .3s;
}
/* anello luminoso rotante */
.artist-av::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--accent) 85%, transparent), transparent 55%);
  opacity: 0; transition: opacity .3s; animation: spin 3.4s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.artist-card:hover .artist-av { transform: scale(1.06); }
.artist-card:hover .artist-av::after { opacity: 1; }
.artist-card .a-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artist-card .a-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }

/* ---- classifiche ---- */
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-row {
  display: grid; grid-template-columns: 34px 46px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 14px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid transparent;
  transition: background .25s, transform .2s, border-color .25s, box-shadow .25s;
}
.rank-row:hover { transform: translateX(5px); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.rank-pos { font-size: 17px; font-weight: 800; color: var(--text-dim); text-align: center; font-variant-numeric: tabular-nums; }
.rank-list > .rank-row:nth-child(1) .rank-pos {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rank-list > .rank-row:nth-child(2) .rank-pos {
  background: linear-gradient(135deg, #f1f5f9, #94a3b8);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rank-list > .rank-row:nth-child(3) .rank-pos {
  background: linear-gradient(135deg, #fdba74, #c2410c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rank-av {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 15px;
  box-shadow: 0 8px 18px -8px #000, inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.rank-main { min-width: 0; }
.rank-name { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.rank-bar { height: 6px; background: rgba(0, 0, 0, 0.4); border-radius: 4px; margin-top: 7px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6); }
.rank-bar span {
  display: block; height: 100%; border-radius: 4px; position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--accent), #38bdf8);
  box-shadow: 0 0 12px -2px var(--accent);
  animation: grow 1s cubic-bezier(.2, .8, .3, 1);
}
@keyframes grow { from { width: 0 !important; } }
.rank-bar span::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: sheen 2.6s ease-in-out infinite;
}
@keyframes sheen { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(200%); } }
.rank-val { font-size: 13px; color: var(--text-dim); white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- statistiche ---- */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
  position: relative; padding: 20px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  transition: transform .25s, box-shadow .25s;
}
.stat-card::before {
  content: ''; position: absolute; top: -40%; right: -20%; width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 42%, transparent), transparent 70%);
  filter: blur(6px);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-val {
  font-size: 30px; font-weight: 800; letter-spacing: -1px; position: relative;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--accent) 62%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-lab { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; position: relative; font-weight: 600; letter-spacing: 0.3px; }
.range-tabs {
  display: flex; gap: 4px; padding: 5px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
}
.range-tabs button {
  background: none; border: none; color: var(--text-dim); padding: 7px 14px;
  border-radius: 9px; font-size: 12.5px; cursor: pointer; font-weight: 700;
  transition: color .2s, background .25s, box-shadow .25s;
}
.range-tabs button:hover { color: var(--text); }
.range-tabs button.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

/* ---- elenco brani ---- */
.track-list { display: flex; flex-direction: column; }
.track-head {
  display: grid; grid-template-columns: 38px 48px 1fr 168px 78px 124px;
  gap: 13px; padding: 8px 14px; font-size: 10px; text-transform: uppercase;
  color: var(--text-dim); letter-spacing: 1.2px; font-weight: 800;
  border-bottom: 1px solid var(--line); margin-bottom: 7px;
}
.track-row {
  display: grid; grid-template-columns: 38px 48px 1fr 168px 78px 124px;
  gap: 13px; align-items: center; padding: 9px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; position: relative;
  transition: background .22s, transform .18s, border-color .22s, box-shadow .22s;
}
.track-row:hover {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border-color: var(--line); transform: translateX(4px);
}
.track-row.playing {
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 24%, transparent), rgba(255, 255, 255, 0.02));
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 6px 22px -14px var(--accent);
}
.track-row.playing::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #38bdf8); box-shadow: 0 0 10px var(--accent);
}
.track-row.playing .t-title { color: color-mix(in srgb, var(--accent) 55%, #fff); }
.t-idx { color: var(--text-dim); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.track-row:hover .t-idx-num, .track-row.playing .t-idx-num { display: none; }
.t-idx .t-idx-play { display: none; }
.track-row:hover .t-idx .t-idx-play, .track-row.playing .t-idx .t-idx-play { display: inline-flex; align-items: center; justify-content: center; }
.play-tri {
  display: inline-block; width: 0; height: 0;
  border-left: 10px solid var(--text); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
/* equalizzatore animato sulla traccia in riproduzione */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 15px; }
.eq i {
  width: 3px; border-radius: 2px; background: linear-gradient(180deg, #38bdf8, var(--accent));
  box-shadow: 0 0 6px var(--accent); animation: bounce .9s ease-in-out infinite;
}
.eq i:nth-child(1) { height: 45%; animation-delay: -.5s; }
.eq i:nth-child(2) { height: 100%; animation-delay: -.25s; }
.eq i:nth-child(3) { height: 65%; animation-delay: -.75s; }
.eq i:nth-child(4) { height: 85%; animation-delay: 0s; }
@keyframes bounce { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.t-thumb {
  width: 46px; height: 46px; border-radius: 9px; object-fit: cover;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 16px -8px #000; transition: transform .25s, box-shadow .25s;
}
.track-row:hover .t-thumb { transform: scale(1.07); box-shadow: 0 8px 20px -8px var(--accent); }
.t-main { min-width: 0; }
.t-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-artist { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.t-artist:hover { color: var(--accent); text-decoration: underline; }
.t-badge { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.t-badge .off { color: var(--ok); font-weight: 700; }
.t-badge .extracting { color: var(--accent); font-weight: 650; }
.t-badge .extracting::after {
  content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent);
  animation: pulse 1.2s ease-in-out infinite; vertical-align: middle;
}
.t-badge .stream-badge { color: var(--text-dim); }
.t-badge .cached { color: #7dd3fc; font-weight: 600; }

/* riquadro dello spazio occupato */
.cache-box { margin-bottom: 6px; }
.cache-bar {
  height: 10px; border-radius: 6px; overflow: hidden; margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.cache-bar span {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, #38bdf8, var(--accent));
  transition: width .4s cubic-bezier(.2, .8, .3, 1);
}
.cache-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; color: var(--text-dim); }
.cache-legend b { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.cache-legend .c-temp { background: #38bdf8; }
.cache-legend .c-pin { background: var(--ok); }
.cache-legend small { opacity: .7; }
.cache-tot { margin-left: auto; color: var(--text); font-weight: 600; }
.t-dur { color: var(--text-dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.t-actions { display: flex; gap: 5px; justify-content: flex-end; opacity: 0; transition: opacity .2s; }
.track-row:hover .t-actions { opacity: 1; }
.t-actions button {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text-dim);
  cursor: pointer; font-size: 14px; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s, transform .18s, border-color .2s;
}
.t-actions button:hover { color: #fff; background: color-mix(in srgb, var(--accent) 34%, transparent); border-color: var(--accent); transform: translateY(-2px); }
.t-actions button.danger:hover { color: #fff; background: color-mix(in srgb, var(--danger) 40%, transparent); border-color: var(--danger); }
.t-actions button.dl-done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }

/* badge piattaforma di provenienza */
.src-badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 3px 7px; border-radius: 6px; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #64748b, #334155);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.src-spotify { background: linear-gradient(135deg, #1ed760, #14833b); }
.src-tiktok { background: linear-gradient(135deg, #ff0050, #00f2ea); }
.src-soundcloud { background: linear-gradient(135deg, #ff7700, #ff3300); }
.src-applemusic { background: linear-gradient(135deg, #fa57c1, #b3005e); }
.src-deezer { background: linear-gradient(135deg, #a238ff, #6b00d7); }
.src-tidal { background: linear-gradient(135deg, #38bdf8, #0369a1); }
.src-amazonmusic { background: linear-gradient(135deg, #25d1da, #0e7490); }
.src-bandcamp { background: linear-gradient(135deg, #629aa9, #33636f); }
.src-instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }
.src-twitter { background: linear-gradient(135deg, #4b5563, #0f172a); }
.src-vimeo { background: linear-gradient(135deg, #17d5ff, #0b7ea3); }
.src-facebook { background: linear-gradient(135deg, #3b82f6, #1e40af); }

/* ================= player ================= */
.player-bar {
  grid-row: 2 / 3; grid-column: 1 / 3; position: relative;
  display: grid; grid-template-columns: 300px 1fr 280px; align-items: center;
  padding: 0 20px; gap: 16px;
  background: linear-gradient(180deg, rgba(23, 21, 37, 0.90), rgba(9, 8, 16, 0.96));
  backdrop-filter: blur(26px) saturate(160%); -webkit-backdrop-filter: blur(26px) saturate(160%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 40px -20px rgba(0, 0, 0, 0.9);
}
/* filo luminoso sul bordo superiore */
.player-bar::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 75%, transparent), rgba(56, 189, 248, 0.6), transparent);
}
.np { display: flex; align-items: center; gap: 14px; min-width: 0; }
.np-art {
  width: 62px; height: 62px; border-radius: 12px; overflow: hidden; position: relative; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 12px 28px -12px #000, 0 0 0 1px var(--line), 0 0 22px -8px var(--accent);
  transition: transform .3s;
}
.np-art:hover { transform: scale(1.05); }
.np-art #ytPlayer { position: absolute; inset: 0; width: 100%; height: 100%; }
.np-art #ytPlayer iframe { width: 100%; height: 100%; pointer-events: none; }
.np-art #npThumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; }
.np-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--text-dim);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent);
}
.np-info { min-width: 0; }
.np-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.player-center { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.control-buttons { display: flex; align-items: center; gap: 20px; }
.ctl-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 5px; position: relative;
  transition: color .2s, transform .18s, filter .2s;
}
.ctl-btn svg { width: 19px; height: 19px; display: block; }
.ctl-btn:hover { color: #fff; transform: scale(1.16); }
.ctl-btn.active { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.ctl-btn.play {
  width: 40px; height: 40px; border-radius: 50%; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.ctl-btn.play svg { width: 17px; height: 17px; }
.ctl-btn.play:hover { transform: scale(1.09); filter: brightness(1.12); }
.ctl-btn.play:active { transform: scale(1.02); }
.badge-one {
  position: absolute; bottom: -3px; right: -5px; font-size: 8px; font-weight: 800;
  background: var(--accent); color: #fff; border-radius: 50%; width: 13px; height: 13px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px var(--accent);
}

.seek-row { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 560px; }
.time { font-size: 10.5px; color: var(--text-dim); width: 36px; text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; height: 5px; border-radius: 4px; flex: 1; cursor: pointer;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
  transition: height .18s;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 10px var(--accent), 0 2px 6px rgba(0, 0, 0, 0.6);
  opacity: 0; transition: opacity .18s, transform .18s;
}
.seek-row:hover input[type="range"], .player-right input[type="range"]:hover { height: 7px; }
.seek-row:hover input[type="range"]::-webkit-slider-thumb,
.player-right input[type="range"]:hover::-webkit-slider-thumb { opacity: 1; }
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

.remote-banner {
  font-size: 11px; color: var(--accent); display: flex; align-items: center; gap: 7px; font-weight: 600;
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 9px var(--accent); animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.72); } }

.player-right { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.player-right input[type="range"] { max-width: 88px; }
.vol-icon { width: 17px; height: 17px; color: var(--text-dim); flex-shrink: 0; }
.dl-btn { font-size: 16px; }
.quality-badge {
  color: var(--text-dim); font-size: 9.5px; font-weight: 800; letter-spacing: 0.7px;
  padding: 5px 9px; border-radius: 8px; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.quality-badge:hover {
  color: #fff; border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 26%, transparent);
  box-shadow: 0 0 14px -4px var(--accent);
}
.device-dot {
  position: absolute; top: 0; right: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: pulse 1.8s ease-in-out infinite;
}

/* ================= pannello dispositivi ================= */
.device-panel {
  display: none; position: fixed; right: 18px; bottom: 110px; width: 328px; z-index: 40;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, rgba(38, 36, 58, 0.92), rgba(14, 13, 24, 0.96));
  backdrop-filter: blur(26px) saturate(160%); -webkit-backdrop-filter: blur(26px) saturate(160%);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 34px -14px var(--accent);
}
.device-panel.show { display: block; animation: popup .28s cubic-bezier(.2, .8, .3, 1); }
@keyframes popup { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.dp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 17px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700;
}
.dp-head button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; transition: color .2s, transform .2s; }
.dp-head button:hover { color: var(--danger); transform: rotate(90deg); }
.dp-list { max-height: 300px; overflow-y: auto; padding: 7px; }
.dp-group {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 800;
  color: var(--text-dim); padding: 9px 11px 5px;
}
.dp-empty { font-size: 12px; color: var(--text-dim); padding: 4px 12px 10px; }
.dp-row {
  display: flex; align-items: center; gap: 12px; padding: 11px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, transform .18s, border-color .2s;
}
.dp-row:hover { background: rgba(255, 255, 255, 0.065); transform: translateX(3px); border-color: var(--line); }
.dp-row.active {
  color: var(--accent);
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 24%, transparent), transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.dp-row .dp-ic { width: 21px; height: 21px; flex-shrink: 0; }
.dp-row .dp-ic svg { width: 100%; height: 100%; }
.dp-name { font-size: 13.5px; font-weight: 700; }
.dp-me {
  font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 5px; margin-left: 5px; vertical-align: middle;
  background: rgba(255, 255, 255, 0.12); color: var(--text-dim);
}
.dp-me.active { background: color-mix(in srgb, var(--accent) 40%, transparent); color: #fff; }
.dp-state { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.dp-row.active .dp-state { color: var(--accent); }
.dp-row.offline { opacity: 0.5; }
.dp-row.offline:hover { opacity: 0.75; }
.dp-led {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.18);
}
.dp-led.on { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: pulse 2.2s ease-in-out infinite; }
.dp-foot { padding: 13px 17px; font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--line); line-height: 1.55; }

/* ================= impostazioni ================= */
.settings-wrap { max-width: 660px; }
.set-group {
  position: relative; padding: 24px; margin-bottom: 20px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.018));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.set-group::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), #38bdf8, transparent);
  opacity: .75;
}
.set-group h2 { font-size: 16px; margin: 0 0 5px; font-weight: 750; }
.set-group .grp-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 18px; line-height: 1.6; }
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: none; }
.set-label { font-size: 13.5px; font-weight: 700; }
.set-desc { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.55; }
.set-ctl { flex-shrink: 0; }
.quality-pick {
  display: flex; gap: 4px; padding: 5px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
}
.quality-pick button {
  background: none; border: none; color: var(--text-dim); padding: 8px 13px;
  border-radius: 9px; font-size: 12px; cursor: pointer; font-weight: 700;
  transition: color .2s, background .25s, box-shadow .25s;
}
.quality-pick button:hover { color: var(--text); }
.quality-pick button.active {
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 14px; cursor: pointer;
  background: rgba(255, 255, 255, 0.14); border: 1px solid var(--line);
  transition: background .25s, box-shadow .25s;
}
.switch span::before {
  content: ''; position: absolute; width: 19px; height: 19px; left: 3px; top: 2.5px;
  background: #fff; border-radius: 50%; transition: transform .25s cubic-bezier(.2, .8, .3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.switch input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 16px -4px var(--accent);
}
.switch input:checked + span::before { transform: translateX(20px); }
.accent-picks { display: flex; gap: 9px; }
.accent-dot {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px -4px #000;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.accent-dot:hover { transform: scale(1.18); }
.accent-dot.active { border-color: #fff; transform: scale(1.12); box-shadow: 0 0 14px -2px currentColor; }
.set-input {
  color: var(--text); background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; width: 210px;
  transition: border-color .2s, box-shadow .2s;
}
.set-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.lan-url {
  display: block; width: 100%; margin-bottom: 6px; cursor: pointer;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  padding: 9px 12px; border-radius: 10px; color: var(--accent);
  background: rgba(0, 0, 0, 0.3); border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  transition: background .2s, border-color .2s;
}
.lan-url:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); }
.set-actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }
.set-msg { font-size: 12px; color: var(--ok); font-weight: 600; }

/* elenco dispositivi nelle impostazioni */
.set-device-list { display: flex; flex-direction: column; gap: 9px; }
.sd-row {
  display: flex; align-items: center; gap: 13px; padding: 13px;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color .22s, transform .18s;
}
.sd-row:hover { border-color: var(--line-2); transform: translateX(3px); }
.sd-ic { width: 24px; height: 24px; flex-shrink: 0; color: var(--text-dim); }
.sd-ic svg { width: 100%; height: 100%; }
.sd-ic.on { color: var(--ok); filter: drop-shadow(0 0 7px var(--ok)); }
.sd-main { flex: 1; min-width: 0; }
.sd-name { font-size: 13.5px; font-weight: 700; }
.sd-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.sd-meta .on-txt { color: var(--ok); }
.sd-del {
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text-dim);
  width: 32px; height: 32px; border-radius: 9px; cursor: pointer; font-size: 13px;
  transition: color .2s, background .2s, border-color .2s;
}
.sd-del:hover { color: #fff; background: color-mix(in srgb, var(--danger) 38%, transparent); border-color: var(--danger); }

/* ================= modale / risultati / toast ================= */
.modal-bg {
  display: none; position: fixed; inset: 0; z-index: 50;
  align-items: center; justify-content: center;
  background: rgba(4, 3, 10, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-bg.show { display: flex; animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 400px; max-width: 92vw; padding: 26px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(40, 38, 62, 0.94), rgba(15, 14, 26, 0.97));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 40px -16px var(--accent);
  animation: popup .3s cubic-bezier(.2, .8, .3, 1);
}
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 750; }
.modal input[type="text"] {
  width: 100%; color: var(--text); background: rgba(0, 0, 0, 0.36);
  border: 1px solid var(--line); border-radius: 11px; padding: 12px; font-size: 14px; margin-bottom: 16px;
}
.modal input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.modal button { border: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; cursor: pointer; font-weight: 600; }
.modal .btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text-dim); border: 1px solid var(--line); }
.modal .btn-ghost:hover { color: #fff; border-color: var(--line-2); }
.modal .pl-pick-row {
  display: flex; align-items: center; gap: 11px; padding: 11px; font-size: 14px;
  cursor: pointer; border-radius: 10px; transition: background .2s;
}
.modal .pl-pick-row:hover { background: rgba(255, 255, 255, 0.06); }
.modal .pl-pick-row input { width: 17px; height: 17px; accent-color: var(--accent); }

/* risultati di ricerca */
.search-list { max-height: 380px; overflow-y: auto; margin: -4px -6px 8px; padding: 0 6px; }
.sr-row {
  display: flex; align-items: center; gap: 12px; padding: 9px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, transform .18s, border-color .2s;
}
.sr-row:hover { background: rgba(255, 255, 255, 0.07); transform: translateX(3px); border-color: var(--line); }
.sr-row img { width: 62px; height: 38px; object-fit: cover; border-radius: 7px; flex-shrink: 0; box-shadow: 0 5px 14px -7px #000; }
.sr-main { min-width: 0; }
.imp-num { width: 26px; text-align: center; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.imp-state { width: 24px; text-align: center; font-size: 14px; color: var(--ok); flex-shrink: 0; }
.imp-state.err { color: var(--danger); }
.imp-avviso { margin: -6px 0 12px; padding: 9px 11px; border-radius: 9px; font-size: 12px; line-height: 1.5; color: var(--text); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.sr-title { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.toast {
  position: fixed; bottom: 122px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 13px 22px; border-radius: 13px; font-size: 13px; z-index: 60; font-weight: 600;
  color: var(--text); max-width: 82vw; text-align: center;
  background: linear-gradient(160deg, rgba(46, 44, 70, 0.96), rgba(18, 17, 30, 0.97));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg), 0 0 26px -12px var(--accent);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ================= scrollbar ================= */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  border-radius: 6px; border: 3px solid transparent; background-clip: padding-box;
  background-color: rgba(255, 255, 255, 0.14);
}
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 55%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

/* =====================================================================
   COMPONENTI MOBILE (nascosti su desktop, attivati dai media query)
   ===================================================================== */

/* barra superiore del telefono */
.mobile-top {
  display: none; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: linear-gradient(180deg, rgba(13, 12, 22, 0.94), rgba(13, 12, 22, 0.55) 70%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  position: sticky; top: 0; z-index: 20;
}
.mt-brand { margin-bottom: 0; font-size: 19px; }
.mt-brand .brand-logo { width: 23px; height: 23px; }
.mt-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text-dim);
}
.mt-btn svg { width: 20px; height: 20px; }

/* navigazione inferiore */
.bottom-nav {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 7px 4px calc(env(safe-area-inset-bottom) + 7px);
  background: linear-gradient(180deg, rgba(16, 15, 27, 0.93), rgba(7, 7, 13, 0.985));
  backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--line);
}
.bn-item {
  flex: 1; background: none; border: none; color: var(--text-dim);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 2px; border-radius: 12px; cursor: pointer;
  font-size: 10px; font-weight: 650; letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent; transition: color .2s;
}
.bn-item svg { width: 21px; height: 21px; transition: transform .22s, filter .22s; }
.bn-item.active { color: #fff; }
.bn-item.active svg { transform: translateY(-1px) scale(1.08); filter: drop-shadow(0 0 8px var(--accent)); }
.bn-item.active span {
  background: linear-gradient(100deg, #fff, color-mix(in srgb, var(--accent) 70%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.bn-item:active { transform: scale(.94); }

/* schermata di riproduzione a tutto schermo */
.player-sheet {
  display: none; position: fixed; inset: 0; z-index: 46;
  flex-direction: column; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 10px) 22px calc(env(safe-area-inset-bottom) + 22px);
  background:
    radial-gradient(75% 55% at 50% 12%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 70%),
    linear-gradient(180deg, #14121f, #06060b);
  transform: translateY(100%); transition: transform .34s cubic-bezier(.25, .9, .3, 1);
}
.player-sheet.open { transform: translateY(0); }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.ps-icon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.ps-icon svg { width: 21px; height: 21px; }
.ps-icon:active { transform: scale(.92); }
.ps-ctx {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; font-weight: 800;
  color: var(--text-dim); text-align: center; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ps-art-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.ps-art {
  position: relative; width: min(78vw, 46vh); aspect-ratio: 1; border-radius: 22px; overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 34px 70px -22px #000, 0 0 60px -22px var(--accent), inset 0 0 0 1px var(--line);
}
.ps-art img { width: 100%; height: 100%; object-fit: cover; display: none; }
.ps-art-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 60px; color: var(--text-dim); }
.ps-meta { flex-shrink: 0; text-align: left; }
.ps-title { font-size: 21px; font-weight: 800; letter-spacing: -0.4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-artist { font-size: 14px; color: var(--text-dim); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-seek { flex-shrink: 0; }
.ps-seek input[type="range"] { width: 100%; height: 6px; }
.ps-seek input[type="range"]::-webkit-slider-thumb { opacity: 1; width: 15px; height: 15px; }
.ps-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); margin-top: 7px; font-variant-numeric: tabular-nums; }
.ps-controls { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; padding: 2px 4px; }
.ps-ctl {
  position: relative; background: none; border: none; color: var(--text-dim);
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: color .2s, transform .15s;
}
.ps-ctl svg { width: 25px; height: 25px; }
.ps-ctl:active { transform: scale(.9); }
.ps-ctl.active { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.ps-play {
  width: 70px; height: 70px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 34px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.ps-play svg { width: 28px; height: 28px; }
.ps-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0; }
.ps-vol { display: flex; align-items: center; gap: 9px; flex: 1; }
.ps-vol input[type="range"] { flex: 1; height: 5px; }
.ps-vol input[type="range"]::-webkit-slider-thumb { opacity: 1; }
.ps-remote {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 11.5px; color: var(--accent); font-weight: 600; flex-shrink: 0;
}

/* elementi visibili solo quando la barra laterale e' nascosta */
.mobile-only { display: none; }
.pl-chips { display: flex; gap: 9px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.pl-chip {
  flex-shrink: 0; padding: 9px 15px; border-radius: 22px; font-size: 12.5px; font-weight: 650;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text-dim);
  cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
.pl-chip.new { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.pl-chip:active { transform: scale(.95); }

/* vista Cerca (telefono) */
.search-view-form { display: flex; gap: 9px; margin-bottom: 8px; }
.search-view-form input {
  flex: 1; min-width: 0; color: var(--text); font-size: 16px; /* 16px evita lo zoom automatico su iOS */
  background: rgba(0, 0, 0, 0.34); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px 15px;
}
.search-view-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.search-view-form button {
  width: 50px; border: none; border-radius: 13px; color: #fff; font-size: 20px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -8px var(--accent);
}
.search-hint { font-size: 12px; color: var(--text-dim); line-height: 1.6; margin-bottom: 20px; }
.sv-results { display: flex; flex-direction: column; gap: 4px; }

/* ================= SCELTA FONTE DI RICERCA ================= */
.src-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 16px; }
.src-opt {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 14px; color: var(--text-dim);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.013));
  border: 1px solid var(--line);
  transition: border-color .22s, box-shadow .22s, transform .18s, color .22s;
}
.src-opt:hover { transform: translateY(-2px); color: var(--text); }
.src-opt.active { color: var(--text); border-color: color-mix(in srgb, var(--accent) 52%, transparent); box-shadow: 0 0 26px -14px var(--accent); }
.src-opt b { display: block; font-size: 14px; }
.src-opt small { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.src-ic {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.src-ic.yt { background: linear-gradient(135deg, #ff4e45, #c4302b); }
.src-ic.sp { background: linear-gradient(135deg, #1ed760, #14833b); }
.sr-noimg {
  width: 62px; height: 38px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
}
.sr-dur { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.via-badge {
  display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--text-dim);
  padding: 3px 9px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}

/* ================= SCHEDA ARTISTA ================= */
.artist-hero {
  display: flex; align-items: center; gap: 26px; margin-bottom: 26px;
  padding: 26px; border-radius: 20px; position: relative; overflow: hidden;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
}
.artist-hero::before {
  content: ''; position: absolute; top: -60%; left: -10%; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
  filter: blur(12px); pointer-events: none;
}
.ah-photo {
  width: 132px; height: 132px; border-radius: 50%; flex-shrink: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; font-weight: 800; color: #fff;
  background-size: cover; background-position: center;
  box-shadow: 0 18px 40px -14px #000, inset 0 2px 0 rgba(255, 255, 255, 0.25);
}
.ah-photo.has-photo { box-shadow: 0 18px 40px -14px #000, 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.ah-main { min-width: 0; position: relative; }
.ah-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.3px; font-weight: 800; color: var(--accent); }
.ah-name {
  margin: 6px 0 10px; font-size: 40px; font-weight: 800; letter-spacing: -1.4px; line-height: 1.05;
  background: linear-gradient(100deg, #fff 30%, color-mix(in srgb, var(--accent) 55%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ah-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px; }
.ah-fact { font-size: 12.5px; color: var(--text); }
.ah-fact b { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); font-weight: 800; margin-bottom: 2px; }
.ah-tags { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 4px; }
.ah-tag {
  font-size: 10.5px; padding: 4px 10px; border-radius: 20px; color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.ah-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ah-ghost {
  padding: 11px 16px; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 650;
  color: var(--text-dim); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  transition: color .2s, border-color .2s, transform .18s;
}
.ah-ghost:hover { color: #fff; border-color: var(--accent); transform: translateY(-1px); }

.ah-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 11px; margin-bottom: 26px; }
.ah-stat {
  padding: 15px; border-radius: 13px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.013));
  border: 1px solid var(--line);
}
.ah-sv {
  font-size: 20px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--accent) 60%, #fff));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ah-sl { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }

.ah-hl {
  display: flex; align-items: center; gap: 14px; padding: 14px; margin-bottom: 26px;
  border-radius: 15px; border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, transparent), rgba(255, 255, 255, 0.015));
}
.ah-hl-lab {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 800;
  color: var(--accent); writing-mode: vertical-rl; transform: rotate(180deg); flex-shrink: 0;
}
.ah-hl img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ah-hl-main { flex: 1; min-width: 0; }
.ah-hl-t { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-hl-s { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }

.ah-bio {
  font-size: 14px; line-height: 1.75; color: #d9d6ea;
  padding: 20px; border-radius: 15px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
}
.ah-bio p { margin: 0 0 12px; }
.ah-bio.loading { color: var(--text-dim); font-style: italic; }
.ah-link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 650; }
.ah-link:hover { text-decoration: underline; }
.ah-credit { font-size: 10.5px; color: var(--text-dim); margin-top: 14px; }
.ah-empty { color: var(--text-dim); font-size: 13.5px; line-height: 1.7; }
.ah-src { display: flex; gap: 5px; }

/* ---- scheda artista nei risultati di ricerca ---- */
.artist-result {
  display: flex; align-items: center; gap: 15px; cursor: pointer; margin-bottom: 12px;
  padding: 14px; border-radius: 16px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 20%, transparent), rgba(255, 255, 255, 0.02));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  transition: transform .18s, box-shadow .22s;
}
.artist-result:hover { transform: translateY(-2px); box-shadow: 0 0 30px -14px var(--accent); }
.ar-photo {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  box-shadow: 0 10px 22px -10px #000;
}
.ar-main { flex: 1; min-width: 0; }
.ar-kind { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 800; color: var(--accent); }
.ar-name { font-size: 18px; font-weight: 800; letter-spacing: -0.4px; margin: 2px 0 3px; }
.ar-sub { font-size: 11.5px; color: var(--text-dim); }
.ar-go { font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }

/* ---- discografia nella pagina artista ---- */
.cat-loading { color: var(--text-dim); font-style: italic; font-size: 13.5px; padding: 12px 0; }
.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-row {
  display: flex; align-items: center; gap: 13px; padding: 8px 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s, transform .16s;
}
.cat-row:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); transform: translateX(3px); }
.cat-pos { width: 20px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cat-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.cat-row .sr-noimg { width: 44px; height: 44px; }
.cat-main { flex: 1; min-width: 0; }
.cat-t { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-s { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cat-dur { font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.cat-add {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; cursor: pointer; font-size: 15px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text-dim);
  transition: color .2s, background .2s, border-color .2s;
}
.cat-add:hover { color: #fff; background: color-mix(in srgb, var(--accent) 34%, transparent); border-color: var(--accent); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 14px; }
.album-card { cursor: pointer; transition: transform .22s; }
.album-card:hover { transform: translateY(-4px); }
.album-card img, .album-ph {
  width: 100%; aspect-ratio: 1; border-radius: 11px; object-fit: cover; margin-bottom: 9px;
  box-shadow: 0 12px 26px -14px #000; background: rgba(255, 255, 255, 0.06);
  display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--text-dim);
}
.album-card:hover img { box-shadow: 0 14px 30px -12px var(--accent); }
.album-t { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-s { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---- ponte verso il microfono ---- */
.pt-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.1px; font-weight: 800;
  color: var(--text-dim); margin: 16px 0 8px;
}
.pt-group:first-child { margin-top: 0; }
.pt-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; margin-bottom: 7px;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color .22s, box-shadow .22s;
}
.pt-row.ponte {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  box-shadow: 0 0 24px -14px var(--accent);
}
.pt-ic { width: 20px; height: 20px; color: var(--text-dim); flex-shrink: 0; }
.pt-row.ponte .pt-ic { color: var(--accent); }
.pt-main { flex: 1; min-width: 0; display: block; }
.pt-nome {
  width: 100%; background: transparent; border: 1px solid transparent; color: var(--text);
  font-size: 13.5px; font-weight: 650; padding: 5px 8px; border-radius: 8px;
  font-family: inherit;
}
.pt-nome:hover { border-color: var(--line); }
.pt-nome:focus { outline: none; border-color: var(--accent); background: rgba(0, 0, 0, 0.3); }
.pt-orig { display: block; font-size: 10.5px; color: var(--text-dim); padding: 0 8px; margin-top: 1px; }
.pt-btn {
  flex-shrink: 0; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 11.5px; font-weight: 650;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text-dim);
  transition: color .2s, border-color .2s, background .2s;
}
.pt-btn:hover { color: #fff; border-color: var(--accent); }
.pt-btn.on { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.pt-tag { font-size: 10.5px; color: var(--text-dim); flex-shrink: 0; }
.pt-meter { display: flex; align-items: center; gap: 11px; margin-top: 16px; }
.pt-meter-lab { font-size: 11.5px; color: var(--text-dim); flex-shrink: 0; }
.pt-meter .mx-meter-bar { flex: 1; }

/* ---- menu "Altro" del telefono ---- */
.more-list { display: flex; flex-direction: column; gap: 6px; }
.more-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 14px; border-radius: 12px; color: var(--text);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014));
  border: 1px solid var(--line);
  transition: border-color .2s, transform .16s;
}
.more-row:active { transform: scale(.98); }
.more-row:hover { border-color: var(--line-2); }
.more-main { flex: 1; min-width: 0; }
.more-t { display: block; font-size: 15px; font-weight: 700; }
.more-s { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.more-go { color: var(--accent); font-size: 19px; font-weight: 700; flex-shrink: 0; }

/* ---- cronologia nella pagina Cerca ---- */
.hist-row .cat-add { opacity: .55; transition: opacity .2s; }
.hist-row:hover .cat-add { opacity: 1; }
.hist-gone {
  font-size: 10px; font-weight: 700; color: var(--text-dim); flex-shrink: 0;
  padding: 3px 8px; border-radius: 20px; background: rgba(255, 255, 255, 0.06);
}
#svRecent .pl-chips { flex-wrap: wrap; overflow: visible; }

/* ---- rifiniture ---- */
.ph-actions { display: flex; gap: 2px; align-items: center; }
.ph-actions button {
  width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  transition: color .2s, background .2s;
}
.ph-actions button:hover { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.ph-actions button:hover .ic { transform: none; }

/* la scheda artista dentro un modale non deve toccare i bordi */
.modal .artist-result { margin: 0 0 10px; }

/* tutti i pulsanti con icona+testo allineati sulla stessa linea */
.btn-primary, .ah-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.pl-bar .btn-primary, .pl-bar .ah-ghost { white-space: nowrap; }

/* le righe dei risultati non devono ballare quando compare la scheda artista */
.sv-results, .search-list { scroll-behavior: smooth; }

/* stati disabilitati coerenti in tutta l'app */
button:disabled { opacity: .55; cursor: default; }
button:disabled:hover { transform: none; filter: none; }

/* ---- griglia artisti ---- */
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.art-tile {
  padding: 18px 14px 16px; border-radius: 16px; text-align: center; cursor: pointer;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.014));
  border: 1px solid var(--line);
  transition: transform .24s cubic-bezier(.2, .8, .3, 1), box-shadow .24s, border-color .24s;
}
.art-tile:hover { transform: translateY(-5px); border-color: var(--line-2); box-shadow: var(--shadow-lg); }
.art-av {
  position: relative; width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 13px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 29px; font-weight: 800; color: #fff;
  box-shadow: 0 14px 28px -14px #000, inset 0 2px 0 rgba(255, 255, 255, 0.22);
}
.art-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-av.has-photo span { display: none; }
.art-tile:hover .art-av { box-shadow: 0 14px 30px -12px var(--accent); }
.art-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.art-bar { height: 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); margin-top: 10px; overflow: hidden; }
.art-bar span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), #38bdf8); }

/* ---- icone vettoriali al posto delle emoji ---- */
.ic { width: 17px; height: 17px; display: block; flex-shrink: 0; }
.t-actions .ic { width: 15px; height: 15px; }
.q-acts .ic, .pick-add .ic { width: 13px; height: 13px; }
.btn-primary .ic, .ah-ghost .ic { width: 15px; height: 15px; display: inline-block; vertical-align: -3px; margin-right: 5px; }
.pl-chip .ic { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.c-play .ic { width: 18px; height: 18px; margin: 0; }
.src-ic .ic { width: 18px; height: 18px; }
.mx-out-ic .ic { width: 19px; height: 19px; }
.np-placeholder .ic, .ps-art-ph .ic { width: 46%; height: 46%; opacity: .55; }
.ps-art-ph .ic { width: 34%; height: 34%; }
.add-form button .ic, .playlists-head button .ic, .user-chip button .ic { width: 16px; height: 16px; margin: 0 auto; }
.cat-add .ic { width: 15px; height: 15px; margin: 0 auto; }
.sd-del .ic, .pl-del .ic { width: 14px; height: 14px; margin: 0 auto; }

/* ---- selettore brani da aggiungere alla playlist ---- */
.pick-row {
  display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s, opacity .2s;
}
.pick-row:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.pick-row.added { opacity: .5; pointer-events: none; }
.pick-row img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.pick-main { flex: 1; min-width: 0; display: block; }
.pick-t { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-s { display: block; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-add {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent);
}
.pick-row.added .pick-add { color: var(--ok); background: color-mix(in srgb, var(--ok) 18%, transparent); border-color: color-mix(in srgb, var(--ok) 36%, transparent); }
#pickFilter {
  width: 100%; margin-bottom: 12px; color: var(--text); font-size: 14px;
  background: rgba(0, 0, 0, 0.36); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 13px;
}
#pickFilter:focus { outline: none; border-color: var(--accent); }

/* ---- coda di riproduzione ---- */
.queue-count {
  position: absolute; top: -3px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; font-size: 9px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
}
.q-row {
  display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: background .2s, border-color .2s;
}
.q-row:hover { background: rgba(255, 255, 255, 0.06); border-color: var(--line); }
.q-row.now { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.q-row.past { opacity: .45; }
.q-pos { width: 20px; text-align: center; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.q-row.now .q-pos { color: var(--accent); }
.q-row img { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.q-main { flex: 1; min-width: 0; display: block; }
.q-t { display: block; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-s { display: block; font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-acts { display: flex; gap: 3px; flex-shrink: 0; }
.q-acts button {
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer; font-size: 10px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--text-dim);
}
.q-acts button:hover { color: #fff; border-color: var(--accent); }
.q-acts .q-del:hover { border-color: var(--danger); color: var(--danger); }

/* ---- barra della playlist ---- */
.pl-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-hint { font-size: 11.5px; color: var(--text-dim); }

/* ---- generi ---- */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 14px; }
.genre-card {
  position: relative; aspect-ratio: 16/10; border-radius: 15px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); color: #fff; text-align: left; padding: 14px;
  display: flex; align-items: flex-end; font-size: 15px; font-weight: 800; letter-spacing: -0.3px;
  background: linear-gradient(145deg, var(--gc), color-mix(in srgb, var(--gc) 35%, #0b0a14));
  transition: transform .22s, box-shadow .25s;
}
.genre-card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .38; mix-blend-mode: luminosity;
}
.genre-card span { position: relative; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.genre-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 16px 34px -16px var(--gc); }
.cat-pos.err { color: var(--danger); }

/* ================= MIXER ================= */
.mx-hint { margin-bottom: 16px; }
.mx-devices { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 13px; }
.mx-dev {
  padding: 15px; border-radius: 15px; border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.013));
  transition: border-color .25s, box-shadow .25s, transform .2s;
}
.mx-dev.on {
  border-color: color-mix(in srgb, var(--accent) 46%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 17%, transparent), rgba(255, 255, 255, 0.015));
  box-shadow: 0 0 26px -14px var(--accent);
}
.mx-dev.off { opacity: .48; }
.mx-dev-head { display: flex; align-items: center; gap: 12px; }
.mx-dev-ic { width: 23px; height: 23px; flex-shrink: 0; color: var(--text-dim); }
.mx-dev-ic svg { width: 100%; height: 100%; }
.mx-dev.on .mx-dev-ic { color: var(--accent); filter: drop-shadow(0 0 8px var(--accent)); }
.mx-dev-meta { flex: 1; min-width: 0; }
.mx-dev-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mx-dev-state { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.mx-dev.on .mx-dev-state { color: var(--accent); }
.mx-sw { width: 42px; height: 24px; }
.mx-sw span::before { width: 17px; height: 17px; top: 2.5px; }
.mx-sw input:checked + span::before { transform: translateX(18px); }
.mx-fader { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.mx-fader .vol-icon { width: 15px; height: 15px; }
.mx-vol { flex: 1; }
.mx-vol-val { font-size: 11px; color: var(--text-dim); width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

.mx-eq { transition: opacity .3s, filter .3s; }
.mx-eq.disabled { opacity: .38; filter: grayscale(.7); pointer-events: none; }
.mx-presets { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.mx-preset {
  padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 650; cursor: pointer;
  background: rgba(255, 255, 255, 0.055); border: 1px solid var(--line); color: var(--text-dim);
  transition: color .2s, border-color .2s, background .25s, transform .18s;
}
.mx-preset:hover { color: #fff; transform: translateY(-1px); }
.mx-preset.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px -6px var(--accent);
}
.mx-bands {
  display: flex; justify-content: space-between; gap: 6px; padding: 16px 10px;
  border-radius: 15px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.32), rgba(255, 255, 255, 0.02));
}
.mx-band { display: flex; flex-direction: column; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.mx-band-val { font-size: 10.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; font-weight: 700; }
.mx-band-hz { font-size: 9.5px; color: var(--text-dim); letter-spacing: 0.3px; }
/* fader verticali: si ruota un range orizzontale, cosi' funziona su tutti i
   browser (Chrome ha deprecato appearance:slider-vertical) */
.mx-band-slot { height: 122px; width: 26px; display: flex; align-items: center; justify-content: center; }
.mx-band-slider {
  -webkit-appearance: none; appearance: none;
  width: 118px; height: 5px; flex-shrink: 0;
  transform: rotate(-90deg);
  border-radius: 4px; background: rgba(255, 255, 255, 0.13); cursor: pointer;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.mx-band-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 17px; height: 17px; border-radius: 50%; opacity: 1;
  background: linear-gradient(135deg, #fff, #cfc9e8);
  box-shadow: 0 0 12px var(--accent), 0 2px 5px rgba(0, 0, 0, 0.6);
}
.mx-band-slider::-moz-range-thumb {
  width: 17px; height: 17px; border: none; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px var(--accent);
}
.mx-extra { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-top: 20px; }
.mx-knob label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 9px; font-weight: 600; }
.mx-knob label b { color: var(--text); float: right; font-variant-numeric: tabular-nums; }
.mx-knob input { width: 100%; }
.mx-knob input::-webkit-slider-thumb { opacity: 1; }
.mx-comp {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 18px; padding: 15px; border-radius: 13px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--line);
}
.mx-live { color: var(--ok); font-weight: 700; }
.mx-meters { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.mx-meter { display: flex; align-items: center; gap: 9px; }
.mx-meter-lab { font-size: 10px; font-weight: 800; color: var(--text-dim); width: 12px; }
.mx-meter-bar {
  flex: 1; height: 9px; border-radius: 5px; overflow: hidden;
  background: rgba(0, 0, 0, 0.4); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}
.mx-meter-bar i {
  display: block; height: 100%; width: 100%; transform-origin: left center; transform: scaleX(0);
  background: linear-gradient(90deg, #22c55e 0%, #22c55e 55%, #eab308 78%, #ef4444 100%);
  transition: transform .06s linear;
}
.mx-spectrum {
  width: 100%; height: 90px; margin-top: 20px; border-radius: 13px; display: block;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.36), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}
.mx-spec-note { font-size: 11px; color: var(--text-dim); margin-top: 9px; text-align: center; }

.mx-outs { display: flex; flex-direction: column; gap: 10px; }
.mx-out {
  display: flex; align-items: center; gap: 13px; padding: 14px;
  border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color .25s, box-shadow .25s;
}
.mx-out.on { border-color: color-mix(in srgb, var(--ok) 42%, transparent); box-shadow: 0 0 22px -14px var(--ok); }
.mx-out-ic { font-size: 19px; flex-shrink: 0; }
.mx-out-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-out-fixed { font-size: 10.5px; color: var(--text-dim); }

/* =====================================================================
   RESPONSIVE
   Tre livelli: telefono (<768), tablet/iPad (768-1099), PC (>=1100)
   ===================================================================== */

/* ---------- TABLET / iPad ---------- */
@media (min-width: 768px) and (max-width: 1099px) {
  .app { grid-template-columns: 218px 1fr; grid-template-rows: 1fr 88px; }
  .sidebar { padding: 18px 12px 12px; }
  .brand { font-size: 19px; margin-bottom: 18px; }
  .main { padding: 22px 22px 40px; }
  .topbar h1 { font-size: 27px; }
  .player-bar { grid-template-columns: 210px 1fr 150px; padding: 0 14px; }
  .player-right .vol-icon, .player-right input[type="range"] { display: none; }
  .track-head, .track-row { grid-template-columns: 32px 44px 1fr 92px 66px 104px; gap: 10px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 13px; }
  .artist-grid { grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 13px; }
  .settings-wrap { max-width: 100%; }
  .set-row { flex-wrap: wrap; }
}

/* iPad in verticale: i controlli restano comodi al pollice */
@media (min-width: 768px) and (max-width: 1099px) and (orientation: portrait) {
  .ctl-btn { padding: 8px; }
  .t-actions button { width: 34px; height: 34px; }
  .nav-item, .playlist-item { padding: 12px; }
}

/* ---------- TELEFONO ---------- */
@media (max-width: 767px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100vh; height: 100dvh;
  }
  .mobile-top { display: flex; }
  .sidebar { display: none; }
  .mobile-only { display: block; }
  .bottom-nav { display: flex; }

  .main {
    grid-row: 2; padding: 4px 16px 0;
    /* spazio per mini-player + barra inferiore */
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }
  .topbar { margin-bottom: 16px; gap: 10px; }
  .topbar h1 { font-size: 27px; }

  /* la barra player diventa un mini-player fisso sopra la navigazione */
  .player-bar {
    position: fixed; left: 8px; right: 8px; z-index: 29;
    bottom: calc(env(safe-area-inset-bottom) + 62px);
    grid-row: auto; grid-column: auto;
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 16px;
    border: 1px solid var(--line-2); border-top: 1px solid var(--line-2);
    background: linear-gradient(135deg, rgba(43, 40, 66, 0.94), rgba(17, 16, 28, 0.96));
    box-shadow: var(--shadow-lg), 0 0 30px -16px var(--accent);
  }
  .player-bar::before { display: none; }
  .np { flex: 1; min-width: 0; gap: 11px; cursor: pointer; }
  .np-art { width: 44px; height: 44px; border-radius: 10px; }
  .np-title { font-size: 13px; }
  .np-artist { font-size: 11px; }

  .player-center { flex-direction: row; gap: 0; width: auto; flex-shrink: 0; }
  .control-buttons { gap: 6px; }
  .ctl-extra { display: none; }           /* shuffle/prev/repeat solo a tutto schermo */
  .ctl-btn.play { width: 38px; height: 38px; }
  .ctl-btn { padding: 8px; }
  .seek-row {
    position: absolute; left: 12px; right: 12px; bottom: 3px; max-width: none; gap: 0;
    pointer-events: none;
  }
  .seek-row .time { display: none; }
  .seek-row input[type="range"] { height: 3px; }
  .seek-row input[type="range"]::-webkit-slider-thumb { display: none; }
  .remote-banner { display: none !important; }

  .player-right { flex-shrink: 0; gap: 4px; }
  .player-right .vol-icon, .player-right input[type="range"], #btnQuality, #btnDownloadCur { display: none; }

  .player-sheet { display: flex; }
  .device-panel { left: 10px; right: 10px; width: auto; bottom: calc(env(safe-area-inset-bottom) + 128px); }

  /* elenco brani compatto e con bersagli grandi */
  .track-head { display: none; }
  .track-row {
    grid-template-columns: 48px 1fr 40px; gap: 12px; padding: 9px 8px; transform: none !important;
  }
  .track-row > .t-idx, .track-row > .t-badge, .track-row > .t-dur { display: none; }
  /* la colonna e' nascosta sul telefono, ma quando scegli i brani la spunta
     deve vedersi: altrimenti selezionavi al buio */
  .track-row.in-sel { grid-template-columns: 26px 48px 1fr 40px; }
  .track-row.in-sel > .t-idx { display: flex; align-items: center; justify-content: center; }
  .track-row > .t-actions { opacity: 1; }
  .t-actions { gap: 0; }
  .t-actions .act-add, .t-actions .act-dl { display: none; }
  .t-actions button { width: 38px; height: 38px; background: none; border: none; }
  .t-thumb { width: 48px; height: 48px; }
  .t-title { font-size: 14.5px; }
  .t-artist { font-size: 12.5px; }

  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 13px; }
  .card { padding: 10px; }
  .card .c-play { display: none; }
  .artist-grid { grid-template-columns: repeat(2, 1fr); gap: 13px; }
  .artist-av { width: 76px; height: 76px; font-size: 25px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .stat-card { padding: 15px; }
  .stat-val { font-size: 23px; }
  .rank-row { grid-template-columns: 26px 40px 1fr auto; gap: 11px; padding: 10px; transform: none !important; }
  .rank-av { width: 40px; height: 40px; }

  .section { margin-bottom: 28px; }
  .section-head h2 { font-size: 16px; }

  /* impostazioni: etichetta sopra, controllo sotto */
  .settings-wrap { max-width: 100%; }
  .set-group { padding: 18px; border-radius: 16px; }
  .set-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .set-ctl { width: 100%; }
  .quality-pick { width: 100%; }
  .quality-pick button { flex: 1; padding: 11px 4px; }
  .set-input { width: 100%; font-size: 16px; }
  .switch { align-self: flex-start; }
  .accent-picks { flex-wrap: wrap; }
  .accent-dot { width: 34px; height: 34px; }
  .sd-row { padding: 12px; }
  .src-pick { grid-template-columns: 1fr; gap: 9px; }
  .src-opt { padding: 12px; }
  .artist-hero { flex-direction: column; align-items: flex-start; gap: 18px; padding: 20px; }
  .ah-photo { width: 104px; height: 104px; font-size: 34px; }
  .ah-name { font-size: 29px; }
  .ah-stats { grid-template-columns: repeat(2, 1fr); }
  .ah-hl-lab { display: none; }
  .mx-devices { grid-template-columns: 1fr; }
  .mx-bands { padding: 14px 4px; gap: 2px; }
  .mx-band-slider { width: 20px; height: 104px; }
  .mx-band-hz { font-size: 8.5px; }
  .mx-extra { grid-template-columns: 1fr; }

  .modal { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding: 22px 18px calc(env(safe-area-inset-bottom) + 22px); }
  .modal-bg { align-items: flex-end; }
  .search-list { max-height: 52vh; }
  .sr-row { padding: 11px 8px; }
  .sr-row img { width: 72px; height: 44px; }
  .toast { bottom: calc(env(safe-area-inset-bottom) + 132px); }

  .auth-card { padding: 28px 22px; border-radius: 20px; }
  .auth-form input { font-size: 16px; padding: 13px; }
  .btn-primary { padding: 14px 18px; }
}

/* telefono molto stretto */
@media (max-width: 359px) {
  .card-grid, .artist-grid, .stat-cards { grid-template-columns: 1fr; }
  .bn-item span { font-size: 9px; }
}

/* telefono in orizzontale: schermo basso, si comprime la schermata player */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .player-sheet { padding-top: calc(env(safe-area-inset-top) + 6px); gap: 8px; }
  .ps-art { width: min(30vw, 40vh); }
  .ps-art-wrap { flex: 0 1 auto; }
  .ps-title { font-size: 17px; }
  .ps-ctl { width: 44px; height: 44px; }
  .ps-play { width: 56px; height: 56px; }
  .ps-foot { display: none; }
  .main { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* dispositivi touch: niente effetti hover che restano "appiccicati" */
@media (hover: none) {
  .card:hover, .artist-card:hover, .stat-card:hover { transform: none; }
  .track-row:hover, .rank-row:hover, .sd-row:hover, .dp-row:hover { transform: none; }
  .t-actions { opacity: 1; }
  .nav-item:hover, .playlist-item:hover { transform: none; }
  .card:hover img { transform: none; }
  .track-row:hover .t-thumb { transform: none; }
}

/* schermi molto grandi: si allarga senza diventare dispersivo */
@media (min-width: 1800px) {
  .main { padding: 32px 60px 56px; }
  .app { grid-template-columns: 300px 1fr; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .player-sheet { transition: none; }
}

/* ---- scelta dei brani da salvare offline ---- */
.sel-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.sel-bar.on {
  padding: 12px 14px; border-radius: 13px;
  background: linear-gradient(100deg, color-mix(in srgb, var(--accent) 16%, transparent), rgba(255, 255, 255, 0.02));
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
}
.sel-conta { font-size: 12.5px; color: var(--text-dim); font-weight: 650; }
.sel-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--line-2); background: rgba(0, 0, 0, 0.3);
  transition: background .18s, border-color .18s;
}
.sel-box.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sel-box .ic { width: 12px; height: 12px; }
.track-row:hover .sel-box { border-color: var(--accent); }
/* mentre scegli, la spunta prende il posto del numero e del triangolo */
.track-row.in-sel .t-idx-num,
.track-row.in-sel .t-idx-play { display: none !important; }

/* ---- pannello di amministrazione ---- */
.admin-group { border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.admin-tag {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  padding: 3px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.admin-riepilogo { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; font-weight: 650; }
.admin-row {
  display: flex; align-items: center; gap: 13px; padding: 13px; margin-bottom: 8px;
  border-radius: 13px; border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
  transition: border-color .2s;
}
.admin-row:hover { border-color: var(--line-2); }
.admin-row.admin-self { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.admin-av {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
}
.admin-main { flex: 1; min-width: 0; }
.admin-nome { font-size: 14px; font-weight: 700; }
.admin-mail { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.admin-dati { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.admin-azioni { display: flex; gap: 7px; flex-shrink: 0; flex-wrap: wrap; }
.admin-azioni button { padding: 7px 12px; font-size: 11.5px; }
.admin-del:hover { color: #fff !important; border-color: var(--danger) !important; background: color-mix(in srgb, var(--danger) 34%, transparent) !important; }
@media (max-width: 767px) {
  .admin-row { flex-wrap: wrap; }
  .admin-azioni { width: 100%; }
  .admin-azioni button { flex: 1; }
}
