/* ============================================================
   BLINDTEST — epic / playful / modern theme
   Theme values come from CSS custom properties set by blindtest.html
   (--primary-color, --secondary-color, --third-color, --fourth-color,
    --fifth-color, --background-color, --background-image, --font-family…).
   Vibrant fallbacks keep it looking great even with no client theming.
   ============================================================ */

:root,
body {
  --bt-c1: var(--primary-color, #19e3ff);   /* electric cyan   */
  --bt-c2: var(--third-color,   #ff3ea5);   /* hot magenta     */
  --bt-c3: var(--fifth-color,   #8b5cff);   /* violet          */
  --bt-c4: var(--fourth-color,  #ffd23e);   /* gold            */
  --bt-ink: var(--secondary-color, #ffffff);
  --bt-bg-base: var(--background-color, #07060f);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  max-width: none !important;
  background-color: var(--bt-bg-base);
  background-image: var(--background-image);
  background-size: cover;
  background-position: center;
  cursor: none;
  overflow: hidden;
  color: var(--bt-ink);
  font-family: var(--font-family, "Poppins", "Montserrat", sans-serif);
}
body.nobg { background: none !important; }

/* ============================================================
   ANIMATED BACKGROUND (aurora blobs + drifting grid)
   ============================================================ */
#bt-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bt-aurora {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.6;            /* dropped `mix-blend-mode: screen` — over the near-black */
  will-change: transform;  /* base it reads the same, and skips per-frame blend compositing */
}
.bt-aurora-1 {
  background: radial-gradient(circle at center, var(--bt-c1), transparent 62%);
  top: -22vmax; left: -16vmax;
  animation: bt-float-1 18s ease-in-out infinite;
}
.bt-aurora-2 {
  background: radial-gradient(circle at center, var(--bt-c2), transparent 62%);
  bottom: -26vmax; right: -16vmax;
  animation: bt-float-2 22s ease-in-out infinite;
}
.bt-aurora-3 {
  background: radial-gradient(circle at center, var(--bt-c3), transparent 64%);
  top: 18vmax; right: 8vmax;
  animation: bt-float-3 26s ease-in-out infinite;
}
@keyframes bt-float-1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(24vmax, 14vmax) scale(1.25); }
}
@keyframes bt-float-2 {
  0%,100% { transform: translate(0,0) scale(1.1); }
  50%     { transform: translate(-20vmax, -12vmax) scale(0.85); }
}
@keyframes bt-float-3 {
  0%,100% { transform: translate(0,0) scale(0.9); }
  50%     { transform: translate(-16vmax, 16vmax) scale(1.2); }
}
/* Subtle moving tech grid for the "modern" feel.
   The pattern lives on a ::before that translates (compositor-only) — far
   cheaper than animating background-position, which repaints every frame.
   The radial mask stays on the static parent. */
.bt-grid {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.5;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 80%);
}
.bt-grid::before {
  content: "";
  position: absolute;
  inset: -68px;
  background-image:
    linear-gradient(color-mix(in srgb, var(--bt-c1) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--bt-c1) 14%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  animation: bt-grid-pan 24s linear infinite;
  will-change: transform;
}
@keyframes bt-grid-pan { to { transform: translate(64px, 64px); } }
body.revealed .bt-grid { opacity: 0.18; }

/* Sweeping disco light beams radiating from the top-left (under the ball) */
.bt-beams {
  position: absolute;
  top: -25vmax; left: -8vmax;
  width: 100vmax; height: 100vmax;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    color-mix(in srgb, var(--bt-c1) 40%, transparent) 8deg, transparent 16deg,
    transparent 40deg,
    color-mix(in srgb, var(--bt-c2) 40%, transparent) 48deg, transparent 56deg,
    transparent 90deg,
    color-mix(in srgb, var(--bt-c4) 38%, transparent) 98deg, transparent 106deg,
    transparent 150deg,
    color-mix(in srgb, var(--bt-c3) 40%, transparent) 158deg, transparent 166deg,
    transparent 360deg);
  mix-blend-mode: screen;
  opacity: 0.35;
  transform-origin: 25% 25%;
  animation: bt-beams-spin 14s linear infinite;
  will-change: transform;
}
@keyframes bt-beams-spin { to { transform: rotate(360deg); } }
/* Beams flare brighter & faster on a win */
body.fx-win .bt-beams { opacity: 0.6; animation-duration: 3s; }

/* Spotlight vignette to focus the centre and add depth */
#bt-vignette {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 75% at 50% 46%,
    transparent 40%,
    color-mix(in srgb, var(--bt-bg-base) 55%, transparent) 78%,
    color-mix(in srgb, #000 70%, transparent) 100%);
}

/* ============================================================
   FLOATING MUSIC NOTES
   ============================================================ */
#bt-notes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#bt-notes span {
  position: absolute;
  bottom: -10vh;
  left: calc((var(--i) + 1) * 10%);
  font-size: clamp(22px, 3.2vmax, 52px);
  color: color-mix(in srgb, var(--bt-c1) 70%, var(--bt-ink));
  opacity: 0;
  text-shadow: 0 0 16px color-mix(in srgb, var(--bt-c1) 60%, transparent);
  animation: bt-note-rise calc(4s + var(--i) * 0.5s) ease-in infinite;
  animation-delay: calc(var(--i) * -0.9s);
}
#bt-notes span:nth-child(even) { color: color-mix(in srgb, var(--bt-c2) 70%, var(--bt-ink)); }
#bt-notes span:nth-child(3n)   { color: color-mix(in srgb, var(--bt-c4) 70%, var(--bt-ink)); }
@keyframes bt-note-rise {
  0%   { transform: translateY(0) rotate(0deg) scale(0.7); opacity: 0; }
  10%  { opacity: 0.85; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-118vh) rotate(220deg) scale(1.1); opacity: 0; }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.wrapper header.flex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px 0;
}
.wrapper header .flex { flex: 1; text-align: center; }

