:root {
  --dip-primary: #381f57;
  --dip-accent: #9fb62e;
  --dip-dark: #2f2547;
  --dip-text: #6a6480;
  --dip-light: #f6f5fb;
}

.dip-player,
.dip-player * {
  box-sizing: border-box;
}

.dip-player {
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-family: inherit;
  color: var(--dip-dark);
}

.dip-logo {
  text-align: center;
  margin-bottom: 16px;
}

.dip-logo img {
  max-height: 92px;
  width: auto;
  display: inline-block;
}

.dip-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 13px 18px;
  border-radius: 12px;
  background: var(--dip-light);
  border: 1px solid rgba(56, 31, 87, 0.06);
  box-shadow: 0 8px 24px rgba(56, 31, 87, 0.055);
}

/* Bouton play v1.3.3 : rond simple, aucun carré au hover */
.dip-player .dip-play {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 50% !important;
  background: var(--dip-primary) !important;
  background-image: none !important;
  color: #fff !important;
  display: inline-grid !important;
  place-items: center !important;
  cursor: pointer !important;
  flex: 0 0 42px !important;
  box-shadow: 0 8px 18px rgba(56, 31, 87, 0.20) !important;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease !important;
  overflow: hidden !important;
}

.dip-player .dip-play::before,
.dip-player .dip-play::after,
.dip-player .dip-play:hover::before,
.dip-player .dip-play:hover::after {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  animation: none !important;
}

.dip-player .dip-play:hover {
  transform: scale(1.055) !important;
  filter: brightness(1.045) saturate(1.03) !important;
  box-shadow: 0 9px 20px rgba(56, 31, 87, 0.23) !important;
}

.dip-player .dip-play:active {
  transform: scale(.98) !important;
  box-shadow: 0 6px 14px rgba(56, 31, 87, 0.18) !important;
}

.dip-player .dip-button-icon {
  width: 29px !important;
  height: 29px !important;
  display: block !important;
  fill: #fff !important;
  pointer-events: none !important;
  transform: none !important;
}

.dip-player.is-playing .dip-button-icon {
  transform: none !important;
}

.dip-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dip-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  min-width: 0;
}

.dip-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 8px;
  border-radius: 999px;
  background: rgba(56, 31, 87, 0.10);
  overflow: hidden;
  flex: 0 0 auto;
}

.dip-live-bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  width: 16px;
  height: 14px;
  position: relative;
  z-index: 1;
}

.dip-live-bars span {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 999px;
  background: var(--dip-accent);
  animation: dip-bars .82s ease-in-out infinite;
}

.dip-live-bars span:nth-child(2) {
  height: 12px;
  animation-delay: .13s;
}

.dip-live-bars span:nth-child(3) {
  height: 8px;
  animation-delay: .26s;
}

@keyframes dip-bars {
  0%, 100% { transform: scaleY(.58); opacity: .7; }
  50% { transform: scaleY(1); opacity: 1; }
}

.dip-live-text {
  position: relative;
  color: var(--dip-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
  z-index: 1;
}

.dip-listeners {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dip-text);
  font-size: 12px;
  white-space: nowrap;
  opacity: .92;
}

.dip-listeners-icon {
  width: 13px;
  height: 13px;
  display: none;
  fill: currentColor;
  opacity: .9;
  flex: 0 0 auto;
}

.dip-listeners-number {
  color: var(--dip-dark);
  font-weight: 800;
}

.dip-listeners-label {
  font-weight: 500;
}

.dip-title-wrap {
  position: relative;
  width: 100%;
  height: 24px;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0, black 44px, black calc(100% - 44px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 44px, black calc(100% - 44px), transparent 100%);
}

.dip-title-inner {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  min-width: max-content;
  white-space: nowrap;
  color: var(--dip-text);
  font-size: 14px;
  line-height: 24px;
  will-change: transform;
  transform: translate3d(100%, 0, 0);
}

.dip-title-wrap:hover .dip-title-inner {
  /* la pause est gérée en JS */
}

.dip-title-text {
  display: inline-block;
}

