:root {
  --bg: #dcecfa;                          /* bleu pastel clair */
  --bg2: rgba(255, 255, 255, 0.45);        /* surfaces légèrement transparentes */
  --bg3: rgba(255, 255, 255, 0.75);
  --line: rgba(27, 36, 51, 0.12);
  --fg: #1b2433; --muted: #5a6b80;
  --accent: #1db954; --accent-text: #0e7a36; --player-h: 88px;
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(160deg, #e6f2fd 0%, #d3e7f8 100%) fixed; background-color: var(--bg); color: var(--fg); font: 15px/1.4 system-ui, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }

.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 16px; align-items: center;
  padding: 14px 24px; background: rgba(230, 242, 253, 0.7); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { margin: 0; font-size: 20px; }
#search { flex: 1; max-width: 360px; padding: 8px 14px; border-radius: 20px; border: 0;
  background: var(--bg3); color: var(--fg); outline: none; }

main { display: flex; height: calc(100vh - 61px - var(--player-h)); }
.grid { flex: 1; overflow-y: auto; padding: 24px; display: grid; gap: 20px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.album { background: var(--bg2); border-radius: 8px; padding: 12px; cursor: pointer;
  transition: background .15s; position: relative; }
.album:hover { background: var(--bg3); }
.album.playing .album-name { color: var(--accent-text); }
.album-name { margin-top: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.album-count { color: var(--muted); font-size: 13px; }

.cover { aspect-ratio: 1; width: 100%; border-radius: 6px; background: #b9cde0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 42px; font-weight: 700;
  color: rgba(255,255,255,.85); overflow: hidden; }
.cover.small { width: 56px; height: 56px; font-size: 18px; flex: none; }

.panel { width: 380px; background: var(--bg2); border-left: 1px solid var(--line); backdrop-filter: blur(10px);
  overflow-y: auto; display: flex; flex-direction: column; }
.panel.hidden { display: none; }
.panel-head { display: flex; gap: 14px; padding: 18px; position: relative; }
.panel-head .cover { width: 110px; flex: none; font-size: 34px; }
.panel-info h2 { margin: 0 0 4px; font-size: 18px; padding-right: 24px; }
.panel-info p { margin: 0 0 12px; color: var(--muted); }
#panel-close { position: absolute; top: 10px; right: 10px; }

.btn { background: var(--accent); color: #000; border: 0; border-radius: 20px; padding: 8px 18px; font-weight: 600; }
.btn:hover { filter: brightness(1.1); }
.icon { background: none; border: 0; font-size: 18px; padding: 6px 10px; border-radius: 50%; }
.icon:hover { background: var(--bg3); }
.icon.big { font-size: 22px; width: 46px; height: 46px; background: var(--fg); color: #fff; }
.icon.big:hover { background: #2c3a52; }

.tracklist { list-style: none; margin: 0; padding: 0 8px 16px; counter-reset: t; }
.tracklist li { counter-increment: t; display: flex; gap: 12px; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.tracklist li::before { content: counter(t); width: 22px; text-align: right; color: var(--muted); flex: none; }
.tracklist li:hover { background: var(--bg3); }
.tracklist li.current { color: var(--accent-text); font-weight: 600; }
.tracklist li.current::before { content: "♪"; color: var(--accent-text); }

.player { position: fixed; bottom: 0; left: 0; right: 0; height: var(--player-h); background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; padding: 0 20px; gap: 16px; }
.now { display: flex; gap: 12px; align-items: center; min-width: 0; }
.now-text { min-width: 0; }
#now-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#now-album { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.buttons { display: flex; gap: 10px; align-items: center; }
.seek { display: flex; gap: 10px; align-items: center; width: 100%; font-size: 12px; color: var(--muted); }
.seek input { flex: 1; }
.volume { justify-self: end; display: flex; align-items: center; gap: 8px; }
input[type=range] { accent-color: var(--accent); }

.actions { margin-left: auto; display: flex; gap: 8px; }
.link { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px;
  padding: 7px 14px; color: var(--fg); white-space: nowrap; }
.link:hover { border-color: var(--accent); }
.link.accent { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.hidden { display: none !important; }

.empty { color: var(--muted); grid-column: 1 / -1; text-align: center; margin-top: 60px; }

@media (max-width: 760px) {
  .panel { position: fixed; inset: 0 0 var(--player-h) 0; width: auto; z-index: 10; background: rgba(230, 242, 253, 0.94); }
  .player { grid-template-columns: 1fr auto; }
  .volume { display: none; }
  .top { gap: 8px; padding: 12px; }
  .top h1 { display: none; }
  #search { min-width: 0; }
  .link { padding: 6px 10px; font-size: 13px; }
  .seek { display: none; }
}