#title {
  margin: 0;
  font-family: var(--font-family, sans-serif);
  font-size: calc(var(--font-size, 3rem));
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--bt-c1), var(--bt-c2), var(--bt-c4), var(--bt-c1));
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px color-mix(in srgb, var(--bt-c2) 45%, transparent));
  animation: bt-title-shine 7s linear infinite;
}
@keyframes bt-title-shine { to { background-position: 250% center; } }

.logo { max-height: 90px; max-width: 220px; object-fit: contain; }
.partner_logo {
  max-width: 300px !important;
  max-height: 300px !important;
  padding: 50px;
  padding-top: 25px;
  display: none;
}

.content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;          /* allow children to shrink instead of overflowing */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2vh 4vw;
  gap: 3.2vh;
  overflow: hidden;
}

/* ============================================================
   COUNTER + PROGRESS
   ============================================================ */
#bt-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--secondary-font-family, var(--font-family, sans-serif));
  font-size: calc(var(--secondary-font-size, 1.5rem));
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 0.4em 1.3em;
  border-radius: 999px;
  color: var(--bt-ink);
  background: color-mix(in srgb, var(--bt-bg-base) 55%, transparent);
  border: 2px solid color-mix(in srgb, var(--bt-c1) 55%, transparent);
  box-shadow: 0 0 22px color-mix(in srgb, var(--bt-c1) 35%, transparent),
              inset 0 0 18px color-mix(in srgb, var(--bt-c1) 12%, transparent);
  backdrop-filter: blur(6px);
  transition: opacity 0.35s ease;
}
#bt-counter.is-empty { opacity: 0; }
#bt-counter-label { opacity: 0.7; font-size: 0.66em; align-self: center; letter-spacing: 4px; }
#bt-counter-num {
  display: inline-block;
  font-size: 1.1em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--bt-c1), var(--bt-c2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--bt-c1) 60%, transparent));
}
#bt-counter-num.bump { animation: bt-bump 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.5); }
#bt-counter-sep { opacity: 0.4; }
#bt-counter-total { opacity: 0.8; font-variant-numeric: tabular-nums; }
@keyframes bt-bump {
  0%   { transform: translateY(0) scale(1) rotate(0); }
  35%  { transform: translateY(-0.14em) scale(1.7) rotate(-6deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}

#bt-progress {
  width: min(48vw, 560px);
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bt-ink) 14%, transparent);
  overflow: hidden;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.4);
}
#bt-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bt-c1), var(--bt-c2), var(--bt-c4));
  background-size: 200% 100%;
  box-shadow: 0 0 16px color-mix(in srgb, var(--bt-c2) 70%, transparent);
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: bt-prog-shimmer 2.4s linear infinite;
}
@keyframes bt-prog-shimmer { to { background-position: 200% 0; } }