.dip-volume {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.dip-mute {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--dip-text);
  opacity: .95;
}

.dip-mute:hover {
  color: var(--dip-primary);
}

.dip-volume-icon {
  width: 26px;
  height: 26px;
  display: block;
  fill: currentColor;
}

.dip-volume-wave {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dip-player.is-muted .dip-volume-wave {
  display: none;
}

.dip-range {
  appearance: none;
  -webkit-appearance: none;
  width: 126px;
  height: 20px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

/* Track WebKit */
.dip-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(to right, var(--dip-primary) 0, var(--dip-primary) var(--dip-volume-level, 100%), #d8dbe2 var(--dip-volume-level, 100%), #d8dbe2 100%);
  border: 1px solid rgba(102,112,139,.18);
}

/* Point rouge parfaitement centré verticalement */
.dip-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dip-accent);
  border: 0;
  margin-top: -7px;
  box-shadow: 0 2px 6px rgba(159,182,46,.26);
}

/* Track Firefox */
.dip-range::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #d8dbe2;
  border: 1px solid rgba(102,112,139,.18);
}

.dip-range::-moz-range-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--dip-primary);
}

.dip-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--dip-accent);
  border: 0;
  box-shadow: 0 2px 6px rgba(159,182,46,.26);
}

@media (max-width: 760px) {
  .dip-card {
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
  }

  .dip-player .dip-play {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    flex-basis: 40px !important;
  }

  .dip-title-inner {
    font-size: 13px;
  }

  .dip-range {
    width: 86px;
  }
}

@media (max-width: 520px) {
  .dip-card {
    gap: 10px;
    min-height: 66px;
  }

  .dip-listeners-icon {
    display: block;
  }

  .dip-listeners-label {
    display: none;
  }

  .dip-volume {
    gap: 4px;
  }

  .dip-range {
    display: none;
  }
}


/* v1.3.4 : le bouton n'utilise plus deux icônes superposées */
.dip-player .dip-svg-play,
.dip-player .dip-svg-pause,
.dip-player .dip-play-shape,
.dip-player .dip-pause-shape {
  display: none !important;
}


/* v1.3.9 : corrections volume */
.dip-player .dip-mute,
.dip-player .dip-mute:hover,
.dip-player .dip-mute:focus,
.dip-player .dip-mute:active {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.dip-player .dip-mute:focus-visible {
  outline: 2px solid rgba(56, 31, 87, .35) !important;
  outline-offset: 3px !important;
  border-radius: 999px !important;
}

.dip-player .dip-volume-icon {
  width: 27px !important;
  height: 27px !important;
}

.dip-player .dip-range {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 126px !important;
  height: 22px !important;
  padding: 0 !important;
  border: 0 !important;
  outline: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Chrome / Edge / Safari */
.dip-player .dip-range::-webkit-slider-runnable-track {
  height: 6px !important;
  border-radius: 999px !important;
  background:
    linear-gradient(to right, var(--dip-primary) 0, var(--dip-primary) var(--dip-volume-level, 100%), #d8dbe2 var(--dip-volume-level, 100%), #d8dbe2 100%) !important;
  border: 1px solid rgba(102,112,139,.20) !important;
  box-shadow: none !important;
}

.dip-player .dip-range::-webkit-slider-thumb {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: var(--dip-accent) !important;
  border: 0 !important;
  box-shadow: 0 2px 6px rgba(159,182,46,.26) !important;
  margin-top: -8px !important; /* (20 - 6) / 2 + track border compensation */
}

/* Firefox */
.dip-player .dip-range::-moz-range-track {
  height: 6px !important;
  border-radius: 999px !important;
  background: #d8dbe2 !important;
  border: 1px solid rgba(102,112,139,.20) !important;
  box-shadow: none !important;
}

.dip-player .dip-range::-moz-range-progress {
  height: 6px !important;
  border-radius: 999px !important;
  background: var(--dip-primary) !important;
}

.dip-player .dip-range::-moz-range-thumb {
  width: 20px !important;
  height: 20px !important;
  border-radius: 50% !important;
  background: var(--dip-accent) !important;
  border: 0 !important;
  box-shadow: 0 2px 6px rgba(159,182,46,.26) !important;
}


/* v1.4.0 : le défilement est géré en JavaScript, pas en keyframes CSS */
.dip-player .dip-title-inner,
.dip-player .dip-title-inner.is-animated {
  animation: none !important;
}


/* v1.4.4 : pas de titre par défaut avant le retour Icecast */
.dip-title-wrap.is-loading .dip-title-inner {
  opacity: 0;
}


/* v1.4.5 : masquer le bouton/contrôle volume sur mobile uniquement */
@media (max-width: 520px) {
  .dip-player .dip-volume {
    display: none !important;
  }
}


/* Historique des titres */
.dip-history-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--dip-text);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .14s ease, color .14s ease, opacity .14s ease;
  opacity: .9;
}

.dip-history-toggle:hover,
.dip-history-toggle[aria-expanded="true"] {
  color: var(--dip-primary);
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1;
}

.dip-history-toggle:hover {
  transform: scale(1.06);
}

.dip-history-toggle svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex: 0 0 auto;
}

