* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", sans-serif;
  width: 100%;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: 0.25rem 0;
  background: #000;
  overflow-x: hidden;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, #2b0064 0%, #0a0018 100%);
}

.bg-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: visible;
  margin: 0.9rem auto 0.75rem;
  max-width: 185px;
}

.bg-logo img {
  width: 88%;
  max-width: 185px;
  opacity: 0.88;
  filter:
    grayscale(0%)
    brightness(1.1)
    contrast(1.02)
    saturate(1.0);
  transform: translateY(0) scale(1);
  image-rendering: auto;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.phone {
  position: relative;
  z-index: 2;
  width: min(360px, calc(100% - 1.5rem));
  max-width: 360px;
  flex-shrink: 0;
  min-height: 650px;
  background: rgba(10, 0, 25, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 36px;
  padding: 1rem 1.5rem 1.25rem;
  margin: 1.25rem auto 0;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.07),
    0 18px 42px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.status-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.9rem;
  padding: 0 0.25rem;
}

.status-time {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.photo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.photo-ring {
  width: 124px;
  height: 124px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #7c3aed, #c084fc, #4c1d95);
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.55);
}

.photo-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.photo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.photo-inner img.is-changing {
  opacity: 0;
}

.station-name {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  max-width: 100%;
  white-space: normal;
}

.station-sub {
  text-align: center;
  font-size: 11px;
  color: rgba(196, 181, 253, 0.65);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.now-playing-wrap {
  background: rgba(109, 40, 217, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.32);
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.np-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.np-text {
  font-size: 14px;
  font-weight: 600;
  color: #e9ddff;
  line-height: 1.35;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word !important;
  overflow-wrap: anywhere;
  text-align: center !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  flex: 1 1 auto;
}

.visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 32px;
  margin-bottom: 1.2rem;
}

.bar {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(to top, #5b0fa8, #c084fc);
  height: 4px;
}

.bar.active {
  animation: bounce var(--d, 0.6s) ease-in-out infinite alternate;
}

@keyframes bounce {
  from { height: 4px; }
  to { height: var(--h, 26px); }
}

.status-msg {
  text-align: center;
  font-size: 11px;
  color: rgba(196, 181, 253, 0.5);
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}

.player-grid {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 40px;
  align-items: center;
  column-gap: 0;
  margin-bottom: 0.75rem;
  width: 100%;
}

.player-col {
  min-width: 0;
}

.player-col--player {
  justify-self: center;
  align-self: center;
  width: 100%;
}

.player-col--speaker {
  justify-self: end;
  align-self: start;
  width: 40px;
}

.player-col--spacer {
  width: 40px;
}

.player-wrapper {
  width: min(280px, 100%);
  max-width: 100%;
  text-align: center;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
}

.player-wrapper a,
.player-shell > a {
  display: none !important;
}

.player-wrapper iframe,
.player-wrapper object,
.player-wrapper embed {
  width: 100% !important;
  max-width: 280px !important;
  height: 50px !important;
  min-height: 50px;
  border: 0;
  display: block !important;
  margin: 0 auto !important;
}

.speaker-btn {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(139, 92, 246, 0.32);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.16);
  color: #efe6ff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  margin: 0;
}

.speaker-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@media (max-width: 360px) {
  .phone {
    padding-inline: 1rem;
  }
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 1rem;
}

.btn-play {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b0fa8, #a855f7);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 28px rgba(139, 92, 246, 0.65);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-play:hover {
  transform: scale(1.07);
  box-shadow: 0 0 42px rgba(168, 85, 247, 0.85);
}

.btn-play:active {
  transform: scale(0.96);
}

.btn-play svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}

.btn-side {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.13);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-side:hover {
  background: rgba(139, 92, 246, 0.28);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 1.1rem;
}

.vol-icon {
  font-size: 13px;
  color: rgba(196, 181, 253, 0.45);
}

.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(139, 92, 246, 0.22);
  outline: none;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a855f7;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.8);
}

.vol-val {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.45);
  min-width: 28px;
  text-align: right;
}

.divider {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 2.3rem;
  border: none;
  border-top: 1px solid rgba(139, 92, 246, 0.22);
  margin: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

.live-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 0;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #333;
  transition: all 0.3s;
}

.live-dot.on {
  background: #a855f7;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.9);
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-text {
  font-size: 11px;
  color: #555;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s;
}

.live-text.on {
  color: #c4b5fd;
}

.listeners {
  font-size: 14px;
  font-weight: 600;
  color: rgba(196, 181, 253, 0.4);
}

#vc-title,
#vc-listeners,
#vc-content,
#vc-current-song,
#vc-nowplaying,
#vc-currentlisteners,
#vc-current-listeners {
  display: none;
}

/* ─── Bannière d'installation PWA ─── */
.pwa-banner {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 999;
  width: min(360px, calc(100% - 2rem));
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(22, 4, 50, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 20px;
  padding: 0.85rem 1rem;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.12),
    0 12px 36px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  pointer-events: none;
}

.pwa-banner[hidden] {
  display: none !important;
}

.pwa-banner.pwa-banner--visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.pwa-banner__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.pwa-banner__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pwa-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pwa-banner__text strong {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner__text span {
  font-size: 11px;
  color: rgba(196, 181, 253, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.pwa-banner__btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.pwa-banner__btn--install {
  background: linear-gradient(135deg, #5b0fa8, #a855f7);
  color: #fff;
  font-size: 12px;
  padding: 0.45rem 0.9rem;
  border-radius: 10px;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.55);
}

.pwa-banner__btn--install:hover {
  transform: scale(1.05);
  box-shadow: 0 0 22px rgba(168, 85, 247, 0.8);
}

.pwa-banner__btn--install:active {
  transform: scale(0.97);
}

.pwa-banner__btn--dismiss {
  background: rgba(139, 92, 246, 0.12);
  color: rgba(196, 181, 253, 0.7);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.pwa-banner__btn--dismiss:hover {
  background: rgba(139, 92, 246, 0.28);
  color: #fff;
}