/* ============================================================
   NOW-PLAYING STAGE — spinning vinyl + equalizer
   ============================================================ */
#bt-stage {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2.4vh;
}
body.playing #bt-stage { display: flex; animation: bt-rise-in 0.5s ease both; }

#bt-disc {
  position: relative;
  width: clamp(140px, 26vmin, 320px);
  height: clamp(140px, 26vmin, 320px);
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      #1a1a1f 0 2px, #0c0c10 2px 4px);
  box-shadow:
    0 18px 50px rgba(0,0,0,0.55),
    0 0 0 6px color-mix(in srgb, var(--bt-c3) 35%, transparent),
    0 0 50px color-mix(in srgb, var(--bt-c1) 45%, transparent);
  animation: bt-spin 1.3s linear infinite;
  will-change: transform;
}
/* Idle (waiting screen): disc keeps turning, but lazily */
body:not(.playing):not(.revealed) #bt-disc { animation-duration: 6s; }
body.revealed #bt-disc { animation-play-state: paused; }
.bt-disc-ring {
  position: absolute; inset: 14%;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--bt-c1) 30%, transparent);
}
.bt-disc-label {
  position: absolute; inset: 33%;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--bt-c2), var(--bt-c3));
  box-shadow: inset 0 0 18px rgba(0,0,0,0.4), 0 0 18px color-mix(in srgb, var(--bt-c2) 60%, transparent);
  color: #fff;
  font-size: clamp(18px, 4vmin, 42px);
}
/* Centre label throbs to the beat while a track plays */
body.playing .bt-disc-label { animation: bt-label-pulse 0.5s ease-in-out infinite alternate; }
@keyframes bt-label-pulse { from { transform: scale(1); } to { transform: scale(1.09); } }
.bt-disc-label::after {
  content: ""; position: absolute;
  width: 9%; height: 9%; border-radius: 50%;
  background: var(--bt-bg-base);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.bt-disc-shine {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(125deg, rgba(255,255,255,0.28) 0%, transparent 45%);
  pointer-events: none;
}
@keyframes bt-spin { to { transform: rotate(360deg); } }

/* Reactive equalizer */
#bt-equalizer {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 70px;
}
/* Glowing reflective floor line under the bars */
#bt-equalizer::after {
  content: "";
  position: absolute;
  left: -8%; right: -8%;
  bottom: -7px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--bt-c1), var(--bt-c2), var(--bt-c4), transparent);
  filter: blur(1px);
  opacity: 0.85;
}
#bt-equalizer span {
  display: block;
  width: 10px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bt-c1) 80%, #fff), var(--bt-c2));
  box-shadow: 0 0 14px color-mix(in srgb, var(--bt-c1) 70%, transparent);
  transform-origin: bottom;
  animation: bt-eq 0.9s ease-in-out infinite;
}
#bt-equalizer span:nth-child(1) { animation-delay: 0s;    height: 35%; }
#bt-equalizer span:nth-child(2) { animation-delay: .12s;  height: 70%; }
#bt-equalizer span:nth-child(3) { animation-delay: .24s;  height: 45%; }
#bt-equalizer span:nth-child(4) { animation-delay: .36s;  height: 92%; }
#bt-equalizer span:nth-child(5) { animation-delay: .48s;  height: 55%; }
#bt-equalizer span:nth-child(6) { animation-delay: .60s;  height: 80%; }
#bt-equalizer span:nth-child(7) { animation-delay: .72s;  height: 40%; }
#bt-equalizer span:nth-child(8) { animation-delay: .84s;  height: 66%; }
#bt-equalizer span:nth-child(9) { animation-delay: .96s;  height: 50%; }
@keyframes bt-eq {
  0%, 100% { transform: scaleY(0.3); }
  50%      { transform: scaleY(1); }
}

/* ============================================================
   GLASS CARD (question / answer)
   ============================================================ */
#bt-card {
  position: relative;
  max-width: min(92vw, 1100px);
  max-height: 72vh;
  overflow: hidden;
  padding: clamp(20px, 4vh, 48px) clamp(24px, 5vw, 72px);
  border-radius: 28px;
  background: color-mix(in srgb, var(--bt-bg-base) 52%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--bt-c1) 35%, transparent);
  /* Lighter blur: backdrop-filter is re-evaluated every frame because the
     background animates — a smaller radius (and no saturate) cuts that cost.
     A slightly more opaque background keeps the frosted-glass read. */
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow:
    0 24px 70px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
