/* ============================================================
   RADIO ASSOMPTION — lecteur, page /radio et installation
   Préfixe .rdo- : aucun conflit avec Bootstrap ni main.css
   ============================================================ */

:root {
  --rdo-night:   #2e1a47;   /* nuit d'Assomption (fond)          */
  --rdo-deep:    #1f1131;
  --rdo-violet:  #6f3fa0;   /* violet du collège                 */
  --rdo-lilac:   #cbb3ea;   /* texte secondaire sur fond sombre  */
  --rdo-gold:    #f0b429;   /* or du blason (lecture, installer) */
  --rdo-gold-hi: #ffc94d;
  --rdo-paper:   #f4eefb;   /* fond clair des cartes             */
  --rdo-ink:     #241536;   /* texte sur fond clair              */
  --rdo-live:    #ff5a5f;   /* voyant « en direct »              */
  --rdo-serif:   'Merriweather', Georgia, 'Times New Roman', serif;
  --rdo-sans:    'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.rdo-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.rdo-svg { width: 1.15em; height: 1.15em; flex: none; }
[hidden] { display: none !important; }

/* ── Boutons ────────────────────────────────────────────────── */
.rdo-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .62rem 1.15rem; min-height: 44px;
  border: 1.5px solid transparent; border-radius: 999px;
  font: 600 .95rem/1.2 var(--rdo-sans);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.rdo-btn:active { transform: translateY(1px); }
.rdo-btn:focus-visible,
.rdo-play:focus-visible,
.rdo-prompt__close:focus-visible,
.rdo-help__close:focus-visible,
.rdo-top__brand:focus-visible { outline: 3px solid var(--rdo-gold); outline-offset: 3px; }
.rdo-btn--gold   { background: var(--rdo-gold); color: var(--rdo-night); }
.rdo-btn--gold:hover { background: var(--rdo-gold-hi); color: var(--rdo-night); }
.rdo-btn--ghost  { background: transparent; border-color: rgba(255,255,255,.38); color: #fff; }
.rdo-btn--ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); color: #fff; }
.rdo-btn--violet { background: var(--rdo-violet); color: #fff; }
.rdo-btn--violet:hover { background: #5d3389; color: #fff; }
.rdo-btn--text   { background: transparent; color: var(--rdo-violet); padding-inline: .8rem; }
.rdo-btn--text:hover { background: var(--rdo-paper); color: var(--rdo-violet); }
.rdo-btn--sm { min-height: 38px; padding: .45rem .9rem; font-size: .875rem; }

/* ── Bouton lecture / pause (signature : ondes dorées) ─────── */
.rdo-play {
  --size: 76px;
  position: relative; flex: none;
  width: var(--size); height: var(--size);
  display: grid; place-items: center;
  border: 0; border-radius: 50%; padding: 0;
  background: var(--rdo-gold); color: var(--rdo-night);
  cursor: pointer;
  box-shadow: 0 0 0 6px rgba(240,180,41,.16), 0 10px 26px rgba(0,0,0,.28);
  transition: transform .15s, background-color .15s;
}
.rdo-play:hover { background: var(--rdo-gold-hi); }
.rdo-play:active { transform: scale(.96); }
.rdo-play__icon { width: 44%; height: 44%; grid-area: 1 / 1; }
.rdo-play__icon--play { margin-left: 6%; }
.rdo-play__icon--pause,
.rdo-play.is-playing .rdo-play__icon--play,
.rdo-play.is-loading .rdo-play__icon--play,
.rdo-play.is-loading .rdo-play__icon--pause { display: none; }
.rdo-play.is-playing .rdo-play__icon--pause { display: block; }

.rdo-play__spinner {
  grid-area: 1 / 1; display: none;
  width: 38%; height: 38%;
  border: 3px solid rgba(46,26,71,.25); border-top-color: var(--rdo-night);
  border-radius: 50%;
  animation: rdo-spin .8s linear infinite;
}
.rdo-play.is-loading .rdo-play__spinner { display: block; }

.rdo-play__rings { position: absolute; inset: 0; pointer-events: none; }
.rdo-play__rings i {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--rdo-gold); opacity: 0;
}
.rdo-play.is-playing .rdo-play__rings i { animation: rdo-ring 2.7s cubic-bezier(.15,.55,.35,1) infinite; }
.rdo-play.is-playing .rdo-play__rings i:nth-child(2) { animation-delay: .9s; }
.rdo-play.is-playing .rdo-play__rings i:nth-child(3) { animation-delay: 1.8s; }

@keyframes rdo-ring {
  0%   { transform: scale(1);   opacity: .6; }
  100% { transform: scale(1.9); opacity: 0; }
}
@keyframes rdo-spin { to { transform: rotate(360deg); } }
@keyframes rdo-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,90,95,.55); }
  60%      { box-shadow: 0 0 0 7px rgba(255,90,95,0); }
}

