/* ==========================================
   Variables Globales & Thème (Dark Mode)
   ========================================== */
:root {
    /* Couleurs de fond principales */
    --bg-dark: #0f172a;
    --bg-darker: #0b1120;
    
    /* Couleurs de texte */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    /* Couleurs des matières (Accents Néon) */
    --neon-maths: #00f0ff;      /* Cyber-bleu */
    --neon-francais: #b026ff;   /* Violet électrique */
    --neon-anglais: #4f7cff;    /* Bleu royal */
    --neon-svt: #00ff66;        /* Vert émeraude */
    --neon-physique: #ff5e00;   /* Orange plasma */
    
    /* Styles Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(16px);
    
    /* Animation Speeds */
    --anim-speed: 0.6s;
    --anim-bounce: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    
    /* Typography */
    --font-main: 'Poppins', sans-serif;
}

/* ==========================================
   Reset CSS & Base
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Arrière-plans dynamiques et particules floutées (Ambiance) */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.15;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--neon-maths), transparent);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--neon-francais), transparent);
}

/* ==========================================
   Classes Utilitaires
   ========================================== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-height: 100vh;
}

/* ==========================================
   Navigation (Top Nav)
   ========================================== */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 2rem;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo-icon {
    font-size: 2rem;
}

.user-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.level-info {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.level-badge {
    background: linear-gradient(45deg, #ff007a, #7a00ff);
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Barre d'XP */
.xp-container {
    width: 200px;
}

.xp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.xp-progress {
    height: 100%;
    width: 65%; /* Simulé */
    background: linear-gradient(90deg, #ff007a, #7a00ff);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(122, 0, 255, 0.8);
}

/* ==========================================
   Zone Héros (Accueil)
   ========================================== */
.hero {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.time-display {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 12px;
}

.quote {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-style: italic;
    max-width: 800px;
}

/* ==========================================
   Grille des matières & Layout
   ========================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    flex-grow: 1;
}

.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Cartes des matières */
.subject-card {
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s ease-out, background 0.4s, box-shadow 0.4s, border-color 0.4s;
    position: relative;
    overflow: hidden; /* Empêche tout contenu enfant de déborder et de modifier la taille */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 3D Settings */
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
    z-index: 1;
    height: 160px; /* Fixe STRICTEMENT la hauteur pour empêcher tout étirement */
}

/* Effets Hover pour les cartes */
.subject-card:hover {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px); /* Glassmorphism intensifié */
    -webkit-backdrop-filter: blur(24px);
    z-index: 10;
}

/* Bordure néon au survol */
.subject-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    border: 1px solid currentColor;
    opacity: 0;
    transition: opacity 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    pointer-events: none;
    z-index: 2;
}

.subject-card:hover::before {
    opacity: 1;
    box-shadow: 0 0 18px currentColor;
}

/* Styles par matière (Glow) */
.subject-card[data-subject="maths"]:hover {
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
    border-color: rgba(0, 240, 255, 0.4);
    color: var(--neon-maths); /* Passe la couleur au before */
}
.subject-card[data-subject="maths"] { color: var(--neon-maths); } /* Pour currentColor */

.subject-card[data-subject="francais"]:hover {
    box-shadow: 0 0 30px rgba(176, 38, 255, 0.25);
    border-color: rgba(176, 38, 255, 0.4);
    color: var(--neon-francais);
}
.subject-card[data-subject="francais"] { color: var(--neon-francais); }

.subject-card[data-subject="anglais"]:hover {
    box-shadow: 0 0 34px rgba(79, 124, 255, 0.26), 0 0 70px rgba(255, 107, 138, 0.1);
    border-color: rgba(79, 124, 255, 0.45);
    color: var(--neon-anglais);
}
.subject-card[data-subject="anglais"] { color: var(--neon-anglais); }

.subject-card[data-subject="svt"]:hover {
    box-shadow: 0 0 35px rgba(0, 255, 102, 0.25), 0 0 70px rgba(0, 255, 102, 0.12);
    border-color: rgba(0, 255, 102, 0.45);
    color: var(--neon-svt);
}
.subject-card[data-subject="svt"] { color: var(--neon-svt); }

.subject-card[data-subject="physique"]:hover {
    box-shadow: 0 0 35px rgba(255, 94, 0, 0.28), 0 0 80px rgba(0, 183, 255, 0.12);
    border-color: rgba(255, 94, 0, 0.45);
    color: var(--neon-physique);
}
.subject-card[data-subject="physique"] { color: var(--neon-physique); }

/* Animations spécifiques : couches thématiques */
.animation-layer {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Animation spécifique : SVT Biomorph Pulse */
.bg-svt {
    opacity: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(0, 255, 102, 0.16) 0 12%, transparent 13%),
        radial-gradient(circle at 75% 30%, rgba(0, 255, 102, 0.12) 0 10%, transparent 11%),
        radial-gradient(circle at 65% 75%, rgba(120, 255, 180, 0.12) 0 14%, transparent 15%),
        radial-gradient(circle at 30% 78%, rgba(0, 255, 102, 0.10) 0 10%, transparent 11%),
        linear-gradient(135deg, rgba(0, 255, 102, 0.06), transparent 55%);
    filter: saturate(1.15);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.subject-card[data-subject="svt"]:hover {
    animation: svtCardBreath 3.2s ease-in-out infinite;
}

.subject-card[data-subject="svt"]:hover .bg-svt {
    opacity: 1;
    transform: scale(1.03);
}

.svt-wave {
    position: absolute;
    left: -20%;
    top: 56%;
    width: 140%;
    height: 48px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 60' preserveAspectRatio='none'><path d='M0 35 L40 35 L70 35 L90 16 L110 50 L136 8 L160 35 L205 35 L224 24 L242 42 L260 35 L320 35' fill='none' stroke='rgba(150,255,200,0.95)' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 100% 100% no-repeat;
    opacity: 0;
    filter: drop-shadow(0 0 6px rgba(120, 255, 190, 0.7));
}

.subject-card[data-subject="svt"]:hover .svt-wave {
    animation: svtWaveScan 2.8s linear infinite;
}

.svt-cell {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(180, 255, 220, 0.28);
    background:
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.28), rgba(120, 255, 180, 0.12) 35%, rgba(0, 255, 102, 0.02) 70%);
    box-shadow: inset 0 0 18px rgba(180, 255, 220, 0.18), 0 0 18px rgba(0, 255, 102, 0.12);
    opacity: 0;
    transform: scale(0.7);
}

.subject-card[data-subject="svt"]:hover .svt-cell {
    animation: svtCellFloat 5.5s ease-in-out infinite;
}

.svt-cell-1 {
    width: 34px;
    height: 34px;
    top: 18%;
    left: 12%;
    animation-delay: 0s;
}

.svt-cell-2 {
    width: 26px;
    height: 26px;
    top: 62%;
    left: 22%;
    animation-delay: 0.8s;
}

.svt-cell-3 {
    width: 44px;
    height: 44px;
    top: 20%;
    right: 14%;
    animation-delay: 1.4s;
}

.svt-cell-4 {
    width: 30px;
    height: 30px;
    bottom: 16%;
    right: 28%;
    animation-delay: 2s;
}

@keyframes svtCardBreath {
    0%, 100% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
        box-shadow: 0 0 25px rgba(0, 255, 102, 0.18), 0 0 50px rgba(0, 255, 102, 0.08);
    }
    50% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.03);
        box-shadow: 0 0 42px rgba(0, 255, 102, 0.32), 0 0 90px rgba(0, 255, 102, 0.16);
    }
}

