/* ============================================================================
   Moulinette 42 — style.css
   Thème : sombre "terminal / école 42", accent néon émeraude (#34d399),
   glassmorphism léger, micro-animations (transform/opacity uniquement).
   Zéro dépendance externe : polices système (sans + mono).
   ========================================================================== */

:root {
  /* Fond */
  --bg-0: #0a0b0f;
  --bg-1: #0d0f15;
  --bg-2: #12141c;

  /* Verre (cartes) */
  --glass-bg: rgba(20, 23, 32, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.14);

  /* Texte */
  --fg: #e8ecf2;
  --fg-muted: #9aa4b2;
  --fg-dim: #667085;

  /* Accent néon émeraude + complément cyan */
  --accent: #34d399;
  --accent-2: #22d3ee;
  --accent-ink: #052e21;
  --accent-glow: rgba(52, 211, 153, 0.35);
  --accent-soft: rgba(52, 211, 153, 0.12);

  /* États sémantiques */
  --ok: #34d399;
  --danger: #fb7185;
  --warn: #fbbf24;
  --gray: #64748b;

  /* Médailles */
  --gold: #fcd34d;
  --silver: #cbd5e1;
  --bronze: #d8985a;

  /* Formes & mouvement */
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Consolas", "JetBrains Mono", "Roboto Mono", "Liberation Mono", Menlo, monospace;
}

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

/* [hidden] doit l'emporter sur les display: grid/flex de nos composants. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--fg);
  background:
    radial-gradient(1200px 700px at 82% -8%, rgba(34, 211, 238, 0.10), transparent 60%),
    radial-gradient(1000px 640px at 0% 0%, rgba(52, 211, 153, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 55%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* Grille subtile en fond (vibe terminal) */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
}

.wrap {
  width: min(1120px, 100% - 2.5rem);
  margin-inline: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  color: var(--accent);
}

/* Accessibilité : focus & saut de contenu */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 20;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ------------------------------ Header ----------------------------------- */
.site-header {
  padding: 2.4rem 0 1.2rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: fade-slide 0.7s var(--ease) both;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 14px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -1px;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.14) inset,
    0 8px 30px var(--accent-glow);
}
.brand-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, #b9c2d0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  margin: 0.1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--fg-muted);
}
.prompt-caret { color: var(--accent); font-weight: 700; }

/* ------------------------------ Layout ----------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
  padding-bottom: 3rem;
}
/* minmax(0, 1fr) : sinon un bloc de code non sécable (arborescence, diff)
   élargit la piste et fait déborder la page horizontalement. */
.col-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; min-width: 0; }
.col-side { position: sticky; top: 1.4rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; }
}

/* ------------------------------ Cartes ----------------------------------- */
.card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 20px 50px -30px rgba(0, 0, 0, 0.9);
  animation: fade-slide 0.6s var(--ease) both;
}
.card-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card-hint {
  margin: 0 0 1rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ------------------------------ Champs ----------------------------------- */
.field-row {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.4rem; min-width: 0; }
.field label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

input[type="text"],
select {
  width: 100%;
  font: inherit;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
input[type="text"]::placeholder { color: var(--fg-dim); }
input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(52, 211, 153, 0.05);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px -6px var(--accent-glow);
}

.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 0.9rem; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--fg-muted);
  border-bottom: 2px solid var(--fg-muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  cursor: pointer;
}
select option { background: var(--bg-2); color: var(--fg); }

/* ------------------------------ Dropzone --------------------------------- */
.dropzone {
  display: grid;
  place-items: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1.9rem 1rem;
  border: 2px dashed var(--glass-border-strong);
  border-radius: var(--radius);
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  color: var(--fg);
  background: var(--accent-soft);
}
.dropzone.is-drag {
  border-color: var(--accent);
  border-style: solid;
  color: var(--fg);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 40px -8px var(--accent-glow);
  transform: translateY(-2px);
}
.dz-icon { color: var(--accent); }
.dz-title { margin: 0.2rem 0 0; font-weight: 600; color: var(--fg); }
.dz-sub { margin: 0; font-size: 0.88rem; }

.link-btn {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--accent-2); }