/* ── Voyant « En direct » ─────────────────────────────────── */
.rdo-live {
  display: inline-flex; align-items: center; gap: .5rem;
  margin: 0; font: 600 .875rem/1.4 var(--rdo-sans); color: var(--rdo-lilac);
}
.rdo-live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rdo-live); flex: none; }
.is-playing .rdo-live__dot { animation: rdo-blink 1.6s ease-out infinite; }

/* ── Volume ───────────────────────────────────────────────── */
.rdo-volume { display: inline-flex; align-items: center; gap: .55rem; margin: 0; color: rgba(255,255,255,.8); cursor: pointer; }
.rdo-volume input { width: 110px; accent-color: var(--rdo-gold); cursor: pointer; }
.rdo-no-volume .rdo-volume { display: none; }

/* ============================================================
   1. BANDEAU DE L'ACCUEIL
   ============================================================ */
.rdo-band {
  position: relative; overflow: hidden;
  padding: 1.75rem 0;
  color: #fff;
  background-color: var(--rdo-night);
  /* ondes décoratives à droite */
  background-image:
    radial-gradient(circle at 100% 50%, transparent 0 118px, rgba(240,180,41,.09) 119px 121px, transparent 122px 178px, rgba(240,180,41,.07) 179px 181px, transparent 182px 238px, rgba(240,180,41,.05) 239px 241px, transparent 242px),
    linear-gradient(100deg, var(--rdo-night) 0%, #3b2160 100%);
  font-family: var(--rdo-sans);
}
.rdo-band__inner { position: relative; display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.rdo-band__meta { flex: 1 1 260px; min-width: 0; }
.rdo-band__title {
  margin: .1rem 0 0; color: #fff;
  font: 900 clamp(1.3rem, 2.3vw, 1.7rem)/1.2 var(--rdo-serif);
}
.rdo-band__track {
  margin: .25rem 0 0; color: rgba(255,255,255,.8); font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rdo-band__tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

@media (max-width: 767.98px) {
  .rdo-band { padding: 1.4rem 0 1.5rem; }
  .rdo-band .rdo-play { --size: 64px; }
  .rdo-band__meta { flex-basis: 0; }
  .rdo-band__tools { width: 100%; }
  .rdo-band__tools .rdo-btn { flex: 1 1 0; padding-inline: .8rem; }
  .rdo-band .rdo-volume { display: none; }
}

/* Variante « barre » : tout en haut de l'accueil, visible dès l'arrivée */
.rdo-band--bar { padding: .7rem 0; }
.rdo-band--bar .rdo-band__inner { gap: 1rem; flex-wrap: nowrap; }
.rdo-band--bar .rdo-play { --size: 54px; box-shadow: 0 0 0 4px rgba(240,180,41,.16), 0 6px 16px rgba(0,0,0,.25); }
.rdo-band--bar .rdo-play.is-playing .rdo-play__rings i { animation-name: rdo-ring-sm; }
.rdo-band--bar .rdo-band__meta {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "title title" "live track";
  column-gap: .8rem; align-items: baseline;
}
.rdo-band--bar .rdo-band__title { grid-area: title; margin: 0; font-size: 1.15rem; }
.rdo-band--bar .rdo-live { grid-area: live; font-size: .82rem; }
.rdo-band--bar .rdo-band__track { grid-area: track; margin: 0; font-size: .88rem; }
.rdo-band--bar .rdo-band__tools { flex-wrap: nowrap; }
.rdo-band--bar .rdo-btn { min-height: 40px; padding: .45rem 1rem; font-size: .9rem; }
@keyframes rdo-ring-sm {
  0%   { transform: scale(1);    opacity: .6; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (max-width: 991.98px) {
  .rdo-band--bar .rdo-band__open span { display: none; }
  .rdo-band--bar .rdo-band__open { padding-inline: .7rem; }
}
@media (max-width: 767.98px) {
  .rdo-band--bar { padding: .6rem 0; }
  .rdo-band--bar .rdo-band__inner { gap: .75rem; }
  .rdo-band--bar .rdo-play { --size: 48px; }
  .rdo-band--bar .rdo-band__meta { flex: 1 1 auto; }
  .rdo-band--bar .rdo-band__title { font-size: 1.02rem; }
  .rdo-band--bar .rdo-band__tools { width: auto; gap: .4rem; }
  .rdo-band--bar .rdo-band__tools .rdo-btn { flex: none; min-height: 42px; width: 42px; padding: 0; }
  .rdo-band--bar .rdo-band__tools .rdo-btn span { display: none; }
  .rdo-band--bar .rdo-band__open { display: none; }       /* le titre suffit : lien vers /radio */
}

/* ============================================================
   2. PAGE /radio (application installée)
   ============================================================ */
.rdo-app {
  margin: 0; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  color: #fff; font-family: var(--rdo-sans); line-height: 1.55;
  background:
    radial-gradient(120% 70% at 50% 0%, #4a2a72 0%, rgba(74,42,114,0) 60%),
    linear-gradient(180deg, var(--rdo-night) 0%, var(--rdo-deep) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.rdo-app *, .rdo-app *::before, .rdo-app *::after { box-sizing: border-box; }

.rdo-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) .75rem max(1.25rem, env(safe-area-inset-left));
}
.rdo-top__brand {
  display: inline-flex; align-items: center; gap: .7rem; min-width: 0;
  color: var(--rdo-lilac); text-decoration: none; font-size: .9rem; font-weight: 600; border-radius: 8px;
}
.rdo-top__brand img { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
.rdo-top__brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rdo-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem 1.5rem max(2rem, env(safe-area-inset-bottom));
}

.rdo-disc { position: relative; display: grid; place-items: center; width: 260px; height: 260px; }
.rdo-disc__halo {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 96px, rgba(240,180,41,.14) 97px 98px, transparent 99px 114px, rgba(240,180,41,.09) 115px 116px, transparent 117px);
}
.rdo-play--xl { --size: 150px; box-shadow: 0 0 0 10px rgba(240,180,41,.14), 0 18px 44px rgba(0,0,0,.4); }
.rdo-play--xl .rdo-play__spinner { border-width: 4px; }

.rdo-name {
  margin: 1.6rem 0 .45rem; color: #fff;
  font: 900 clamp(2rem, 7vw, 2.9rem)/1.1 var(--rdo-serif);
  letter-spacing: -.01em;
}
.rdo-app .rdo-live { font-size: .95rem; }

.rdo-now {
  margin-top: 1.5rem; width: 100%; max-width: 420px;
  display: flex; align-items: center; gap: .9rem; text-align: left;
  padding: .7rem 1rem .7rem .7rem;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
}
.rdo-now__art { width: 60px; height: 60px; border-radius: 11px; object-fit: cover; flex: none; background: var(--rdo-violet); }
.rdo-now__text { min-width: 0; }
.rdo-now__text p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdo-now__label  { font-size: .8rem; color: var(--rdo-lilac); }
.rdo-now__title  { font-weight: 700; font-size: 1.02rem; }
.rdo-now__artist { font-size: .9rem; color: rgba(255,255,255,.75); }

.rdo-desc { margin: 1.1rem auto 0; max-width: 36ch; color: rgba(255,255,255,.78); font-size: 1rem; }

.rdo-volume--wide { margin-top: 1.6rem; }
.rdo-volume--wide input { width: 180px; }

.rdo-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1.75rem; }
.rdo-foot { margin: 1.5rem 0 0; display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; color: var(--rdo-lilac); }

.rdo-off { display: flex; flex-direction: column; align-items: center; }
.rdo-off__icon {
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: var(--rdo-gold); font-size: 44px;
}
.rdo-off__title { margin: 0; font-weight: 700; font-size: 1.1rem; }

/* En application installée : on masque ce qui ne sert qu'au navigateur */
.rdo-standalone .rdo-install-only { display: none !important; }

@media (max-height: 640px) {
  .rdo-disc { width: 210px; height: 210px; }
  .rdo-play--xl { --size: 124px; }
  .rdo-name { margin-top: 1rem; }
}
@media (hover: none) and (pointer: coarse) {
  .rdo-volume--wide { display: none; }   /* téléphones : touches de volume */
}

/* ============================================================
   3. INVITATION À INSTALLER + AIDE + MESSAGE
   ============================================================ */
.rdo-prompt {
  position: fixed; z-index: 1085;
  left: 1.25rem; bottom: 1.25rem;
  width: min(400px, calc(100vw - 2.5rem));
  display: flex; gap: .9rem; align-items: flex-start;
  padding: 1.1rem 2.9rem 1rem 1.1rem;
  background: #fff; color: var(--rdo-ink);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(46,26,71,.32), 0 2px 8px rgba(46,26,71,.14);
  font-family: var(--rdo-sans);
  animation: rdo-rise .32s cubic-bezier(.2,.7,.3,1) both;
}
.rdo-prompt__icon { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.rdo-prompt__body { min-width: 0; }
.rdo-prompt__title { margin: 0; font-weight: 700; font-size: 1.05rem; line-height: 1.3; color: var(--rdo-ink); }
.rdo-prompt__text  { margin: .3rem 0 .85rem; font-size: .9rem; line-height: 1.5; color: #54456a; }
.rdo-prompt__actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.rdo-prompt__close,
.rdo-help__close {
  position: absolute; top: .45rem; right: .45rem;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: #7a6b8f; cursor: pointer;
}
.rdo-prompt__close:hover, .rdo-help__close:hover { background: var(--rdo-paper); color: var(--rdo-ink); }

@keyframes rdo-rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 575.98px) {
  .rdo-prompt {
    left: 0; right: 0; bottom: 0; width: auto;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .rdo-prompt__actions .rdo-btn--violet { flex: 1 1 auto; }
}

/* Fenêtre d'aide (étapes d'installation) */
.rdo-help {
  width: min(440px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 1.75rem 1.5rem 1.4rem; border: 0; border-radius: 22px;
  background: #fff; color: var(--rdo-ink); font-family: var(--rdo-sans);
  box-shadow: 0 30px 80px rgba(20,8,36,.45);
}
.rdo-help:not([open]) { display: none; }
.rdo-help[open] { position: fixed; inset: 0; margin: auto; z-index: 1090; }
.rdo-help::backdrop { background: rgba(24,12,40,.6); }
.rdo-help__icon { width: 64px; height: 64px; border-radius: 16px; display: block; }
.rdo-help__title { margin: 1rem 0 .25rem; font: 900 1.3rem/1.3 var(--rdo-serif); color: var(--rdo-ink); }

.rdo-steps { list-style: none; counter-reset: rdo-step; margin: .9rem 0 1.25rem; padding: 0; }
.rdo-steps li {
  counter-increment: rdo-step;
  display: grid; grid-template-columns: 2rem 1fr; gap: .8rem; align-items: start;
  padding: .55rem 0; font-size: .95rem; line-height: 1.5;
}
.rdo-steps li + li { border-top: 1px solid #efe8f7; }
.rdo-steps li::before {
  content: counter(rdo-step);
  width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--rdo-paper); color: var(--rdo-violet); font-weight: 700;
}
.rdo-steps .rdo-svg { vertical-align: -.2em; margin-inline: .15em; color: #2f7df6; }
.rdo-help__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.rdo-help__actions .rdo-btn--violet { flex: 1 1 auto; }

/* Message bref (installé, lien copié…) */
.rdo-toast {
  position: fixed; z-index: 1095; left: 50%; bottom: 1.5rem; transform: translateX(-50%);
  max-width: calc(100vw - 2rem);
  padding: .7rem 1.1rem; border-radius: 999px;
  background: var(--rdo-ink); color: #fff; font: 600 .9rem/1.4 var(--rdo-sans);
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

/* Bouton « Écouter la radio » du hero de l'accueil */
.rdo-hero-btn .rdo-svg { width: 1.1em; height: 1.1em; }
.rdo-hero-btn.is-playing { background: var(--rdo-gold); border-color: var(--rdo-gold); color: var(--rdo-night); }

/* ── Mouvement réduit ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .rdo-play.is-playing .rdo-play__rings i,
  .rdo-band--bar .rdo-play.is-playing .rdo-play__rings i,
  .is-playing .rdo-live__dot,
  .rdo-prompt { animation: none; }
  .rdo-play.is-playing .rdo-play__rings i:first-child { opacity: .35; transform: scale(1.25); }
  .rdo-play__spinner { animation-duration: 2s; }
}

/* Titre de la barre : lien discret vers le lecteur plein écran */
.rdo-band__title a { color: inherit; text-decoration: none; }
.rdo-band__title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.rdo-band__title a:focus-visible { outline: 3px solid var(--rdo-gold); outline-offset: 2px; border-radius: 4px; }
