/* ============================================================
   expresalab.css – ExpresaLab Nature Theme
   Charles de ZORDO – 2026
   Fond vivant forêt : particules vertes/dorées, lumière filtrée
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    --forest-deep:   #0d1a0f;
    --forest-mid:    #122418;
    --forest-card:   rgba(15, 28, 18, 0.78);
    --forest-border: rgba(74, 160, 90, 0.22);
    --leaf-green:    #4aa05a;
    --gold:          #d4a843;
    --light-gold:    #f5d67a;
    --text:          #e8f5e9;
    --text-dim:      #a5c9a8;
    --text-mute:     #6b9470;
    --font:          'Nunito', sans-serif;
    --font-display:  'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: var(--font);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

body {
    background: var(--forest-deep);
}

/* ============================================================
   SPLASH SCREEN
   ============================================================ */
#splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--forest-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
#splash.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
#splash svg.splash-husky {
    width: 140px;
    height: 140px;
    animation: huskyFloat 3s ease-in-out infinite;
}
.splash-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text), var(--light-gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 1px;
}
.splash-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--leaf-green);
    opacity: 0;
    animation: splashRing 1.8s ease-out forwards;
}
.splash-ring:nth-child(1) { width:160px; height:160px; animation-delay:0.1s; }
.splash-ring:nth-child(2) { width:220px; height:220px; animation-delay:0.35s; }
.splash-ring:nth-child(3) { width:280px; height:280px; animation-delay:0.6s; }
@keyframes splashRing {
    0%   { transform:scale(0.7); opacity:0.5; }
    100% { transform:scale(1.2); opacity:0; }
}
@keyframes huskyFloat {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-8px); }
}

/* ============================================================
   CANVAS FORÊT
   ============================================================ */
#forestCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
    position: relative;
    z-index: 10;
    background: rgba(10, 22, 12, 0.75);
    border-bottom: 1px solid var(--forest-border);
    backdrop-filter: blur(12px);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title h1 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--light-gold);
}
.topbar-sub { font-size: 11px; color: var(--text-mute); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   BUTTONS
   ============================================================ */
button, select {
    font-family: var(--font);
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--forest-border);
    background: rgba(15,30,18,0.8);
    color: var(--text);
    padding: 9px 18px;
    cursor: pointer;
    transition: all 0.18s ease;
    backdrop-filter: blur(6px);
}
button:hover { background: rgba(74,160,90,0.2); border-color: var(--leaf-green); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: linear-gradient(135deg, #1d5c28, #2d8a40);
    border-color: var(--leaf-green);
    color: white;
    font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(135deg, #256b31, #38a050); }

.btn-ia {
    background: linear-gradient(135deg, #4a3500, #8a6200);
    border-color: var(--gold);
    color: var(--light-gold);
    font-weight: 700;
}
.btn-ia:hover { background: linear-gradient(135deg, #5c4200, #a87800); }

.btn-round {
    width: 52px; height: 52px;
    border-radius: 50%;
    padding: 0;
    font-size: 20px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.btn-round:hover { transform: translateY(-3px) scale(1.05); }

select {
    border-radius: 999px;
    background: rgba(15,30,18,0.8);
    color: var(--text);
    padding: 9px 18px;
}

/* ============================================================
   WIZARD : ÉTAPES DU PROJET
   ============================================================ */
.app-layout-wizard {
    position: relative;
    z-index: 5;
    padding: 14px;
    max-width: 800px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
}

.wizard-step {
    display: none;
    animation: fadeInStep 0.4s ease-out;
}
.wizard-step.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-header {
    text-align: center;
    margin-bottom: 10px;
}
.wizard-header h2 {
    font-family: var(--font-display);
    color: var(--light-gold);
    margin: 0 0 5px;
}
.wizard-header p {
    color: var(--text-dim);
    font-size: 14px;
    margin: 0;
}

/* ÉTAPE 1 : GRILLE DES THÈMES */
.theme-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 20px;
}
@media (min-width: 600px) {
    .theme-grid { grid-template-columns: repeat(3, 1fr); }
}

.theme-card {
    background: var(--forest-card);
    border: 2px solid var(--forest-border);
    border-radius: 20px;
    padding: 30px 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}
.theme-card:hover {
    border-color: var(--leaf-green);
    background: rgba(74, 160, 90, 0.15);
    transform: translateY(-5px);
}

/* ÉTAPE 2 : PRÉPARATION */
.cubes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
@media (max-width: 500px) {
    .cubes-grid { grid-template-columns: repeat(2, 1fr); }
}

.step-actions {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.btn-back {
    position: absolute;
    left: 10px;
    top: 10px;
    font-size: 12px;
    padding: 6px 12px;
}

/* RÉFÉRENCE FLOTTANTE : BOUTONS */
.recall-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Grille 2x2 plus équilibrée */
    gap: 8px;
    padding: 8px;
}
.btn-recall {
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--forest-border);
    color: var(--text);
    transition: all 0.2s;
}
.btn-recall:active { transform: scale(0.95); background: rgba(74,160,90,0.2); }

/* BULLE DE SUGGESTION PROACTIVE */
#connectorTip {
    display: none;
    background: rgba(212, 168, 67, 0.15);
    border-left: 4px solid var(--gold);
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--light-gold);
    animation: slideInTip 0.4s ease-out;
}
@keyframes slideInTip {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* CONTENU DU RAPPEL */
.recall-grid-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
}
.recall-item {
    background: rgba(255,255,255,0.05);
    padding: 8px;
    border-radius: 10px;
    font-size: 12px;
}
.recall-item .emoji { font-size: 20px; }

/* BADGES DE NIVEAU IA */
.nivel-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 800;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.nivel-A { background: var(--leaf-green); color: #051a05; }
.nivel-B { background: var(--gold); color: #1a1505; }
.nivel-C { background: #e5534b; color: white; }

.seccion-correccion {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    border-left: 3px solid var(--leaf-green);
}
.seccion-correccion h3 { margin-top: 0; color: var(--light-gold); font-size: 16px; }
.error-original { text-decoration: line-through; color: #e5534b; }
.error-correcto { color: var(--leaf-green); font-weight: 700; }
.star-pop {
    font-size: 80px;
    animation: starJump 1.2s ease-out forwards;
    filter: drop-shadow(0 0 15px gold);
}
@keyframes starJump {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    50% { transform: scale(1.5) rotate(15deg); opacity: 1; }
    100% { transform: scale(1) translateY(-100px); opacity: 0; }
}
.ref-panel {
    padding: 15px;
    border-top: 1px solid var(--forest-border);
    max-height: 300px;
    overflow-y: auto;
}
.cubes-grid-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.cube-mini {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 5px;
    text-align: center;
    font-size: 10px;
}
.cube-mini .emoji { font-size: 20px; }
.cube-mini strong { display: block; color: var(--gold); font-size: 9px; }

/* RE-ADAPTATION DU DASHBOARD POUR LE WIZARD */
.wizard-step .dashboard-grid {
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 10px;
}
@media (max-width: 600px) {
    .wizard-step .dashboard-grid { grid-template-columns: repeat(3, 1fr); }
}
.col { display: flex; flex-direction: column; gap: 10px; }

.panel-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--leaf-green);
    font-weight: 700;
    margin: 6px 0 -2px;
}

/* ============================================================
   CARDS / PANNEAUX
   ============================================================ */
.glass-card {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    padding: 14px;
}

#consigneBox, #connecteurBox {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    line-height: 1.5;
    border: 1px solid var(--forest-border);
    backdrop-filter: blur(8px);
}

#cubes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.cube {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
    font-size: 13px;
    color: var(--text);
    position: relative;
    backdrop-filter: blur(6px);
    transition: border-color 0.2s, background 0.2s;
}
.cube.carta-usada {
    border-color: var(--leaf-green);
    background: rgba(74,160,90,0.12);
}
.cube .emoji { font-size: 28px; margin-bottom: 3px; }
.cube strong { color: var(--gold); font-size: 11px; display: block; margin-top: 3px; }

.carta-check {
    position: absolute;
    top: 5px; right: 5px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--leaf-green);
    color: #0d1a0f;
    font-size: 9px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.cube:hover::after {
    content: attr(data-info);
    position: absolute;
    bottom: -8px; left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: rgba(10,22,12,0.95);
    border: 1px solid var(--forest-border);
    padding: 8px 12px;
    border-radius: 10px;
    white-space: pre-line;
    font-size: 11px;
    color: var(--text);
    z-index: 20;
    width: max-content; max-width: 180px;
    text-align: left;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}
@keyframes fadeInTooltip {
    from { opacity:0; transform: translateX(-50%) translateY(110%); }
    to   { opacity:1; transform: translateX(-50%) translateY(100%); }
}

/* ============================================================
   CENTRE : ÉCRITURE
   ============================================================ */
#instructionEcriture {
    font-size: 14px;
    font-weight: 600;
    color: var(--light-gold);
    min-height: 1.4em;
    padding: 2px 0;
}

#zoneHistoire {
    display: block; /* Visible par défaut, c'est l'étape qui contrôle la section */
    width: 100%;
    min-height: 200px;
    padding: 14px;
    font-family: var(--font);
    font-size: 16px; /* Évite le zoom sur Android */
    line-height: 1.7;
    border-radius: 14px;
    border: 1px solid var(--forest-border);
    background: rgba(10, 22, 12, 0.72);
    color: var(--text);
    resize: none;
    backdrop-filter: blur(8px);
    margin-bottom: 15px;
}
#zoneHistoire::placeholder { color: var(--text-mute); }

#textoConFeedback {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(10,22,12,0.65);
    border: 1px solid var(--forest-border);
    font-size: 14px;
    line-height: 1.8;
    min-height: 30px;
    color: var(--text);
    backdrop-filter: blur(6px);
}
.frase-ok   { background: rgba(74,160,90,0.18); border-bottom: 2px solid var(--leaf-green); border-radius: 3px; padding: 0 2px; color: #b9f0bc; }
.frase-warn { background: rgba(212,168,67,0.18); border-bottom: 2px solid var(--gold); border-radius: 3px; padding: 0 2px; color: #f5d67a; }
.frase-neutral { color: var(--text-dim); }

.palabra-incorrecta { text-decoration: line-through; color: #f0a0a0; opacity: 0.8; }
.palabra-correccion { color: #b9f0bc; font-weight: 600; }

#tarjetasFeedback { display: flex; flex-wrap: wrap; gap: 8px; }
.feedback-card {
    flex: 1; min-width: 200px;
    border-radius: 10px; padding: 10px 12px;
    font-size: 12px; line-height: 1.5;
    border: 1px solid transparent;
    backdrop-filter: blur(6px);
}
.feedback-card .fb-header { font-weight: 700; font-size: 11px; margin-bottom: 3px; display: block; }
.feedback-ok   { background: rgba(74,160,90,0.14); border-color: rgba(74,160,90,0.3); color: #b9f0bc; }
.feedback-ok .fb-header { color: var(--leaf-green); }
.feedback-warn { background: rgba(212,168,67,0.14); border-color: rgba(212,168,67,0.3); color: #f5d67a; }
.feedback-warn .fb-header { color: var(--gold); }
.feedback-neutral { background: var(--forest-card); border-color: var(--forest-border); color: var(--text-dim); }

.center-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

#btnCorregir {
    background: linear-gradient(135deg, #4a3500, #8a6200);
    color: var(--light-gold);
    border: 1px solid var(--gold);
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
#btnCorregir:hover:not(:disabled) {
    background: linear-gradient(135deg, #5c4200, #a87800);
    transform: translateY(-2px);
}
#btnCorregir:disabled { opacity: 0.5; }

/* ============================================================
   DASHBOARD COMPTEURS
   ============================================================ */
#dashboardContadores { width: 100%; }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.dash-card {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 10px;
    padding: 9px 5px;
    text-align: center;
    border-top: 3px solid var(--forest-border);
    backdrop-filter: blur(6px);
    transition: all 0.2s;
}
.dash-palabras   { border-top-color: #5ba3d9; }
.dash-indefinido { border-top-color: #e5534b; }
.dash-imperfecto { border-top-color: #a78bfa; }
.dash-conectores { border-top-color: var(--gold); }
.dash-adjetivos  { border-top-color: var(--leaf-green); }
.dash-card.dash-ok { border-top-color: var(--leaf-green) !important; background: rgba(74,160,90,0.12); }
.dash-icon { font-size: 16px; margin-bottom: 2px; }
.dash-label { font-size: 9px; color: var(--text-mute); font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.dash-value { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1; }
.dash-total { font-size: 11px; color: var(--text-mute); font-weight: 400; }
.dash-sub { font-size: 8px; color: var(--text-mute); min-height: 12px; }
.dash-card.dash-ok .dash-sub { color: var(--leaf-green); font-weight: 600; }

/* ============================================================
   NIVEAU CECRL
   ============================================================ */
#nivelLiveBox {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    backdrop-filter: blur(8px);
}
.nivel-live-value { font-size: 26px; font-weight: 700; color: var(--gold); }
.nivel-live-label { font-size: 9px; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.nivel-live-detalle { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.nivel-live-checks { font-size: 10px; color: var(--text-dim); margin-top: 8px; line-height: 1.8; text-align: left; display: inline-block; }
.check-ok   { color: var(--leaf-green); font-weight: 600; }
.check-pend { color: var(--gold); font-weight: 600; }

/* ============================================================
   ADJECTIFS
   ============================================================ */
#adjetivosBox {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(8px);
}
#listeAdjetivos { display: flex; flex-wrap: wrap; gap: 5px; }
#listeAdjetivos button {
    font-size: 11px; padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--forest-border);
    background: rgba(15,30,18,0.6);
    color: var(--text-dim) !important;
}
#listeAdjetivos button.adj-chosen { background: rgba(74,160,90,0.2); border-color: var(--leaf-green); color: #b9f0bc !important; }
#listeAdjetivos button.adj-usado-check { background: rgba(212,168,67,0.2); border-color: var(--gold); color: var(--light-gold) !important; }
#adjetivosSeleccionados { margin: 8px 0 0; font-size: 12px; color: var(--text-dim); }

/* ============================================================
   MINUTEUR
   ============================================================ */
#timer {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-display);
    backdrop-filter: blur(8px);
}

/* ============================================================
   DICTÉE
   ============================================================ */
#dictadoBox {
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(8px);
}
.dictado-help { font-size: 11px; color: var(--text-dim); margin: 0 0 8px; }
.dictado-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.dictado-buttons button { font-size: 11px; padding: 6px 10px; }
#dictadoTexto {
    width: 100%; padding: 10px;
    font-size: 12px; border-radius: 8px;
    border: 1px solid var(--forest-border);
    background: rgba(10,22,12,0.7);
    color: var(--text); resize: vertical;
    font-family: var(--font);
}
#dictadoTexto::placeholder { color: var(--text-mute); }
#estadoDictado { font-size: 11px; color: var(--text-mute); margin: 6px 0 0; }

/* ============================================================
   CONNECTEURS CHIPS
   ============================================================ */
.conector-chip {
    display: inline-block;
    font-size: 11px; padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(255,255,255,0.15);
    color: white; margin: 2px 2px 0 0;
}
.conector-chip.conector-usado { background: rgba(74,160,90,0.2); border-color: var(--leaf-green); color: #b9f0bc; }
.chip-check { font-weight: 700; }

/* ============================================================
   CORRECCIÓN IA
   ============================================================ */
#correccionBox {
    display: none; width: 100%;
    background: var(--forest-card);
    border: 1px solid var(--forest-border);
    border-radius: 14px; overflow: hidden;
    backdrop-filter: blur(10px);
    animation: fadeInCorreccion 0.3s ease;
}
@keyframes fadeInCorreccion {
    from { opacity:0; transform: translateY(8px); }
    to   { opacity:1; transform: translateY(0); }
}
.correccion-header {
    background: linear-gradient(135deg, #1d4a25, #2d7a38);
    color: white; padding: 12px 18px;
    display: flex; justify-content: space-between; align-items: center;
}
.correccion-title { font-size: 14px; font-weight: 600; }
.btn-cerrar-correccion {
    background: rgba(255,255,255,0.15); color: white;
    border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
    padding: 4px 10px; cursor: pointer; font-size: 11px; margin: 0;
}
.correccion-contenido { padding: 16px 20px; color: var(--text-dim); }
.nivel-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.nivel-A { background: rgba(74,160,90,0.15); color: #b9f0bc; border: 1px solid var(--leaf-green); }
.nivel-B { background: rgba(212,168,67,0.15); color: #f5d67a; border: 1px solid var(--gold); }
.nivel-C { background: rgba(229,83,75,0.15); color: #ffb3b3; border: 1px solid #e5534b; }
.seccion-correccion { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--forest-border); }
.seccion-correccion h3 { margin: 0 0 6px; font-size: 13px; color: var(--text); }
.seccion-correccion p, .seccion-correccion ul { margin:0; font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.seccion-correccion ul { padding-left: 16px; }
.seccion-correccion li { margin-bottom: 5px; }
.error-original { background: rgba(229,83,75,0.18); color: #ffb3b3; padding: 1px 4px; border-radius: 4px; text-decoration: line-through; font-weight: 600; }
.error-correcto { background: rgba(74,160,90,0.18); color: #b9f0bc; padding: 1px 4px; border-radius: 4px; font-weight: 600; }
.mensaje-final { background: rgba(212,168,67,0.1); border-left: 3px solid var(--gold); border-radius: 8px; padding: 10px 14px; font-size: 12px; color: var(--text-dim); }
.mensaje-final p { margin: 0; }
.correccion-loading { display: flex; flex-direction: column; align-items: center; padding: 28px; color: var(--text-dim); font-size: 13px; }
.correccion-spinner { width: 30px; height: 30px; border: 3px solid var(--forest-border); border-top: 3px solid var(--leaf-green); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   POPUPS GENERIQUES (accessibilité, install)
   ============================================================ */
.rgpd-popup {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex; justify-content: center; align-items: center;
    z-index: 9990;
}
.rgpd-content {
    background: var(--forest-mid);
    border: 1px solid var(--forest-border);
    padding: 24px; width: 90%; max-width: 420px;
    border-radius: 16px; text-align: center; color: var(--text);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }
.rgpd-content h2, .rgpd-content h3 { margin-top: 0; color: var(--text); }
.rgpd-content p, .rgpd-content li { color: var(--text-dim); font-size: 13px; }
#rgpdBtn { background: var(--leaf-green); color: white; border: none; margin-top: 14px; }

/* ============================================================
   RÉSULTATS ANALYSE (hidden)
   ============================================================ */
#analyseConnecteurs, #analyseVerbes { display: none; }
#resultadoTexto { font-size: 13px; color: var(--text-dim); }

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    position: relative; z-index: 5;
    padding: 14px 20px; text-align: center;
    font-size: 12px; color: var(--text-mute);
    background: rgba(10,22,12,0.6);
    border-top: 1px solid var(--forest-border);
    margin-bottom: 80px;
}
.footer-bold { font-weight: 600; color: var(--text-dim); }

/* Adj avec mark */
mark { background: rgba(74,160,90,0.2); color: #b9f0bc; border-radius: 3px; padding: 0 2px; }

/* ============================================================
   SÉLECTEUR DE TEMPS (banner prof)
   ============================================================ */
#bannerTiempos {
    position: relative;
    z-index: 9;
    background: rgba(10, 22, 12, 0.70);
    border-bottom: 1px solid var(--forest-border);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.banner-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}
#selectorTiempos {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tiempo-chip {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--forest-border);
    background: rgba(15,30,18,0.7);
    color: var(--text-mute);
    cursor: pointer;
    transition: all 0.18s ease;
}
.tiempo-chip.tiempo-activo {
    background: rgba(74,160,90,0.25);
    border-color: var(--leaf-green);
    color: #b9f0bc;
    font-weight: 700;
}
.tiempo-chip:hover { border-color: var(--leaf-green); color: var(--text); }

/* ============================================================
   ZONE SUGGESTIONS IA (correction automatique)
   ============================================================ */
#sugerenciasIA {
    width: 100%;
    background: rgba(10, 22, 12, 0.80);
    border: 1px solid var(--forest-border);
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: blur(10px);
    animation: fadeInCorreccion 0.3s ease;
}
.sugerencias-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.sug-cerrar {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--text-mute);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}
.sug-cerrar:hover { color: var(--text); }

.nivel-badge-inline {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.nivel-badge-inline.nivel-A { background: rgba(74,160,90,0.2); color: #b9f0bc; border: 1px solid var(--leaf-green); }
.nivel-badge-inline.nivel-B { background: rgba(212,168,67,0.2); color: var(--light-gold); border: 1px solid var(--gold); }
.nivel-badge-inline.nivel-C { background: rgba(229,83,75,0.15); color: #ffb3b3; border: 1px solid #e5534b; }

.sug-logros {
    font-size: 12px;
    color: #b9f0bc;
    background: rgba(74,160,90,0.1);
    border: 1px solid rgba(74,160,90,0.2);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    line-height: 1.5;
}
.sug-seccion { margin-bottom: 8px; }
.sug-titulo {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-mute);
    margin-bottom: 6px;
}
.sugerencia-error-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.5;
}
.sug-original {
    text-decoration: line-through;
    color: #f0a0a0;
    background: rgba(229,83,75,0.1);
    padding: 1px 6px;
    border-radius: 4px;
}
.sug-flecha { color: var(--text-mute); }
.sug-correcto {
    color: #b9f0bc;
    font-weight: 700;
    background: rgba(74,160,90,0.1);
    padding: 1px 6px;
    border-radius: 4px;
}
.sug-explicacion { color: var(--text-dim); font-size: 11px; }
.sugerencia-tip {
    font-size: 12px;
    color: var(--light-gold);
    margin-bottom: 4px;
    line-height: 1.5;
}
.sugerencia-loading {
    font-size: 12px;
    color: var(--text-mute);
    font-style: italic;
    text-align: center;
    padding: 10px;
}
.sugerencia-error {
    font-size: 12px;
    color: #f0a0a0;
    text-align: center;
    padding: 8px;
}

/* ============================================================
   DICTIONNAIRE IA FLOTTANT
   ============================================================ */
.dic-bubble {
    position: fixed;
    z-index: 99999;
    width: 300px;
    background: rgba(8, 18, 10, 0.97);
    border: 1px solid var(--leaf-green);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(74,160,90,0.1);
    overflow: hidden;
    animation: bubbleIn 0.2s ease;
}
@keyframes bubbleIn {
    from { opacity:0; transform:scale(0.92) translateY(6px); }
    to   { opacity:1; transform:scale(1) translateY(0); }
}
.dic-header {
    background: rgba(74,160,90,0.15);
    border-bottom: 1px solid var(--forest-border);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dic-palabra {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #b9f0bc;
    flex: 1;
}
.dic-tipo {
    font-size: 10px;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.dic-nivel-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(212,168,67,0.2);
    border: 1px solid var(--gold);
    color: var(--light-gold);
    font-weight: 700;
}
.dic-cerrar {
    background: transparent;
    border: none;
    color: var(--text-mute);
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
}
.dic-cerrar:hover { color: var(--text); }

.dic-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dic-definicion {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.6;
}
.dic-conjugacion {
    font-size: 11px;
    color: var(--light-gold);
    background: rgba(212,168,67,0.08);
    border-radius: 6px;
    padding: 5px 8px;
    font-family: var(--font-display);
}
.dic-sinonimos {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.dic-chip {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(74,160,90,0.12);
    border: 1px solid rgba(74,160,90,0.25);
    color: #b9f0bc;
}
.dic-ejemplo {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.5;
    border-left: 2px solid var(--leaf-green);
    padding-left: 8px;
}
.dic-expresiones { display: flex; flex-direction: column; gap: 3px; }
.dic-expresion {
    font-size: 11px;
    color: var(--gold);
    line-height: 1.4;
}
.dic-cargando {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-mute);
    font-style: italic;
}
