:root{
  --bg:#0b0b0f;
  --text:#fff;
  --accent:#ff3b30;
  --card:rgba(255,255,255,.06);
  --card2:rgba(255,255,255,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x:hidden;
}

/* background blur */
.bg-art{
  position:fixed;
  inset:0;
  background-size:cover;
  background-position:center;
  filter: blur(30px) saturate(1.1);
  opacity:.35;
  transform: scale(1.1);
  z-index:-2;
}
.bg-overlay{
  position:fixed;
  inset:0;
  background: radial-gradient(circle at 20% 10%, rgba(255,59,48,.18), transparent 55%),
              radial-gradient(circle at 80% 30%, rgba(0,200,255,.12), transparent 50%),
              linear-gradient(to bottom, rgba(11,11,15,.92), rgba(11,11,15,.75));
  z-index:-1;
}

header{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 16px 8px;
}
header img{
  width:42px;
  height:42px;
  border-radius:12px;
  box-shadow: var(--shadow);
}
.header-text{line-height:1.1}
.header-text .name{font-weight:800; font-size:18px}
.header-text .slogan{opacity:.8; font-size:12px}

.container{max-width:980px; margin:0 auto; padding:0 16px 100px}

.tabs{
  display:flex;
  gap:8px;
  overflow:auto;
  padding:8px 0 12px;
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none}
.tab{
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
}
.tab.active{
  background: rgba(255,59,48,.18);
  border-color: rgba(255,59,48,.45);
}

.grid{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:16px;
}
@media (max-width: 860px){
  .grid{grid-template-columns:1fr}
}

.card{
  background: var(--card);
  border:1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}
.card h2{margin:0 0 10px; font-size:14px; opacity:.9; letter-spacing:.2px}

/* player */
.player{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.player-top{
  display:flex;
  gap:14px;
  align-items:center;
}

.vinyl-wrap{
  width:220px;
  height:220px;
  border-radius:999px;
  position:relative;
  flex:0 0 auto;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.10), transparent 60%),
              radial-gradient(circle at 65% 65%, rgba(255,255,255,.06), transparent 62%),
              rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  overflow:hidden;
}
@media (max-width:480px){
  .vinyl-wrap{width:180px;height:180px}
}
.vinyl{
  width:100%; height:100%;
  border-radius:999px;
  background-size:cover;
  background-position:center;
  position:relative;
  will-change: transform;
}
.vinyl::after{
  content:"";
  position:absolute;
  inset:12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
}
.vinyl::before{
  content:"";
  position:absolute;
  left:50%; top:50%;
  width:22%; height:22%;
  transform: translate(-50%,-50%);
  border-radius:999px;
  background: radial-gradient(circle, var(--accent) 0 28%, rgba(255,255,255,.85) 28% 32%, rgba(0,0,0,.35) 32%);
  border:1px solid rgba(255,255,255,.14);
}

.spinning .vinyl{animation: spin 2.2s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.track{
  flex:1;
  min-width:0;
}
.track .live{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,59,48,.16);
  border:1px solid rgba(255,59,48,.45);
  margin-bottom:10px;
}
.dot{
  width:7px; height:7px; border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,59,48,.18);
}
.track .title{font-weight:900; font-size:20px; margin:0 0 4px}
.track .artist{opacity:.85; margin:0 0 10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.smallrow{display:flex; gap:10px; flex-wrap:wrap; opacity:.85; font-size:12px}

.controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.btn{
  border:none;
  border-radius:14px;
  padding:12px 14px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.btn.primary{
  background: linear-gradient(135deg, rgba(255,59,48,.85), rgba(255,59,48,.35));
}
.btn:active{transform: translateY(1px)}

.slider{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
input[type=range]{width:140px}

canvas{
  width:100%;
  height:70px;
  display:block;
  border-radius:14px;
  background: rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.10);
}

/* lists */
.list{display:flex; flex-direction:column; gap:10px}
.item{
  display:flex; gap:12px; align-items:center;
  padding:10px;
  border-radius:14px;
  background: rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.10);
}
.item img{width:46px;height:46px;border-radius:12px;object-fit:cover}
.item .meta{min-width:0}
.item .meta .t{font-weight:900; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item .meta .s{opacity:.8; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.item .r{margin-left:auto; opacity:.75; font-size:12px}

/* sponsor banner */
.bottom-banner{
  position:fixed;
  left:0; right:0; bottom:0;
  display:flex;
  justify-content:center;
  padding:10px;
  background: rgba(11,11,15,.82);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.10);
  z-index:50;
}
.banner-box{
  max-width:980px;
  width:100%;
  display:flex;
  justify-content:center;
}
.banner-box a{display:inline-flex}
.banner-box img{height:50px; border-radius:12px; border:1px solid rgba(255,255,255,.12)}

/* modal popup */
.modal{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  z-index:60;
  padding:18px;
}
.modal.open{display:grid}
.modal-card{
  width:min(520px, 100%);
  background: rgba(20,20,28,.92);
  border:1px solid rgba(255,255,255,.12);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal-card img{width:100%; display:block}
.modal-actions{
  display:flex;
  gap:10px;
  padding:12px;
}
.modal-actions .btn{flex:1; justify-content:center}

.hidden{display:none !important}

.footer-note{opacity:.6; font-size:12px; padding:10px 2px}

/* ===== Fix affichage PC (layout + vinyle) ===== */
@media (min-width: 980px) {

  /* Centrer + limiter la largeur globale */
  .wrap{
    max-width: 1200px;
    margin: 0 auto;
  }

  /* La "card" devient une grille: gauche (vinyl) / droite (tabs+panels) */
  .card.player{
    display: grid;
    grid-template-columns: 540px 1fr;
    grid-template-areas:
      "vinyl  tabs"
      "vinyl  panels"
      "controls controls";
    gap: 16px;
    align-items: start;
  }

  .vinylWrap{ grid-area: vinyl; }
  .controls{ grid-area: controls; }
  .tabs{ grid-area: tabs; }
  .panels{ grid-area: panels; }

  /* Empêche le bloc vinyle de devenir géant */
  .vinylWrap{
    position: relative;
    max-width: 540px;
  }

  /* Limite taille du disque */
  .vinyl{
    width: 540px;
    height: 540px;
    max-width: 540px;
    max-height: 540px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
  }

  /* Le canvas ne doit pas forcer une largeur/hauteur énorme */
  #viz{
    width: 100%;
    height: 120px;
    display: block;
  }

  /* Les panels à droite restent lisibles */
  .panels{
    min-width: 0;
  }
}
