@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   DJ LIVE — tient sur un seul écran, sans scroll
   ============================================================================ */

:root {
  --al-bg-deep: #03040a;
  --al-surface: rgba(18, 19, 39, 0.68);
  --al-line: rgba(255, 255, 255, 0.13);
  --al-line-bright: rgba(255, 255, 255, 0.24);
  --al-text: #f7f5ff;
  --al-muted: #a8a8c0;
  --al-pink: #ff4f9a;
  --al-violet: #a56bff;
  --al-cyan: #53d7ff;
  --al-live: #ff526f;
  --al-radius-xl: 1.6rem;
  --al-radius-lg: 1.1rem;
  --al-shadow: 0 1.5rem 3.5rem rgba(0, 0, 0, 0.42);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

html {
  min-width: 320px;
  background: var(--al-bg-deep);
}

body.al-body {
  position: relative;
  isolation: isolate;
  height: 100vh;
  margin: 0;
  overflow: hidden; /* plus de scroll possible */
  color: var(--al-text);
  background:
    radial-gradient(circle at 14% 18%, rgba(108, 54, 188, 0.22), transparent 31rem),
    radial-gradient(circle at 87% 22%, rgba(31, 119, 178, 0.18), transparent 28rem),
    radial-gradient(circle at 53% 100%, rgba(209, 46, 123, 0.14), transparent 34rem),
    linear-gradient(135deg, #09091b 0%, #080916 48%, #03040a 100%);
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.al-body::before,
body.al-body::after {
  position: fixed;
  z-index: -1;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  content: '';
  pointer-events: none;
  filter: blur(5rem);
  opacity: 0.23;
  animation: al-drift 18s ease-in-out infinite alternate;
}

body.al-body::before { top: -17rem; left: -10rem; background: rgba(184, 65, 255, 0.55); }
body.al-body::after { right: -14rem; bottom: -16rem; background: rgba(42, 189, 255, 0.45); animation-delay: -7s; animation-direction: alternate-reverse; }

/* --------------------------------------------------------------------------
   Conteneur : flex column, hauteur de l'écran, réparti en 3 zones
   -------------------------------------------------------------------------- */

.al-container {
  width: min(100% - 2.5rem, 78rem);
  height: 100vh;
  margin: 0 auto;
  padding: clamp(0.8rem, 2vh, 1.6rem) 0 clamp(0.6rem, 1.5vh, 1.1rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centré au lieu de space-between */
  gap: clamp(1.2rem, 3vh, 2.2rem);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Header compact
   -------------------------------------------------------------------------- */

.al-header {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  animation: al-rise 0.8s ease both;
}

.al-dj-name {
  color: transparent;
  background: linear-gradient(100deg, var(--al-pink) 5%, #d26dff 47%, var(--al-cyan) 98%);
  background-clip: text;
  -webkit-background-clip: text;
}

.al-header h1 {
  margin: clamp(0.5rem, 1.4vh, 0.9rem) 0 0;
  max-width: 100%;
  font-size: clamp(1.8rem, 4.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
  text-shadow: 0 0 2rem rgba(213, 93, 255, 0.15);
}

.al-subtitle {
  margin: 0.5rem 0 0;
  color: var(--al-muted);
  font-size: clamp(0.62rem, 1vw, 0.8rem);
  font-weight: 500;
  letter-spacing: 0.24em;
  line-height: 1.4;
  text-transform: uppercase;
}

.al-tagline {
  max-width: 40rem;
  margin: 0.4rem auto 0;
  color: color-mix(in srgb, var(--al-muted) 82%, var(--al-text));
  font-size: clamp(0.68rem, 1.1vw, 0.85rem);
  line-height: 1.4;
  opacity: 0.9;
}

.al-pulse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffd9df;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.al-pulse::before {
  width: 0.5rem;
  height: 0.5rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--al-live);
  box-shadow: 0 0 0 0 rgba(255, 82, 111, 0.75), 0 0 1rem rgba(255, 82, 111, 0.9);
  content: '';
  animation: al-pulse 1.8s ease-out infinite;
}

.al-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.14rem;
  width: 0.9rem;
  height: 0.7rem;
  margin-left: 0.35rem;
  filter: drop-shadow(0 0 0.35rem color-mix(in srgb, var(--al-cyan) 42%, transparent));
}

.al-eq span {
  width: 0.14rem;
  min-height: 0.2rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--al-cyan) 0%, var(--al-violet) 52%, var(--al-pink) 100%);
  transform-origin: center bottom;
  animation: al-eq-bounce 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.al-eq span:nth-child(1) { height: 0.4rem; animation-delay: -0.72s; }
.al-eq span:nth-child(2) { height: 0.6rem; animation-delay: -0.48s; }
.al-eq span:nth-child(3) { height: 0.5rem; animation-delay: -0.24s; }
.al-eq span:nth-child(4) { height: 0.7rem; animation-delay: 0s; }

.al-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: min(100%, 22rem);
  margin: 0.6rem auto 0;
}

.al-divider span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--al-violet) 75%, transparent), transparent);
}
.al-divider span:last-of-type {
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--al-cyan) 75%, transparent), transparent);
}
.al-divider svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--al-cyan);
  filter: drop-shadow(0 0 0.4rem color-mix(in srgb, var(--al-cyan) 70%, transparent));
}