/* Glowing animated gradient ring around the card */
#bt-card::before {
  content: "";
  position: absolute; inset: -2px;
  border-radius: 30px;
  padding: 2px;
  background: linear-gradient(120deg, var(--bt-c1), var(--bt-c2), var(--bt-c3), var(--bt-c1));
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.9;
  animation: bt-ring 6s linear infinite;
  pointer-events: none;
}
@keyframes bt-ring { to { background-position: 300% 50%; } }
body.playing #bt-card { animation: bt-card-glow 2.2s ease-in-out infinite; }
@keyframes bt-card-glow {
  0%,100% { box-shadow: 0 24px 70px rgba(0,0,0,0.45), 0 0 30px color-mix(in srgb, var(--bt-c1) 30%, transparent); }
  50%     { box-shadow: 0 24px 70px rgba(0,0,0,0.45), 0 0 70px color-mix(in srgb, var(--bt-c2) 55%, transparent); }
}
/* Light bloom that bursts from the card centre the moment the answer reveals */
#bt-card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 58%,
    color-mix(in srgb, var(--bt-c1) 50%, transparent),
    color-mix(in srgb, var(--bt-c2) 30%, transparent) 35%,
    transparent 62%);
  opacity: 0;
  pointer-events: none;
}
body.revealed #bt-card::after { animation: bt-reveal-bloom 0.95s ease-out; }
@keyframes bt-reveal-bloom {
  0%   { opacity: 0;    transform: scale(0.55); }
  35%  { opacity: 0.95; }
  100% { opacity: 0;    transform: scale(1.45); }
}

/* The question prompt */
#bt-question {
  font-family: var(--font-family, sans-serif);
  font-size: min(calc(var(--font-size, 3rem) * 1.7), 7vw, 13vh);
  line-height: 1.05;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--bt-c1) 60%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px color-mix(in srgb, var(--bt-c1) 40%, transparent));
  transition: font-size 0.4s ease, opacity 0.4s ease;
}
#bt-question.bt-enter { animation: bt-enter 0.55s cubic-bezier(0.2, 0.8, 0.3, 1.1) both; }
@keyframes bt-enter {
  from { transform: translateY(34px) scale(0.94); opacity: 0; filter: blur(8px); }
  to   { transform: translateY(0)    scale(1);    opacity: 1; filter: blur(0); }
}
/* On reveal the question shrinks to a caption above the answer */
body.revealed #bt-question {
  font-size: calc(var(--font-size, 3rem) * 0.7);
  opacity: 0.6;
  margin-bottom: 0.3em;
}

/* The answer */
#bt-answer {
  font-family: var(--font-family, sans-serif);
  font-size: min(calc(var(--font-size, 3rem) * 3.2), 15vw, 34vh);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 1px;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  background: linear-gradient(110deg, var(--bt-c1), var(--bt-c2), var(--bt-c4));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px color-mix(in srgb, var(--bt-c2) 50%, transparent));
  display: none;
}
body.revealed #bt-answer {
  display: block;
  animation: bt-answer-shimmer 3.5s linear infinite, bt-answer-glow 2.6s ease-in-out infinite;
}
#bt-answer.bt-pop {
  animation:
    bt-pop 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.5) both,
    bt-answer-shimmer 3.5s linear infinite 0.7s,
    bt-answer-glow 2.6s ease-in-out infinite 0.7s;
}
@keyframes bt-pop {
  0%   { transform: scale(0.4) rotate(-7deg);  opacity: 0; }
  55%  { transform: scale(1.18) rotate(3deg);  opacity: 1; }
  78%  { transform: scale(0.96) rotate(-1.5deg); }
  100% { transform: scale(1) rotate(0);        opacity: 1; }
}
@keyframes bt-answer-shimmer { to { background-position: 220% 0; } }
@keyframes bt-answer-glow {
  0%,100% { filter: drop-shadow(0 8px 26px color-mix(in srgb, var(--bt-c1) 40%, transparent)); }
  50%     { filter: drop-shadow(0 12px 48px color-mix(in srgb, var(--bt-c2) 75%, transparent)); }
}

/* Track info line under the answer */
#bt-meta {
  font-family: var(--secondary-font-family, var(--font-family, sans-serif));
  font-size: calc(var(--secondary-font-size, 1.5rem) * 1.15);
  color: color-mix(in srgb, var(--bt-ink) 80%, var(--bt-c1));
  margin-top: 0.5em;
  letter-spacing: 1px;
  display: none;
}
/* Track-info line is hidden by default; the operator can switch it on
   (intro.show_track_info = 1 → body gets the .show-meta class). */
