/* =========================
   FONTS
   - Déclarations @font-face
   ========================= */
@font-face {
    font-family: 'Cookie';
    src: url('../fonts/Cookie-Regular.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* Exemple pour Roboto */
@font-face {
    font-family: 'Outfit';
    src: url('../fonts/Outfit-VariableFont_wght.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Police 2';
    src: url('../fonts/Satisfy-Regular.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

/* =========================
   VARIABLES GLOBALES (THEME)
   - Couleurs, accents, etc.
   ========================= */
:root {
  --loader-z: 99999;                  /* z-index loader */
  --bg-overlay: rgba(4,6,8,0.96);     /* noir semi-transparent */
  --card-bg-top: rgba(10,12,15,0.96); /* gris-noir (haut de carte) */
  --card-bg-bottom: rgba(6,8,10,0.98);/* gris-noir plus foncé (bas de carte) */
  
  --dracula-background: #282A36;

  --bg:     #0f0f12; /* noir foncé */
  --panel:  #15161a; /* gris très foncé */
  --ink:    #e6eef3; /* blanc bleuté */
  --muted:  #9aa0a6; /* gris moyen */
  --accent: #e63946; /* rouge vif */
  --chip:   #1e2026; /* gris ardoise foncé */
  --card:   #131417; /* gris anthracite */
  --ring:   #2a2d36; /* gris bleuté foncé */

  --max-mobile-width: 486px;          /* largeur max mobile */
  --scroll-speed: 4000ms;             /* vitesse scroll */
  --fade-ms: 420ms;                   /* durée fondu */
}

/* =========================
   RÈGLES DE BASE
   - html / body, typographie par défaut
   ========================= */
   /* Bloquer la sélection de tout le contenu */
* {
  user-select: none;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    background: linear-gradient(180deg, #0f0f12 0%, #121318 60%, #0e0f13 100%);
    color: var(--ink);
}

/* Classe appliquée via JS pour bloquer le scroll quand modal ouverte */
body.modal-open {
    position: fixed;
    inset: 0 0 auto 0;
    width: 100%;
    overflow: hidden;
}

/* =========================
   HEADER / NAV
   ========================= */
header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(1.2) blur(8px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), transparent);
    border-bottom: 1px solid var(--ring);
    padding: 20px 16px;
    text-align: center;
}







.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    height: auto;
}

h1 {
    margin: 0;
    font-size: clamp(18px, 2.6vw, 26px);
}

/* =========================
   BADGE / TOGGLE
   - Exam badge, bouton d'ouverture
   ========================= */
.exam-badge {
    background: var(--chip);
    border: 1px solid var(--ring);
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cookie';
}

.exam-badge strong {
    color: var(--accent);
    font-weight: 900;
}

.chargement-page-code{
    font-size: 7px;
}

.change-toggle {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 800;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}

.change-toggle:focus {
    outline: 2px solid var(--ring);
}

.change-toggle:hover {
    transform: translateY(-2px);
    color: var(--ink);
}

/* =========================
   ECRAN DE CHANGEMENT (OVERLAY)
   - Fullscreen overlay avec animation de pattern
   ========================= */
.change-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3,4,6,0.72);
    backdrop-filter: blur(8px) saturate(120%);
}

.change-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-radial-gradient(circle, rgba(255,255,255,0.055) 0 1px, transparent 1px 8px);
    background-size: 16px 16px;
    opacity: 0.95;
    mix-blend-mode: overlay;
    filter: blur(0.8px) saturate(1.05);
    animation: moveDots 18s linear infinite;
}

@keyframes moveDots {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 500px 500px;
    }
}

/* =========================
   CARTE CENTRALE (QUOTE / CHANGE CARD)
   ========================= */
.change-card {
    position: relative;
    z-index: 2;
    min-width: min(860px, 92%);
    max-width: 1100px;
    border-radius: 16px;
    padding: 28px 28px 22px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.change-card .title {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 0.6px;
}

/* zone citation */
.quote-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
}

.quote {
    font-family: 'Police 2', cursive;
    font-size: 24px;
    line-height: 1.2;
    text-align: center;
    color: var(--ink);
    max-width: 88%;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .45s ease, transform .45s ease;
}

.quote.visible {
    opacity: 1;
    transform: translateY(0);
}

.quote-meta {
    font-size: 13px;
    color: var(--muted);
    font-weight: 700;
}