/* ------------------------------ Liste fichiers --------------------------- */
.file-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.file-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  animation: fade-slide 0.35s var(--ease) both;
}
.file-list .f-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
}
.file-list .f-size { color: var(--fg-dim); flex-shrink: 0; }
.file-list .f-remove {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: none; border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 1rem; line-height: 1;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.file-list .f-remove:hover { background: rgba(251, 113, 133, 0.18); color: var(--danger); }
.file-dot { color: var(--accent); flex-shrink: 0; }

/* ------------------------------ Boutons ---------------------------------- */
.submit-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.btn {
  font: inherit;
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.25s var(--ease),
              background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 26px -10px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 10px 34px -8px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transform: translateY(-1px);
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: saturate(0.4);
}
.btn-ghost {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-border-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ------------------------------ Résultat : running ----------------------- */
.running-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.spinner {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  box-shadow: 0 0 18px -4px var(--accent-glow);
  animation: spin 0.85s linear infinite;
}
.terminal {
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: #c7d0dc;
  background: #06070b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.terminal .t-line { display: block; white-space: pre-wrap; word-break: break-word; animation: fade-slide 0.25s var(--ease) both; }
.terminal .t-prompt { color: var(--accent); }
.terminal .t-ok { color: var(--ok); }
.terminal .t-dim { color: var(--fg-dim); }
.terminal .cursor::after {
  content: "▋";
  color: var(--accent);
  animation: blink 1s steps(2, start) infinite;
}

/* ------------------------------ Résultat : done -------------------------- */
.result-done { animation: fade-slide 0.5s var(--ease) both; }
.verdict-head {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-bottom: 1.3rem;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid var(--glass-border);
  flex-wrap: wrap;
}

/* Anneau de score */
.score-ring {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px var(--accent-glow));
}
.score-ring svg { display: block; }
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 9;
}
.ring-value {
  fill: none;
  stroke: var(--accent);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 326.7; /* 2πr, r=52 */
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.1s var(--ease), stroke 0.4s var(--ease);
}
.ring-value.is-danger { stroke: var(--danger); }
.score-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: var(--font-mono);
  line-height: 1;
}
#score-number { font-size: 1.9rem; font-weight: 700; color: var(--fg); }
.score-max { font-size: 0.85rem; color: var(--fg-dim); }

.verdict-info { display: grid; gap: 0.5rem; min-width: 0; flex: 1; }
.badge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}
.badge.is-ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.35);
}
.badge.is-danger {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.35);
}
.verdict-message { margin: 0; color: var(--fg); font-size: 0.95rem; }
.verdict-summary {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
}

/* Tests */
.tests-title {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
.tests-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.tests-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem;
  animation: fade-slide 0.4s var(--ease) both;
}
.tests-list .t-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}
.t-icon.st-passed { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.t-icon.st-failed,
.t-icon.st-crashed { color: var(--danger); background: rgba(251, 113, 133, 0.12); }
.t-icon.st-errored { color: var(--warn); background: rgba(251, 191, 36, 0.12); }
.t-icon.st-skipped { color: var(--gray); background: rgba(100, 116, 139, 0.15); }
.tests-list .t-name {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tests-list .t-cat {
  flex-shrink: 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-dim);
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
}
.tests-list .t-cat.bonus { color: var(--accent-2); border-color: rgba(34, 211, 238, 0.3); }
.tests-list .t-score {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
}

/* ------------------------------ Comment ça marche ------------------------ */
.howto-steps {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}
.howto-steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}
.howto-steps strong { font-weight: 650; font-size: 0.95rem; }
.howto-steps p {
  margin: 0.15rem 0 0;
  color: var(--fg-muted);
  font-size: 0.88rem;
}
.step-num {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* Encadrés d'information */
.callout {
  margin: 0 0 1.1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--glass-border);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.025);
}
.callout strong { color: var(--fg); }
.callout-warn {
  border-left-color: var(--warn);
  background: rgba(251, 191, 36, 0.07);
}
.callout-info {
  border-left-color: var(--accent-2);
  background: rgba(34, 211, 238, 0.07);
}