@keyframes svtWaveScan {
    0% {
        transform: translateX(-18%) scaleY(0.92);
        opacity: 0;
    }
    15% {
        opacity: 0.95;
    }
    70% {
        opacity: 0.9;
    }
    100% {
        transform: translateX(10%) scaleY(1.05);
        opacity: 0;
    }
}

@keyframes svtCellFloat {
    0%, 100% {
        opacity: 0.2;
        transform: translateY(10px) scale(0.78);
    }
    30% {
        opacity: 0.65;
        transform: translateY(-6px) scale(1);
    }
    60% {
        opacity: 0.45;
        transform: translateY(-14px) scale(1.08);
    }
}

/* Animation spécifique : Maths Vision Géométrique */
.bg-maths {
    opacity: 0;
    background:
        radial-gradient(circle at 18% 20%, rgba(0, 240, 255, 0.12), transparent 18%),
        radial-gradient(circle at 82% 26%, rgba(0, 240, 255, 0.10), transparent 16%),
        linear-gradient(135deg, rgba(0, 240, 255, 0.07), transparent 55%);
    transition: opacity 0.45s ease, transform 0.45s ease;
    filter: blur(0.4px);
}

.subject-card[data-subject="maths"]:hover .bg-maths { 
    opacity: 1; 
    transform: scale(1.04);
}

.subject-card[data-subject="maths"]:hover {
    animation: mathsCardLift 3.6s ease-in-out infinite;
}

.maths-grid,
.maths-curve,
.maths-shape,
.maths-formula {
    position: absolute;
}

.maths-grid {
    inset: -8%;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.12) 1px, transparent 1px);
    background-size: 30px 30px;
    opacity: 0;
}

.subject-card[data-subject="maths"]:hover .maths-grid {
    animation: mathsGridShift 6s linear infinite;
}

.maths-curve {
    left: -12%;
    bottom: 14%;
    width: 140%;
    height: 70px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 80' preserveAspectRatio='none'><path d='M0 64 C48 60 72 18 110 18 C152 18 162 65 207 65 C248 65 275 30 320 10' fill='none' stroke='rgba(150,245,255,0.95)' stroke-width='3.5' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat;
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.55));
}

.subject-card[data-subject="maths"]:hover .maths-curve {
    animation: mathsCurveDraw 3.2s ease-in-out infinite;
}

.maths-shape {
    border: 1px solid rgba(150, 245, 255, 0.4);
    opacity: 0;
}

.maths-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    top: 18%;
    right: 10%;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.18);
}

.maths-triangle {
    width: 58px;
    height: 58px;
    left: 11%;
    bottom: 18%;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.12);
}

.subject-card[data-subject="maths"]:hover .maths-circle {
    animation: mathsShapeRotate 7s linear infinite;
}

.subject-card[data-subject="maths"]:hover .maths-triangle {
    animation: mathsShapePulse 4.5s ease-in-out infinite;
}

.maths-formula {
    color: rgba(180, 250, 255, 0.92);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
    opacity: 0;
    transform: translateY(12px) scale(0.85);
}

.formula-1 {
    top: 16%;
    left: 12%;
    font-size: 1.1rem;
}

.formula-2 {
    top: 18%;
    left: 43%;
    font-size: 1.5rem;
}

.formula-3 {
    bottom: 20%;
    right: 14%;
    font-size: 1rem;
}

.formula-4 {
    top: 48%;
    right: 28%;
    font-size: 1.1rem;
}

.formula-5 {
    bottom: 16%;
    left: 28%;
    font-size: 0.95rem;
}

.subject-card[data-subject="maths"]:hover .formula-1 {
    animation: mathsFormulaFloat 4.6s ease-in-out infinite;
}

.subject-card[data-subject="maths"]:hover .formula-2 {
    animation: mathsFormulaFloat 4.2s ease-in-out infinite 0.4s;
}

.subject-card[data-subject="maths"]:hover .formula-3 {
    animation: mathsFormulaFloat 4.8s ease-in-out infinite 0.8s;
}

.subject-card[data-subject="maths"]:hover .formula-4 {
    animation: mathsFormulaFloat 4s ease-in-out infinite 1.1s;
}

.subject-card[data-subject="maths"]:hover .formula-5 {
    animation: mathsFormulaFloat 4.4s ease-in-out infinite 1.5s;
}

@keyframes mathsCardLift {
    0%, 100% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.16), 0 0 45px rgba(0, 240, 255, 0.08);
    }
    50% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.03);
        box-shadow: 0 0 38px rgba(0, 240, 255, 0.28), 0 0 82px rgba(0, 240, 255, 0.16);
    }
}

@keyframes mathsGridShift {
    0% {
        opacity: 0.18;
        transform: translate(-8px, 6px) scale(1);
    }
    50% {
        opacity: 0.32;
        transform: translate(6px, -6px) scale(1.04);
    }
    100% {
        opacity: 0.18;
        transform: translate(-8px, 6px) scale(1);
    }
}

@keyframes mathsCurveDraw {
    0% {
        opacity: 0;
        transform: translateY(10px) scaleX(0.92);
    }
    25% {
        opacity: 0.95;
    }
    70% {
        opacity: 0.85;
    }
    100% {
        opacity: 0;
        transform: translateY(-8px) scaleX(1.05);
    }
}

@keyframes mathsShapeRotate {
    0% {
        opacity: 0.2;
        transform: rotate(0deg) scale(0.88);
    }
    50% {
        opacity: 0.55;
        transform: rotate(180deg) scale(1);
    }
    100% {
        opacity: 0.2;
        transform: rotate(360deg) scale(0.88);
    }
}

@keyframes mathsShapePulse {
    0%, 100% {
        opacity: 0.18;
        transform: rotate(-6deg) scale(0.82);
    }
    50% {
        opacity: 0.52;
        transform: rotate(6deg) scale(1.06);
    }
}