/* =========================
   CONTRÔLES (PREV / PLAY / NEXT / CLOSE)
   ========================= */
.controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.controls button {
    appearance: none;
    border: 0;
    background: #111215;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--muted);
    cursor: pointer;
    border: 1px solid var(--ring);
    font-weight: 800;
}

.controls button.primary {
    background: var(--accent);
    color: #fff;
}

/* bouton de fermeture (coin) */
.change-close {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 3;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    padding: 6px 8px;
}

/* =========================
   RESPONSIVE (petits écrans)
   ========================= */
@media (max-width:780px) {
    .change-card {
        padding: 18px;
        min-width: 92%;
    }
    .quote {
        font-size: 18px;
    }
}

/* =========================
   HERO / IMAGES / EFFETS
   - Section hero, bordure animée, placeholders, lazy-loading
   ========================= */
.hero-wrap {
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    
}

.hero {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    border: 1px solid var(--ring);
    border-radius: 14px;
    padding: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}


.img-wrap {
    position: relative;
    padding: 8px;
    display: block;
    width: 300px;
    height: auto;
    margin-top: auto;
    box-sizing: border-box;
}

.img-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: conic-gradient(from 0deg, #ff0066, #ff9900, #ffd500, #33ff77, #00d4ff, #7a6cff, #ff0066);
    filter: blur(14px) saturate(120%);
    opacity: 0.95;
    transform: translateZ(0);
    animation: spin-border 8s linear infinite, glow 3s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}



.lazy-loading {
    filter: blur(8px) saturate(.9);
    transform: scale(1.01);
    transition: filter .45s ease, transform .45s ease, opacity .45s ease;
    opacity: 0.95;
    background: linear-gradient(90deg, rgba(255,255,255,0.01), rgba(255,255,255,0.02));
}

img:not([data-src]).lazy-placeholder,
img.loaded {
    filter: none;
    transform: none;
    opacity: 1;
}

.img-preview-placeholder {
    width: 84px;
   height: 84px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.03));
    border: 1px solid var(--ring);
}

.overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
    padding-bottom: 0px;
}

.overlay .caption {
    background: rgba(2,6,11,0.45);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Police 2', cursive;
    font-weight: 700;
    text-align: center;
    color: var(--ink);
    backdrop-filter: blur(100px) saturate(120%);
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    max-width: 92%;
    line-height: 1.15;
}

@keyframes spin-border {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes glow {
    0%   { filter: blur(6px) saturate(120%) brightness(1); }
    50%  { filter: blur(16px) saturate(160%) brightness(1.3); }
    100% { filter: blur(6px) saturate(120%) brightness(1); }
}

@keyframes light-effect {
    0%   { filter: brightness(1); }
    50%  { filter: brightness(1.25); }
    100% { filter: brightness(1); }
}

.question{
    font-weight: 800;
    font-size: 13px;
    background: #2a2d36;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
    width: fit-content;
    margin-top: 30px;
    margin-bottom: 30px;
    
}

.question2{
    font-weight: 800;
    font-size: 13px;
    background: #2a2d36;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);

    
}

/* =========================
   MAIN / GRID / CARDS
   ========================= */
main {
    padding: 18px 6px;
    max-width: 1200px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.card {
    background: var(--card);
    border: 1px solid var(--ring);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 160px;
}

.meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--ring);
}

.meta .step  {
    font-weight: 800;
    font-size: 13px;
    background: #2a2d36;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
}

.meta .title {
    font-weight: 700;
    font-size: 15px;
}

.sample {
    padding: 16px 16px 6px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    font-family: 'Cookie', cursive;
    font-size: 18px;
    color: var(--ink);
}

.module-list {
    padding: 6px 8px 8px;
    color: var(--muted);
    font-size: 14px;
}

.module-list ul { margin: 8px 0 0 18px; }

.module-list li { margin: 6px 0; }

/* =========================
   STUDENTS / LISTS (global styles)
   ========================= */
.students {
    margin: 30px 40px;
}

/* base challenge-grid used inline or in modal (modal-specific rules applied below) */
.challenge-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.student-card {
    background: var(--card);
    border: 1px solid var(--ring);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    justify-content: space-between;
    min-height: 64px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}

.student-card .note {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 110px;
    text-align: left;
    font-weight: 700;
    color: var(--muted);
    font-size: 14px;
    flex: 0 0 110px;
}

