/* -------------------------------
   CORSI — UI THEME (UMONS)
   Couleurs & polices alignées avec ton style existant
---------------------------------*/

/* Polices */
@import url("https://fonts.googleapis.com/css?family=Roboto|Raleway|Roboto+Slab");

/* Variables de thème */
:root{
  --bg-grad-start: #667eea;
  --bg-grad-end:   #764ba2;
  --card-bg: #ffffff;
  --card-shadow: 0 10px 30px rgba(0,0,0,.10);
  --text: #1d1f27;
  --muted: #606772;
  --primary: #2f80ed;     /* boutons / accents */
  --primary-dark: #1f5fb4;
  --accent-green: #27ae60;/* succès */
  --accent-red:   #eb5757;/* erreur */
  --stroke: #ccd5dd;      /* bordures douces */
  --block-stroke: #3a4757;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Reset léger */
*{ box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-grad-start) 0%, var(--bg-grad-end) 100%);
  color: var(--text);
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* Option jsPsych compat si tu utilises son conteneur */
.jspsych-display-element{ margin:0; }

/* Arrière-plan (nom maintenu pour compat avec ton code) */
.display_stage_background{
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-grad-start) 0%, var(--bg-grad-end) 100%);
  z-index: -1;
}

/* Carte centrale -> passe en plein écran sans padding */
.display_stage{
  position: fixed;
  inset: 0;             /* occupe tout l’écran */
  width: 100vw; height: 100vh;
  background: transparent;   /* on laisse voir le gradient de fond */
  box-shadow: none;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
}

/* ---------- Layout Corsi ---------- */

/* Wrapper principal du test */
.corsi-wrap{
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 18px;
  height: 100%;
}

/* Bandeau d’infos (HUD) */
.corsi-hud{
  display: flex;
  gap: 20px;
  align-items: center;
  font-family: "Raleway", Roboto, sans-serif;
  color: var(--muted);
  font-size: 15px;
}
.corsi-hud strong{ color: var(--text); }

/* Aire de jeu = plein écran */
.corsi-grid{
  position: absolute;
  inset: 0;
  width: 90vw; height: 90vh;
  margin: 10px auto;
  background: #f4f6f8;
  border: 0;
  border-radius: 0;
  box-shadow: inset 0 4px 12px rgba(0,0,0,.06);
  user-select: none;
  touch-action: manipulation;
}

/* Feedback neutre au clic (pendant la réponse du participant) */
.corsi-block.tap{
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(47,128,237,.25);
  transform: scale(1.05);
}

/* (Optionnel) on neutralise toute trace d'erreur */
.corsi-block.miss{ /* plus utilisé */
  background: inherit;
  border-color: var(--block-stroke);
}



/* Blocs (sans numéro visible) */
/* Les blocs auront une taille fixée par JS (en px) pour rester proportionnels */
.corsi-block{
  position: absolute;
  min-width: 90px;
  min-height: 90px;
  border-radius: var(--radius-md);
  background: #fff;
  border: 2px solid var(--block-stroke);
  box-shadow: 0 3px 10px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
}

.corsi-block:focus-visible{
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.corsi-block.dim{ opacity: .75; }
.corsi-block.active{
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(47,128,237,.25);
  transform: scale(1.05);
}
.corsi-block.hit{
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.corsi-block.miss{
  background: var(--accent-red);
  border-color: var(--accent-red);
}

/* Message / consignes */
.corsi-msg{
  min-height: 28px;
  text-align: center;
  font-size: 16px;
  color: var(--text);
  font-family: "Roboto Slab", Georgia, serif;
}

/* Boutons d’action */
.corsi-cta{
  display: flex; gap: 10px; justify-content: center; align-items: center;
}
.corsi-btn{
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(47,128,237,.25);
  transition: transform .08s ease, background-color .12s ease, box-shadow .12s ease;
}
.corsi-btn:hover{ background: var(--primary-dark); }
.corsi-btn:active{ transform: translateY(1px); }
.corsi-btn.secondary{
  background: #48556a;
  box-shadow: 0 6px 14px rgba(72,85,106,.18);
}
.corsi-btn.secondary:hover{ background: #3b4658; }

/* Encadré final (résumé & téléchargement) */
.corsi-final{
  margin: 6px auto 0;
  max-width: 820px;
  width: 92%;
  padding: 14px 16px;
  background: #eef7ed;
  border: 1px solid #cfe9cf;
  border-radius: var(--radius-md);
  color: #234b2e;
  font-size: 15px;
}

/* ---------- Responsif ---------- */
@media (max-width: 1024px){
  .display_stage{ left: 3vw; width: 94vw; }
  .corsi-grid{ width: 92vw; height: 72vh; }
}

/* Phase DEMO (ordi joue la séquence) : contour vert */
.corsi-grid.demo .corsi-block{
  border-color: var(--accent-green);
}
.corsi-grid.demo .corsi-block.active{
  border-color: var(--accent-green);
}

.end-wrap{
  max-width: 760px; margin: 12vh auto 0; padding: 24px 22px;
  background: #fff; border-radius: 16px; box-shadow: var(--card-shadow);
  text-align: center;
}
.end-title{ margin: 0 0 8px 0; font-size: 26px; }
.end-text{ margin: 6px 0 16px 0; }
.end-stats{ margin: 10px 0 18px 0; display: grid; gap: 6px; }
.end-cta{ display: flex; gap: 10px; justify-content: center; }


/* Phase INPUT (participant répond) : contour normal/bleu par défaut */
.corsi-grid.input .corsi-block{
  border-color: var(--block-stroke);
}

/* ---- Overlays d’instructions / fin ---- */
.corsi-overlay{
  position:absolute; inset:0;
  display:none; align-items:center; justify-content:center;
  background: rgba(0,0,0,.35);
  z-index: 50;
}
.corsi-card{
  background:#fff; border-radius:16px; padding:24px 22px;
  max-width: 720px; width: min(92vw, 720px);
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
  font-family: "Roboto", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}
.corsi-card h2{ margin: 0 0 8px 0; font-size: 24px; }
.corsi-card p { margin: 8px 0; line-height: 1.45; }
.corsi-card-cta{ margin-top:16px; display:flex; gap:10px; justify-content:flex-end; }

@media (max-width: 640px){
  .display_stage{
    left: 2vw; top: 1.5vh; width: 96vw; height: 97vh; padding: 18px;
    border-radius: 14px;
  }
  .corsi-hud{ font-size: 14px; gap: 12px; flex-wrap: wrap; }
  .corsi-grid{ width: 96%; height: 70vh; }
  .corsi-btn{ padding: 10px 14px; }
}

/* ---------- Classes “texte” héritées utiles (compat) ---------- */
.centerbox{
  width: 50vw; height: 60vh;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
.block-text, .center-block-text{
  width: 100%;
  margin: 0 auto 1em auto;
  line-height: 1.2;
  font-size: 22px;
  font-family: "Raleway", Roboto, sans-serif;
  color: var(--text);
}
.block-text{ text-align: justify; }
.center-block-text{ text-align: center; }

.center-text{
  text-align: center; font-size: 56px; position: relative; top: 50%;
  transform: translateY(-50%);
}
.fixation{
  text-align: center; font-size: 140px; position: relative; top: 50%;
  transform: translateY(-50%);
}

/* Accessibilité : préférer le contraste quand prefers-reduced-motion */
@media (prefers-reduced-motion: reduce){
  .corsi-block, .corsi-btn{ transition: none !important; }
}