@keyframes mathsFormulaFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(14px) scale(0.82);
    }
    25% {
        opacity: 0.9;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 0.65;
        transform: translateY(-12px) scale(1.06);
    }
}

/* Animation spécifique : Français Calligraphie Vivante */
.bg-francais {
    opacity: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 38%),
        linear-gradient(135deg, rgba(176, 38, 255, 0.10), transparent 60%);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.subject-card[data-subject="francais"]:hover .bg-francais {
    opacity: 1;
    transform: scale(1.03);
}

.subject-card[data-subject="francais"]:hover {
    animation: francaisCardDrift 3.4s ease-in-out infinite;
}

.francais-ink,
.francais-line,
.francais-quote {
    position: absolute;
}

.francais-ink {
    inset: auto 8% 8% auto;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at 50% 50%, rgba(176, 38, 255, 0.18), rgba(176, 38, 255, 0.06) 45%, transparent 72%);
    filter: blur(4px);
    opacity: 0;
}

.subject-card[data-subject="francais"]:hover .francais-ink {
    animation: francaisInkBloom 3.8s ease-in-out infinite;
}

.francais-line {
    left: 8%;
    right: 8%;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(220, 180, 255, 0.55), transparent);
    opacity: 0;
    transform-origin: left center;
}

.francais-line-1 {
    top: 28%;
}

.francais-line-2 {
    top: 48%;
}

.francais-line-3 {
    top: 68%;
}

.subject-card[data-subject="francais"]:hover .francais-line-1 {
    animation: francaisLineWrite 2.8s ease-in-out infinite;
}

.subject-card[data-subject="francais"]:hover .francais-line-2 {
    animation: francaisLineWrite 2.8s ease-in-out infinite 0.35s;
}

.subject-card[data-subject="francais"]:hover .francais-line-3 {
    animation: francaisLineWrite 2.8s ease-in-out infinite 0.7s;
}

.francais-quote {
    color: rgba(245, 210, 255, 0.95);
    font-family: 'Times New Roman', serif;
    font-size: 3rem;
    text-shadow: 0 0 18px rgba(176, 38, 255, 0.5);
    opacity: 0;
}

.quote-open {
    top: 10%;
    left: 10%;
}

.quote-close {
    right: 10%;
    bottom: 2%;
}

.subject-card[data-subject="francais"]:hover .quote-open {
    animation: francaisQuoteFloat 3.6s ease-in-out infinite;
}

.subject-card[data-subject="francais"]:hover .quote-close {
    animation: francaisQuoteFloat 3.6s ease-in-out infinite 0.8s reverse;
}

@keyframes francaisCardDrift {
    0%, 100% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
        box-shadow: 0 0 20px rgba(176, 38, 255, 0.16), 0 0 42px rgba(176, 38, 255, 0.08);
    }
    50% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.03);
        box-shadow: 0 0 34px rgba(176, 38, 255, 0.28), 0 0 78px rgba(176, 38, 255, 0.14);
    }
}

@keyframes francaisInkBloom {
    0%, 100% {
        opacity: 0.1;
        transform: translate(6px, 10px) scale(0.78);
    }
    50% {
        opacity: 0.55;
        transform: translate(-8px, -4px) scale(1.08);
    }
}

@keyframes francaisLineWrite {
    0% {
        opacity: 0;
        transform: scaleX(0.08) translateY(0);
    }
    18% {
        opacity: 0.7;
    }
    60% {
        opacity: 0.9;
        transform: scaleX(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scaleX(0.92) translateY(-4px);
    }
}

@keyframes francaisQuoteFloat {
    0%, 100% {
        opacity: 0.18;
        transform: translateY(10px) rotate(-8deg) scale(0.86);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-8px) rotate(6deg) scale(1.04);
    }
}

/* Animation spécifique : Anglais Neon Lexicon */
.bg-anglais {
    opacity: 0;
    background:
        linear-gradient(135deg, rgba(79, 124, 255, 0.12), transparent 54%),
        radial-gradient(circle at 82% 22%, rgba(255, 107, 138, 0.12), transparent 18%),
        radial-gradient(circle at 18% 78%, rgba(127, 214, 255, 0.12), transparent 18%);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.subject-card[data-subject="anglais"]:hover .bg-anglais {
    opacity: 1;
    transform: scale(1.04);
}

.subject-card[data-subject="anglais"]:hover {
    animation: anglaisCardDialogue 3.5s ease-in-out infinite;
}

.anglais-notebook,
.anglais-bubble,
.anglais-chip,
.anglais-underline {
    position: absolute;
}

.anglais-notebook {
    inset: 12% 8%;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 30%),
        repeating-linear-gradient(180deg, rgba(127, 214, 255, 0.12) 0 2px, transparent 2px 14px);
    opacity: 0;
}

.subject-card[data-subject="anglais"]:hover .anglais-notebook {
    animation: anglaisNotebookGlow 3.4s ease-in-out infinite;
}

.anglais-bubble {
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(127, 214, 255, 0.24);
    color: rgba(236, 244, 255, 0.96);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(79, 124, 255, 0.32);
    opacity: 0;
}

.anglais-bubble::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    bottom: -4px;
    left: 18px;
    background: rgba(15, 23, 42, 0.78);
    border-right: 1px solid rgba(127, 214, 255, 0.2);
    border-bottom: 1px solid rgba(127, 214, 255, 0.2);
    transform: rotate(45deg);
}

.anglais-bubble-1 {
    top: 14%;
    left: 10%;
}

.anglais-bubble-2 {
    top: 28%;
    right: 9%;
}

.anglais-bubble-3 {
    bottom: 24%;
    left: 24%;
}

.subject-card[data-subject="anglais"]:hover .anglais-bubble-1 {
    animation: anglaisBubbleTalk 3.6s ease-in-out infinite;
}

.subject-card[data-subject="anglais"]:hover .anglais-bubble-2 {
    animation: anglaisBubbleTalk 3.6s ease-in-out infinite 0.45s;
}

.subject-card[data-subject="anglais"]:hover .anglais-bubble-3 {
    animation: anglaisBubbleTalk 3.6s ease-in-out infinite 0.9s;
}

.anglais-chip {
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    background: rgba(79, 124, 255, 0.12);
    border: 1px solid rgba(79, 124, 255, 0.26);
    color: rgba(214, 232, 255, 0.94);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-shadow: 0 0 10px rgba(79, 124, 255, 0.3);
    opacity: 0;
    transform: translateY(10px) scale(0.8);
}

.anglais-chip-1 {
    top: 14%;
    left: 7%;
}

.anglais-chip-2 {
    bottom: 14%;
    right: 16%;
}

.subject-card[data-subject="anglais"]:hover .anglais-chip-1 {
    animation: anglaisChipPulse 3.4s ease-in-out infinite;
}