.student-card .note svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: red;
    
}

.student-card .note .score {
    font-weight: 800;
    color: var(--muted);
    font-size: 14px;
}

/* petite pastille de position */
.position-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 13px;
    border: 2px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: #ffffff;
    flex: 0 0 36px;
}

.position-bubble .pos-number {
    line-height: 1;
    display: inline-block;
}

.note-star {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-block;
    margin-left: 4px;
}

/* --- Pastille des 3 premiers --- */
.student-card.rank-1 .position-bubble {
  background: gold;
  color: #fff;
  border: 2px solid #daa520;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
}
.student-card.rank-2 .position-bubble {
  background: silver;
  color: #fff;
  border: 2px solid #a9a9a9;
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.8);
}
.student-card.rank-3 .position-bubble {
  background: #cd7f32;
  color: #fff;
  border: 2px solid #8b4513;
  box-shadow: 0 0 8px rgba(205, 127, 50, 0.8);
}

.student-card .name {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 8px;
}

.student-card img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    flex: 0 0 72px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: filter .25s ease, transform .2s ease;
    filter: saturate(0.95) contrast(0.94);
}

.student-card img.lazy-loading {
    filter: blur(6px) grayscale(.15);
    transform: scale(.995);
}

.student-card.rank-1 img {
    border-color: gold;
    box-shadow: 0 6px 18px rgba(255,204,51,0.14);
}

.student-card.rank-2 img {
    border-color: silver;
    box-shadow: 0 6px 18px rgba(255,122,0,0.14);
}

.student-card.rank-3 img {
    border-color: #cd7f32;
    box-shadow: 0 6px 18px rgba(204,0,0,0.14);
}

/* =========================
   RESPONSIVE LAYOUT
   ========================= */
@media (max-width:780px) {
    .wrap { flex-direction: column; align-items: flex-start; }
    .grid { grid-template-columns: 1fr; }
    .students { margin: 20px 18px; }
}

@media (max-width:480px) {
    .student-card { padding: 8px; min-height: 62px; gap: 8px; }
    .student-card img { width: 56px; height: 56px; flex: 0 0 56px; }
    .student-card .note { flex: 0 0 64px; width: 64px; font-size: 13px; }
    .student-card .name { font-size: 14px; }
}

/* =========================
   NOTE / SCORE (petite section)
   ========================= */
.note {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #FFD700;
}

.score-section {
    margin-left: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #FFD700;
    font-weight: 700;
    font-size: 14px;
}

/* =========================
   MODULE (listes de modules)
   ========================= */
.module-section, .module-section-exercice {
    background: var(--card);
    border: 1px solid var(--panel);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 18px;
    margin-top: 18px;
}

.module-section{
border: 1px solid var(--ring);
   
}

.module-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.module-header .step {
    font-weight: 800;
    font-size: 13px;
    background: #2a2d36;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--muted);
}

.module-header .title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

/* =========================
   MODULE-SPECIFIC LAYOUTS
   ========================= */
.module-section-cours {
    background: var(--card);
    margin-bottom: 2px;
    margin-top: 18px;
    max-width: 330px;
    display: flex;
    border: none;
    justify-content: center;
}

.module-list-cours {
    max-width: 800px;
    width: 100%;
    box-sizing: border-box;
}

.module-list-cours ul { margin: 8px 0 0 18px; }
.module-list-cours li { margin: 6px 0; font-size: 14px; color: var(--muted); }

/* =========================
   CODE / PRE
   ========================= */
pre {
    margin-right: 5%;
    max-width: 95%;
    overflow-x: auto;
    
    color: #f5f5f5;
    padding: 0px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.4;
    white-space: pre;
}

code {
    font-family: "Fira Code", Consolas, monospace;
}

/* =========================
   LOGO CONTAINER
   ========================= */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin-left: 30px;
}

/* =========================
   PARTICIPANTS MODAL (corrigé & structuré)
   - reprend le style de .change-screen/.change-card et active scroll interne
   ========================= */

/* Overlay (identique au change-screen look & behavior) */
.challenge-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none; /* affiché via JS : display:flex */
    align-items: center;
    justify-content: center;
    background: rgba(3, 4, 6, 0.72);
    backdrop-filter: blur(8px) saturate(120%);
    overflow: hidden;
}