/* Blocs dépliables */
.disclosure {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}
.disclosure + .disclosure { margin-top: 0.5rem; }
.disclosure > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  border-radius: var(--radius-sm);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before {
  content: "";
  flex-shrink: 0;
  width: 7px; height: 7px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.2s var(--ease);
}
.disclosure[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.disclosure > summary:hover { background: rgba(255, 255, 255, 0.04); }
.disclosure-body {
  padding: 0 0.9rem 0.9rem;
  font-size: 0.88rem;
  color: var(--fg-muted);
  animation: fade-slide 0.3s var(--ease) both;
}
.disclosure-body p { margin: 0 0 0.65rem; }
.disclosure-body p:last-child { margin-bottom: 0; }
.disclosure-body strong { color: var(--fg); }
.disclosure-body .dim { color: var(--fg-dim); }

.tree {
  margin: 0 0 0.65rem;
  padding: 0.75rem 0.9rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #c7d0dc;
  background: #06070b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.tree code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ------------------------------ Onglets ---------------------------------- */
.tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  animation: fade-slide 0.6s var(--ease) both;
}
.tab {
  flex: 1;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--fg); background: rgba(255, 255, 255, 0.04); }
.tab.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(52, 211, 153, 0.3);
}
.tab-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; min-width: 0; }

/* ------------------------------ Test rapide ------------------------------ */
.field-hint {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  color: var(--fg-dim);
  line-height: 1.6;
}
.field-hint .link-btn { font-size: inherit; }
kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  padding: 0.08em 0.35em;
  border: 1px solid var(--glass-border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
}

.code-area {
  display: block;
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  tab-size: 4;
  -moz-tab-size: 4;
  white-space: pre;
  overflow: auto;
  color: var(--fg);
  background: #06070b;
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.code-area::placeholder { color: var(--fg-dim); }
.code-area:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 0 0 3px var(--accent-soft);
}

.quick-card .disclosure { margin-top: 1.1rem; }
.quick-card .field-row { margin-bottom: 0.8rem; }

/* Puces de désambiguïsation (réponse 409) */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border-strong);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Zone de verdict du test rapide */
.quick-result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
.quick-result[data-state="idle"] { margin-top: 0; }
.quick-result:not([data-state="idle"]) {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--glass-border);
}
.quick-status { display: grid; gap: 0.7rem; }
.quick-running { display: flex; align-items: center; gap: 0.8rem; }
.spinner-sm { width: 24px; height: 24px; border-width: 2px; }
.quick-running-text { margin: 0; color: var(--fg-muted); font-size: 0.92rem; }
.quick-done {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  animation: fade-slide 0.35s var(--ease) both;
}
.quick-done .badge { flex-shrink: 0; }
.quick-done .verdict-message { flex: 1; min-width: 12rem; }
.quick-target-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
}
.quick-target-line b { color: var(--accent); font-weight: 600; }
.quick-result .callout { margin: 0; }

.quick-details {
  margin: 0;
  max-height: 340px;
  overflow: auto;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c7d0dc;
  background: #06070b;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
}
.quick-details code { background: none; padding: 0; color: inherit; font-size: inherit; }
#quick-details-box .tests-title { margin-bottom: 0.5rem; }

/* ------------------------------ Leaderboard ------------------------------ */
.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.lb-head .card-title { margin: 0; }
.lb-project {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  counter-reset: none;
}
.lb-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--glass-border);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  animation: fade-slide 0.4s var(--ease) both;
}
.lb-list li:hover { background: rgba(255, 255, 255, 0.05); transform: translateX(2px); }
.lb-rank {
  flex-shrink: 0;
  width: 30px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg-muted);
}
.lb-rank.medal { font-size: 1.2rem; }
.lb-pseudo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.lb-score {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}
.lb-list li.top1 { border-color: rgba(252, 211, 77, 0.4); background: linear-gradient(90deg, rgba(252, 211, 77, 0.10), transparent); }
.lb-list li.top2 { border-color: rgba(203, 213, 225, 0.3); }
.lb-list li.top3 { border-color: rgba(216, 152, 90, 0.3); }
.lb-list li.is-me {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-glow), 0 0 26px -12px var(--accent-glow);
}
.lb-list li.is-me .lb-pseudo::after {
  content: "toi";
  margin-left: 0.5rem;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0.05rem 0.4rem;
  border-radius: 5px;
  vertical-align: middle;
}

/* ------------------------------ Footer ----------------------------------- */
.site-footer {
  padding: 1.6rem 0 2.4rem;
  color: var(--fg-dim);
  font-size: 0.82rem;
}
.site-footer .wrap { display: flex; gap: 0.6rem; align-items: center; justify-content: center; }
.site-footer .dot { color: var(--accent); }

/* ------------------------------ Animations ------------------------------- */
@keyframes fade-slide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .ring-value { transition: none; }
}