.subject-card[data-subject="anglais"]:hover .anglais-chip-2 {
    animation: anglaisChipPulse 3.4s ease-in-out infinite 0.7s;
}

.anglais-underline {
    left: 12%;
    right: 12%;
    bottom: 18%;
    height: 14px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 40' preserveAspectRatio='none'><path d='M6 28 C42 10 76 10 112 28 C148 38 180 38 216 28 C250 18 282 18 314 28' fill='none' stroke='rgba(127,214,255,0.95)' stroke-width='3.2' stroke-linecap='round'/></svg>") center / 100% 100% no-repeat;
    opacity: 0;
    filter: drop-shadow(0 0 8px rgba(79, 124, 255, 0.36));
}

.subject-card[data-subject="anglais"]:hover .anglais-underline {
    animation: anglaisUnderlineSpeak 2.9s ease-in-out infinite;
}

@keyframes anglaisCardDialogue {
    0%, 100% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
        box-shadow: 0 0 22px rgba(79, 124, 255, 0.16), 0 0 44px rgba(255, 107, 138, 0.06);
    }
    50% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.035);
        box-shadow: 0 0 38px rgba(79, 124, 255, 0.28), 0 0 74px rgba(255, 107, 138, 0.12);
    }
}

@keyframes anglaisNotebookGlow {
    0% {
        opacity: 0;
        transform: scale(0.96);
    }
    28% {
        opacity: 0.82;
    }
    72% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: scale(1.02);
    }
}

@keyframes anglaisBubbleTalk {
    0%, 100% {
        opacity: 0;
        transform: translateY(10px) scale(0.82);
    }
    22% {
        opacity: 0.94;
        transform: translateY(0) scale(1);
    }
    68% {
        opacity: 0.68;
        transform: translateY(-8px) scale(1.04);
    }
}

@keyframes anglaisChipPulse {
    0%, 100% {
        opacity: 0;
        transform: translateY(10px) scale(0.82);
    }
    24% {
        opacity: 0.85;
        transform: translateY(0) scale(1);
    }
    64% {
        opacity: 0.58;
        transform: translateY(-6px) scale(1.06);
    }
}

@keyframes anglaisUnderlineSpeak {
    0%, 100% {
        opacity: 0;
        transform: translateY(8px) scaleX(0.92);
    }
    28% {
        opacity: 0.95;
        transform: translateY(0) scaleX(1);
    }
    70% {
        opacity: 0.6;
        transform: translateY(-4px) scaleX(1.04);
    }
}

/* Animation spécifique : Physique-Chimie Atomique */
.subject-card[data-subject="physique"] {
    position: relative;
}

.bg-physique {
    opacity: 0;
    background:
        radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 140, 0, 0.32), transparent 26%),
        radial-gradient(circle at 24% 78%, rgba(0, 183, 255, 0.16), transparent 18%),
        radial-gradient(circle at 78% 22%, rgba(255, 94, 0, 0.18), transparent 20%),
        linear-gradient(135deg, rgba(255, 94, 0, 0.08), rgba(0, 183, 255, 0.03) 55%, transparent);
    transition: opacity 0.35s ease, transform 0.35s ease;
    mix-blend-mode: screen;
}

.subject-card[data-subject="physique"]:hover .bg-physique {
    opacity: 1;
    transform: scale(1.04);
}

.subject-card[data-subject="physique"]:hover {
    animation: physicsCardCharge 3.6s ease-in-out infinite;
}

.atom-core,
.atom-orbit,
.energy-particle {
    position: absolute;
    top: 50%;
    left: 50%;
}

.atom-core {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 196, 0, 0.9) 30%, rgba(255, 94, 0, 0.55) 65%, transparent 100%);
    box-shadow: 0 0 18px rgba(255, 196, 0, 0.75), 0 0 35px rgba(255, 94, 0, 0.45);
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
}

.subject-card[data-subject="physique"]:hover .atom-core {
    animation: atomCorePulse 2.4s ease-in-out infinite;
}

.atom-orbit {
    border: 1px solid rgba(255, 190, 120, 0.28);
    border-radius: 50%;
    opacity: 0;
}

.orbit-1 {
    width: 90px;
    height: 42px;
    transform: translate(-50%, -50%) rotate(18deg);
}

.orbit-2 {
    width: 92px;
    height: 44px;
    transform: translate(-50%, -50%) rotate(82deg);
}

.orbit-3 {
    width: 78px;
    height: 36px;
    transform: translate(-50%, -50%) rotate(-32deg);
}

.subject-card[data-subject="physique"]:hover .orbit-1 {
    animation: orbitGlow1 4.5s linear infinite;
}

.subject-card[data-subject="physique"]:hover .orbit-2 {
    animation: orbitGlow2 5.2s linear infinite;
}

.subject-card[data-subject="physique"]:hover .orbit-3 {
    animation: orbitGlow3 3.8s linear infinite;
}

.energy-particle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(0, 183, 255, 0.75) 55%, rgba(255, 94, 0, 0.25) 100%);
    box-shadow: 0 0 12px rgba(0, 183, 255, 0.8), 0 0 20px rgba(255, 94, 0, 0.25);
    opacity: 0;
}

.subject-card[data-subject="physique"]:hover .particle-1 {
    animation: electronSpin1 4s linear infinite;
}

.subject-card[data-subject="physique"]:hover .particle-2 {
    animation: electronSpin2 5.3s linear infinite;
}

.subject-card[data-subject="physique"]:hover .particle-3 {
    animation: electronSpin3 3.6s linear infinite;
}

@keyframes physicsCardCharge {
    0%, 100% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1);
    }
    50% {
        transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1.04);
    }
}

@keyframes atomCorePulse {
    0%, 100% {
        opacity: 0.55;
        transform: translate(-50%, -50%) scale(0.82);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.08);
    }
}

@keyframes orbitGlow1 {
    0% {
        opacity: 0.3;
        box-shadow: 0 0 0 rgba(255, 94, 0, 0);
        transform: translate(-50%, -50%) rotate(18deg);
    }
    100% {
        opacity: 0.9;
        box-shadow: 0 0 16px rgba(255, 94, 0, 0.3);
        transform: translate(-50%, -50%) rotate(378deg);
    }
}

@keyframes orbitGlow2 {
    0% {
        opacity: 0.25;
        box-shadow: 0 0 0 rgba(0, 183, 255, 0);
        transform: translate(-50%, -50%) rotate(82deg);
    }
    100% {
        opacity: 0.85;
        box-shadow: 0 0 18px rgba(0, 183, 255, 0.28);
        transform: translate(-50%, -50%) rotate(-278deg);
    }
}

