/* =========================================================
   DataGrade — interface élève (minimaliste, pensée fullscreen)
   ========================================================= */

body.eleve-app {
    background: var(--bg);
    overflow: visible;
    margin: 0;
    min-height: 100vh;
}
body.eleve-app .bg-decor { display: none; }

.eleve-topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 28px;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.eleve-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 17px;
    margin-right: auto;
    color: inherit;            /* c'est un lien vers l'accueil élève : garder l'aspect du logo */
    text-decoration: none;
}
.eleve-topbar__brand .brand__mark { width: 28px; height: 28px; }
/* Logo de l'établissement entre la marque et l'élève, s'il y a la place. */
.eleve-topbar__org { margin-right: auto; }
@media (max-width: 1180px) { .eleve-topbar__org { display: none; } }
.eleve-topbar__who {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 24px;
    border-right: 1px solid var(--line);
}
.eleve-topbar__name {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink);
    font-size: 14.5px;
    line-height: 1.2;
}
.eleve-topbar__class {
    font-size: 12px;
    color: var(--ink-muted);
}

.eleve-topbar__clock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    margin-right: 12px;
}
.eleve-topbar__clock-warn {
    color: var(--coral-500);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11px;
    margin-left: 4px;
    padding: 2px 6px;
    background: var(--rose-50);
    border-radius: 4px;
}

.eleve-topbar__nav {
    display: flex;
    gap: 18px;
    align-items: center;
}
/* Liens nav : simple texte, la page courante est soulignée. */
.eleve-topbar__nav a {
    padding: 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color .15s var(--ease-out), border-color .15s var(--ease-out);
}
.eleve-topbar__nav a:hover { color: var(--violet-700); }
.eleve-topbar__nav a.is-active {
    color: var(--violet-700);
    border-bottom-color: var(--violet-500);
}
.eleve-topbar__icon {
    font-size: 16px;
    line-height: 1;
}
.eleve-topbar__logout { color: var(--ink-muted) !important; }
.eleve-topbar__logout:hover { color: var(--coral-500) !important; }

/* Thème : un lien « Thème » qui ouvre un petit menu avec les choix. */
/* Menu « Thème » ouvert : la barre passe devant tout le contenu, quel que soit
   le thème (certains lui donnent le même z-index que la page). */
