/* Radio en ligne — ServicesHub.ca : page unique sombre, palette du hub */
:root {
  --nuit: #070d24; --nuit-2: #0d1838; --nuit-3: #14225a; --bleu: #2f6bff; --ciel: #38bdf8; --lis: #f6c744;
  --menthe: #34d399; --rouge: #f87171; --texte: #dbe4ff; --doux: #93a3d1; --ligne: rgba(255,255,255,.12); --verre: rgba(255,255,255,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--nuit); color: var(--texte); font: 14px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
body { display: flex; flex-direction: column; overflow: hidden; }
a { color: var(--ciel); }
button, input, select { font: inherit; color: inherit; }
button, .bouton { background: var(--verre); border: 1px solid var(--ligne); border-radius: 8px; padding: 7px 12px; cursor: pointer; white-space: nowrap; text-decoration: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .bouton:hover { border-color: var(--ciel); }
button:disabled { opacity: .5; cursor: default; }
button.principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
button.rond { width: 54px; height: 54px; border-radius: 50%; font-size: 22px; padding: 0; }
button.danger { color: #ffb4b4; }
button.icone { padding: 6px 10px; }
input[type=search] { width: 100%; background: rgba(0,0,0,.35); border: 1px solid var(--ligne); border-radius: 8px; padding: 8px 10px; color: #fff; }
input:focus { outline: none; border-color: var(--ciel); }
input::placeholder { color: #5f6f9d; }
select { background: var(--nuit-2); border: 1px solid var(--ligne); border-radius: 8px; padding: 6px 8px; color: var(--texte); }
kbd { background: var(--nuit-3); border: 1px solid var(--ligne); border-radius: 4px; padding: 0 5px; font-size: 11px; }
code { background: rgba(0,0,0,.35); border-radius: 4px; padding: 1px 4px; font-size: 12px; }
[hidden] { display: none !important; }
.indice { color: var(--doux); font-size: 12px; margin: 0; }
.ligne { display: flex; gap: 6px; flex-wrap: wrap; }
.defilant { overflow-y: auto; min-height: 0; }

#entete { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--nuit-2); border-bottom: 1px solid var(--ligne); }
.marque { font-size: 17px; white-space: nowrap; }
.marque b { color: var(--ciel); }
.recherche { flex: 1; max-width: 480px; margin-left: auto; }

#app { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px 1fr 340px; }
#cote, #stations { background: var(--nuit-2); border-right: 1px solid var(--ligne); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
#sections { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
#sections button { justify-content: flex-start; background: none; border-color: transparent; color: var(--doux); padding: 8px 10px; }
#sections button:hover { background: var(--verre); color: #fff; }
#sections button.actif { background: var(--nuit-3); color: #fff; border-color: var(--ligne); }
#sousPanneau { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; min-height: 0; flex: 1; }
#sousListe { flex: 1; }
.sous { display: flex; justify-content: space-between; gap: 6px; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: var(--doux); white-space: nowrap; }
.sous span:first-child { overflow: hidden; text-overflow: ellipsis; }
.sous:hover { background: var(--verre); color: #fff; }
.sous.actif { background: var(--bleu); color: #fff; }
.sous small { opacity: .7; }
.credit { padding: 8px 12px; border-top: 1px solid var(--ligne); }

.titre { padding: 10px 14px; font-weight: 600; color: #fff; border-bottom: 1px solid var(--ligne); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.titre small { color: var(--doux); font-weight: 400; }
#liste { flex: 1; padding: 6px; }
.st { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; cursor: pointer; }
.st:hover { background: var(--verre); }
.st.actif { background: var(--nuit-3); }
.logo { width: 46px; height: 46px; flex: none; border-radius: 10px; background: #000; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--doux); overflow: hidden; font-size: 13px; position: relative; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.st .nm { flex: 1; min-width: 0; }
.st .nm b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .nm small { display: block; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .meta { color: var(--doux); font-size: 11px; text-align: right; flex: none; }
.st .meta.hs { color: #ffb4b4; }
.fav { background: none; border: none; color: #3f4d7d; font-size: 18px; padding: 4px 6px; }
.fav.actif, .fav:hover { color: var(--lis); }
.compteur { padding: 6px 12px; color: var(--doux); font-size: 12px; border-top: 1px solid var(--ligne); }
.vide { padding: 30px 16px; text-align: center; color: var(--doux); }
.vide .grand { font-size: 36px; }
.plus { margin: 8px; width: calc(100% - 16px); }

#lecteur { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 18px; background: radial-gradient(ellipse at 50% 30%, #14225a 0%, #070d24 70%); min-width: 0; }
.vinyle { width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, #1b2c6e 0 18%, #0a0f2a 19% 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 0 1px var(--ligne); }
.vinyle.tourne { animation: tourne 6s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.logo.grand { width: 120px; height: 120px; border-radius: 50%; font-size: 40px; background-color: #000; }
#courant { text-align: center; min-width: 0; width: 100%; }
#courant b { display: block; font-size: 18px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#courant small { display: block; color: var(--doux); margin-top: 4px; }
#courant small.etat { color: var(--ciel); min-height: 1.2em; }
#courant small.etat.erreur { color: #ffb4b4; white-space: normal; }
#barre { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
#barre button { padding: 8px 10px; }
#volume { width: 110px; padding: 0; accent-color: var(--ciel); }

dialog { background: var(--nuit-2); color: var(--texte); border: 1px solid var(--ligne); border-radius: 14px; padding: 0; width: min(600px, 94vw); }
dialog::backdrop { background: rgba(0,0,0,.65); }
.dh { padding: 14px 18px; border-bottom: 1px solid var(--ligne); font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.fermer { background: none; border: none; font-size: 16px; }
.db { padding: 14px 18px; overflow: auto; max-height: 72vh; }
.db h3 { margin: 12px 0 6px; font-size: 14px; color: var(--ciel); }
.db h3:first-child { margin-top: 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--nuit-3); border: 1px solid var(--ligne); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 90vw; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

@media (max-width: 1100px) { #app { grid-template-columns: 210px 1fr 300px; } }

/* téléphone / tablette : lecteur compact en haut, sections en rubans, liste dessous */
@media (max-width: 860px) {
  body { overflow: auto; height: auto; min-height: 100%; }
  #entete { flex-wrap: wrap; height: auto; padding: 8px 10px; }
  .recherche { max-width: none; width: 100%; order: 3; margin: 0; }
  #app { display: flex; flex-direction: column; }
  #lecteur { order: 1; position: sticky; top: 0; z-index: 10; flex-direction: row; flex-wrap: wrap; gap: 10px 14px; padding: 10px 12px; border-bottom: 1px solid var(--ligne); background: var(--nuit-2); }
  .vinyle { width: 64px; height: 64px; box-shadow: none; }
  .logo.grand { width: 44px; height: 44px; font-size: 20px; }
  #courant { flex: 1; text-align: left; width: auto; }
  #courant b { font-size: 15px; }
  #courant small:not(.etat) { display: none; }
  #barre { width: 100%; justify-content: space-between; gap: 6px; }
  button.rond { width: 44px; height: 44px; font-size: 18px; }
  #volume { width: 70px; }
  #cote { order: 2; border-right: none; }
  #sections { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  #sections button { flex: none; }
  #sousPanneau { max-height: 36vh; }
  .credit { display: none; }
  #stations { order: 3; border-right: none; min-height: 60vh; }
}