@keyframes orbitGlow3 {
    0% {
        opacity: 0.2;
        box-shadow: 0 0 0 rgba(255, 196, 0, 0);
        transform: translate(-50%, -50%) rotate(-32deg);
    }
    100% {
        opacity: 0.8;
        box-shadow: 0 0 14px rgba(255, 196, 0, 0.24);
        transform: translate(-50%, -50%) rotate(328deg);
    }
}

@keyframes electronSpin1 {
    0% {
        opacity: 0.1;
        transform: translate(-50%, -50%) rotate(0deg) translateX(46px) scale(0.85);
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 0.75;
        transform: translate(-50%, -50%) rotate(360deg) translateX(46px) scale(1);
    }
}

@keyframes electronSpin2 {
    0% {
        opacity: 0.1;
        transform: translate(-50%, -50%) rotate(120deg) translateX(38px) scale(0.72);
    }
    20% {
        opacity: 0.9;
    }
    100% {
        opacity: 0.7;
        transform: translate(-50%, -50%) rotate(-240deg) translateX(38px) scale(0.95);
    }
}

@keyframes electronSpin3 {
    0% {
        opacity: 0.1;
        transform: translate(-50%, -50%) rotate(-60deg) translateX(54px) scale(0.9);
    }
    18% {
        opacity: 0.95;
    }
    100% {
        opacity: 0.75;
        transform: translate(-50%, -50%) rotate(300deg) translateX(54px) scale(1.02);
    }
}

/* Animation spécifique : Français Floating Fragments */
.floating-letter {
    position: absolute; /* Sortie complète du flux normal */
    color: var(--neon-francais);
    opacity: 0;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    font-size: 2.2rem;
    pointer-events: none; /* Ignore les clics */
    z-index: 0; /* Passe derrière le contenu */
    text-shadow: 0 0 15px var(--neon-francais), 0 0 5px #fff;
    /* On démarre bas avec un léger flou */
    transform: translateY(30px) rotate(0deg) scale(0.5);
    filter: blur(2px);
    /* Placement strict */
    bottom: 10%; /* Part légèrement au-dessus du bas */
    left: 50%;
    margin: 0;
    padding: 0;
    display: block; /* Évite les comportements inline bizarres */
    white-space: nowrap;
}

/* 3 variantes d'animation pour plus de naturel et éviter les TP (Téléportations) */
.float-var-1 { animation: floatUpSmooth1 4.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.float-var-2 { animation: floatUpSmooth2 4.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }
.float-var-3 { animation: floatUpSmooth3 4.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

@keyframes floatUpSmooth1 {
    0% { transform: translateY(34px) translateX(0) rotate(-12deg) scale(0.55); opacity: 0; filter: blur(3px); }
    22% { opacity: 0.95; filter: blur(0); transform: translateY(4px) translateX(-18px) rotate(-6deg) scale(1); }
    72% { opacity: 0.9; filter: blur(0); transform: translateY(-62px) translateX(12px) rotate(10deg) scale(1.02); }
    100% { transform: translateY(-104px) translateX(24px) rotate(18deg) scale(0.88); opacity: 0; filter: blur(4px); }
}

@keyframes floatUpSmooth2 {
    0% { transform: translateY(24px) translateX(0) rotate(8deg) scale(0.6); opacity: 0; filter: blur(2px); }
    25% { opacity: 1; filter: blur(0); transform: translateY(-8px) translateX(18px) rotate(14deg) scale(1.02); }
    74% { opacity: 0.95; filter: blur(0); transform: translateY(-58px) translateX(-14px) rotate(-8deg) scale(1.04); }
    100% { transform: translateY(-98px) translateX(-22px) rotate(-16deg) scale(0.86); opacity: 0; filter: blur(3px); }
}

@keyframes floatUpSmooth3 {
    0% { transform: translateY(38px) translateX(0) rotate(0deg) scale(0.48); opacity: 0; filter: blur(3px); }
    30% { opacity: 0.88; filter: blur(0); transform: translateY(2px) translateX(-6px) rotate(-8deg) scale(1.08); }
    70% { opacity: 0.88; filter: blur(0); transform: translateY(-56px) translateX(16px) rotate(4deg) scale(1.05); }
    100% { transform: translateY(-94px) translateX(8px) rotate(12deg) scale(0.9); opacity: 0; filter: blur(2px); }
}

/* Protection du contenu de la carte */
.subject-card > :not(.floating-letter):not(.animation-layer):not(.ripple) {
    z-index: 2;
    position: relative;
    color: var(--text-primary); /* Rétablit la couleur de texte normale */
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-container {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.05);
}

/* Couleurs des icônes */
.neon-maths { color: var(--neon-maths); box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.1); }
.neon-francais { color: var(--neon-francais); box-shadow: inset 0 0 15px rgba(176, 38, 255, 0.1); }
.neon-anglais { color: var(--neon-anglais); box-shadow: inset 0 0 15px rgba(79, 124, 255, 0.12); }
.neon-svt { color: var(--neon-svt); box-shadow: inset 0 0 15px rgba(0, 255, 102, 0.1); }
.neon-physique { color: var(--neon-physique); box-shadow: inset 0 0 15px rgba(255, 94, 0, 0.1); }

.english-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.35rem;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.18), rgba(255, 107, 138, 0.1));
    border: 1px solid rgba(127, 214, 255, 0.22);
    color: #eef6ff;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-shadow: 0 0 10px rgba(79, 124, 255, 0.3);
    box-shadow: 0 0 16px rgba(79, 124, 255, 0.14);
}

.subject-card h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* Barres de progression */
.progress-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 10px;
}

.neon-maths-bar .progress-fill { background: var(--neon-maths); box-shadow: 0 0 8px var(--neon-maths); }
.neon-francais-bar .progress-fill { background: var(--neon-francais); box-shadow: 0 0 8px var(--neon-francais); }
.neon-anglais-bar .progress-fill { background: var(--neon-anglais); box-shadow: 0 0 8px var(--neon-anglais); }
.neon-svt-bar .progress-fill { background: var(--neon-svt); box-shadow: 0 0 8px var(--neon-svt); }
.neon-physique-bar .progress-fill { background: var(--neon-physique); box-shadow: 0 0 8px var(--neon-physique); }

/* ==========================================
   Zone de Travail (Workspace)
   ========================================== */
.workspace {
    min-height: 500px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.workspace-content {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    transition: opacity 0.3s ease;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
}

.empty-state .pulse-icon {
    font-size: 4rem;
    animation: pulse 2s infinite ease-in-out;
}

.empty-state h3 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

/* ==========================================
   Animations et Micro-Interactions (Onde de choc & Blur-in)
   ========================================== */
/* Onde de choc (Ripple) */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleAnim 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
    z-index: 50;
}

