/* ===== LISTA MELODII (rămâne la fel) ===== */
.track-item{display:flex;align-items:center;gap:.75rem;padding:.75rem;border-radius:.75rem;background:#101418;color:#e7e7e7;position:relative}
.track-item+.track-item{margin-top:.5rem}
.track-meta{flex:1;min-width:0}
.track-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-artist{opacity:.8;font-size:.9rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.track-play{width:40px;height:40px;border-radius:999px;border:0;background:#1f2937;cursor:pointer;position:relative;z-index:2}
.track-play::before{content:"►";position:absolute;inset:0;display:grid;place-items:center;font-weight:700}
.track-item.playing .track-play::before{content:"❚❚"}
.track-item.playing{outline:2px solid #2563eb}
.stretched-link{position:absolute;inset:0;z-index:1}

/* ===== PLAYER DESKTOP (bară sus, vizibil doar pe desktop) ===== */
.am-player{
  position: sticky; top: 0; z-index: 100;
  display: grid; grid-template-columns: 1fr 2fr 1fr;
  align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(16, 20, 24, .9);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #1f2937;
  color: #e7e7e7;
}
.am-player.hidden{ display: none; }
.am-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.am-left img{ width:44px; height:44px; border-radius:8px; object-fit:cover; }
.am-meta{ min-width:0; }
#am-title, #am-title-desktop{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#am-artist, #am-artist-desktop{ opacity:.8; font-size:.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.am-center{ display:flex; flex-direction:column; gap:6px; align-items:center; }
.am-controls{ display:flex; align-items:center; gap:10px; }
.am-btn{ display:grid; place-items:center; width:38px; height:38px; border-radius:50%; background:#1f2937; border:0; color:#fff; cursor:pointer }
.am-btn.am-big{ width:44px; height:44px; font-size:18px; }
.am-ico{ width:20px; height:20px }
.am-timeline{ display:flex; align-items:center; gap:10px; width:100%; max-width:640px; }
#am-time, #am-dur, #am-time-desktop, #am-dur-desktop{ font-variant-numeric: tabular-nums; font-size:.9rem; opacity:.9; }
#am-seek, #am-seek-desktop{
  -webkit-appearance:none; appearance:none; width:100%; height:4px; background:#263240; border-radius:999px; outline:none;
}
#am-seek::-webkit-slider-thumb, #am-seek-desktop::-webkit-slider-thumb{
  -webkit-appearance:none; width:14px; height:14px; border-radius:50%; background:#fff; cursor:pointer;
}
#am-seek::-moz-range-thumb, #am-seek-desktop::-moz-range-thumb{ width:14px; height:14px; border-radius:50%; background:#fff; border:0; cursor:pointer; }
.am-right{ display:flex; justify-content:flex-end; }
.am-volume{ display:flex; align-items:center; gap:8px; }
#am-vol, #am-vol-desktop{ width:120px; height:4px; background:#263240; border-radius:999px; }
#am-vol::-webkit-slider-thumb, #am-vol-desktop::-webkit-slider-thumb{ -webkit-appearance:none; width:12px; height:12px; border-radius:50%; background:#fff; }
.am-btn.is-active{ box-shadow:0 0 0 2px #22c55e inset; }
@media (max-width: 640px){ .am-btn{ width:44px; height:44px } .am-btn.am-big{ width:52px; height:52px } .am-ico{ width:22px; height:22px } .am-timeline{ gap:8px } }
.am-btn, .am-ico{ -webkit-tap-highlight-color: transparent; touch-action: manipulation }

/* ===== MINI PLAYER (mobil, bară fixă jos) ===== */
.mini-player{
  position: fixed; left: 0; right: 0; bottom: 0;
  display: none; /* implicit ascuns, JS îl arată pe mobil */
  align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(10,13,18,.92);
  border-top: 1px solid rgba(255,255,255,.06);
  backdrop-filter: saturate(140%) blur(10px);
  z-index: 1000;
}
.mini-player.hidden{ display: none; }
.mini-player .mp-cover img{ width:44px; height:44px; border-radius:10px; object-fit:cover; }
.mini-player .mp-info{ min-width:0; flex:1; }
#mp-title{ font-weight:800; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#mp-artist{ font-weight:600; font-size:13px; color:#b9c5d6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mp-progress{ height:3px; background: rgba(255,255,255,.12); border-radius:999px; margin-top:6px; overflow:hidden; }
#mp-bar{ height:100%; width:0%; background:#7fb8ff; }
.mini-player .mp-ctrls button{ width:40px; height:40px; border:0; border-radius:999px; background:#1b2330; color:#fff; font-weight:800; }
@media (hover:none){ .mini-player{ cursor:pointer; } .mini-player .mp-ctrls{ cursor:default; } }

/* ===== SHEET (player mare, mobil) ===== */
.am-sheet{
  position: fixed; inset: 0; z-index: 1100;
  display: none; /* JS adaugă .show */
  grid-template-rows: 14px auto auto auto auto auto;
  align-items: center; justify-items: center;
  padding: 12px 16px 24px;
  transform: translateY(100%); opacity: 0;
  transition: transform .28s ease, opacity .28s ease;
}
.am-sheet.show{ display:grid; transform: translateY(0); opacity: 1; }
.am-backdrop{ position:absolute; inset:0; background: radial-gradient(120% 120% at 50% 10%, rgba(127,184,255,.45), rgba(0,0,0,.92) 55%); filter: blur(30px); z-index:-1; }
.am-grabber{ width:48px; height:5px; border-radius:999px; background:rgba(255,255,255,.35); margin:6px 0 8px; }
.am-close{ position:absolute; top:10px; right:12px; border:0; background:transparent; color:#fff; font-size:22px; }
.am-art img{ width:min(86vw, 420px); aspect-ratio:1/1; border-radius:18px; object-fit:cover; box-shadow:0 18px 48px rgba(0,0,0,.45); }
.am-meta{ text-align:center; }
#am-title{ margin:12px 0 2px; font-size:22px; color:#fff; }
#am-artist{ color:#b9c5d6; font-weight:600; }
.am-controls{ display:flex; align-items:center; gap:16px; margin-top:6px; }
.am-btn{ width:46px; height:46px; border-radius:999px; border:0; background:#1b2330; color:#fff; font-weight:800; }
.am-btn.am-big{ width:64px; height:64px; font-size:20px; }
.am-timeline{ width:min(92vw,560px); display:grid; grid-template-columns:auto 1fr auto; gap:8px; align-items:center; margin-top:6px; color:#fff; }
#am-seek{ width:100%; }
.am-volume{ width:min(92vw,560px); margin-top:6px; }

/* ===== VIZIBILITATE DESKTOP vs MOBIL ===== */
@media (min-width:769px){
  .am-player{ display:grid; }       /* desktop ON */
  .mini-player, .am-sheet{ display:none !important; } /* mobil OFF */
}
@media (max-width:768px){
  .am-player{ display:none !important; } /* desktop OFF pe mobil */
  .mini-player{ display:flex; }          /* mini-player ON pe mobil */
  /* .am-sheet rămâne controlată din JS: se vede doar când primește .show */
  body{ padding-bottom:64px; }           /* ca să nu acopere bara conținutul */
}

/* bara desktop invizibilă implicit (ridicată în sus) */
.desktop-player{
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 120;
  transform: translateY(-100%);
  transition: transform .25s ease;
}
.desktop-player.is-open{
  transform: translateY(0);
}
/* împinge conținutul când e vizibilă */
body.has-desktop-bar{ padding-top: var(--bar-h, 76px); }

/* NU o mai face sticky aici */
#am-player-desktop{ position: static; }

/* important: pe desktop să NU fie ascunsă în media queries */
@media (min-width:769px){
  .desktop-player{ display:block; }
}

/* ====== DESKTOP BAR: invizibilă implicit, vizibilă DOAR cu .is-open ====== */
.desktop-player{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 120;
  transform: translateY(-100%);          /* ascunsă la load */
  transition: transform .25s ease;
}

/* când începe redarea, JS adaugă .is-open */
.desktop-player.is-open{
  transform: translateY(0);               /* vizibilă */
}

/* împinge conținutul ca să nu fie acoperit de bară */
body.has-desktop-bar{
  padding-top: var(--bar-h, 76px);
}

/* bara internă nu mai trebuie să fie sticky */
#am-player-desktop{ position: static; }

/* ====== VIZIBILITATE: desktop vs mobil ====== */
@media (min-width:769px){
  .desktop-player{ display: block; }
  .mini-player, .am-sheet{ display: none !important; }  /* ascunde playerul mobil pe desktop */
}
@media (max-width:768px){
  .desktop-player{ display: none !important; }          /* ascunde bară desktop pe mobil */
  .mini-player{ display: flex; }                        /* arată mini-player pe mobil */
}
/* ===== PLAYER DESKTOP ===== */
@media (min-width: 769px) {
  .desktop-player {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    display: none;           /* ascuns implicit */
    background: #0b0f14;     /* fundal ca să nu se amestece cu headerul */
    border-bottom: 1px solid #1f2937;
  }

  /* apare doar când JS îi pune clasa */
  .desktop-player.is-open {
    display: block;
  }

  /* împinge conținutul în jos când playerul e vizibil */
  body.has-desktop-bar {
    padding-top: 76px; /* ajustează în funcție de înălțimea barei */
  }
}

/* ===== ASCUNDE TOTAL PE MOBIL ===== */
@media (max-width: 768px) {
  .desktop-player { display: none !important; }
}