/* --------------------------------------------------------------------------
   Bloc "now playing" — occupe l'espace restant, ne déborde jamais
   -------------------------------------------------------------------------- */

.al-now-playing {
  position: relative;
  flex: 0 1 auto;           /* ne force plus l'étirement */
  width: min(100%, 52rem);  /* largeur max raisonnable */
  max-height: 60vh;         /* hauteur max raisonnable */
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  margin: 0 auto;
  padding: clamp(0.8rem, 2vh, 1.6rem) clamp(1rem, 2.5vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--al-line);
  border-radius: var(--al-radius-xl);
  background: linear-gradient(135deg, rgba(32, 29, 64, 0.8), rgba(10, 12, 27, 0.64));
  box-shadow: var(--al-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(1.5rem) saturate(130%);
  -webkit-backdrop-filter: blur(1.5rem) saturate(130%);
  animation: al-rise 0.8s 0.12s ease both;
}

.al-now-playing::before {
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  background: linear-gradient(125deg, rgba(255, 88, 174, 0.33), transparent 34%, transparent 67%, rgba(84, 208, 255, 0.24)) border-box;
  content: '';
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.al-cover-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 11rem;
  aspect-ratio: 1;
  margin: 0 auto;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 22%, transparent 22.5% 35%, rgba(255, 255, 255, 0.08) 35.5% 36%, transparent 36.5%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.02));
  box-shadow: 0 1.2rem 2.5rem rgba(0, 0, 0, 0.42), inset 0 0 1.2rem rgba(0, 0, 0, 0.3);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.55s ease;
}

.al-cover-wrap::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0.55rem;
  height: 0.55rem;
  border: 2px solid rgba(255, 255, 255, 0.54);
  border-radius: 50%;
  background: #090a14;
  content: '';
  transform: translate(-50%, -50%);
}

.al-cover-wrap:hover {
  transform: rotate(2.5deg) scale(1.025);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.5), 0 0 2rem rgba(174, 82, 255, 0.18);
}

