.bg-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.bg-stage::before,
.bg-stage::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
}

/* Per-lesson photo background: slow zoom for a little life, plus a dark
   scrim so white text stays readable no matter how bright/busy the photo
   is - overrides the blurred-blob pseudo-elements the gradient themes use. */
.bg-photo {
    background-size: cover;
    background-position: center;
    animation: bgPhotoZoom 25s ease-in-out infinite alternate;
}
.bg-photo::before { content: none; }
.bg-photo::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0;
    filter: none;
    opacity: 1;
    background: linear-gradient(160deg, rgba(8,10,18,0.78) 0%, rgba(8,10,18,0.5) 45%, rgba(8,10,18,0.8) 100%);
}
@keyframes bgPhotoZoom {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6%, 8%) scale(1.15); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-8%, -6%) scale(1.1); }
}

/* Calm */
.bg-calm { background: linear-gradient(160deg, #1e3c72 0%, #2a5298 55%, #557a95 100%); }
.bg-calm::before { width: 55vw; height: 55vw; top: -10%; left: -10%; background: #7fc7d9; animation: drift1 22s ease-in-out infinite; }
.bg-calm::after { width: 45vw; height: 45vw; bottom: -15%; right: -10%; background: #4a6fa5; animation: drift2 26s ease-in-out infinite; }

/* Energetic */
.bg-energetic { background: linear-gradient(150deg, #f7971e 0%, #ff5858 50%, #b3287d 100%); }
.bg-energetic::before { width: 50vw; height: 50vw; top: -15%; right: -5%; background: #ffd76e; animation: drift1 12s ease-in-out infinite; }
.bg-energetic::after { width: 50vw; height: 50vw; bottom: -20%; left: -10%; background: #ff3d68; animation: drift2 15s ease-in-out infinite; }

/* Professional */
.bg-professional { background: linear-gradient(160deg, #232526 0%, #3a4750 55%, #5c6b73 100%); }
.bg-professional::before { width: 40vw; height: 40vw; top: -10%; left: 20%; background: #667eea; animation: drift1 24s ease-in-out infinite; }
.bg-professional::after { width: 45vw; height: 45vw; bottom: -15%; right: -5%; background: #3a4750; animation: drift2 28s ease-in-out infinite; }

/* Playful */
.bg-playful { background: linear-gradient(150deg, #ff9a9e 0%, #fad0c4 50%, #ffd1ff 100%); }
.bg-playful::before { width: 45vw; height: 45vw; top: -10%; left: -5%; background: #ff6fa4; animation: drift1 14s ease-in-out infinite; }
.bg-playful::after { width: 40vw; height: 40vw; bottom: -10%; right: -5%; background: #ffe066; animation: drift2 17s ease-in-out infinite; }

/* Nature */
.bg-nature { background: linear-gradient(160deg, #134e5e 0%, #2f9e6f 55%, #71b280 100%); }
.bg-nature::before { width: 50vw; height: 50vw; top: -15%; right: 0; background: #a8e063; animation: drift1 20s ease-in-out infinite; }
.bg-nature::after { width: 40vw; height: 40vw; bottom: -10%; left: -10%; background: #134e5e; animation: drift2 24s ease-in-out infinite; }

/* Night City */
.bg-night-city { background: linear-gradient(160deg, #0f0c29 0%, #302b63 50%, #24243e 100%); }
.bg-night-city::before { width: 40vw; height: 40vw; top: -10%; left: 10%; background: #ff2fb0; animation: drift1 18s ease-in-out infinite; }
.bg-night-city::after { width: 45vw; height: 45vw; bottom: -15%; right: -10%; background: #00d4ff; animation: drift2 22s ease-in-out infinite; }

/* Minimal Dark */
.bg-minimal-dark { background: linear-gradient(160deg, #0f0f0f 0%, #1c1c1c 50%, #2b2b2b 100%); }
.bg-minimal-dark::before { width: 35vw; height: 35vw; top: -5%; right: 10%; background: #667eea; opacity: 0.3; animation: drift1 26s ease-in-out infinite; }
.bg-minimal-dark::after { width: 35vw; height: 35vw; bottom: -10%; left: -5%; background: #444; opacity: 0.4; animation: drift2 30s ease-in-out infinite; }

/* Warm */
.bg-warm { background: linear-gradient(150deg, #d1913c 0%, #ffd194 55%, #f6416c 100%); }
.bg-warm::before { width: 45vw; height: 45vw; top: -15%; left: 5%; background: #ffb26b; animation: drift1 16s ease-in-out infinite; }
.bg-warm::after { width: 45vw; height: 45vw; bottom: -15%; right: -5%; background: #f6416c; animation: drift2 19s ease-in-out infinite; }

/* ============================================================
   Level backgrounds — one distinct, richer design per level,
   used by present.php instead of the per-topic mood above.
   ============================================================ */

@keyframes twinkle {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
@keyframes auroraDrift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    50% { transform: translateX(4%) translateY(-3%) scale(1.08); }
}

/* Beginner — warm sunrise, playful and welcoming */
.bg-level-beginner {
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.55) 0 3px, transparent 4px),
        radial-gradient(circle at 75% 15%, rgba(255,255,255,0.4) 0 2px, transparent 3px),
        radial-gradient(circle at 40% 70%, rgba(255,255,255,0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 88% 55%, rgba(255,255,255,0.4) 0 2.5px, transparent 3.5px),
        radial-gradient(circle at 25% 85%, rgba(255,255,255,0.3) 0 2px, transparent 3px 4px) 0 0/150px 150px,
        linear-gradient(155deg, #ff9a76 0%, #ffb26b 40%, #ffd194 70%, #ffe8b0 100%);
}
.bg-level-beginner::before {
    width: 48vw; height: 48vw; top: -14%; right: -6%;
    background: radial-gradient(circle, #fff2c4 0%, #ffcf7a 55%, transparent 75%);
    animation: drift1 22s ease-in-out infinite;
    opacity: 0.9;
}
.bg-level-beginner::after {
    width: 70vw; height: 42vw; bottom: -22%; left: -12%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.4), transparent 70%);
    animation: drift2 26s ease-in-out infinite;
}

/* Elementary — bright sky and clouds, cheerful and calm */
.bg-level-elementary {
    background:
        radial-gradient(circle at 85% 12%, rgba(255,255,255,0.5) 0 3px, transparent 4px),
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.35) 0 2px, transparent 3px),
        radial-gradient(circle at 55% 80%, rgba(255,255,255,0.3) 0 2px, transparent 3px),
        radial-gradient(circle at 10% 60%, rgba(255,255,255,0.4) 0 2.5px, transparent 3.5px),
        radial-gradient(circle at 30% 20%, rgba(255,255,255,0.25) 0 2px, transparent 3px 4px) 0 0/170px 170px,
        linear-gradient(160deg, #2e86ab 0%, #4fb0c6 50%, #a8dadc 100%);
}
.bg-level-elementary::before {
    width: 44vw; height: 44vw; top: -14%; left: 6%;
    background: radial-gradient(circle, rgba(255,255,255,0.6), transparent 70%);
    animation: drift1 20s ease-in-out infinite;
    opacity: 0.85;
}
.bg-level-elementary::after {
    width: 50vw; height: 32vw; bottom: -12%; right: -8%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.45), transparent 70%);
    animation: drift2 24s ease-in-out infinite;
}

/* Pre-intermediate — starry dusk, calmer and a little more grown-up */
.bg-level-pre-intermediate {
    background:
        radial-gradient(circle at 10% 20%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 80% 10%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 60% 28%, #fff 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 30% 55%, #fff 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 92% 65%, #fff 0 2px, transparent 3px),
        radial-gradient(circle at 45% 88%, #fff 0 1.5px, transparent 2.5px),
        radial-gradient(circle at 15% 45%, rgba(255,255,255,0.8) 0 2px, transparent 3px 4px) 0 0/210px 210px,
        linear-gradient(160deg, #2b1055 0%, #4c2a85 50%, #7b4397 100%);
}
.bg-level-pre-intermediate::before {
    width: 34vw; height: 34vw; top: -8%; right: 5%;
    background: radial-gradient(circle, #fef6e4 0%, #e8d5f5 55%, transparent 75%);
    animation: drift1 26s ease-in-out infinite, twinkle 6s ease-in-out infinite;
    opacity: 0.9;
}
.bg-level-pre-intermediate::after {
    width: 52vw; height: 52vw; bottom: -18%; left: -12%;
    background: radial-gradient(circle, #4c2a85, transparent 70%);
    animation: drift2 30s ease-in-out infinite;
}

/* Intermediate — sophisticated aurora over a fine grid, calm and focused */
.bg-level-intermediate {
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 48px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 48px),
        linear-gradient(170deg, #0b132b 0%, #1c2541 50%, #3a506b 100%);
}
.bg-level-intermediate::before {
    width: 60vw; height: 32vw; top: 6%; left: -10%;
    background: linear-gradient(100deg, #00c9a7, #5b5fef 60%, transparent 80%);
    filter: blur(70px);
    border-radius: 50%;
    animation: auroraDrift 24s ease-in-out infinite;
    opacity: 0.55;
    mix-blend-mode: screen;
}
.bg-level-intermediate::after {
    width: 55vw; height: 28vw; bottom: -2%; right: -12%;
    background: linear-gradient(260deg, #ff6b9d, #5b5fef 60%, transparent 80%);
    filter: blur(70px);
    border-radius: 50%;
    animation: auroraDrift 28s ease-in-out infinite reverse;
    opacity: 0.5;
    mix-blend-mode: screen;
}