.dip-history-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(420px, 100%);
  max-height: 320px;
  overflow: auto;
  z-index: calc(var(--dip-sticky-zindex, 9999) + 1);
  background: #fff;
  border: 1px solid rgba(56, 31, 87, .08);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(56, 31, 87, .13);
  padding: 0 12px 12px;
}

.dip-main {
  position: relative;
}

.dip-history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 8px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(102,112,139,.12);
}

.dip-history-head strong {
  color: var(--dip-dark);
  font-size: 13px;
}

.dip-history-head span {
  color: var(--dip-text);
  font-size: 11px;
}

.dip-history-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dip-history-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 -12px 6px;
  padding: 6px 12px 8px;
  background: #fff;
  border-bottom: 1px solid rgba(102,112,139,.12);
  box-shadow: 0 6px 10px -8px rgba(56, 31, 87, .25);
}

.dip-history-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 0 !important;
  background: transparent !important;
  color: var(--dip-text);
  box-shadow: none !important;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 7px;
  border-radius: 999px;
  opacity: .78;
  transition: transform .14s ease, color .14s ease, opacity .14s ease;
}

.dip-history-tab:hover,
.dip-history-tab.is-active {
  color: var(--dip-primary);
  opacity: 1;
  transform: scale(1.04);
}

.dip-history-day[hidden] {
  display: none;
}

.dip-history-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 4px;
  border-radius: 8px;
}

.dip-history-item:hover {
  background: rgba(102, 112, 139, .06);
}

.dip-history-time {
  color: var(--dip-primary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.dip-history-title {
  color: var(--dip-text);
  font-size: 12px;
  line-height: 1.25;
}

.dip-history-empty {
  color: var(--dip-text);
  font-size: 12px;
  padding: 8px 4px;
}

@media (max-width: 520px) {
  .dip-history-toggle {
    width: 26px;
    height: 25px;
    padding: 0;
    justify-content: center;
  }

  .dip-history-toggle span {
    display: none;
  }

  .dip-history-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 12px;
    width: auto;
    max-height: 52vh;
  }
}


/* v1.4.9 : aucun carré/pastille sur le bouton historique */
.dip-player .dip-history-toggle,
.dip-player .dip-history-toggle:hover,
.dip-player .dip-history-toggle:focus,
.dip-player .dip-history-toggle:active,
.dip-player .dip-history-toggle[aria-expanded="true"] {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}


/* v1.5.0 : centrage du texte dans le badge EN DIRECT */
.dip-player .dip-live {
  height: 30px !important;
  min-height: 30px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.dip-player .dip-live-text {
  display: inline-flex !important;
  align-items: center !important;
  height: 100% !important;
  line-height: 1 !important;
  transform: translateY(0) !important;
}

.dip-player .dip-live-bars {
  align-self: center !important;
  display: inline-flex !important;
  align-items: center !important;
  height: 16px !important;
}


/* ============================================================
   v1.6.0 : barre fixe en bas de chaque page (sticky footer)
   v1.6.3 : alignement durci contre les CSS de thème (!important)
   ============================================================ */
.dip-player.dip-player--sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  margin: 0;
  z-index: var(--dip-sticky-zindex, 99990);
  background: var(--dip-light);
  border: 0;
  box-shadow: 0 -8px 24px rgba(56, 31, 87, 0.10);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
}

/* Bandeau vert de séparation, en pseudo-élément : ininterceptable par le thème */
.dip-player.dip-player--sticky::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--dip-accent);
  z-index: 2;
  pointer-events: none;
}