.al-cover {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: linear-gradient(135deg, #2c164d, #101b3c);
  object-fit: cover;
}

.al-track-info {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.al-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--al-cyan);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: clamp(0.6rem, 0.95vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#currentTitle {
  max-width: 100%;
  margin: 0;
  color: var(--al-text);
  font-size: clamp(1.4rem, 3.4vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#currentArtist {
  margin: 0.6rem 0 0;
  color: var(--al-muted);
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Zone message — TOUJOURS visible, emplacement réservé en permanence
   -------------------------------------------------------------------------- */

.al-message {
  display: none; /* caché par défaut, affiché uniquement en JS quand il y a un message */
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: clamp(4rem, 10vh, 6rem);
  width: min(100%, 60rem);
  margin: 0 auto;
  padding: 1.1rem 1.8rem;
  border: 2px solid rgba(255, 108, 177, 0.45);
  border-radius: var(--al-radius-lg);
  background: linear-gradient(110deg, rgba(255, 76, 157, 0.24), rgba(139, 91, 255, 0.22));
  color: #fff0f8;
  box-shadow: 0 1rem 2.6rem rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.1), 0 0 2.5rem rgba(255, 79, 154, 0.25);
  font-size: clamp(1.1rem, 2.1vw, 1.5rem);
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(1rem);
  -webkit-backdrop-filter: blur(1rem);
  overflow: hidden;
}

.al-message.is-visible {
  display: flex;
  animation: al-message-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.al-message-title {
  display: block;
  margin-bottom: 0.4rem;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.005em;
  color: #ffd9ec;
}

.al-message-body {
  display: block;
  color: inherit;
  opacity: 0.97;
  font-weight: 500;
}

#messageText { margin: 0; }

.al-now-playing--blocked #currentTitle {
  color: #ffb199;
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
}

.al-now-playing--blocked .al-label {
  opacity: 0.6;
}

.al-now-playing--blocked .al-cover-wrap {
  filter: grayscale(1) brightness(0.6);
  opacity: 0.6;
}

/* Conteneur bloqué — grisé */
.al-now-playing--blocked {
  background: linear-gradient(135deg, rgba(100, 100, 120, 0.5), rgba(60, 60, 80, 0.5)) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  filter: saturate(0.3) brightness(0.75);
  opacity: 0.7;
}

.al-now-playing--blocked .al-cover {
  filter: grayscale(100%) brightness(0.6);
}

.al-now-playing--blocked #currentTitle {
  color: #ccc;
  font-style: italic;
}

.al-now-playing--blocked .al-label {
  opacity: 0.5;
  color: #999;
}

.al-now-playing--blocked #currentArtist {
  opacity: 0.5;
}

/* --------------------------------------------------------------------------
   Footer compact, toujours en bas
   -------------------------------------------------------------------------- */

.al-footer {
  flex: 0 0 auto;
  padding: 0.2rem 0.5rem 0;
  color: var(--al-muted);
  font-family: "DM Mono", monospace;
  font-size: clamp(0.56rem, 0.8vw, 0.66rem);
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0.75;
}

.al-footer p { margin: 0; }
.al-footer-sub {
  margin-top: 0.15rem !important;
  opacity: 0.6;
  font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   al-hint — optionnel, masqué par défaut pour économiser la place
   (remets display:flex si tu veux le garder visible)
   -------------------------------------------------------------------------- */

.al-hint { display: none; }

/* --------------------------------------------------------------------------
   Petits écrans (projecteur 4:3 bas / tablette en portrait)
   -------------------------------------------------------------------------- */

@media (max-height: 700px) {
  .al-header h1 { font-size: clamp(1.5rem, 4vw, 2.4rem); }
  .al-cover-wrap { max-width: 7.5rem; }
  #currentTitle { font-size: clamp(1.1rem, 3vw, 1.8rem); }
  .al-tagline, .al-divider { display: none; }
}

@media (max-width: 700px) {
  .al-now-playing {
    grid-template-columns: 1fr;
    text-align: center;
    row-gap: 0.8rem;
  }
  .al-cover-wrap { max-width: 7rem; margin: 0 auto; }
  #currentTitle { -webkit-line-clamp: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes al-rise {
  from { opacity: 0; transform: translateY(0.8rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes al-message-in {
  from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes al-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 82, 111, 0.78), 0 0 1rem rgba(255, 82, 111, 0.9); transform: scale(0.9); }
  70% { box-shadow: 0 0 0 0.5rem rgba(255, 82, 111, 0), 0 0 1rem rgba(255, 82, 111, 0.45); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(255, 82, 111, 0), 0 0 1rem rgba(255, 82, 111, 0.9); transform: scale(0.9); }
}

@keyframes al-eq-bounce {
  0%, 100% { transform: scaleY(0.4); opacity: 0.7; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes al-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3rem, 1.5rem, 0) scale(1.1); }
}