@keyframes rippleAnim {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Spring Click */
.spring-click {
    animation: springBounce var(--anim-speed) var(--anim-bounce) forwards !important;
}

@keyframes springBounce {
    0% { transform: scale(1); }
    40% { transform: scale(0.92); }
    100% { transform: scale(1); }
}

/* Spring Click spécifique pour les cartes (garde la 3D) */
.subject-card.spring-click {
    animation: springBounceCard var(--anim-speed) var(--anim-bounce) forwards !important;
}

@keyframes springBounceCard {
    0% { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1); }
    40% { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(0.92); }
    100% { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(1); }
}

/* Effet d'apparition Blur-in Slide-up */
.blur-slide-up {
    animation: blurSlideUp var(--anim-speed) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes blurSlideUp {
    0% { 
        opacity: 0; 
        filter: blur(15px); 
        transform: translateY(30px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        filter: blur(0); 
        transform: translateY(0) scale(1); 
    }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 0.8; }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Spinner de chargement (Loader CSS pur) */
.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--neon-maths); /* Changé en JS selon la matière */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Composant dynamique injecté via JS */
.active-session {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    animation: fadeInUp 0.5s ease forwards;
}

.active-session h2 {
    font-size: 2.5rem;
    background: -webkit-linear-gradient(45deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Boutons Interactifs (Start & Options Quiz) - Animations AAA */
.start-btn {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Effet Glow Sweep sur le bouton Start */
.start-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    transition: all 0.6s ease;
    z-index: 1;
}

.start-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4), 0 0 20px currentColor;
    letter-spacing: 3px;
}

.start-btn:hover::before {
    left: 200%;
    transition: all 0.8s ease;
}

.start-btn span {
    position: relative;
    z-index: 2;
}

/* Workspace : vue matiere et modules */
.subject-session {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.subject-session-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.subject-main-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.subject-main-info h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.subject-main-info p {
    color: var(--text-secondary);
    max-width: 720px;
}

.subject-emoji {
    font-size: 3rem;
}

.subject-level-panel {
    padding: 1.25rem 1.35rem;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--subject-color) 45%, rgba(255, 255, 255, 0.08));
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--subject-color) 12%, rgba(255, 255, 255, 0.03)), rgba(255, 255, 255, 0.03)),
        rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.02);
}

.subject-level-copy {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.subject-level-copy strong {
    font-size: 1.1rem;
}

.subject-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--subject-color) 60%, rgba(255, 255, 255, 0.2));
    color: var(--text-primary);
    background: color-mix(in srgb, var(--subject-color) 14%, transparent);
    font-size: 0.9rem;
    font-weight: 600;
}

.subject-level-meter,
.workspace-progress-bar,
.quiz-run-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.subject-level-meter-fill,
.workspace-progress-fill,
.quiz-run-progress-fill {
    height: 100%;
    border-radius: inherit;
}

.subject-level-panel p,
.workspace-progress span {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.subject-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}

.subject-stat-pill,
.quiz-session-pill,
.quiz-result-pill {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.015);
}

.subject-stat-pill strong,
.quiz-session-pill strong,
.quiz-result-pill strong {
    display: block;
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.subject-stat-pill span,
.quiz-session-pill span,
.quiz-result-pill span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.workspace-progress {
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 260px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.module-card.unlocked:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.module-card.current {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 18px 34px rgba(0, 0, 0, 0.18);
}

.module-card.completed {
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.08), rgba(255, 255, 255, 0.03));
}

.module-card.locked {
    opacity: 0.68;
}

.module-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.module-level-tag,
.quiz-chip,
.quiz-results-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

.module-status {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.module-card h3 {
    font-size: 1.15rem;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.module-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.module-card-meta span {
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.module-play-btn {
    margin-top: auto;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--module-color) 55%, rgba(255, 255, 255, 0.2));
    background: color-mix(in srgb, var(--module-color) 12%, rgba(255, 255, 255, 0.02));
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.module-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px color-mix(in srgb, var(--module-color) 18%, rgba(0, 0, 0, 0.22));
}

.module-locked-note {
    margin-top: auto;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .top-nav {
        flex-direction: column;
        gap: 1rem;
        position: relative;
        top: 0;
    }
    
    .subjects-grid {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .time-display {
        font-size: 1.2rem;
    }
}

/* ==========================================
   Quiz Plein Écran (QCM)
   ========================================== */
.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: none; /* Masqué par défaut */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.quiz-overlay.active {
    opacity: 1;
}

.quiz-container {
    width: 90%;
    max-width: 800px;
    padding: 3rem;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-height: 90vh;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.quiz-overlay.active .quiz-container {
    transform: translateY(0);
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.quiz-header h2 {
    font-size: 2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.quiz-content {
    transition: opacity 0.22s ease;
}

.quiz-meta,
.quiz-question-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quiz-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.quiz-question {
    font-size: 1.4rem;
    text-align: center;
    font-weight: 500;
    line-height: 1.6;
}

.quiz-part-title {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.quiz-question-panel {
    padding: 1.2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.quiz-session-grid,
.quiz-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
    align-items: stretch;
    grid-auto-rows: 1fr;
    overflow: visible;
}

.quiz-option-slot {
    position: relative;
    min-height: 104px;
    height: 100%;
    aspect-ratio: 2.75 / 1;
    overflow: visible;
}

.quiz-option-btn {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.08), transparent 28%);
    border: none;
    outline: 4px solid transparent;
    outline-offset: -4px;
    padding: 1.35rem 1.4rem 1.35rem 1.7rem;
    border-radius: 18px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        outline-color 0.2s ease;
    text-align: left;
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
    isolation: isolate;
    width: 100%;
    box-sizing: border-box;
    contain: layout paint;
    transform: scale(1);
    transform-origin: center;
    will-change: transform;
    z-index: 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 0 0 rgba(0, 0, 0, 0);
}

.quiz-option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 6px;
    border-radius: 0 12px 12px 0;
    background: linear-gradient(180deg, transparent, currentColor 22%, #ffffff 50%, currentColor 78%, transparent);
    opacity: 0.45;
}

.quiz-option-btn::after {
    content: none;
}

.quiz-option-btn:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04)),
        radial-gradient(circle at 16% 50%, color-mix(in srgb, currentColor 16%, transparent), transparent 32%);
    outline-color: color-mix(in srgb, currentColor 45%, transparent);
    transform: scale(1.03);
    z-index: 10;
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, currentColor 28%, rgba(255, 255, 255, 0.16)),
        0 0 26px color-mix(in srgb, currentColor 18%, transparent);
}

.quiz-option-btn:hover:not(:disabled)::before {
    opacity: 0.72;
    box-shadow: 0 0 8px currentColor;
}