/* motif animé discret en fond */
.challenge-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-radial-gradient(
        circle,
        rgba(255, 255, 255, 0.055) 0 1px,
        transparent 1px 8px
    );
    background-size: 16px 16px;
    opacity: 0.95;
    mix-blend-mode: overlay;
    filter: blur(0.8px) saturate(1.05);
    animation: moveDots 18s linear infinite;
}

/* fenêtre principale */
.challenge-screen .change-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    max-height: 80vh;
    border-radius: 16px;
    padding: 2; /* réduit l’espace latéral */
    
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* bouton de fermeture */
.challenge-screen .change-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 900;
    cursor: pointer;
    padding: 6px 8px;
    transition: transform 0.18s ease, color 0.18s ease;
}
.challenge-screen .change-close:hover {
    color: #ff4d4d;
    transform: scale(1.12);
}

/* zone scrollable des étudiants */
.challenge-screen .challenge-grid {
    flex: 1;
    overflow-y: auto;
    margin-top: 8px;
    padding: 0px; /* ⬅️ espace interne à gauche/droite réduit */
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* fade bas pour indiquer le scroll */
.challenge-screen .challenge-grid::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, rgba(17, 17, 17, 0.9));
    pointer-events: none;
    z-index: 4;
}

/* scrollbar discrète */
.challenge-screen .challenge-grid::-webkit-scrollbar {
    width: 6px;
}
.challenge-screen .challenge-grid::-webkit-scrollbar-thumb {
    
    border-radius: 8px;
}

/* css/loader.css
   Styles pour l'écran de chargement "code qui défile"
   - utilisé par #site-loader, .loader-card, .terminal, .lines-wrapper, etc.
   - compatible avec un thème Prism externe (ex: dracula-prism.css)
*/

/* ---------- variables ---------- */


/* ---------- overlay global ---------- */
#site-loader{
  position: fixed;
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  z-index: var(--loader-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--bg-overlay), rgba(8,10,12,0.98));
  transition: opacity var(--fade-ms) ease, visibility var(--fade-ms) ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* empêche le scroll du contenu lorsque le loader est actif */
body.loader-active {
  overflow: hidden;
}

/* ---------- carte / faux terminal ---------- */
.loader-card{
  width: min(92%, 800px);
  max-width: 96%;
  border-radius: 12px;
  padding: 14px;
  box-sizing: border-box;
  background: linear-gradient(180deg, var(--card-bg-top), var(--card-bg-bottom));
  box-shadow: 0 10px 40px rgba(2,4,6,0.6);
  border: 1px solid rgba(255,255,255,0.03);
  color: var(--ink);
}