body.show-meta.revealed #bt-meta { display: block; }
#bt-meta.bt-fade-up { animation: bt-fade-up 0.5s ease 0.22s both; }
@keyframes bt-fade-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Status / waiting text — the big pulsing idle call-to-action ("Prêts ?") */
#bt-status {
  font-family: var(--font-family, sans-serif);
  font-size: min(calc(var(--font-size, 3rem) * 1.5), 9vw, 16vh);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--bt-c1), var(--bt-c2), var(--bt-c4));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 28px color-mix(in srgb, var(--bt-c2) 45%, transparent));
  animation: bt-status-pulse 1.6s ease-in-out infinite, bt-prog-shimmer 4s linear infinite;
}
@keyframes bt-status-pulse {
  0%,100% { transform: scale(1);    filter: drop-shadow(0 6px 22px color-mix(in srgb, var(--bt-c1) 35%, transparent)); }
  50%     { transform: scale(1.06); filter: drop-shadow(0 10px 40px color-mix(in srgb, var(--bt-c2) 60%, transparent)); }
}

/* Idle waiting screen: disc idles centre-stage; hide the empty card + equalizer */
body:not(.playing):not(.revealed) #bt-stage { display: flex; }
body:not(.playing):not(.revealed) #bt-equalizer { display: none; }
body:not(.playing):not(.revealed) #bt-card { display: none; }

@keyframes bt-rise-in {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Live feed container (kept from karaoke scaffold) */
.Live__videoContainer { display: none; }
body.has-live-feed .Live__videoContainer { display: block; }

/* ============================================================
   RESPONSIVE (mobile fan view)
   ============================================================ */
@media (max-width: 768px) {
  .wrapper header.flex-row { padding: 16px 16px 0; }
  #bt-question { font-size: calc(var(--font-size, 3rem) * 1.25); }
  #bt-answer   { font-size: calc(var(--font-size, 3rem) * 1.7); }
  #bt-progress { width: 80vw; }
  #bt-card { padding: 24px 22px; border-radius: 22px; }

  /* Phones are the most constrained (and battery-bound) and only show the
     question/answer — drop the heaviest decorative layers there. */
  .bt-beams { display: none; }
  .bt-grid { display: none; }
  #discoBall, #discoBallLight { display: none; } /* 3D ball is desktop/tablet only */
  .bt-aurora { filter: blur(48px); }              /* cheaper blur radius */
  .bt-aurora-3 { display: none; }                 /* two glow blobs are plenty */
  #bt-notes span:nth-child(n+5) { display: none; } /* keep ~4 notes */
  /* backdrop-filter is the priciest effect on mobile GPUs — use a solid
     translucent panel instead of a live blur. */
  #bt-card { backdrop-filter: none; -webkit-backdrop-filter: none;
             background: color-mix(in srgb, var(--bt-bg-base) 80%, transparent); }
}

/* ============================================================
   WIN / LOSE FX LAYER
   ============================================================ */
#bt-fx {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  overflow: hidden;
}
#bt-flash { position: absolute; inset: 0; opacity: 0; }
#bt-flash.flash-win  { animation: bt-flash-win  0.8s ease-out; }
#bt-flash.flash-lose { animation: bt-flash-lose 0.8s ease-out; }
@keyframes bt-flash-win {
  0%   { opacity: 0; background: radial-gradient(circle at 50% 42%, rgba(124,252,0,0.6), transparent 60%); }
  18%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes bt-flash-lose {
  0%   { opacity: 0; background: radial-gradient(circle at 50% 50%, rgba(255,40,40,0.6), transparent 65%); }
  16%  { opacity: 1; }
  100% { opacity: 0; }
}

#bt-confetti { position: absolute; inset: 0; }
.bt-confetti-piece {
  position: absolute;
  will-change: transform, opacity;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* BRAVO / RATÉ badge */
#bt-badge {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  font-family: var(--font-family, sans-serif);
  font-size: calc(var(--font-size, 3rem) * 2.8);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-text-stroke: 2px rgba(0,0,0,0.25);
}
#bt-badge.win  { color: #7CFC00; text-shadow: 0 0 40px rgba(124,252,0,0.8), 0 8px 30px rgba(0,0,0,0.5); }
#bt-badge.lose { color: #ff4d4d; text-shadow: 0 0 40px rgba(255,77,77,0.8), 0 8px 30px rgba(0,0,0,0.5); }
#bt-badge.show { animation: bt-badge 2.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
@keyframes bt-badge {
  0%   { transform: translate(-50%, -50%) scale(0.3) rotate(-10deg); opacity: 0; }
  14%  { transform: translate(-50%, -50%) scale(1.25) rotate(4deg);  opacity: 1; }
  26%  { transform: translate(-50%, -50%) scale(1) rotate(0);        opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0; }
}

/* Whole-screen reactions */
body.fx-win  { animation: bt-pulse-win  0.6s ease-out; }
body.fx-lose { animation: bt-shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes bt-pulse-win {
  0%   { filter: brightness(1); }
  30%  { filter: brightness(1.4) saturate(1.3); }
  100% { filter: brightness(1); }
}
@keyframes bt-shake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-18px); }
  30% { transform: translateX(16px); }
  45% { transform: translateX(-13px); }
  60% { transform: translateX(11px); }
  75% { transform: translateX(-6px); }
}