.eleve-topbar.is-menu-open { z-index: 200 !important; }
.theme-menu { position: relative; }
.theme-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-soft);
}
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu > summary:hover,
.theme-menu[open] > summary { color: var(--violet-700); }
.theme-menu .theme-picker {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(3, 30px);
    gap: 4px;
    padding: 8px;
    background: var(--bg-elev, #fff);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px -10px rgba(15, 23, 42, 0.3);
}
.theme-menu .theme-picker__btn { width: 30px; height: 30px; border-radius: 8px; }
.theme-picker__btn img { width: 22px; height: 22px; display: block; }
/* « Automatique » : disque mi-clair mi-sombre, dessiné en SVG, à la couleur du texte. */
.theme-picker__btn--auto { display: grid; place-items: center; color: var(--ink-soft); }
.theme-picker__btn--auto svg { display: block; }

.eleve-main {
    padding: 32px 28px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ---------- Layout 2 colonnes : contenu + side rules ---------- */

.eleve-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}
@media (max-width: 900px) {
    .eleve-grid { grid-template-columns: 1fr; }
}

.eleve-rules {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 24px;
    position: sticky;
    top: 88px;
}
.eleve-rules h3 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.eleve-rules h3 img { width: 30px; height: 30px; flex-shrink: 0; }
.eleve-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.eleve-rules li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.5;
}
/* Icônes illustrées (public/assets/img/regles/) : un filet les sépare du texte. */
.eleve-rules .rule-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
}
.eleve-rules li > div {
    border-left: 1px solid var(--line);
    padding-left: 14px;
}
.eleve-rules strong {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- États (waiting, no results...) ---------- */

.eleve-state {
    text-align: center;
    padding: 48px 24px;
}
/* Liste d'activités : pas de marges latérales, pour que les cartes aient la même
   largeur que les briques du dessous (AxioMaths, cours, Mindlock…). */
.eleve-state--list { padding: 32px 0 6px; }
.eleve-state__img {
    max-width: 280px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
    filter: drop-shadow(0 12px 24px rgba(124, 58, 237, 0.18));
    animation: float-y 5s ease-in-out infinite;
}
@keyframes float-y {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
/* Liu en avatar rond (public/assets/img/liu/*.webp, découpés de la planche) */
.eleve-liu {
    display: block;
    width: 112px;
    height: 112px;
    margin: 0 auto 12px;
    padding: 8px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f3edff 70%, #ebe3ff 100%);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18), 0 0 0 4px #fff, 0 0 0 5px var(--line, #ECE7F2);
    user-select: none;
}
/* Liu cliquable : mène à « Qui est Liu ? » (/liu.php) */
.eleve-liu-link { display: block; width: fit-content; margin: 0 auto; border-radius: 50%; }
.eleve-liu-link:hover .eleve-liu { box-shadow: 0 12px 28px rgba(124, 58, 237, 0.28), 0 0 0 4px #fff, 0 0 0 5px var(--violet-200, #D2C2FF); }
.eleve-liu-link:focus-visible { outline: 2px solid var(--violet-500); outline-offset: 4px; }
.eleve-liu--hello { animation: liu-hello 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.eleve-liu--sleep { animation: liu-breathe 4.5s ease-in-out infinite; }
@keyframes liu-hello {
    0%, 70%, 100% { transform: rotate(0); }
    78% { transform: rotate(-5deg); }
    86% { transform: rotate(5deg); }
    94% { transform: rotate(-3deg); }
}
@keyframes liu-breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.035) translateY(2px); }
}
@media (prefers-reduced-motion: reduce) {
    .eleve-liu--hello, .eleve-liu--sleep, .eleve-state__img { animation: none; }
}
.eleve-state__title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    color: var(--ink);
    margin-bottom: 8px;
}
.eleve-state__lead {
    color: var(--ink-soft);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.55;
}
/* Mention d'état (« En attente d'une activité »…) : simple texte avec un point. */
.eleve-state__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-muted);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 16px;
}
.eleve-state__badge .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--violet-500);
    animation: pulse-soft 1.6s ease-in-out infinite;
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

/* ---------- Liste résultats ---------- */

.result-card {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: inherit;
    margin-bottom: 12px;
    transition: all .2s;
}
.result-card:hover {
    border-color: var(--violet-200);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.result-card__score {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 28px;
    color: var(--violet-600);
    width: 84px;
    flex-shrink: 0;
    text-align: center;
}
.result-card__score small {
    font-size: 14px;
    color: var(--ink-muted);
    font-weight: 500;
}
.result-card__body {
    flex: 1;
    min-width: 0;
}
.result-card__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
}
.result-card__meta {
    font-size: 13px;
    color: var(--ink-muted);
    margin-top: 2px;
}
.result-card__pending {
    color: var(--amber-500);
    font-weight: 600;
    font-size: 13.5px;
}