.quiz-option-btn > span {
    position: relative;
    z-index: 2;
}

.quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 10px currentColor;
}

.quiz-option-btn:active {
    outline-color: color-mix(in srgb, currentColor 52%, transparent);
    transform: scale(0.97);
    z-index: 10;
}

.quiz-option-btn:disabled {
    cursor: default;
}

.quiz-overlay[data-subject="maths"] .quiz-option-btn:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(255, 255, 255, 0.04)),
        repeating-linear-gradient(90deg, rgba(0, 240, 255, 0.08) 0 1px, transparent 1px 24px),
        radial-gradient(circle at 18% 50%, rgba(0, 240, 255, 0.18), transparent 34%);
    outline-color: rgba(0, 240, 255, 0.4);
    box-shadow:
        inset 0 0 0 1px rgba(0, 240, 255, 0.28),
        0 0 24px rgba(0, 240, 255, 0.2);
}

.quiz-overlay[data-subject="maths"] .quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(176, 38, 255, 0.16), rgba(255, 255, 255, 0.04)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 42%),
        radial-gradient(circle at 15% 55%, rgba(176, 38, 255, 0.16), transparent 34%);
    outline-color: rgba(176, 38, 255, 0.38);
    box-shadow:
        inset 0 0 0 1px rgba(176, 38, 255, 0.28),
        0 0 24px rgba(176, 38, 255, 0.18);
}

.quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled)::before {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.9) 38%, currentColor 68%, transparent);
}

.quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 16px rgba(176, 38, 255, 0.26);
}

.quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(79, 124, 255, 0.18), rgba(255, 255, 255, 0.04)),
        linear-gradient(90deg, rgba(255, 107, 138, 0.08), transparent 40%, rgba(127, 214, 255, 0.08) 100%),
        radial-gradient(circle at 18% 50%, rgba(127, 214, 255, 0.18), transparent 32%);
    outline-color: rgba(79, 124, 255, 0.42);
    box-shadow:
        inset 0 0 0 1px rgba(79, 124, 255, 0.28),
        0 0 24px rgba(79, 124, 255, 0.18);
}

.quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled)::before {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.92) 34%, #7fd6ff 54%, currentColor 78%, transparent);
}

.quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 15px rgba(79, 124, 255, 0.28), 0 0 8px rgba(255, 107, 138, 0.16);
}

.quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled) {
    background:
        radial-gradient(circle at 14% 50%, rgba(0, 255, 102, 0.2), transparent 32%),
        linear-gradient(135deg, rgba(0, 255, 102, 0.14), rgba(255, 255, 255, 0.04)),
        radial-gradient(circle at 82% 25%, rgba(150, 255, 200, 0.08), transparent 20%);
    outline-color: rgba(0, 255, 102, 0.38);
    box-shadow:
        inset 0 0 0 1px rgba(0, 255, 102, 0.28),
        0 0 24px rgba(0, 255, 102, 0.18);
}

.quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled)::before {
    border-radius: 0 12px 12px 0;
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.45);
}

.quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 14px rgba(0, 255, 102, 0.28);
}

.quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled) {
    background:
        linear-gradient(135deg, rgba(255, 94, 0, 0.18), rgba(255, 255, 255, 0.04)),
        radial-gradient(circle at 18% 50%, rgba(255, 174, 0, 0.18), transparent 30%),
        linear-gradient(90deg, transparent 8%, rgba(0, 183, 255, 0.12) 48%, transparent 88%);
    outline-color: rgba(255, 140, 0, 0.38);
    box-shadow:
        inset 0 0 0 1px rgba(255, 140, 0, 0.28),
        0 0 24px rgba(255, 94, 0, 0.16);
}

.quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled)::before {
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.95) 34%, #00b7ff 54%, currentColor 76%, transparent);
}

.quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled) > span {
    text-shadow: 0 0 16px rgba(255, 140, 0, 0.24), 0 0 8px rgba(0, 183, 255, 0.18);
}

/* États de validation du QCM */
.quiz-option-btn.correct {
    background: rgba(0, 255, 102, 0.15) !important;
    outline: 4px solid rgba(0, 255, 102, 0.56);
    outline-offset: -4px;
    box-shadow:
        inset 0 0 0 1px rgba(0, 255, 102, 0.2),
        0 0 24px rgba(0, 255, 102, 0.2);
    animation: correctGlow 0.7s ease-out;
}

.quiz-option-btn.wrong {
    background: rgba(255, 0, 122, 0.15) !important;
    outline: 4px solid rgba(255, 0, 122, 0.56);
    outline-offset: -4px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 0, 122, 0.2),
        0 0 24px rgba(255, 0, 122, 0.18);
    animation: wrongGlow 0.5s ease-out;
}

.quiz-feedback {
    position: relative;
    min-height: 110px;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.quiz-feedback.show {
    opacity: 1;
}

.quiz-feedback-card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    border: none;
    outline: 1px solid rgba(255, 255, 255, 0.08);
    outline-offset: -1px;
    background: rgba(255, 255, 255, 0.04);
    text-align: left;
    box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.02);
}

.quiz-feedback-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
}

.quiz-feedback-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.feedback-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quiz-feedback.success {
    color: #00ff66;
}

.quiz-feedback.success .quiz-feedback-card {
    background: linear-gradient(135deg, rgba(0, 255, 102, 0.08), rgba(255, 255, 255, 0.03));
    outline: 2px solid rgba(0, 255, 102, 0.18);
    outline-offset: -2px;
}

.quiz-feedback.error {
    color: #ff7bb5;
}

.quiz-feedback.error .quiz-feedback-card {
    background: linear-gradient(135deg, rgba(255, 0, 122, 0.08), rgba(255, 255, 255, 0.03));
    outline: 2px solid rgba(255, 0, 122, 0.18);
    outline-offset: -2px;
}

.quiz-option-btn.locked-answer {
    opacity: 0.96;
    pointer-events: none;
}

.quiz-option-btn.locked-answer::before,
.quiz-option-btn.correct::before,
.quiz-option-btn.wrong::before,
.quiz-option-btn.reveal-correct::before {
    width: 6px !important;
    opacity: 0.7;
    box-shadow: none !important;
}

.quiz-option-btn.locked-answer > span,
.quiz-option-btn.correct > span,
.quiz-option-btn.wrong > span,
.quiz-option-btn.reveal-correct > span {
    animation: none !important;
    letter-spacing: normal !important;
    text-shadow: none !important;
}

.quiz-option-btn.reveal-correct {
    animation: revealCorrect 0.9s ease-out;
}

.quiz-content.success-flash {
    animation: successFlash 0.65s ease;
}

.quiz-results {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    animation: fadeInUp 0.5s ease forwards;
}