/* ============================================================
   DISCO BALL — true 3D faceted sphere (tiles generated in JS).
   Hung top-left so it clears the centred title.
   ============================================================ */
#discoBallLight {
  width: 100px;
  height: 100px;
  position: fixed;
  top: 8px;
  left: 7%;
  border-radius: 100%;
  background-color: #fff;
  opacity: 0.2;
  -webkit-filter: blur(20px);
  filter: blur(20px);
  z-index: 2;
  pointer-events: none;
}
#discoBall {
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  width: 100px;
  height: 100px;
  position: fixed;
  top: 8px;
  left: 7%;
  z-index: 2;
  pointer-events: none;
  -webkit-animation: rotateDiscoBall 18s linear infinite;
  animation: rotateDiscoBall 18s linear infinite;
}
.square {
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  position: absolute;
  top: 50px;
  left: 50px;
  width: 6px;
  height: 6px;
}
#discoBallMiddle {
  width: 100%;
  height: 100%;
  border-radius: 100%;
  position: absolute;
  background: linear-gradient(to top, #111, #333);
  -webkit-animation: rotateDiscoBallMiddle 18s linear infinite;
  animation: rotateDiscoBallMiddle 18s linear infinite;
}
@-webkit-keyframes rotateDiscoBall {
  0%   { -webkit-transform: rotateX(90deg) rotateZ(0deg) rotate(0deg); }
  100% { -webkit-transform: rotateX(90deg) rotateZ(360deg) rotate(0deg); }
}
@keyframes rotateDiscoBall {
  0%   { transform: rotateX(90deg) rotateZ(0deg) rotate(0deg); }
  100% { transform: rotateX(90deg) rotateZ(360deg) rotate(0deg); }
}
@-webkit-keyframes rotateDiscoBallMiddle {
  0%   { -webkit-transform: rotateX(90deg) rotateY(0deg) rotate(0deg); }
  100% { -webkit-transform: rotateX(90deg) rotateY(-360deg) rotate(0deg); }
}
@keyframes rotateDiscoBallMiddle {
  0%   { transform: rotateX(90deg) rotateY(0deg) rotate(0deg); }
  100% { transform: rotateX(90deg) rotateY(-360deg) rotate(0deg); }
}
@-webkit-keyframes reflect {
  0%   { -webkit-filter: brightness(60%); }
  50%  { -webkit-filter: brightness(120%); }
  100% { -webkit-filter: brightness(90%); }
}
@keyframes reflect {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}
/* On a win the ball spins up and its light flares */
body.fx-win #discoBall,
body.fx-win #discoBallMiddle { animation-duration: 4s; }
body.fx-win #discoBallLight { opacity: 0.55; }

/* ============================================================
   REDUCED MOTION — keep it readable, drop the heavy loops
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .bt-aurora, .bt-grid::before, .bt-beams, #bt-notes span, #bt-disc,
  #bt-progress-bar, #bt-card::before, #bt-card::after, #bt-status, #title,
  body.playing #bt-card, body.revealed #bt-answer, #bt-answer, #bt-equalizer span,
  body.playing .bt-disc-label,
  #discoBall, #discoBallMiddle, .square > div {
    animation: none !important;
  }
}