/* ============== Choix entre plusieurs quiz disponibles ============== */
.eleve-state__badge--ready { color: #065F46; }
.dot--ready { background: var(--emerald-500); }

.quiz-choices {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.quiz-choice {
    /* Fond du thème, pas blanc en dur : les textes de la carte suivent les
       couleurs du thème et devenaient illisibles sur blanc dans les thèmes sombres. */
    background: var(--bg-elev, #fff);
    border: 1.5px solid var(--line);
    border-radius: 14px;
    transition: all .15s var(--ease-out);
}
.quiz-choice:hover {
    border-color: var(--violet-500);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px -8px rgba(124, 58, 237, .25);
}

/* 🛡️ Carte ÉVALUATION (anti-triche actif) : couleur vive rouge/rose +
   léger pulse pour signaler que c'est l'activité prioritaire. */
.quiz-choice--exam {
    border-color: #f43f5e;
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    box-shadow: 0 4px 18px -6px rgba(244, 63, 94, .40);
    animation: examPulse 2.4s ease-in-out infinite;
}
.quiz-choice--exam:hover {
    border-color: #e11d48;
    box-shadow: 0 10px 28px -8px rgba(244, 63, 94, .55);
}
@keyframes examPulse {
    0%, 100% { box-shadow: 0 4px 18px -6px rgba(244, 63, 94, .40); }
    50%      { box-shadow: 0 4px 26px -4px rgba(244, 63, 94, .70); }
}
.quiz-choice__exam-flag {
    display: inline-block;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    font-weight: 800;
    font-size: 11.5px;
    letter-spacing: 0.03em;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
    box-shadow: 0 2px 6px rgba(225, 29, 72, .35);
}
.quiz-choice--exam .quiz-choice__title { color: #9f1239; }
.quiz-choice--exam .quiz-choice__cta { color: #e11d48; }
@media (prefers-reduced-motion: reduce) {
    .quiz-choice--exam { animation: none; }
}
/* Les cartes d'activité portent la classe .quiz-choice, qui désigne aussi une réponse
   de quiz dans landing.css (flex, marges, survol) : on annule ici ce qui déborde,
   sinon le lien se réduit à son contenu et Liu comme « Démarrer » changent de place
   d'une carte à l'autre. */
.quiz-choices > .quiz-choice { display: block; padding: 0; width: auto; gap: 0; }
.quiz-choices > .quiz-choice:hover { background: var(--bg-elev, #fff); transform: translateY(-1px); }
.quiz-choices > .quiz-choice--exam:hover { background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%); }

/* Corps de la carte à gauche ; à droite, toujours au même endroit, Liu (défis de
   code) et le bouton d'action. */
.quiz-choice__link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 20px;
    padding: 18px 22px;
    text-decoration: none;
    color: inherit;
}
.quiz-choice__body { min-width: 0; }
.quiz-choice__side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 104px; }
.quiz-choice__liu {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(91, 33, 182, 0.25));
    transition: transform .15s var(--ease-out);
}
.quiz-choice:hover .quiz-choice__liu { transform: scale(1.06); }
@media (max-width: 560px) {
    .quiz-choice__link { grid-template-columns: 1fr; row-gap: 8px; }
    .quiz-choice__side { align-items: flex-end; min-width: 0; }
    .quiz-choice__liu { display: none; }
}
.quiz-choice__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    color: var(--ink);
    margin-bottom: 6px;
}
.quiz-choice__desc {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin-bottom: 10px;
    line-height: 1.4;
}
.quiz-choice__meta {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    font-size: 12.5px; color: var(--ink-muted);
}
.quiz-choice__time, .quiz-choice__close {
    color: var(--ink-muted);
}
/* Lien « Voir le leaderboard » du tableau de bord (remplace la barre de niveau). */
.eleve-leaderboard-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px 18px 8px 10px;
    border-radius: var(--r-btn, 8px);
    border: 1px solid var(--line, #e5e7eb);
    background: var(--bg-elev, #fff);
    color: var(--violet-700, #5b21b6);
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.eleve-leaderboard-link img { width: 26px; height: 26px; flex-shrink: 0; }
.eleve-leaderboard-link:hover {
    transform: translateY(-1px);
    border-color: var(--violet-500, #7c3aed);
    box-shadow: 0 6px 18px -8px rgba(124, 58, 237, .35);
}

/* Pilules illustrées des cartes d'activité (icônes : public/assets/img/pilules/). */
.q-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px 3px 5px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.q-pill img { width: 20px; height: 20px; flex-shrink: 0; }
.q-pill--violet { background: #EFE9FF; color: #5B2FC4; border-color: #DDD0FF; }
.q-pill--coral  { background: #FFE8EC; color: #C22A4C; border-color: #FFCDD6; }
.q-pill--mint   { background: #E8F5F0; color: #14795B; border-color: #C5EBDD; }
.q-pill--amber  { background: #FFF4D6; color: #92400E; border-color: #FFE4A0; }
.q-pill--red    { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; font-weight: 700; }
.q-pill--plain  { background: transparent; color: var(--ink-soft, #4b5563); border-color: var(--line, #e5e7eb); font-weight: 500; }
/* La carte d'évaluation garde son fond rose clair dans tous les thèmes : ses textes restent sombres. */
.quiz-choice--exam .quiz-choice__desc { color: #6b2130; }
.quiz-choice--exam .q-pill--plain { color: #6b2130; border-color: #fda4af; }
.quiz-choice__retake {
    color: #B45309;
    background: #FEF3C7;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.quiz-choice__cta {
    white-space: nowrap;
    font-weight: 600;
    color: var(--violet-700);
    font-size: 13.5px;
    transition: transform .15s;
}
.quiz-choice:hover .quiz-choice__cta { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
    .eleve-state__img, .eleve-state__badge .dot { animation: none; }
}

.eleve-state__title--hero { margin-top: 14px; }

/* ---------- Comptes liés : « Mes classes » ---------- */
.eleve-classes {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin-bottom: 16px;
    background: var(--bg-elev, #fff); border: 1px solid var(--line, #e5e7eb); border-radius: 12px; font-size: 13.5px;
}
.eleve-classes__label { font-weight: 700; color: var(--ink-soft, #475569); }
.eleve-classes__chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-weight: 600;
    text-decoration: none; background: var(--bg, #f8fafc); color: var(--ink, #1e293b); border: 1px solid var(--line, #e5e7eb);
}
.eleve-classes__chip.is-current { font-weight: 700; background: var(--violet-600, #7c3aed); color: #fff; border-color: transparent; }
.eleve-classes__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.eleve-classes__chip.is-current .eleve-classes__dot { border: 1px solid #fff; }
.eleve-classes__xp { margin-left: auto; color: var(--ink-muted, #64748b); font-size: 12.5px; }

/* ---------- Compétitions en cours (bandeau en tête) ---------- */
.eleve-live { background: linear-gradient(135deg, #fde68a 0%, #fbbf24 100%); border: 2px solid #f59e0b; margin-bottom: 18px; padding: 18px; }
.eleve-live__badge { color: #78350f; }
.eleve-live__title { margin: 12px 0 8px; color: #78350f; font-size: 22px; }
.eleve-live__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.eleve-live__item {
    display: block; padding: 14px 18px; background: rgba(255,255,255,0.85); border-radius: 12px;
    text-decoration: none; color: #78350f; border: 1px solid rgba(120,53,15,0.15); transition: transform .1s;
}
.eleve-live__item:hover { transform: translateY(-2px); }
.eleve-live__meta { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #92400e; font-weight: 600; }
.eleve-live__name { font-size: 18px; font-weight: 700; margin: 4px 0; color: #78350f; }
.eleve-live__go { font-size: 14px; font-weight: 600; color: #b45309; }

/* ---------- Briques d'accès (CTF, AxioMaths, Langues, Mindlock…) ----------
   Par défaut, chaque espace garde ses couleurs (variables --b-*). Les thèmes clair
   et sombre les remplacent par des cartes sobres (eleve-sobre.css). */
.dg-brick {
    display: block; position: relative; padding: 16px 22px; margin-bottom: 18px;
    border-radius: 14px; color: #fff; text-decoration: none;
    background: var(--b-bg); border: var(--b-border, 0); box-shadow: var(--b-shadow, none);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.dg-brick:hover { transform: translateY(-2px); box-shadow: var(--b-shadow-h, none); }
.dg-brick__row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dg-brick__lead { display: flex; align-items: center; gap: 14px; }
.dg-brick__eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--b-eyebrow); font-weight: 700; }
.dg-brick__title { font-size: 22px; font-weight: 800; margin-top: 4px; color: var(--b-title, inherit); }
.dg-brick__sub { font-size: 13px; color: var(--b-sub); margin-top: 4px; }
.dg-brick__cta {
    background: var(--b-cta-bg, rgba(255,255,255,0.2)); color: var(--b-cta-fg, #fff); border: var(--b-cta-border, 0);
    padding: 8px 14px; border-radius: 999px; font-weight: var(--b-cta-weight, 600); font-size: 14px;
}
.dg-brick__img { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; filter: var(--b-img-filter, none); }
.dg-brick__icon, .dg-brick__mark, .dg-brick__glow, .dg-brick__watermark, .dg-bricks__title { display: none; }
.dg-brick-group { margin-bottom: 18px; }
.dg-brick-group > .dg-brick { margin-bottom: 0; }
.dg-brick-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dg-brick-chip { padding: 8px 14px; background: #ede9fe; color: #5b21b6; border-radius: 999px; text-decoration: none; font-size: 13px; font-weight: 600; }
.dg-brick-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dg-brick-pair > .dg-brick { margin-bottom: 0; padding: 16px 18px; }
.dg-brick-pair .dg-brick__lead { display: block; }
.dg-brick-pair .dg-brick__title { font-size: 19px; }
.dg-brick-pair .dg-brick__sub { margin-top: 6px; }
.dg-brick.is-disabled { opacity: 0.6; pointer-events: none; }

.dg-brick--ctf {
    --b-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
    --b-shadow: 0 6px 18px rgba(15, 23, 42, 0.25); --b-shadow-h: 0 10px 28px rgba(15, 23, 42, 0.35);
    --b-eyebrow: #fbbf24; --b-sub: #94a3b8; --b-cta-bg: rgba(251, 191, 36, 0.2); --b-cta-fg: #fde68a; --b-cta-weight: 700;
    color: #f1f5f9;
}
.dg-brick__score { text-align: right; }
.dg-brick__score-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #94a3b8; }
.dg-brick__score-value { font-size: 24px; font-weight: 800; color: #fbbf24; }
.dg-brick--prompt {
    --b-bg: linear-gradient(135deg, #4c1d95 0%, #6d28d9 55%, #8b5cf6 100%);
    --b-shadow: 0 6px 18px rgba(76, 29, 149, 0.25); --b-shadow-h: 0 10px 28px rgba(76, 29, 149, 0.35);
    --b-eyebrow: #ddd6fe; --b-sub: #ddd6fe; --b-cta-weight: 700;
}
.dg-brick--orientation {
    --b-bg: linear-gradient(135deg, #1e1b4b 0%, #4338ca 55%, #6366f1 100%);
    --b-shadow: 0 6px 18px rgba(67, 56, 202, 0.25); --b-shadow-h: 0 10px 28px rgba(67, 56, 202, 0.35);
    --b-eyebrow: #c7d2fe; --b-sub: #c7d2fe;
}
.dg-brick--academy {
    --b-bg: #FFFBF2; --b-border: 2.5px solid #1B1340; --b-shadow: 5px 5px 0 #1B1340; --b-shadow-h: 3px 3px 0 #1B1340;
    --b-eyebrow: #4B2BFF; --b-sub: #5A5278;
    --b-cta-bg: #4B2BFF; --b-cta-fg: #fff; --b-cta-border: 2.5px solid #1B1340; --b-cta-weight: 800;
    border-radius: 18px; color: #1B1340; transition: transform .12s ease, box-shadow .12s ease;
}
.dg-brick--academy:hover { transform: translate(2px, 2px); }
.dg-brick--academy .dg-brick__mark {
    display: grid; place-items: center; flex: 0 0 52px; width: 52px; height: 52px; border-radius: 15px;
    background: #4B2BFF; border: 2.5px solid #1B1340; color: #FFD23F; font-size: 26px; box-shadow: 3px 3px 0 #1B1340;
}
.dg-brick--academy .dg-brick__eyebrow { font-weight: 800; }
.dg-brick--academy .dg-brick__title { letter-spacing: -0.02em; }
.dg-brick--academy .dg-brick__sub { font-weight: 500; }
.dg-brick--academy .dg-brick__cta { border-radius: 13px; }
.dg-brick__side { display: flex; align-items: center; gap: 12px; }
.dg-brick--academy .dg-brick__badge { background: #FFD23F; border: 2.5px solid #1B1340; border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; }
.dg-brick--maths {
    --b-bg: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #60a5fa 100%);
    --b-shadow: 0 6px 18px rgba(37, 99, 235, 0.25); --b-shadow-h: 0 10px 28px rgba(37, 99, 235, 0.35);
    --b-eyebrow: #bfdbfe; --b-sub: #dbeafe; --b-img-filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}
.dg-brick--snt {
    --b-bg: linear-gradient(135deg, #0e7490 0%, #06b6d4 60%, #67e8f9 100%);
    --b-shadow: 0 6px 18px rgba(8, 145, 178, 0.25); --b-shadow-h: 0 10px 28px rgba(8, 145, 178, 0.35);
    --b-eyebrow: #cffafe; --b-sub: #e0f7fb;
}
.dg-brick--langues {
    --b-bg: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 55%, #ef4444 100%);
    --b-shadow: 0 6px 18px rgba(185, 28, 28, 0.25); --b-shadow-h: 0 10px 28px rgba(185, 28, 28, 0.35);
    --b-eyebrow: #fecaca; --b-sub: #fee2e2;
}
.dg-brick--cours {
    --b-bg: #0f1117; --b-border: 1px solid #2a2e3a;
    --b-shadow: 0 8px 22px rgba(15, 17, 23, 0.28); --b-shadow-h: 0 14px 32px rgba(108, 158, 255, 0.28);
    --b-eyebrow: #8b8fa3; --b-title: #fff; --b-sub: #8b8fa3;
    --b-cta-bg: rgba(108, 158, 255, 0.14); --b-cta-fg: #6c9eff; --b-cta-border: 1px solid rgba(108, 158, 255, 0.35);
    --b-img-filter: drop-shadow(0 0 10px rgba(192, 132, 252, 0.4));
    overflow: hidden; color: #e6e8ee;
}
.dg-brick--cours:hover { border-color: #6c9eff; }
.dg-brick--cours .dg-brick__glow {
    display: block; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(420px 160px at 12% 0%, rgba(108,158,255,0.22), transparent 70%),
                radial-gradient(380px 160px at 62% 0%, rgba(192,132,252,0.18), transparent 70%),
                radial-gradient(300px 140px at 96% 30%, rgba(251,146,60,0.12), transparent 70%);
}
.dg-brick--cours .dg-brick__amp { color: #c084fc; }
.dg-brick--libre {
    --b-bg: linear-gradient(135deg, #059669 0%, #10b981 60%, #34d399 100%);
    --b-shadow: 0 6px 18px rgba(16, 185, 129, 0.25); --b-shadow-h: 0 10px 26px rgba(16, 185, 129, 0.35);
    --b-eyebrow: #d1fae5; --b-sub: #d1fae5;
}
.dg-brick--daily {
    --b-bg: linear-gradient(135deg, #b45309 0%, #f59e0b 60%, #fbbf24 100%);
    --b-shadow: 0 6px 18px rgba(245, 158, 11, 0.25); --b-shadow-h: 0 10px 26px rgba(245, 158, 11, 0.35);
    --b-eyebrow: #fef3c7; --b-sub: #fef3c7;
}
.dg-brick--mindlock, .dg-brick--ivy { padding: 12px 18px; border-radius: 12px; }
.dg-brick--mindlock .dg-brick__lead, .dg-brick--ivy .dg-brick__lead { gap: 12px; }
.dg-brick--mindlock .dg-brick__cta, .dg-brick--ivy .dg-brick__cta { padding: 6px 14px; font-size: 13px; }
.dg-brick--mindlock {
    --b-bg: linear-gradient(135deg, #0b0a12 0%, #16161d 100%); --b-border: 1px solid #2a2436;
    --b-shadow-h: 0 8px 22px rgba(212, 162, 76, 0.25);
    --b-eyebrow: #ffd37a; --b-title: #f3f1ea; --b-sub: #9a93a8;
    --b-cta-bg: #d4a24c; --b-cta-fg: #1a1408; --b-cta-weight: 700;
    --b-img-filter: drop-shadow(0 0 10px rgba(255, 211, 122, 0.45));
    color: #f3f1ea;
}
.dg-brick--mindlock:hover { border-color: #d4a24c; }
.dg-brick--mindlock .dg-brick__img { width: 56px; height: 56px; flex-basis: 56px; }
.dg-brick__extra { font-size: 12.5px; color: #ffd37a; font-weight: 700; margin-top: 6px; }
.dg-brick__extra--ok { color: #86efac; }
.dg-brick__hl { color: #ffd37a; }
.dg-brick__extra-note { color: #9a93a8; font-weight: 500; }
.dg-brick--ivy {
    --b-bg: linear-gradient(135deg, #b73225 0%, #9a281d 100%); --b-border: 1px solid #c94a3a;
    --b-shadow-h: 0 8px 22px rgba(183, 50, 37, 0.35);
    --b-eyebrow: #f7d9d2; --b-title: #fff; --b-sub: #f1cfc8;
    --b-cta-bg: #f4efe6; --b-cta-fg: #b73225; --b-cta-weight: 700;
    overflow: hidden; color: #f4efe6;
}
.dg-brick--ivy:hover { border-color: #f4efe6; }
.dg-brick--ivy .dg-brick__watermark {
    display: block; position: absolute; right: 118px; top: 50%; transform: translateY(-50%); pointer-events: none;
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; font-size: 96px; line-height: 1; color: rgba(244, 239, 230, 0.10);
}
.dg-brick__seal {
    display: grid; place-items: center; width: 60px; height: 60px; flex: 0 0 60px;
    background: #f4efe6; border-radius: 10px; box-shadow: 0 2px 10px rgba(60, 10, 5, 0.35);
}
.dg-brick__seal img { width: 54px; height: 54px; object-fit: contain; display: block; }
.dg-brick__seal--text {
    width: 56px; height: 56px; flex-basis: 56px; color: #b73225; border-radius: 8px;
    box-shadow: inset 0 0 0 3px #f4efe6, inset 0 0 0 4px #b73225;
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; font-size: 30px; font-weight: 700; line-height: 1;
}
.dg-brick__title--serif { font-family: 'Lora', Georgia, 'Times New Roman', serif; font-weight: 700; }
.dg-brick__title--serif em { font-style: italic; }
.dg-brick__zh { font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif; font-weight: 400; font-size: 18px; margin-left: 8px; color: #f7d9d2; }
.dg-brick--ivy .dg-brick__extra { color: #fff; }
.dg-brick--ivy .dg-brick__extra-note { color: #f7d9d2; }
.dg-brick__code {
    font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: 0.06em;
    background: #f4efe6; color: #b73225; padding: 1px 7px; border-radius: 5px; user-select: all;
}
.dg-brick--ivy .dg-brick__row, .dg-brick--ivy .dg-brick__lead { position: relative; }

/* ======================== Mobile (≤ 720px) ======================== */
@media (max-width: 720px) {
    .eleve-topbar {
        flex-wrap: wrap;
        gap: 10px 14px;
        padding: 10px 14px;
    }
    .eleve-topbar__brand { font-size: 15px; margin-right: auto; }
    .eleve-topbar__who {
        padding-right: 0;
        border-right: none;
        gap: 8px;
    }
    .eleve-topbar__class { display: none; } /* gain de place */
    .eleve-topbar__clock { font-size: 12px; margin-right: 0; }
    .eleve-topbar__nav {
        order: 99;        /* passe sous le reste */
        width: 100%;
        justify-content: flex-end;
    }
    .eleve-topbar__nav { gap: 14px; }
    .eleve-topbar__nav a { font-size: 13px; }

    .eleve-main { padding: 20px 14px; }
    .eleve-grid { grid-template-columns: 1fr; gap: 18px; }

    .eleve-state {
        padding: 24px 18px;
    }
    .eleve-state__img { max-width: 180px; }
    .eleve-state__title { font-size: 22px; }
    .eleve-rules ul li { font-size: 13.5px; }
}