.quiz-results h3 { font-size: 2.5rem; }
.quiz-results p { font-size: 1.2rem; color: var(--text-secondary); }
.quiz-results .score { font-size: 4rem; font-weight: 700; color: var(--text-primary); }

.quiz-results-badge {
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

@keyframes correctGlow {
    0% {
        box-shadow: inset 0 0 0 1px rgba(0, 255, 102, 0.12), 0 0 0 rgba(0, 255, 102, 0);
    }
    55% {
        box-shadow: inset 0 0 0 1px rgba(0, 255, 102, 0.24), 0 0 28px rgba(0, 255, 102, 0.28);
    }
    100% {
        box-shadow: inset 0 0 0 1px rgba(0, 255, 102, 0.2), 0 0 24px rgba(0, 255, 102, 0.2);
    }
}

@keyframes wrongGlow {
    0% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 0, 122, 0.12),
            0 0 0 rgba(255, 0, 122, 0);
    }
    55% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 0, 122, 0.24),
            0 0 28px rgba(255, 0, 122, 0.24);
    }
    100% {
        box-shadow:
            inset 0 0 0 1px rgba(255, 0, 122, 0.2),
            0 0 24px rgba(255, 0, 122, 0.18);
    }
}

@keyframes revealCorrect {
    0% {
        filter: brightness(1);
    }
    40% {
        filter: brightness(1.15);
    }
    100% {
        filter: brightness(1);
    }
}

@keyframes successFlash {
    0% {
        box-shadow: 0 0 0 rgba(0, 255, 102, 0);
    }
    35% {
        box-shadow: inset 0 0 0 999px rgba(0, 255, 102, 0.045), 0 0 30px rgba(0, 255, 102, 0.08);
    }
    100% {
        box-shadow: 0 0 0 rgba(0, 255, 102, 0);
    }
}

@media (hover: none), (pointer: coarse) {
    .quiz-option-btn {
        transition:
            transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            background 0.2s ease,
            background-color 0.2s ease,
            box-shadow 0.2s ease,
            outline-color 0.2s ease;
    }

    .quiz-option-btn:hover:not(:disabled),
    .quiz-overlay[data-subject="maths"] .quiz-option-btn:hover:not(:disabled),
    .quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled),
    .quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled),
    .quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled),
    .quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled) {
        box-shadow: none;
        box-shadow:
            inset 0 0 0 1px rgba(255, 255, 255, 0.12),
            0 0 0 rgba(0, 0, 0, 0);
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
            radial-gradient(circle at 12% 50%, rgba(255, 255, 255, 0.08), transparent 28%);
    }

    .quiz-option-btn:hover:not(:disabled)::before,
    .quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled)::before,
    .quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled)::before,
    .quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled)::before,
    .quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled)::before {
        width: 6px;
        opacity: 0.45;
        box-shadow: none;
    }

    .quiz-option-btn:hover:not(:disabled)::after,
    .quiz-overlay[data-subject="maths"] .quiz-option-btn:hover:not(:disabled)::after,
    .quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled)::after,
    .quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled)::after,
    .quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled)::after,
    .quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled)::after {
        opacity: 0;
    }

    .quiz-option-btn:hover:not(:disabled) > span,
    .quiz-overlay[data-subject="maths"] .quiz-option-btn:hover:not(:disabled) > span,
    .quiz-overlay[data-subject="francais"] .quiz-option-btn:hover:not(:disabled) > span,
    .quiz-overlay[data-subject="anglais"] .quiz-option-btn:hover:not(:disabled) > span,
    .quiz-overlay[data-subject="svt"] .quiz-option-btn:hover:not(:disabled) > span,
    .quiz-overlay[data-subject="physique"] .quiz-option-btn:hover:not(:disabled) > span {
        animation: none;
        letter-spacing: normal;
        text-shadow: none;
    }
}

@media (max-width: 768px) {
    .quiz-options { grid-template-columns: 1fr; }
    .quiz-option-slot {
        min-height: 96px;
        aspect-ratio: 4.8 / 1;
    }
    .quiz-container { padding: 1.5rem; }
    .quiz-header h2 { font-size: 1.5rem; }
    .quiz-question { font-size: 1.2rem; }
    .subject-session-header,
    .subject-main-info,
    .subject-level-copy {
        align-items: flex-start;
    }
}

/* ==========================================
   Scrollbars furtives
   ========================================== */
html,
body {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

body:hover {
    scrollbar-color: rgba(51, 65, 85, 0.62) transparent;
}

.quiz-container {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    scrollbar-gutter: stable both-edges;
}

.quiz-container:hover {
    scrollbar-color: rgba(51, 65, 85, 0.62) transparent;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.quiz-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.quiz-container::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.quiz-container::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html:hover::-webkit-scrollbar-thumb,
body:hover::-webkit-scrollbar-thumb,
.quiz-container:hover::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.62);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.78);
}

.quiz-overlay[data-subject="maths"] .quiz-container:hover {
    scrollbar-color: rgba(0, 240, 255, 0.78) transparent;
}

.quiz-overlay[data-subject="francais"] .quiz-container:hover {
    scrollbar-color: rgba(176, 38, 255, 0.78) transparent;
}

.quiz-overlay[data-subject="anglais"] .quiz-container:hover {
    scrollbar-color: rgba(79, 124, 255, 0.78) transparent;
}

.quiz-overlay[data-subject="svt"] .quiz-container:hover {
    scrollbar-color: rgba(0, 255, 102, 0.78) transparent;
}

.quiz-overlay[data-subject="physique"] .quiz-container:hover {
    scrollbar-color: rgba(255, 140, 0, 0.8) transparent;
}

.quiz-overlay[data-subject="maths"] .quiz-container:hover::-webkit-scrollbar-thumb,
.quiz-overlay[data-subject="maths"] .quiz-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.78);
}

.quiz-overlay[data-subject="francais"] .quiz-container:hover::-webkit-scrollbar-thumb,
.quiz-overlay[data-subject="francais"] .quiz-container::-webkit-scrollbar-thumb:hover {
    background: rgba(176, 38, 255, 0.78);
}

.quiz-overlay[data-subject="anglais"] .quiz-container:hover::-webkit-scrollbar-thumb,
.quiz-overlay[data-subject="anglais"] .quiz-container::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 124, 255, 0.78);
}

.quiz-overlay[data-subject="svt"] .quiz-container:hover::-webkit-scrollbar-thumb,
.quiz-overlay[data-subject="svt"] .quiz-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 102, 0.78);
}

.quiz-overlay[data-subject="physique"] .quiz-container:hover::-webkit-scrollbar-thumb,
.quiz-overlay[data-subject="physique"] .quiz-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 140, 0, 0.8);
}