/* header style (les ronds "macos") */
.term-header{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.term-circles{ display:flex; gap:6px; }
.c{ width:10px; height:10px; border-radius:50%; box-shadow: inset 0 -1px rgba(0,0,0,0.25); }
.c.red{ background:#ff5f56; } .c.yellow{ background:#ffbd2e; } .c.green{ background:#27c93f; }
.term-title{ margin-left: auto; color: var(--muted); font-size: .86rem; }

/* ---------- terminal / code area ---------- */
/* on laisse Prism gérer les couleurs -> on n'écrase pas la coloration syntaxique */
.loader-card pre[class*="language-"] {
  margin: 0;
  background: transparent; /* laisser Prism appliquer son fond si besoin */
  
  border-radius: 0px;
  overflow: visible;
  white-space: pre-wrap;
  word-break: break-word;
  box-sizing: border-box;
  
  
}

/* container visible qui masque l'excès (zone fenêtre) */
.terminal{
  border-radius: 3px;
  padding: 0;
  min-height: 140px;
  overflow: hidden;
  position: relative;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.45;
  background:  transparent ; /* Prism theme appliquera le fond si nécessaire */
}

/* zone visible qui masque le reste (masque supérieur/inferieur du scroll) */
.scroll-window{
  height: 120px; /* ajuster : combien de lignes visibles */
  overflow: hidden;
  position: relative;
}

/* wrapper interne qui recevra 2x <pre> pour la boucle fluide */
.lines-wrapper{
  will-change: transform;
}

/* animation de translation verticale (0 -> -50%) */
@keyframes vsroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* class ajoutée par JS pour lancer l'animation */
.lines-wrapper.animated{
  animation: vsroll var(--scroll-speed) linear infinite;
  background:  var(--dracula-background);
}

/* caret (petit rectangle clignotant sur la ligne "boot") */
.caret{
  display:inline-block;
  width:8px;
  height:14px;
  background: var(--ink);
  margin-left: 8px;
  vertical-align: middle;
  animation: blink-caret .9s steps(1) infinite;
}
@keyframes blink-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* message sous le terminal (utilisé sur desktop pour expliquer pourquoi on bloque l'accès) */
#loader-message{
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

/* floating background appliqué à l'overlay lorsqu'on veut un fond animé */
.floating-bg{
  background: linear-gradient(-45deg, #0f0f12, #1e1f25, #2a2d36, #0f0f12);
  background-size: 400% 400%;
  animation: gradientFloat 10s ease infinite;
}
@keyframes gradientFloat {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .lines-wrapper.animated { animation: none; transform: none; }
  .caret { animation: none; opacity: 1; }
  .floating-bg { animation: none; background-size: auto; }
}

/* ---------- responsive: desktop / tablette ---------- */
/* Sur écrans > --max-mobile-width on cache visuellement la fenetre (JS affichera message) */
@media (min-width: calc(var(--max-mobile-width) + 1px)) {
  .scroll-window { display: none; } /* la fenêtre code est cachée */
  .term-title { display: none; }
  #loader-message { color: var(--ink); font-size: 1rem; max-width: 680px; margin-left: auto; margin-right: auto; }
}

/* ---------- accessibilités / utilitaires ---------- */
.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- transitions utiles ---------- */
/* on preserve l'opacité pour fade-out via JS */
#site-loader[aria-hidden="true"] { pointer-events: none; }

/* ---------- optionnel : bouton "continuer quand même" (style prêt) ---------- */
/* Si tu veux ajouter un bouton pour forcer l'accès sur desktop, utilise la structure HTML suivante :
   <button id="loader-continue" class="btn-continue">Continuer quand même</button>
   et affichez-le uniquement sur desktop via JS. */
.btn-continue {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-continue:hover { transform: translateY(-1px); transition: transform .14s ease; }

/* ---------- fine tuning pour Prism integration ----------
   - On laisse dracula-prism.css (ou autre) faire la coloration et le fond.
   - Le loader CSS définit uniquement structure, overflow et animations.
   - Si le thème Prism contient des backgrounds forts, tu peux ajouter :
     .loader-card pre { background: transparent !important; }
   But avoid heavy overrides to preserve theme colors.
*/

.nav-link {
                /* couleur accent (rouge du thème) */
  color: var(--muted);
  text-decoration: none;             /* enlève le soulignement */
  background: var(--card);           /* fond carte */
  padding: 6px;
  
  border-radius: 8px;                /* arrondi */
  transition: background 0.25s ease, color 0.25s ease;
}

.nav-link:hover {
  border-bottom: 1px solid var(--ring);     /* bordure du thème */
}

.sous-titre {
  font-size: 1.6rem;                 /* taille un peu plus grande que normal */
  font-weight: 600;                  /* semi-bold */
  color: var(--ink);                 /* texte clair */
  position: relative;
  margin: 2rem 0 1rem;               /* espacement autour */
  padding-bottom: 0.5rem;
}

.sous-titre::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;                       /* longueur de la barre */
  height: 3px;                       /* épaisseur */
  background: var(--accent);         /* ta couleur accent (rouge) */
  border-radius: 2px;
}


.sous-titre-3{
    font-size: 1.1rem;                 /* taille un peu plus grande que normal */
  font-weight: 600;                  /* semi-bold */
  color: var(--accent);                 /* texte clair */
  position: relative;
  margin: 2rem 0 1rem;               /* espacement autour */
  padding-bottom: 0.5rem;
  
}

.sous-titre-3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;                       /* longueur de la barre */
  height: 3px;                       /* épaisseur */
  background: var(--muted);         /* ta couleur accent (rouge) */
  border-radius: 2px;
}


details p{
    color: var(--muted);
    padding: 6px 12px;
    
    font-size: 0.9rem;
    font-style: italic;
    border: 1px solid var(--ring);
    border-radius: 14px;
    background: var(--dracula-background);
    
}

summary{
    font-size: 1rem;
    font-style: italic;
    
    padding: 6px 12px;
    border-radius: 14px;
    
}
hr {
  border: none;                  /* supprime le style par défaut */
  height: 6px;                   /* épaisseur */
  background: var(--ring);       /* couleur sombre cohérente */
  margin: 2rem 0;                /* espace autour */
  border-radius: 6px;            /* arrondi */
}

/* ---------- Styles spécifiques à la page Challenges ---------- */
.challenge-grid { gap: 12px; }

.challenge-item .module-list { padding: 12px 16px 18px; color: var(--muted); }
.countdown-value {
  display: inline-block;
  font-weight: 800;
  color: var(--accent);
  background: rgba(230,57,70,0.06);
  padding: 4px 8px;
  border-radius: 999px;
  margin-left: 6px;
  min-width: 160px;
  text-align: center;
}

/* état terminé */
.challenge-item.finished {
  opacity: 0.6;
  filter: grayscale(0.08);
}
.challenge-item .muted { color: var(--muted); font-size: 0.92rem; }

/* participants: petits ajustements (responsive déjà géré par ton CSS) */
.student-card { align-items: center; gap: 12px; padding: 10px 12px; }
.student-card .name { text-align: left; padding: 0 12px; }
.student-card .note .score { color: #FFD700; font-weight: 800; }


.copy-btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform .12s ease, background .12s ease;
  
}
.copy-btn {
  display: block;
  margin-left: auto; /* pousse à droite */
}
.copy-btn:hover { transform: translateY(-1px); }
.copy-btn.copied {
  background: rgba(0,128,0,0.12);
  border-color: rgba(0,128,0,0.25);
}
.copy-btn.error {
  background: rgba(200,0,0,0.08);
  border-color: rgba(200,0,0,0.2);
}

/* ========================================================================
   STYLES DES BOUTONS DE MODULES (NOTES + EXERCICE)
   ------------------------------------------------------------------------
   - .action-links : conteneur flex qui aligne les boutons côte à côte
   - .btn-link     : style des boutons (look sobre, hover, active)
   - .notes-link   : cas particulier si besoin de marge en haut
   ======================================================================== */

/* ========================================================================
   STYLES DES BOUTONS DE MODULES (NOTES + EXERCICE)
   ======================================================================== */

.notes-link {
  margin-top: 16px;
}

.action-links {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end; /* aligne les boutons à droite */
  gap: 12px;
  flex-wrap: wrap;           /* passe à la ligne sur mobile */
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}

.btn-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.06);
}

.btn-link:active {
  transform: translateY(0);
}

.btn-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor; /* garde la couleur du texte */
}