/* La carte : une seule ligne, tout centré verticalement, forcé */
.dip-player.dip-player--sticky .dip-card {
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 4px !important;
  min-height: 56px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  position: relative !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 16px !important;
}

/* On garde .dip-main comme vraie boîte flex (pas de display:contents,
   trop fragile avec certains thèmes) mais en ligne horizontale. */
.dip-player.dip-player--sticky .dip-main {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 14px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  position: relative !important;
}

.dip-player.dip-player--sticky .dip-topline {
  flex: 0 0 auto !important;
  align-items: center !important;
}

.dip-player.dip-player--sticky .dip-title-wrap {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
}

/* Neutralise les marges verticales que les thèmes ajoutent souvent
   aux boutons, span et svg, ce qui décalait l'alignement. */
.dip-player.dip-player--sticky .dip-play,
.dip-player.dip-player--sticky .dip-main,
.dip-player.dip-player--sticky .dip-topline,
.dip-player.dip-player--sticky .dip-title-wrap,
.dip-player.dip-player--sticky .dip-volume,
.dip-player.dip-player--sticky .dip-live,
.dip-player.dip-player--sticky .dip-listeners,
.dip-player.dip-player--sticky .dip-history-toggle {
  align-self: center !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  float: none !important;
  vertical-align: middle !important;
}

.dip-player.dip-player--sticky .dip-play {
  flex: 0 0 42px !important;
}

.dip-player.dip-player--sticky .dip-volume {
  flex: 0 0 auto !important;
}

/* Alignement du volume : neutralise les marges que le thème ajoute au
   bouton mute et à l'input range (valable barre fixe ET shortcode). */
.dip-player .dip-volume {
  align-items: center !important;
}

.dip-player .dip-mute,
.dip-player .dip-range {
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  vertical-align: middle !important;
  align-self: center !important;
}

.dip-player.dip-player--sticky .dip-audio {
  display: none !important;
}

.dip-player.dip-player--sticky .dip-logo {
  display: none !important;
}

/* L'historique s'ouvre vers le haut au-dessus de la barre */
.dip-player.dip-player--sticky .dip-history-panel {
  top: auto !important;
  bottom: calc(100% + 12px) !important;
}

@media (max-width: 760px) {
  .dip-player.dip-player--sticky {
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom, 0px));
  }
  .dip-player.dip-player--sticky .dip-card {
    padding: 2px !important;
    gap: 12px !important;
  }
  .dip-player.dip-player--sticky .dip-main {
    gap: 10px !important;
  }
}

/* Sur mobile, le panneau historique reste ancré au-dessus de la barre */
@media (max-width: 520px) {
  .dip-player.dip-player--sticky .dip-history-panel {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(var(--dip-sticky-h, 74px) + 10px) !important;
    width: auto !important;
    max-height: 50vh !important;
  }
}


/* ============================================================
   v1.6.4 : fond translucide (glassmorphism), activable en réglages
   ============================================================ */
.dip-player.dip-player--glass {
  background: var(--dip-light); /* repli si rgba(var()) non supporté */
  background: rgba(var(--dip-light-rgb, 246, 245, 251), var(--dip-glass-alpha, 0.72)) !important;
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
}

/* Sur la barre fixe, on adoucit l'ombre pour un rendu plus "verre" */
.dip-player.dip-player--sticky.dip-player--glass {
  box-shadow: 0 -6px 20px rgba(56, 31, 87, 0.08) !important;
}