/* =========================
   CASES À COCHER PERSONNALISÉES
   ========================= */
/* =========================
   CASES À COCHER CSS PUR
   ========================= */
/* ===============================
   CASE À COCHER RONDE (custom)
   =============================== */
.round-checkbox {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-left: auto; /* pousse à droite */
}

/* on cache l'input natif */
.round-checkbox input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

/* cercle */
.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  border: 2px solid var(--muted, #aaa);
  background-color: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* hover */
.round-checkbox:hover .checkmark {
  border-color: var(--accent, #e63946);
}

/* clic */
.round-checkbox input:active ~ .checkmark {
  transform: scale(0.95);
}

/* coche en CSS */
.checkmark::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid var(--accent, #e63946);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); /* invisible au départ */
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

/* état coché */
.round-checkbox input:checked ~ .checkmark {
  border-color: var(--accent, #e63946);
  background: rgba(230, 57, 70, 0.08);
}

/* apparition animée de la coche */
.round-checkbox input:checked ~ .checkmark::after {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}


 /* reprend tes variables : si elles existent déjà dans ton CSS, pas besoin de les redéfinir */
  :root {
    --icon-size: 34px; /* taille des icônes */
    --gap: 35px;
  }

  .simple-nav {
    display:flex;
    gap:var(--gap);
    align-items:center;
  }

  .simple-link{
    display:inline-flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    text-decoration:none;
    color:var(--ink);
    font-size:12px;
    width: calc(var(--icon-size) + 8px);
    text-align:center;
  }

  .icon-box{
    width:var(--icon-size);
    height:var(--icon-size);
    display:grid;
    place-items:center;
    border-radius:10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.01), rgba(0,0,0,0.03));
    border: 1px solid var(--ring);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
  }

  .simple-link:focus .icon-box,
  .simple-link:hover .icon-box{
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.55);
    border-color: rgba(230,57,70,0.12); /* subtile */
  }
  

  svg.simple-icon{
    width: calc(var(--icon-size) - 10px);
    height: calc(var(--icon-size) - 10px);
    display:block;
  }

  /* stroke default + hover accent */
  .simple-icon path,
  .simple-icon line,
  .simple-icon circle,
  .simple-icon rect {
    stroke: var(--muted);
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  .simple-link:focus .simple-icon path,
  .simple-link:hover .simple-icon path,
  .simple-link:focus .simple-icon line,
  .simple-link:hover .simple-icon line {
    stroke: var(--accent);
  }

  .label {
    color: var(--muted);
    font-size:11px;
    letter-spacing:0.02em;
  }

  @media (prefers-reduced-motion: reduce){
    .icon-box { transition: none !important; transform: none !important; box-shadow: none !important; }
  }
  
  /* positionnement pour pouvoir placer la pastille */
.icon-box { position: relative; }

/* pastille rouge pour indiquer challenges en cours */


.challenge-dot {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent, #e63946); /* rouge par défaut */
  box-shadow: 0 4px 10px rgba(230,57,70,0.28);
  border: 2px solid rgba(0,0,0,0.18);
  display: inline-block;
  transform-origin: center;
  transition: transform 0.18s cubic-bezier(.2,.9,.2,1),
              opacity 0.18s;
}

/* petit effet "pop" au survol du lien */
.simple-link:hover .challenge-dot,
.simple-link:focus .challenge-dot {
  transform: scale(1.2);
}

/* caché si pas de challenge actif */
.challenge-dot[hidden] {
  display: none;
}



.header-challenge {
  display: flex;
  justify-content: center; /* 1er à gauche, 2e à droite */
  align-items: center;
  flex-wrap: wrap;                /* permet au 3e de descendre */
  gap: 10px; /* ajoute de l’espace entre les éléments */
}

.header-challenge .exam-badge {
  text-align: center; /* centre le texte dans chaque bouton */
}

.header-challenge a:nth-child(3) {
  margin: 0 auto; /* centre le 3e sans forcer sa largeur */
}


.header-challenge a {
  text-decoration: none; /* enlève le soulignement */
}




 /* ------------------------------------- */
 
 /* ------------------------------------- */
 
 /* ------------Page-404--------------- */
 
 
 /* ------------------------------------- */
    .card-center {
      min-height: 50vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px; /* évite que ça colle aux bords sur petits écrans */
      box-sizing: border-box;
    }

    .card-404 {
      width: min(var(--center-max-width), 96vw);
      background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
      border: 1px solid rgba(255,255,255,0.04);
      border-radius: 14px;
      padding: 28px;
      box-shadow: 0 12px 40px rgba(2,6,11,0.6);
      display: grid;
      grid-template-columns: 1fr;
      gap: 2px;
      align-items: center;
      justify-items: center;
      position: relative;
      overflow: hidden;
    }

    .status {
      display:flex;
      flex-direction:column;
      align-items:center;
      gap:10px;
      text-align:center;
      z-index: 4;
      
    }

    .status h1 {
      margin:0;
      font-size: clamp(28px, 5vw, 42px);
      letter-spacing: -0.02em;
      color: #fff;
    }
    .status p {
      margin:0;
      color: var(--muted);
      max-width: 68ch;
      line-height:1.45;
      font-size: 12px;
    }

.img-wrap-illustration, .img-wrap-guide {
      position: relative;
      max-width: 40%;
      height: auto;
      display:flex;
      align-items:center;
      justify-content:center;
      padding: 0; /* plus de padding */
      margin-bottom: -10px;
      margin-top: -5px;
      box-sizing: border-box;
      z-index: 2;
      
 }
    
    
.img-inner {
    position: relative;
    z-index: 1;
    
}

.img-inner img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    vertical-align: middle;
}    
       
  

 .img-wrap-illustration img {
  display: block;
  margin: 0 auto;
  position: relative;
  margin-left: 50px;
  
  
}



    
    .img-wrap-guide{
    margin-bottom: 0px;
      margin-top: 0px;
        max-width: 80%;
    }

    /* plus aucune bordure/ombre sur l'image */


    .img-wrap-404 img {
      display:block;
      width:100%;
      height:auto;
      object-fit:cover;
      vertical-align: middle;
    }
    
 

    .small {
      color: var(--muted);
      font-size: 13px;
    }
    
