:root {
  /* Hybrid Rift color palette - cyberpunk × hacking × LoL */
  --bg-primary: #020617;
  --bg-secondary: #0f172a;
  --bg-tertiary: #1e293b;
  
  --accent-primary: #22d3ee;     /* cyan */
  --accent-secondary: #0ac8b9;   /* teal */
  --accent-jade: #22c55e;        /* green */
  --accent-gold: #facc15;        /* yellow */
  --accent-violet: #a855f7;      /* purple */
  
  --text-primary: #f9fafb;
  --text-secondary: #e5e7eb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --border-color: rgba(56, 189, 248, 0.15);
  --border-soft: rgba(148, 163, 184, 0.1);
  
  --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.5);
  --glow-jade: 0 0 20px rgba(34, 197, 94, 0.5);
  --glow-strong: 0 0 30px rgba(34, 211, 238, 0.7), 0 0 50px rgba(34, 197, 94, 0.3);
  
  font-family: 'Space Grotesk', 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  font-weight: 400;

  color: var(--text-primary);
  
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: var(--accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--accent-secondary);
  text-shadow: var(--glow);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, #020617 0, #020617 40%, #02040a 100%),
    radial-gradient(circle at 20% 80%, rgba(56,189,248,0.22), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(168,85,247,0.2), transparent 60%),
    radial-gradient(circle at 0% 0%, rgba(34,197,94,0.16), transparent 65%);
  overflow-x: clip; /* pas « hidden » : ferait de body une 2e zone défilante (voir App.css) */
  position: relative;
}

/* AI Grid background */
body::before {
  content: "";
  position: fixed;
  inset: -100px;
  background-image:
    linear-gradient(rgba(15,23,42,0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.55) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: soft-light;
  z-index: 0;
}

/* Taches de couleur du fond (.orb) : voir App.css */

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(10px, -15px) scale(1.05); }
  50% { transform: translate(-5px, 10px) scale(0.95); }
  75% { transform: translate(-12px, -8px) scale(1.02); }
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.02em;
}
button:hover {
  border-color: var(--accent-primary);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}
button:active {
  transform: translateY(0);
}
button:focus,
button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Primary button style */
button.btn-primary {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #022c22;
  font-weight: 600;
  border: none;
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
}
button.btn-primary:hover {
  box-shadow: 0 0 26px rgba(34, 197, 94, 0.9);
}

/* Force dark theme - no light mode */

    * { box-sizing:border-box; margin:0; padding:0; }

    .sso-conflict-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      background: rgba(251, 191, 36, 0.12);
      border: 1px solid rgba(251, 191, 36, 0.35);
      border-radius: 10px;
      padding: 10px 16px;
      margin-bottom: 10px;
      font-size: 13px;
      color: #fde68a;
      line-height: 1.5;
    }
    .sso-conflict-banner strong {
      color: #fef3c7;
      font-weight: 700;
    }
    .sso-conflict-close {
      background: none;
      border: none;
      color: #fde68a;
      cursor: pointer;
      font-size: 16px;
      padding: 2px 6px;
      border-radius: 4px;
      flex-shrink: 0;
      line-height: 1;
      opacity: 0.8;
    }
    .sso-conflict-close:hover { opacity: 1; }

    /* Une seule barre de défilement : celle de la page (html). body et #root NE doivent PAS être des zones
       défilantes (overflow auto/hidden) : sur Windows (barres toujours visibles) #root affichait une 2e barre à
       droite dès que son contenu le dépassait de quelques pixels. overflow-x: clip coupe le débord horizontal
       sans créer de zone défilante. */
    html {
      overflow-y: auto;
      overflow-x: hidden;
      height: auto;
    }
    body, #root {
      overflow-x: clip;
      overflow-y: visible;
      height: auto;
    }

    body {
      min-height:100vh;
      font-family:'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      color:#f9fafb;
      background:
        radial-gradient(circle at top, #020617 0, #020617 40%, #02040a 100%),
        radial-gradient(circle at 20% 80%, rgba(56,189,248,0.22), transparent 55%),
        radial-gradient(circle at 80% 10%, rgba(168,85,247,0.2), transparent 60%),
        radial-gradient(circle at 0% 0%, rgba(34,197,94,0.16), transparent 65%);
      /* le défilement vertical est celui de la page (html) */
      overflow-x:clip;
    }

    #root {
      max-width:1500px;
      margin:0 auto;
      padding:18px 16px 24px;
      position:relative;
      /* #root est isolé (isolation: isolate) : ses fenêtres (promotion, cours, anti-triche… z-index 9999) ne peuvent
         pas sortir de sa couche. Sans z-index, le pied de page d'index.html (peint après) passait PAR-DESSUS et
         cachait le bouton « Suivant » de la promotion sur les écrans peu hauts. */
      z-index:1;
      display:flex;
      flex-direction:column;
      gap:16px;
      isolation:isolate;
    }

    /* soft AI grid in background */
    #root::before {
      content:"";
      position:fixed;
      inset:-100px;
      background-image:
        linear-gradient(rgba(15,23,42,0.55) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15,23,42,0.55) 1px, transparent 1px);
      background-size:46px 46px;
      opacity:0.35;
      pointer-events:none;
      mix-blend-mode:soft-light;
    }

    /* floating holo shapes : position fixe (inline, tirée au hasard par <Orbes/>), sans animation continue ;
       seul le changement de place à chaque question glisse (transform uniquement, flou constant). */
    .orb {
      position:fixed;
      top:0; left:0;
      border-radius:999px;
      filter:blur(48px);
      opacity:0.55;
      pointer-events:none;
      mix-blend-mode:screen;
      z-index:-1;
      animation:none;
      transition: transform 1.2s ease-in-out;
    }
    .orb--cyan { width:260px; height:260px; background:#22d3ee55; }
    .orb--jade { width:220px; height:220px; background:#22c5c255; }
    .orb--violet { width:280px; height:280px; background:#a855f755; }
    .orb--pink { width:240px; height:240px; background:#fb017e55; }
    @media (prefers-reduced-motion: reduce) { .orb { transition:none; } }

    /* ==== HEADER – hybrid clean + arcane logo ==== */
    .header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:12px;
    }

    .brand {
      display:flex;
      align-items:center;
      gap:12px;
      min-width:0;
    }

    .brand > a {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .crest {
      width:42px; height:42px;
      border-radius:22px;
      padding:2px;
      background:
        conic-gradient(from 210deg, #22c55e, #4ade80, #22d3ee, #a855f7, #22c55e);
      box-shadow:
        0 0 26px rgba(34,197,94,0.6),
        0 0 26px rgba(56,189,248,0.45);
      position:relative;
      overflow:hidden;
    }
    .crest-core {
      width:100%; height:100%;
      border-radius:18px;
      background:
        radial-gradient(circle at 30% 0%, rgba(248,250,252,0.16), transparent 60%),
        radial-gradient(circle at center, #020617 0, #020617 55%, #020617 100%);
      display:flex;
      align-items:center;
      justify-content:center;
      position:relative;
    }
    .crest-core::before {
      content:"";
      position:absolute;
      width:130%;
      height:1px;
      background:linear-gradient(90deg, transparent, rgba(148,163,184,0.8), transparent);
      transform:rotate(-24deg) translateY(-10px);
      opacity:0.7;
    }
    .crest-symbol {
      font-family:'Roboto Mono',monospace;
      font-size:13px;
      color:#bbf7d0;
      text-shadow:0 0 10px #22c55e;
    }

    .title-block {
      display:flex;
      flex-direction:column;
      gap:2px;
      min-width:0;
    }
    .title {
      font-weight:600;
      letter-spacing:0.28em;
      font-size:18px;
      text-transform:uppercase;
      color:#e5e7eb;
      text-shadow:
        0 0 14px rgba(15,23,42,0.9),
        0 0 18px rgba(34,197,94,0.35);
      white-space:nowrap;
    }
    .subtitle {
      font-size:11px;
      color:#9ca3af;
    }

    .header-right {
      display:flex;
      align-items:center;
      gap:14px;
      font-size:11px;
      color:#9ca3af;
      flex-wrap:wrap;
      justify-content:flex-end;
    }
    .stat {
      display:flex;
      align-items:baseline;
      gap:4px;
    }
    .stat strong { color:#e5f5ea; }

    .admin-pill {
      padding:4px 10px;
      border-radius:999px;
      background:rgba(15,23,42,0.75);
      color:#e5e7eb;
      font-size:11px;
      display:inline-flex;
      align-items:center;
      gap:6px;
      cursor:pointer;
      box-shadow:0 10px 24px rgba(0,0,0,0.7);
      backdrop-filter:blur(10px);
      border:none;
    }
.admin-pill span {
  font-size:10px;
  padding:1px 6px;
  border-radius:999px;
  background:linear-gradient(135deg,#4b5563,#111827);
}

/* Utilities */
.spacer-12 { height:12px; }

/* IP component controls */
.ip-controls {
  margin-bottom:12px;
  display:flex;
  gap:12px;
  align-items:center;
}
.ip-checkbox-label { font-size:13px; }
.ip-validate-btn {
  padding:6px 12px;
  font-size:13px;
  background:linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color:white;
  border:none;
  border-radius:4px;
  cursor:pointer;
  box-shadow:var(--glow);
  transition:0.15s;
}
.ip-validate-btn--danger {
  background:linear-gradient(135deg, rgba(229, 57, 53, 0.8), rgba(229, 57, 53, 0.6));
  box-shadow:0 0 15px rgba(229, 57, 53, 0.4);
}

/* Generic stacks */
.stack-12-center {
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
}

/* Question Phase styles moved to Question.css for uniformity */

/* Question Phase 2 */
.qp2-cidr {
  display:flex;
  align-items:center;
  gap:8px;
}
.qp2-cidr-slash {
  font-size:18px;
  font-weight:bold;
}
.qp2-source-mask {
  font-weight:600;
}
.qp2-inline {
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.qp2-inline-mono {
  font-family:monospace;
  display:inline-flex;
  gap:4px;
  align-items:center;
}
.qp2-dot {
  font-weight:bold;
}
.qp2-warning {
  color:red;
  font-size:12px;
  margin-left:8px;
}
.qp2-source-bin {
  color:#666;
  margin-left:8px;
}
.qp2-source-fallback {
  display:flex;
  gap:8px;
  align-items:center;
  color:#333;
  font-size:14px;
}
.qp2-mask-wrap {
  display:flex;
  gap:6px;
  align-items:center;
}

/* Question Phase 3 */
.qp3-stack {
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:center;
}
.qp3-fallback {
  font-style:italic;
  color:#777;
}
.qp3-source {
  margin-bottom:16px;
  font-size:14px;
  color:#333;
  display:flex;
  align-items:center;
  gap:8px;
}
.qp3-source-value {
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.qp3-source-mask { font-weight:600; }
.qp3-binary {
  display:inline-flex;
  gap:8px;
  align-items:center;
}
.qp3-binary-code {
  font-family:monospace;
  font-size:12px;
}
.qp3-binary-dot { color:#666; }

/* Question Phase 4 (reuses qp2 inline styles) */
.qp4-inline { display:inline-flex; gap:8px; align-items:center; }
.qp4-inline-mono { font-family:monospace; display:inline-flex; gap:4px; align-items:center; }
.qp4-dot { font-weight:bold; }
.qp4-source-bin { color:#666; margin-left:8px; }
.qp4-source-mask { font-weight:600; }
.qp4-card {
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:flex-start;
}
.qp4-row { display:flex; gap:8px; align-items:center; }
.qp4-row-space { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.qp4-btn {
  padding:6px 10px;
  border-radius:6px;
  border:1px solid var(--border-color);
  background:rgba(10,30,40,0.6);
  cursor:pointer;
  color:var(--accent-primary);
}
.qp4-badge {
  font-size:12px;
  color:var(--accent-gold);
  padding:2px 6px;
  border-radius:6px;
  background:rgba(200,155,60,0.1);
  border:1px solid var(--accent-gold);
}
.qp4-desc {
  color:#333;
  font-size:14px;
}
.qp4-warn { color:red; font-size:12px; }

/* Question Phase 5 */
.qp5-stack { display:flex; flex-direction:column; gap:12px; }
.qp5-field { display:flex; flex-direction:column; gap:8px; }
.qp5-label { font-size:14px; font-weight:500; color:#e5e7eb; }
.qp5-input {
  padding:8px 12px;
  border-radius:6px;
  border:1px solid #ccc;
  font-family:monospace;
  font-size:14px;
}

/* Question Phase 6 */
.qp6-stack { display:flex; flex-direction:column; gap:16px; }
.qp6-card {
  padding:12px;
  background:linear-gradient(135deg, rgba(10, 200, 185, 0.05), rgba(10, 200, 185, 0.02));
  border-radius:6px;
  border:1px solid var(--border-color);
  box-shadow:var(--glow);
}
.qp6-subnets {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.qp6-subnet {
  padding:12px;
  background:rgba(10, 30, 40, 0.4);
  border-radius:6px;
  border:1px solid var(--border-color);
  display:flex;
  flex-direction:column;
  gap:8px;
  box-shadow:inset 0 0 10px rgba(10, 200, 185, 0.05);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.qp6-subnet-title {
  font-size:14px;
  font-weight:600;
  color:#555;
}
.qp6-grid {
  display:flex;
  flex-direction:column;
  gap:12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.qp6-grid > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Styles extracted from Question.jsx */
.authRequired {
  text-align: center;
  padding: 40px 20px;
  font-size: 18px;
  color: #666;
}
.authTitle {
  font-size: 24px;
  margin-bottom: 20px;
}
.authText { color: #666; }

.adminControls { display: flex; gap: 8px; margin-bottom: 20px;}
.adminBtn {
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
}
.adminBtn.adminFail { border-color: #e53935; color: #ff6b6b; box-shadow: 0 0 15px rgba(229,57,53,0.2); background: linear-gradient(135deg, rgba(229,57,53,0.12), rgba(229,57,53,0.06)); }
.adminBtn.adminSuccess { border-color: #43a047; background: #e8f5e9; color: #1b5e20; }
.adminBtn.adminPromote { border-color: #1976d2; background: #e3f2fd; color: #0d47a1; }
.adminBtn.adminDemote { border-color: var(--accent-gold); background: linear-gradient(135deg, rgba(200,155,60,0.2), rgba(200,155,60,0.1)); color: var(--accent-gold); }

.adminNumWrap { display:flex; justify-content:flex-end; margin-top:6px; }
.adminNumBadge { padding: 4px 8px; border-radius:6px; background:#eef3ff; color:#1a237e; font-size:12px; border:1px solid #cfd8ff; }

.questionInfo { margin-bottom:16px; }
.questionHeaderTitle { margin: 4px 0 4px; }
.questionHeaderSmall { margin-left:8px; color: #777; font-size: 0.85em; }
.questionHeaderDesc { margin:0; font-size:14px; color:#555; }

.uiWrapper {
margin: 0px;
}

.resultPanel {
  padding: 20px;
  border: 1px solid #ff2f2f75;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
  color:  rgb(149, 62, 129);
}
.resultTitle { margin-top: 0; }
.resultMeta { margin-top: 8px; }
.resultActions { margin-top: 12px; }
.resultNextButton {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: #e3f2fd;
  color: #0d47a1;
}

.navContainer { display:flex; gap:8px; justify-content:space-between; align-items:center; margin-top:12px; }
.newQuestionButton {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #1976d2;
  background: #e3f2fd;
  color: #0d47a1;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.qp6-label {
  font-size:12px;
  color:#666;
}
.qp6-input {
  padding:6px 8px;
  border-radius:4px;
  border:1px solid #ccc;
  width:100%;
  font-family:monospace;
}
/* ===== ADMIN VIEW EDITOR ===== */
.admin-view {
  background: linear-gradient(135deg, rgba(10, 200, 185, 0.08), rgba(10, 200, 185, 0.04));
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--glow-strong);
}
.admin-view__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-view__title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}
.admin-view__targets {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #666;
}
.admin-view__target-btn {
  padding: 4px 12px;
  font-size: 12px;
  background: #ecf0f1;
  color: #7f8c8d;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.15s;
}
.admin-view__target-btn--active {
  background: #3498db;
  color: #fff;
}
.admin-view__tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-view__tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(10, 30, 40, 0.4);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.admin-view__tab:hover {
  background: rgba(10, 30, 40, 0.6);
}
.admin-view__tab--active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.admin-view__rank-display {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, rgba(10, 30, 40, 0.6), rgba(20, 40, 60, 0.4));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.admin-view__rank-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}
.admin-view__rank-label {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 0 12px rgba(200, 155, 60, 0.6);
  letter-spacing: 0.5px;
}
.admin-view__info {
  margin-bottom: 8px;
  padding: 6px;
  background: rgba(10, 30, 40, 0.5);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.admin-view__info-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-view__info-label {
  flex: 1 1 auto;
}
.admin-view__nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.admin-view__nav-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: rgba(10, 30, 40, 0.6);
  cursor: pointer;
  color: var(--accent-primary);
}
.admin-view__nav-badge {
  font-size: 12px;
  color: var(--accent-gold);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(200, 155, 60, 0.1);
  border: 1px solid var(--accent-gold);
}
.admin-view__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
}
.admin-view__qbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s;
  min-height: 46px;
  position: relative;
  border: 1px solid rgba(0,0,0,0.06);
}
.admin-view__qbtn--on {
  background: #27ae60;
  color: #fff;
}
.admin-view__qbtn--off {
  background: #95a5a6;
  color: #fff;
}
.admin-view__qbtn--undef {
  background: transparent;
  color: #949494;
  border-style: dashed;
  border-width: 2px;
  border-color: rgba(0,0,0,0.12);
}
.admin-view__qbtn-key {
  font-size: 13px;
}
.admin-view__qbtn-sub {
  font-size: 9px;
  margin-top: 2px;
  opacity: 0.7;
  font-weight: 400;
}
.admin-view__rbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: 0.2s;
  min-height: 50px;
}
.admin-view__rbtn--on { background: #27ae60; }
.admin-view__rbtn--off { background: #95a5a6; }
.admin-view__rbtn-key {
  font-size: 10px;
  opacity: 0.9;
  margin-bottom: 2px;
}
.admin-view__rbtn-state {
  font-size: 13px;
}

/* New button styles for AdminViewEditor */
.admin-view__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: 0.15s;
  min-height: 60px;
  position: relative;
  border: 1px solid var(--border-color);
  background: rgba(10, 30, 40, 0.3);
  color: var(--text-secondary);
}
.admin-view__btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.admin-view__btn--disabled {
  background: rgba(10, 30, 40, 0.2);
  color: #666;
  border-style: dashed;
}
.admin-view__btn--enabled {
  background: rgba(241, 196, 15, 0.2);
  color: #f39c12;
  border-color: rgba(241, 196, 15, 0.3);
}
.admin-view__btn--enabled:hover {
  background: rgba(241, 196, 15, 0.3);
}
.admin-view__btn--active {
  background: rgba(39, 174, 96, 0.3);
  color: #27ae60;
  border-color: rgba(39, 174, 96, 0.5);
}
.admin-view__btn--active:hover {
  background: rgba(39, 174, 96, 0.4);
}
.admin-view__btn-key {
  font-size: 10px;
  margin-bottom: 4px;
  word-break: break-word;
  text-align: center;
  pointer-events: none;
}
    .brand > a,
    .brand > a * {
      text-decoration: none !important;
      color: inherit !important;
    }
    .brand > a:hover,
    .brand > a:focus {
      text-decoration: none !important;
      outline: none !important;
    }

.admin-view__btn-state {
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}
.admin-view__btn-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent-primary);
  color: #fff;
  font-size: 8px;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 700;
  pointer-events: none;
}

.help_255to8bit{
   font-size: 11px; 
   font-family: monospace;
   color: #3cff49;
   letter-spacing: 2px;
   user-select: none;
}

/* Tooltip cross-browser (Safari compatible) */
.admin-view__btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
  max-width: 250px;
  width: max-content;
  text-align: center;
  z-index: 1000;
  pointer-events: none;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0s ease 0s;
}
.admin-view__btn[data-tooltip]::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0s ease 0s;
}
.admin-view__btn[data-tooltip]:hover::after,
.admin-view__btn[data-tooltip]:hover::before {
  opacity: 1;
  transition-delay: 1s;
}
    @media (max-width:768px) {
      .header { flex-direction:column; align-items:flex-start; }
      .header-right { justify-content:space-between; width:100%; }
    }

    /* ==== LAYOUT (3 cols, no hard frames) ==== */
    .layout {
      display:grid;
      grid-template-columns: 250px minmax(0,1.5fr) 260px;
      gap:18px;
      /* Allow layout to grow and not trap page scroll */
      min-height: calc(100vh - 96px);
      min-height: 520px;
      position:relative;
    }

    @media (max-width: 1200px) {
      .layout {
        grid-template-columns: 230px minmax(0,1.6fr);
        grid-template-rows: minmax(0,1.1fr) minmax(0,0.9fr);
        grid-template-areas:
          "sidebar arena"
          "stream arena";
      }
      .sidebar { grid-area:sidebar; }
      .arena { grid-area:arena; }
      .stream { grid-area:stream; }
    }
    @media (max-width: 900px) {
      .layout {
        height:auto;
        grid-template-columns:1fr;
        grid-template-rows:auto auto auto;
        grid-template-areas:
          "arena"
          "sidebar"
          "stream";
      }
    }

    .sidebar,
    .arena,
    .stream {
      position:relative;
      padding-left:20px;
      padding-right:20px;
      margin-right:-20px;
      padding-top:4px;
      /* Ensure content can shrink to fit */
      min-width: 0;
      overflow-x: clip;
    }

    /* holo vertical guides, very soft */
    .sidebar::before,
    .arena::before,
    .stream::before {
      content:"";
      position:absolute;
      top:0;
      bottom:0;
      left:2px;
      width:2px;
      border-radius:999px;
      background:linear-gradient(#22d3ee8f, rgba(207, 34, 170, 0.491) 35.74%, #22c55e66);
      opacity:0.55;
      filter:blur(0.5px);
      box-shadow:0 0 12px  rgba(207, 34, 170, 0.332)  ;
    }

    /* panels: glass, no borders */
    .glass-panel {
      height:100%;
      background:
        radial-gradient(circle at top, rgba(248,250,252,0.05), transparent 60%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.191), rgba(15, 23, 42, 0.348));
      border-radius:22px;
      padding:10px 12px;
      box-shadow:
        0 22px 40px rgba(0,0,0,0.85),
        0 0 32px rgba(15,23,42,0.9);
      backdrop-filter:blur(18px);
    }

    /* header inside panels */
    .panel-header {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
      margin-bottom:8px;
      font-size:11px;
      color:#9ca3af;
      text-transform:uppercase;
      letter-spacing:0.16em;
    }
    .panel-header span:last-child {
      text-transform:none;
      letter-spacing:0;
      font-size:10px;
      color:#6b7280;
    }

    /* ==== SIDEBAR: Phases cards (no frame) ==== */
    .phase-list {
      margin-top:4px;
      display:flex;
      flex-direction:column;
      gap:7px;
      /* allow the list to expand and use page scroll instead */
      max-height:none;
      overflow-y:visible;
      padding-right:3px;
    }
    .phase-list::-webkit-scrollbar { width:6px; }
    .phase-list::-webkit-scrollbar-thumb {
      background:rgba(51,65,85,0.95);
      border-radius:999px;
    }

    .phase-item {
      display:flex;
      gap:8px;
      align-items:center;
      padding:7px 8px;
      border-radius:14px;
      background:
        linear-gradient(90deg, rgba(15,23,42,0.95), rgba(15,23,42,0.8));
      box-shadow:0 12px 24px rgba(0,0,0,0.7);
      cursor:pointer;
      transition:0.18s;
    }
    .phase-item:hover {
      transform:translateY(-1px);
      background:
        linear-gradient(90deg, rgba(56,189,248,0.3), rgba(15,23,42,0.95));
    }

.subnet-item-index{
  font-size: smaller;
}

.UsageHost{
  font-size: smaller;
}
    .phase-item--locked {
      opacity:0.45;
      cursor:not-allowed;
      box-shadow:none;
    }

    .phase-icon {
      width:50px; height:50px;
      border-radius:999px;
     
      display:flex;
      align-items:center;
      justify-content:center;
      font-family:'Roboto Mono',monospace;
      font-size:13px;
      color:#e5e7eb;
      text-shadow:0 0 10px #38bdf8;
      flex-shrink:0;
    }

    .phase-text {
      display:flex;
      flex-direction:column;
      gap:1px;
      min-width:0;
    }
    .phase-top {
      display:flex;
      justify-content:space-between;
      gap:6px;
      align-items:center;
      font-size:11px;
    }
    .phase-name { font-weight:500; color:#e5f5ea; }
    .phase-status { white-space:nowrap; color:#c4b5fd; }
    .phase-desc {
      font-size:11px;
      color:#9ca3af;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
    }
    .phase-rank {
      font-size:11px;
      color:#facc15;
      display:flex;
      align-items:center;
      gap:6px;
    }
    .phase-rank-icon {
      width:22px;
      height:22px;
      object-fit:contain;
      filter:drop-shadow(0 0 6px rgba(255,255,255,0.18));
    }

    .play-btn {
      margin-top:9px;
      width:100%;
      border-radius:999px;
      border:none;
      padding:8px 12px;
      font-size:12px;
      font-weight:500;
      background:linear-gradient(135deg,#22c55e,#a3e635);
      color:#022c22;
      cursor:pointer;
      box-shadow:
        0 18px 40px rgba(34,197,94,0.7),
        0 0 20px rgba(34,197,94,0.6);
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:6px;
      transition:0.18s;
    }
    .play-btn:hover { transform:translateY(-1px); }

    /* ==== ARENA (center) ==== */
    .arena .glass-panel {
      display:flex;
      flex-direction:column;
      gap:10px;
    }

    .arena-header {
      display:flex;
      justify-content:space-between;
      align-items:flex-end;
      gap:8px;
    }
    .arena-phase-label {
      font-size:11px;
      letter-spacing:0.2em;
      text-transform:uppercase;
      color:#a5b4fc;
    }
    .arena-title {
      font-size:19px;
      margin-top:3px;
      text-shadow:0 0 12px rgba(15,23,42,0.9);
    }
    .arena-meta {
      font-size:11px;
      color:#9ca3af;
    }

    .arena-desc {
      font-size:13px;
      color:#e5e7eb;
    }
    .arena-submeta {
      font-size:11px;
      color:#9ca3af;
      display:flex;
      justify-content:space-between;
      gap:8px;
      flex-wrap:wrap;
      align-items:center;
    }

    .arena-inner {
      margin-top:4px;
      display:flex;
      flex-direction:column;
      gap:10px;
      flex:1;
      min-height:0;
    }

    .ip-row {
      display:flex;
      flex-direction:column;
      gap:4px;
    }
    .ip-label {
      font-size:12px;
      color:#e5f5ea;
    }
    .ip-pill {
      display:inline-flex;
      align-items:center;
      gap:7px;
      padding:4px 11px;
      border-radius:999px;
      background:radial-gradient(circle at top left, rgba(148,163,184,0.25), rgba(15,23,42,0.9));
      font-family:'Roboto Mono',monospace;
      font-size:12px;
      box-shadow:0 12px 26px rgba(15,23,42,0.9);
    }
    .ip-pill span:last-child {
      color:#22c55e;
    }

    .help-flex {
      display:flex;
      flex-wrap:wrap;
      gap:10px;
      align-items:flex-start;
    }
    .help-card {
      border-radius:14px;
      padding:7px 9px;
      background:
        radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.96));
      box-shadow:0 16px 34px rgba(0,0,0,0.8);
      min-width:190px;
    }
    .help-header {
      font-size:11px;
      margin-bottom:5px;
      display:flex;
      gap:8px;
      align-items:center;
    }
    .help-pill {
      font-family:'Roboto Mono',monospace;
      font-size:11px;
      padding:2px 7px;
      border-radius:999px;
      background:#22d3ee;
      color:#0b1120;
    }
    .help-pill-alt {
      background:#f97316;
      color:#0b1120;
    }

    .help-grid {
      display:grid;
      grid-template-columns:repeat(4,minmax(46px,1fr));
      gap:5px;
    }
    .help-cell {
      text-align:center;
      font-family:'Roboto Mono',monospace;
    }
    .help-value {
      display:inline-block;
      padding:3px 5px;
      border-radius:999px;
      font-size:11px;
      color:#f9fafb;
    }
    .help-value.even { background:rgba(37,99,235,0.9); }
    .help-value.odd { background:rgba(22,163,74,0.9); }
    .help-dec {
      font-size:11px;
      margin-top:3px;
      color:#a1a1aa;
    }

    .bits-card {
      border-radius:16px;
      padding:7px 9px;
      background:
        radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.96));
      box-shadow:0 18px 40px rgba(0,0,0,0.9);
    }
    .bits-title {
      font-size:12px;
      margin-bottom:4px;
      color:#e5f5ea;
    }
    .bytes-row {
      display:flex;
      flex-wrap:nowrap;
      overflow-x:auto;
      gap:6px;
      padding-bottom:2px;
    }
    .byte-group {
      flex:0 0 auto;
      display:flex;
      flex-direction:column;
      align-items:center;
      gap:2px;
    }
    .bit-row {
      display:flex;
      gap:2px;
    }
    .bit {
      width:22px; height:22px;
      border-radius:6px;
      background:#020617;
      font-family:'Roboto Mono',monospace;
      font-size:11px;
      display:flex;
      align-items:center;
      justify-content:center;
      color:#e5e7eb;
      box-shadow:0 8px 18px rgba(0,0,0,0.8);
    }
    .bit--on {
      background:radial-gradient(circle at top, #22c55e, #16a34a);
      color:#022c22;
      box-shadow:
        0 0 12px rgba(34,197,94,0.8),
        0 8px 20px rgba(22,101,52,0.9);
    }
    .bit-dec {
      font-size:11px;
      color:#9ca3af;
      font-family:'Roboto Mono',monospace;
    }
    .byte-sep {
      flex:0 0 auto;
      display:flex;
      align-items:center;
      font-size:18px;
      color:#6b7280;
    }

    .arena-actions {
      display:flex;
      flex-wrap:wrap;
      gap:6px;
      margin-top:4px;
    }
    .btn {
      border-radius:999px;
      padding:7px 14px;
      font-size:13px;
      border:none;
      cursor:pointer;
      display:inline-flex;
      align-items:center;
      gap:6px;
      background:transparent;
      color:#e5e7eb;
      transition:0.16s;
    }
    .btn-primary {
      background:linear-gradient(135deg,#22c55e,#4ade80);
      color:#022c22;
      font-weight:500;
      box-shadow:0 0 18px rgba(34,197,94,0.8);
    }
    .btn-primary:hover { transform:translateY(-1px); }
    .btn-danger {
      background:linear-gradient(135deg,#fb7185,#b91c1c);
      font-weight:500;
      color:#fef2f2;
      box-shadow:0 0 16px rgba(248,113,113,0.75);
    }
    .btn-ghost {
      background:rgba(15,23,42,0.9);
      color:#9ca3af;
    }
    .btn-outline {
      border:1px solid rgba(56,189,248,0.85);
      background:rgba(15,23,42,0.9);
      color:#e0f2fe;
    }
    .btn-outline:hover {
      box-shadow:0 0 14px rgba(56,189,248,0.8);
    }

    .arena-footer {
      margin-top: 24px;
      padding: 14px 20px;
      font-size: 13px;
      color: #9ca3af;
      display: flex;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      align-items: center;
      border-top: 1px solid rgba(148,163,184,0.06);
      background: linear-gradient(180deg, rgba(2,6,23,0.35), rgba(15,23,42,0.25));
      backdrop-filter: blur(6px);
    }

    .arena-footer .footer-left,
    .arena-footer .footer-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .arena-footer .footer-left span,
    .arena-footer .footer-right span {
      color: #cbd5e1;
      font-size: 13px;
    }

    .arena-footer a {
      color: #9ca3af;
      text-decoration: none;
      font-size: 13px;
    }

    .arena-footer a:hover {
      color: #e6f6ff;
      text-decoration: underline;
    }

    .arena-footer .btn-ghost {
      background: transparent;
      color: #9ca3af;
      border: 1px solid rgba(148,163,184,0.06);
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 13px;
    }

    .arena-footer .btn-outline {
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 13px;
    }

    /* ==== STREAM (right) ==== */
    .stream .glass-panel {
      display:flex;
      flex-direction:column;
      gap:10px;
    }

    .stream-block {
      border-radius:18px;
      padding:8px 9px;
      background:
        radial-gradient(circle at top left, rgba(148,163,184,0.18), rgba(15,23,42,0.96));
      box-shadow:0 16px 34px rgba(0,0,0,0.85);
      font-size:12px;
    }
    .stream-block.highlight {
      background:
        radial-gradient(circle at left, rgba(34,197,94,0.35), rgba(15,23,42,1));
      box-shadow:
        0 20px 42px rgba(34,197,94,0.8),
        0 0 20px rgba(56,189,248,0.5);
    }

    .stream-row {
      display:flex;
      justify-content:space-between;
      align-items:center;
      gap:8px;
    }
    .stream-label {
      font-size:11px;
      text-transform:uppercase;
      letter-spacing:0.12em;
      color:#9ca3af;
    }
    .stream-value { font-size:12px; color:#e5e7eb; }

    .stream-bar {
      margin-top:4px;
      position:relative;
      height:4px;
      border-radius:999px;
      background:rgba(15,23,42,0.9);
      overflow:hidden;
    }
    .stream-fill {
      position:absolute;
      inset:0;
      width:100%;
      background:linear-gradient(90deg,#22c55e,#4ade80);
    }

    .stream-logs {
      margin-top:4px;
      /* allow the logs to grow; page scroll handles overflow */
      max-height: none;
      overflow-y: visible;
      padding-right:3px;
      display:flex;
      flex-direction:column;
      gap:4px;
      font-family:'Roboto Mono',monospace;
    }
    .stream-logs::-webkit-scrollbar { width:6px; }
    .stream-logs::-webkit-scrollbar-thumb {
      background:rgba(51,65,85,0.95);
      border-radius:999px;
    }

    .log-line {
      font-size:11px;
      padding:3px 5px;
      border-radius:999px;
      background:rgba(15,23,42,0.96);
      box-shadow:0 10px 24px rgba(0,0,0,0.8);
      display:flex;
      justify-content:space-between;
      gap:8px;
    }
    .log-line--ok {
      background:radial-gradient(circle at left, rgba(22,163,74,0.35), rgba(15,23,42,0.96));
      color:#bbf7d0;
    }
    .log-line--fail {
      background:radial-gradient(circle at left, rgba(248,113,113,0.35), rgba(15,23,42,0.96));
      color:#fecaca;
    }

    /* Shared panel styles used across components (replaces inline styles) */
    .panel {
      margin-bottom: 16px;
      padding: 12px;
      border-radius: 8px;
      box-sizing: border-box;
    }
    .panel--blue {
      background: #e8f4f8;
      border: 2px solid #4a9eff;
      border-radius: 6px;
    }
    .panel--gold {
      background: linear-gradient(135deg, rgba(200,155,60,0.15), rgba(200,155,60,0.05));
      border: 2px solid var(--accent-gold);
      box-shadow: 0 0 15px rgba(200,155,60,0.2);
      border-radius: 6px;
    }
    .panel--teal {
      background: linear-gradient(135deg, rgba(10,200,185,0.05), rgba(10,200,185,0.02));
      border: 1px solid var(--border-color);
      border-radius: 6px;
    }

    /* Buttons */
    .btn {
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 4px;
      border: none;
      color: white;
      background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
      box-shadow: var(--glow);
      font-weight: 700;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .btn--small { padding: 6px 10px; font-size: 13px }
    .btn[disabled], .btn--ghost[disabled] { cursor: not-allowed; opacity: 0.5 }
    .btn--danger { background: linear-gradient(135deg, rgba(229,57,53,0.8), rgba(229,57,53,0.6)); box-shadow: 0 0 15px rgba(229,57,53,0.4) }
    .btn--ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); box-shadow: none }

    .muted { font-size: 12px; color: #666 }
    .muted.error { color: #f44336; font-weight: 700 }

    /* Utility helpers used by several components */
    .controls { margin-bottom: 8px }
    .controls-row { display:flex; gap:8px; align-items:center; margin-bottom:8px }
    .count-muted { font-size:13px; color:#666 }
    .inline-wrap { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:6px }
    .mono { font-family: 'Roboto Mono', monospace }
    .nowrap { white-space: nowrap }
    .ident-section { margin-top:8px }
    .meta-row { margin-top:8px; display:flex; flex-direction:row; gap:12px; flex-wrap:wrap; align-items:center }

    /* Subnet / mask chips used in MaskControls and PlageIP */
    .subnet-item {
      display:inline-flex;
      align-items:center;
      gap:10px;
      padding:6px 8px;
      border:1px solid rgba(238,238,238,0.06);
      border-radius:6px;
      min-width:140px;
      box-sizing:border-box;
    }
    .subnet-swatch { width:12px; height:12px; border-radius:3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06) }
    .subnet-name { font-size:13px; min-width:80px }
    .subnet-actions { margin-left:auto; display:flex; gap:8px; align-items:center }

    .icon-btn {
      padding:4px 8px;
      font-size:12px;
      cursor:pointer;
      background: rgba(10,30,40,0.4);
      border: 1px solid var(--border-color);
      border-radius:3px;
      color: var(--accent-primary);
    }

    /* Plage cards */
    .plage-card {
      border: 2px solid var(--border-color);
      padding: 16px;
      border-radius: 8px;
      margin-bottom: 16px;
      background: rgba(10,30,40,0.4);
      box-shadow: inset 0 0 10px rgba(10,200,185,0.05);
    }
    .plage-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px }
    .plage-left { display:flex; align-items:center; gap:16px }
    .plage-title { font-size:16px; font-weight:700 }

    /* Mask selector */
    .mask-list { display:flex; align-items:center; gap:8px; font-size:13px }
    .mask-label { display:flex; align-items:center; gap:6px; cursor:pointer; padding:4px 8px; border-radius:4px }
    .mask-label.active { background: rgba(255,255,255,0.02); border: 2px solid currentColor }
    .mask-swatch { width:12px; height:12px; border-radius:3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1) }

    .rank-tag {
      font-size:11px;
      color:#facc15;
    }

    @media (max-width: 900px) {
      .glass-panel { border-radius:20px; }
    }

    /* ====================================
       Component Styles: Unified Digit Components (Bit, Decimal, Hexa)
       ==================================== */
    
    /* Unified style for all digit components (bit-array-bit, decimal-digit, hexa-digit) */
    .bit-array-bit,
    .decimal-digit,
    .hexa-digit {
      aspect-ratio: 1;
      flex: 0 1 auto;
      width: 32px;
      max-width: 45px;
      min-width: 16px;
      height: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      user-select: none;
      font-family: 'Roboto Mono', monospace;
      font-size: clamp(7px, 1.9vw, 14px);
      font-weight: 600;
      background: var(--bg, #020617);
      color: #363636ba;
      transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
      box-sizing: border-box;
      box-shadow: 0 8px 18px rgba(0,0,0,0.8);
      position: relative;
    }

    /* state modifiers applied by components (no inline styles required) */
    .bit-array-bit.locked,
    .decimal-digit.locked,
    .hexa-digit.locked {
      opacity: 0.8;
      pointer-events: none;
      cursor: default;
    }

    .bit-array-bit.focused,
    .decimal-digit.focused,
    .hexa-digit.focused {
      outline: 2px solid rgba(74,144,226,0.9);
    }

    /* use CSS variable --bg set by components when needed */
    .bit-array-bit,
    .decimal-digit,
    .hexa-digit {
      background: var(--bg, inherit);
    }

    /* Power label shown under each bit */
    .bit-array-bit .bit-power-label,
    .decimal-digit .bit-power-label,
    .hexa-digit .bit-power-label {
      position: absolute;
      top: calc(100% + 6px);
      left: 50%;
      transform: translateX(-50%);
      white-space: nowrap;
      font-size: 9px;
      color: #3ba1f5;
      font-family: monospace;
      pointer-events: none;
      opacity: 1;
      visibility: visible;
    }

    /* Hexa help wrapper and nibble separator styling moved here (removed inline styles) */
    .hexa-help-bits {
      display: flex;
      gap: 2px;
      align-items: flex-start;
      position: relative;
    }

    .hexa-nibble-sep {
      position: absolute;
      right: -8px;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      font-size: 12px;
      color: #666;
      font-weight: bold;
    }
    
    /* Responsive adjustments */
    @media (max-width: 1200px) {
      .bit-array-bit,
      .decimal-digit,
      .hexa-digit {
        font-size: clamp(7px, 0.85vw, 13px);
        border-radius: 4px;
        max-height: 40px;
        min-width: 16px;
      }
    }
    
    @media (max-width: 900px) {
      .bit-array-bit,
      .decimal-digit,
      .hexa-digit {
        font-size: clamp(9px, 1.2vw, 15px);
        border-radius: 5px;
        max-height: 48px;
        min-width: 13px;
      }
    }
    
    @media (max-width: 600px) {
      .bit-array-bit,
      .decimal-digit,
      .hexa-digit {
        min-width: 12px;
        max-height: 38px;
        font-size: clamp(7px, 1.5vw, 12px);
        border-radius: 3px;
        max-width: calc((100% - 7px) / 8);
      }
    }
    
    /* Active state for all digit components — prefer component-provided `--bg` when available */
    .bit-array-bit[aria-pressed="true"],
    .decimal-digit[aria-pressed="true"],
    .hexa-digit[aria-pressed="true"] {
      /* If component set --bg (mask color), use it; otherwise fall back to green gradient */
      background: var(--bg, radial-gradient(circle at top, #22c55e, #16a34a));
      color: #01370cca;
      box-shadow:
        0 0 12px rgba(34, 214, 211, 0.8),
        0 8px 20px rgba(22,101,52,0.9);
    }
    

    .bit-array-bit[aria-pressed="false"],
    .decimal-digit[aria-pressed="false"],
    .hexa-digit[aria-pressed="false"] {
      /* If component set --bg (mask color), use it; otherwise fall back to darker gradient */
      background: var(--bg, radial-gradient(circle at top, #036b29d0, #16a34a));
      color: #01370cca;
      box-shadow:
        0 0 12px rgba(34, 214, 211, 0.8),
        0 8px 20px rgba(22,101,52,0.9);
    }
    
    /* Override pour les hexa avec couleur custom */
    .hexa-digit.has-custom-color[aria-pressed="true"],
    .hexa-digit.has-custom-color[aria-pressed="false"] {
      background: var(--bg) !important;
      color: #fff;
      box-shadow: 0 4px 12px rgba(0,0,0,0.6);
    }

    /* Hover state for all digit components */
    .bit-array-bit:hover,
    .decimal-digit:hover,
    .hexa-digit:hover {
      transform: scale(1.05);
    }
    
    /* Active click state for all digit components */
    .bit-array-bit:active,
    .decimal-digit:active,
    .hexa-digit:active {
      transform: scale(0.95);
    }

    /* DecimalArray container and layout classes */
    .decimal-array {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .decimal-array-bytes {
      display: flex;
      gap: 4px;
      align-items: center;
      justify-content: center;
    }

    .decimal-array-byte-group {
      display: flex;
      gap: 2px;
    }

    .decimal-array-separator {
      font-size: 24px;

    /* Top10 small helpers: avoid abrupt disappearance and add subtle transitions */
    .top10-loading { font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
    .top10-list li { transition: opacity 200ms ease, transform 200ms ease; }
    .top10-list li.hidden { opacity: 0; transform: translateY(-4px); }
      font-weight: bold;
      color: #ecececd2;
      user-select: none;
    }

    .decimal-array-mask {
      margin-top: 8px;
      display: flex;
      justify-content: center;
    }

    .decimal-array-mask-text {
      font-family: monospace;
      font-size: 14px;
    }

    /* ====================================
       Welcome Page Styles
       ==================================== */
    
    .welcomeContainer {
      max-width: 900px;
      margin: 0 auto;
      padding: 2rem 1rem;
    }

    .welcomeHero {
      text-align: center;
      margin-bottom: 3rem;
      padding: 2rem;
      background: linear-gradient(135deg, rgba(34,197,94,0.1), rgba(56,189,248,0.1));
      border-radius: 16px;
      border: 1px solid rgba(34,197,94,0.2);
      box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    }

    .welcomeTitle {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 1rem;
      margin-bottom: 1rem;
    }

    .welcomeIcon {
      font-size: 3rem;
      animation: float 3s ease-in-out infinite;
    }

    @keyframes float {
      0%, 100% { transform: translateY(0px); }
      50% { transform: translateY(-10px); }
    }

    .welcomeTitle h1 {
      font-size: 2.5rem;
      font-weight: 700;
      background: linear-gradient(135deg, #22c55e, #06b6d4);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .welcomeSubtitle {
      font-size: 1.2rem;
      color: #94a3b8;
      max-width: 600px;
      margin: 0 auto;
    }

    .welcomeContent {
      display: flex;
      flex-direction: column;
      gap: 2rem;
    }

    .welcomeSection {
      background: rgba(15,23,42,0.6);
      backdrop-filter: blur(10px);
      border: 1px solid rgba(148,163,184,0.1);
      border-radius: 12px;
      padding: 1.5rem;
      box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    }

    .welcomeSection h2 {
      font-size: 1.5rem;
      margin-bottom: 1rem;
      color: #e5e7eb;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .welcomeSection p {
      color: #cbd5e1;
      line-height: 1.6;
      margin-bottom: 1rem;
    }

    .welcomeFeatures {
      display: flex;
      flex-direction: column;
      gap: 1rem;
      margin-top: 1rem;
    }

    .welcomeFeature {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      padding: 1rem;
      background: rgba(30,41,59,0.4);
      border-radius: 8px;
      border: 1px solid rgba(148,163,184,0.1);
    }

    .featureIcon {
      font-size: 1.5rem;
      flex-shrink: 0;
    }

    .welcomeFeature strong {
      display: block;
      color: #f1f5f9;
      margin-bottom: 0.25rem;
    }

    .welcomeFeature p {
      margin: 0;
      font-size: 0.9rem;
      color: #94a3b8;
    }

    .welcomePhases {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 1rem;
      margin-top: 1rem;
    }

    .welcomePhase {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      padding: 1rem;
      background: rgba(30,41,59,0.4);
      border-radius: 8px;
      border: 1px solid rgba(148,163,184,0.1);
      transition: all 0.2s ease;
    }

    .welcomePhase:hover {
      background: rgba(30,41,59,0.6);
      border-color: rgba(34,197,94,0.3);
      transform: translateY(-2px);
    }

    .phaseNumber {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      background: linear-gradient(135deg, #22c55e, #16a34a);
      color: #022c22;
      font-weight: 700;
      border-radius: 8px;
      flex-shrink: 0;
      box-shadow: 0 4px 12px rgba(34,197,94,0.3);
    }

    .welcomePhase strong {
      display: block;
      color: #f1f5f9;
      margin-bottom: 0.25rem;
      font-size: 0.95rem;
    }

    .welcomePhase p {
      margin: 0;
      font-size: 0.85rem;
      color: #94a3b8;
    }

    .welcomeDemo {
      margin: 1.5rem 0;
      padding: 1.5rem;
      background: rgba(30,41,59,0.6);
      border-radius: 12px;
      border: 1px solid rgba(148,163,184,0.15);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 1rem;
      width: 100%;
      max-width: 100%;
      overflow: hidden;
      box-sizing: border-box;
    }
    
    .welcomeDemo > * {
      width: 100%;
      max-width: 100%;
      box-sizing: border-box;
    }

    .demoCaption {
      font-size: 0.9rem;
      color: #94a3b8;
      text-align: center;
      margin: 0;
    }

    .welcomeCTA {
      margin-top: 2rem;
      padding: 2rem;
      background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(56,189,248,0.15));
      border-radius: 12px;
      border: 1px solid rgba(168,85,247,0.2);
      text-align: center;
      box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    }

    .ctaText {
      font-size: 1.1rem;
      color: #e5e7eb;
      margin-bottom: 1rem;
    }

    .ctaArrow {
      font-size: 2rem;
      animation: bounce 2s ease-in-out infinite;
    }

    @keyframes bounce {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-10px); }
    }

    @media (max-width: 768px) {
      .welcomeTitle h1 {
        font-size: 2rem;
      }

      .welcomeIcon {
        font-size: 2rem;
      }

      .welcomePhases {
        grid-template-columns: 1fr;
      }

      .welcomeDemo {
        padding: 1rem;
      }
    }
  
/* =====================================================================
   GestionEFE — Admin EFE panel
   ===================================================================== */

.gefe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px;
  overflow-y: auto;
}

.gefe-panel {
  background: #12161e;
  border: 1px solid #2a3040;
  border-radius: 12px;
  width: 100%;
  max-width: 1200px;
  min-width: 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- Header ---- */
.gefe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #2a3040;
  gap: 12px;
  flex-wrap: wrap;
}

.gefe-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #e0e8ff;
  letter-spacing: 0.3px;
}

.gefe-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---- Buttons ---- */
.gefe-btn {
  padding: 6px 13px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 0.15s, transform 0.1s;
}
.gefe-btn:hover { opacity: 0.85; }
.gefe-btn:active { transform: scale(0.96); }

.gefe-btn-refresh  { background: #2563eb; color: #fff; }
.gefe-btn-close    { background: #3a3f4d; color: #cdd; }
.gefe-btn-carry    { background: #16a34a; color: #fff; }
.gefe-btn-carry:disabled { opacity: 0.5; cursor: not-allowed; }
.gefe-btn-disconnect { background: #b91c1c; color: #fff; font-size: 12px; padding: 4px 10px; }
.gefe-btn-disconnect:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---- Table wrapper ---- */
.gefe-table-wrap {
  overflow-x: auto;
  padding: 16px 20px 24px;
}

.gefe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #cdd;
}

.gefe-table thead th {
  text-align: center;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #8899bb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #2a3040;
  white-space: nowrap;
}

.gefe-table thead th.gefe-th-left {
  text-align: left;
}

.gefe-table tbody tr {
  border-bottom: 1px solid #1c2130;
  transition: background 0.1s;
}
.gefe-table tbody tr:hover { background: rgba(255,255,255,0.025); }

.gefe-table td {
  padding: 10px 10px;
  text-align: center;
  vertical-align: middle;
}

.gefe-table td.gefe-td-left {
  text-align: left;
}

/* ---- User info cells ---- */
.gefe-cell-name {
  font-size: 13px;
  color: #e0e8ff;
  font-weight: 500;
  min-width: 80px;
}

.gefe-cell-classe {
  font-size: 12px;
  color: #8899bb;
  font-style: italic;
}

/* ---- Phase cell ---- */
.gefe-phase-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.gefe-rank-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, transform 0.1s;
}
.gefe-rank-btn:hover {
  border-color: rgba(99, 179, 237, 0.5);
  transform: scale(1.08);
}

.gefe-rank-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.gefe-rank-empty {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1c2130;
  border: 1px dashed #3a4050;
  display: inline-block;
}

/* Active toggle */
.gefe-active-toggle {
  background: none;
  border: 1px solid #3a4050;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
  color: #8899bb;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.gefe-active-toggle.is-active {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #4ade80;
}
.gefe-active-toggle.is-inactive {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #f87171;
}
.gefe-active-toggle:hover { opacity: 0.8; }

/* ---- Streak input ---- */
.gefe-streak-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.gefe-streak-input {
  width: 52px;
  padding: 4px 6px;
  background: #1c2130;
  border: 1px solid #3a4050;
  border-radius: 5px;
  color: #e0e8ff;
  font-size: 13px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.gefe-streak-input:focus { border-color: #2563eb; }
.gefe-streak-input.is-locked { border-color: #eab308; }

.gefe-lock-icon {
  font-size: 12px;
  color: #eab308;
  cursor: default;
  user-select: none;
}

/* ---- Empty state ---- */
.gefe-empty {
  padding: 40px 20px;
  text-align: center;
  color: #5566788;
  font-size: 14px;
}

/* ---- Loading ---- */
.gefe-loading {
  padding: 32px 20px;
  text-align: center;
  color: #8899bb;
  font-size: 14px;
}

/* ---- Error ---- */
.gefe-error {
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: #f87171;
  font-size: 13px;
}

/* ---- Info ---- */
.gefe-info {
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid #22c55e;
  border-radius: 6px;
  color: #86efac;
  font-size: 13px;
}

/* =====================================================================
   Rank Picker Popup
   ===================================================================== */

.gefe-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9100;
}

.gefe-picker-popup {
  position: fixed;
  z-index: 9200;
  background: #1a2030;
  border: 1px solid #2a3a50;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.gefe-picker-title {
  font-size: 12px;
  color: #8899bb;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a3040;
}

.gefe-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.gefe-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: 2px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  padding: 6px 4px;
  transition: border-color 0.12s, background 0.12s;
}
.gefe-picker-item:hover {
  background: rgba(99, 179, 237, 0.1);
  border-color: rgba(99, 179, 237, 0.4);
}
.gefe-picker-item.is-current {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
}

.gefe-picker-rank-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.gefe-picker-rank-name {
  font-size: 10px;
  color: #8899bb;
  text-transform: capitalize;
  line-height: 1;
}
/* =====================================================================
   ListeInscrits — onglet admin « Inscrits » (réutilise les classes gefe-*)
   ===================================================================== */

.linsc-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid #2a3040;
}

.linsc-search {
  flex: 1 1 260px;
  min-width: 0;
  padding: 7px 12px;
  border-radius: 6px;
  border: 1px solid #2a3040;
  background: #0c1017;
  color: #e0e8ff;
  font-size: 13px;
}
.linsc-search:focus { outline: none; border-color: #2563eb; }

.linsc-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8899bb;
}
.linsc-sort select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #2a3040;
  background: #0c1017;
  color: #e0e8ff;
  font-size: 13px;
}

.linsc-th { cursor: pointer; user-select: none; }
.linsc-th:hover { color: #c4d2ff; }
.linsc-th-actif { color: #60a5fa; }

.linsc-email { color: #8899bb; font-size: 12px; }
.linsc-num { font-variant-numeric: tabular-nums; }

/* ---- Cellules numériques modifiables ---- */
.linsc-edit-btn {
  min-width: 64px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px dashed transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: text;
}
.linsc-edit-btn:hover:not(:disabled) { border-color: #3b4a6b; background: rgba(96, 165, 250, 0.08); }
.linsc-edit-btn:disabled { cursor: not-allowed; opacity: 0.45; }

.linsc-edit-input {
  width: 110px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid #2563eb;
  background: #0c1017;
  color: #e0e8ff;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.linsc-edit-input:focus { outline: none; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35); }
.linsc-edit-input:disabled { opacity: 0.6; }
.bit-array-container {
  padding: clamp(8px, 1vw, 12px);
  border: none;
  overflow: visible;
  background: 
    radial-gradient(circle at top, rgba(15,23,42,1), rgba(15,23,42,0.96));
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.8);
  /* Ensure container can shrink in flex/grid layouts */
  min-width: 0;
  
  width: 100%;
  box-sizing: border-box;
}

.bit-array-bytes {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  justify-content: center;
}

/* Center hex byte groups when used in HexaArray (only 2 hex digits per byte = less space) */
.hexa-array-container .bit-array-bytes {
  justify-content: center;
}

/* Remove flex-grow for hex groups so they don't stretch and stay centered */
.hexa-array-container .bit-array-byte-group {
  flex: 0 0 auto;
}

.bit-array-byte-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.bit-array-bits-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  justify-content: center;
}

.bit-array-decimal {
  margin-top: 16px;
  font-family: monospace;
  font-size: clamp(10px, 1vw, 13px);
  white-space: nowrap;
  color: #4f9bff;
}

/* Note: Base .bit-array-bit styles moved to App.css for unification with .decimal-digit and .hexa-digit */
/* BitArray-specific responsive adjustments for container elements */
@media (max-width: 600px) {
  .bit-array-bytes {
    gap: clamp(0.5px, 0.15vw, 2px);
  }
  
  .bit-array-bits-row {
    gap: clamp(0.5px, 0.08vw, 1px);
  }
  
  .bit-array-container {
    padding: clamp(6px, 0.8vw, 10px);
    margin: clamp(4px, 0.8vw, 10px);
  }
}

/* mask bar */
.bit-array-mask {
  position: absolute;
  height: 200%;
  /* span most of the container vertically to be clearly visible and draggable */
  top: -14px;
  bottom: 4px;
  width: 4px;
  /* No default background color - will be set inline from mask.color prop */
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: col-resize;
  z-index: 40;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}

/* Compact nibble display for Hexa help */
.hexa-nibble-compact.bit-array-container {
  padding: 0;
  border: none;
  margin: 0;
}

.hexa-nibble-compact .bit-array-bytes {
  gap: 1px;
}

.hexa-nibble-compact .bit-array-byte-group {
  min-width: auto;
}

.hexa-nibble-compact .bit-array-bits-row {
  gap: 1px;
}

.hexa-nibble-compact .bit-array-bit {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  font-size: 7px;
  border-width: 1px;
  border-radius: 2px;
}

.hexa-nibble-compact .bit-array-decimal {
  display: none;
}

/* when we explicitly request to show nibble decimal (e.g. help_Bille), override compact hide */
.hexa-nibble-compact.show-nibble-decimal .bit-array-decimal {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}

.hexa-nibble-compact .bit-array-separator {
  display: none;
}

/* Byte separator (dot between byte groups) */
.bit-array-separator {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  margin: 0 4px;
  user-select: none;
  position: relative;
  z-index: 10;
}

/* small visual separator between two nibble bitarrays (4bit | 4bit) */
.hexa-nibble-sep {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  align-self: center;
  pointer-events: none;
  opacity: 0.8;
  /* small visual tuning */
  padding: 0 4px;
}

/* Help tables shown by HexaArray when requested */
/* .hexa-help-tables moved to Table.css */

/* hexa-help-color-swatch moved to Table.css */

/* Value cell (hex digit or 4-bit string) - dark hextech theme */
/* hexa-help-* table styles moved to Table.css */
.hexa-help-tables {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.hexa-help-table {
  
  padding: 10px;
  


  min-width: 0;
}

/* Header row */
.hexa-help-header {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.hexa-help-label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 700;
}
.hexa-help-label--accent {
  background: linear-gradient(135deg, rgba(10, 200, 185, 0.2), rgba(10, 200, 185, 0.1));
  border: 1px solid var(--accent-primary);
  color: var(--accent-secondary);
}
.hexa-help-label--gold {
  background: linear-gradient(135deg, rgba(200, 155, 60, 0.2), rgba(200, 155, 60, 0.1));
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 11px;
}

.hexa-help-arrow { color: var(--text-muted); }

/* Grid containers */
.hexa-help-grid {
  display: grid;
  gap: 6px;
}
.hexa-help-grid.grid-48 { grid-template-columns: repeat(4, minmax(48px, 1fr)); }
.hexa-help-grid.grid-24 { grid-template-columns: repeat(4, minmax(24px, 1fr)); }

.hexa-help-cell { text-align: center; font-family: monospace; }

/* Value cell (hex digit or 4-bit string) - dark hextech theme */
.hexa-help-value { display: inline-block; padding: 4px 6px; border-radius: 4px; color: var(--text-primary); font-weight: 600; }
.hexa-help-value.even { background: linear-gradient(135deg, rgba(10, 200, 185, 0.15), rgba(10, 200, 185, 0.08)); border: 1px solid rgba(10, 200, 185, 0.2);color : rgb(9, 225, 207)  }
.hexa-help-value.odd { background: linear-gradient(135deg, rgba(200, 155, 60, 0.15), rgba(200, 155, 60, 0.08)); border: 1px solid rgba(200, 155, 60, 0.2); }

/* Decimal cell below the value */
.hexa-help-decimal { font-size: 0.82em; margin-top: 6px; color: var(--text-secondary); }

/* small gold value rectangle used in BitHexaTable */
.hexa-help-golden { margin-top: 8px; padding: 6px 10px; border-radius: 6px; border: 0px solid var(--accent-gold); font-size: 0.95em; font-weight: 700; color: var(--accent-gold); box-shadow: 0 0 10px rgba(200, 155, 60, 0.2); }

/* fallback internal cell styling from old BitArray styles */
.hexa-help-table div { line-height: 1; }

/* color swatch used by some helpers */
.hexa-help-color-swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border-color); box-shadow: 0 0 4px rgba(10, 200, 185, 0.2); }

/* Table font sizing (default smaller) */
/* helper table font sizes (variables above) */
:root {
  --hexa-table-font-size: 11px; /* default helper table size */
  --hexa-table-font-size-sm: 10px; /* even smaller variant */
}
.hexa-help-table {
  font-size: var(--hexa-table-font-size);
}
.hexa-help-table--sm { font-size: var(--hexa-table-font-size-sm); }

/* scale internal pieces relative to the table font size */
.hexa-help-header { font-size: 1em; }
.hexa-help-value { font-size: 0.94em; }
.hexa-help-decimal { font-size: 0.82em; }
.hexa-help-label { font-size: 0.92em; }
/* Question Container - wrapper for rotation animations */
.question-container {
	position: relative;
	transform-style: preserve-3d;
	perspective: 1000px;
}

/* Styles pour la carte de grade utilisée dans Question.jsx - Hybrid Rift design */
.grade-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	padding: 0;
	border-radius: 22px;
	background:
		radial-gradient(circle at top, rgba(248,250,252,0.05), transparent 60%),
		linear-gradient(135deg, rgba(15,23,42,0.9), rgba(15,23,42,0.88));
	box-shadow:
		0 22px 40px rgba(0,0,0,0.85),
		0 0 32px rgba(15,23,42,0.9);
	backdrop-filter: blur(18px);
	min-height: 180px;
	min-width: 360px;
	overflow: hidden;
}

.grade-name-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 10;
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #0b1120;
	background: linear-gradient(135deg, #facc15, #fde047);
	padding: 6px 12px;
	border-radius: 14px;
	border: none;
	box-shadow: 
		0 0 20px rgba(250, 204, 21, 0.6),
		0 10px 24px rgba(0,0,0,0.7);
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.grade-lp-bar {
	position: relative;
	width: 100%;
	height: 42px;
	background: 
		radial-gradient(circle at left, rgba(148,163,184,0.18), rgba(15,23,42,0.96));
	border-top: 1px solid rgba(148, 163, 184, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	border-bottom-left-radius: 22px;
	border-bottom-right-radius: 22px;
}

.lp-fill {
	position: absolute;
	left: 0;
	top: 0;
	height: 100%;
	background: linear-gradient(90deg, #22c55e, #4ade80);
	box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
	transition: width 400ms cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 1;
	border-bottom-left-radius: 22px;
}

.lp-text {
	position: relative;
	z-index: 2;
	font-size: 15px;
	font-weight: 700;
	color: var(--text-primary);
	text-shadow: 0 2px 8px rgba(0,0,0,0.8);
	letter-spacing: 0.5px;
}

@media (max-width: 720px) {
	.grade-card {
		min-width: 280px;
		min-height: 140px;
	}
	.grade-name-badge {
		font-size: 20px;
		padding: 8px 20px;
	}
	.grade-lp-bar {
		height: 36px;
	}
	.lp-text {
		font-size: 14px;
	}
}

/* Question Header Card - Clear hierarchy for title, description, and statement */
.question-header-card {
	background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
	border: 1px solid rgba(148, 163, 184, 0.15);
	border-radius: 16px;
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: 
		0 4px 12px rgba(0, 0, 0, 0.3),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.question-header-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	gap: 12px;
}

.question-phase-badge {
	display: inline-block;
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
	border: 1px solid rgba(59, 130, 246, 0.4);
	color: #60a5fa;
	padding: 6px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.question-number-badge {
	display: inline-block;
	background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(249, 115, 22, 0.15));
	border: 1px solid rgba(251, 146, 60, 0.4);
	color: #fb923c;
	padding: 6px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.3s ease;
}

.question-number-badge:hover {
	background: linear-gradient(135deg, rgba(251, 146, 60, 0.3), rgba(249, 115, 22, 0.25));
	border-color: rgba(251, 146, 60, 0.6);
	transform: translateY(-1px);
}

.question-number-badge.training-mode {
	background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(22, 163, 74, 0.15));
	border: 1px solid rgba(34, 197, 94, 0.4);
	color: #22c55e;
	animation: pulse-training 2s ease-in-out infinite;
}

@keyframes pulse-training {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
	}
}

.question-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
	margin: 0 0 12px 0;
	line-height: 1.3;
}

.question-description {
	font-size: 15px;
	color: var(--text-secondary);
	margin: 0 0 16px 0;
	line-height: 1.6;
	opacity: 0.85;
}

.question-statement {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: rgba(59, 130, 246, 0.08);
	border-left: 3px solid #3b82f6;
	padding: 16px;
	border-radius: 8px;
	margin-top: 16px;
}

.statement-icon {
	font-size: 20px;
	flex-shrink: 0;
	line-height: 1;
}

.statement-text {
	font-size: 16px;
	color: var(--text-primary);
	font-weight: 500;
	line-height: 1.5;
}

@media (max-width: 768px) {
	.question-header-card {
		padding: 18px;
		margin-bottom: 18px;
	}
	
	.question-header-top {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.question-title {
		font-size: 20px;
	}
	
	.question-description {
		font-size: 14px;
	}
	
	.statement-text {
		font-size: 15px;
	}
}

/* Question Source Value Display */
.q-source {
	background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(37, 99, 235, 0.08));
	border: 1px solid rgba(59, 130, 246, 0.25);
	border-radius: 12px;
	padding: 20px;
	margin-bottom: 24px;
	text-align: center;
}

.q-source-label {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #60a5fa;
	margin-bottom: 8px;
}

.q-source-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--text-primary);
	font-family: 'Courier New', monospace;
	letter-spacing: 1px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	word-break: break-all;
	overflow-wrap: break-word;
}

/* Reduce font size for long values (binary strings, long numbers) */
.q-source-value:has(*) {
	font-size: 24px;
}

/* Alternative: use container queries if content is too long */
@container (max-width: 600px) {
	.q-source-value {
		font-size: 22px;
	}
}

/* Answer Section */
.answer-section {
  background: linear-gradient(135deg, rgba(10, 200, 185, 0.08), rgba(10, 200, 185, 0.04));
  border: 2px solid var(--accent-primary);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--glow-strong);
}

.answer-section-label {
	font-size: 14px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--text-secondary);
	margin-bottom: 12px;
	opacity: 0.9;
}

.qp1-format-label {
	font-size: 13px;
	font-weight: 600;
	color: #a855f7;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
	text-align: center;
}

/* Dynamic font size based on content length */
.q-source-value[data-length="short"] {
	font-size: 28px;
}

.q-source-value[data-length="medium"] {
	font-size: 22px;
}

.q-source-value[data-length="long"] {
	font-size: 18px;
}

.q-source-value[data-length="very-long"] {
	font-size: 15px;
	letter-spacing: 0.5px;
}

@media (max-width: 768px) {
	.q-source {
		padding: 16px;
	}
	
	.q-source-value {
		font-size: 22px;
	}
	
	.q-source-value[data-length="medium"] {
		font-size: 18px;
	}
	
	.q-source-value[data-length="long"] {
		font-size: 15px;
	}
	
	.q-source-value[data-length="very-long"] {
		font-size: 13px;
	}
	
	.answer-section {
		padding: 16px;
	}
}

/* Result Panel - for showing validation results */
.resultPanel {
	background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.95));
	border: 1px solid rgba(148, 163, 184, 0.2);
	border-radius: 16px;
	padding: 24px;
	margin: 20px 0;
	box-shadow: 0 10px 30px rgba(0,0,0,0.5);
	backdrop-filter: blur(10px);
}

.resultTitle {
	font-size: 24px;
	font-weight: 700;
	color: var(--text-primary);
	margin-bottom: 16px;
	text-align: center;
}

.resultPanel p {
	margin: 12px 0;
	color: var(--text-secondary);
	line-height: 1.8;
	white-space: pre-wrap;
	font-family: 'Courier New', monospace;
	font-size: 14px;
}

.resultPanel p strong {
	color: var(--text-primary);
	font-weight: 600;
	display: block;
	margin-bottom: 6px;
	font-family: system-ui, -apple-system, sans-serif;
}

.nextQuestionBtn {
	background: linear-gradient(135deg, #3b82f6, #2563eb);
	color: white;
	border: none;
	border-radius: 12px;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
	margin-top: 16px;
	width: 100%;
}

.nextQuestionBtn:hover {
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.nextQuestionBtn:active {
	transform: translateY(0);
}

/* ─── Phase 1 : état post-validation ─────────────────────────────────────── */
.phase1-validated-info {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.phase1-error-count {
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.phase1-solution-frame {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04));
    border: 2px solid #22c55e;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.2);
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
}

.phase1-solution-label {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #22c55e;
    margin-bottom: 12px;
}

/* Cadre réponse attendue : reprend answer-section avec override vert */
.answer-section--expected {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.04)) !important;
    border-color: #22c55e !important;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.2) !important;
    margin-top: 8px;
    margin-bottom: 0;
}

.answer-section--expected .answer-section-label {
    color: #22c55e;
}

/* ================================================================
   Écran de chargement plein écran (connexion + première question)
   ================================================================ */
.bootOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bootOverlay-in 0.25s ease forwards;
}

@keyframes bootOverlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bootOverlay-card {
    background: linear-gradient(155deg, #0d1117 0%, #161b22 55%, #1a1d2e 100%);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 24px;
    padding: 2.4rem 2.2rem;
    max-width: 380px;
    width: calc(100% - 2rem);
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.1),
        0 0 60px rgba(56, 189, 248, 0.1),
        0 25px 60px rgba(0, 0, 0, 0.7);
    animation: bootOverlay-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bootOverlay-card-in {
    from { transform: scale(0.55) translateY(50px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.bootOverlay-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 1.2rem;
    border-radius: 50%;
    border: 4px solid rgba(56, 189, 248, 0.15);
    border-top-color: #38bdf8;
    animation: bootOverlay-spin 0.85s linear infinite;
}

@keyframes bootOverlay-spin {
    to { transform: rotate(360deg); }
}

.bootOverlay-card h3 {
    margin: 0 0 0.5rem;
    color: #e2e8f0;
    font-size: 1.15rem;
}

.bootOverlay-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.5;
}
/* Fireworks Animation for Correct Answers */
.fireworks-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.firework {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  animation: firework-explosion 0.8s ease-out forwards;
}

@keyframes firework-explosion {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Increase particle lifetime for better visibility */
.firework {
  animation-duration: 1.5s !important;
}

/* Question Fade Transition */
.question-container {
  transition: opacity 0.8s ease-in-out;
}

.question-container.rotating-in {
  animation: fadeIn 0.8s ease-in-out forwards;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Success Flash Effect */
.success-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.3) 0%, transparent 70%);
  animation: successFlash 1s ease-out forwards;
}

@keyframes successFlash {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* PhaseProgress.css - Hybrid Rift sidebar design */

.phase-progress-container {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.phase-list {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  /* Allow the list to grow vertically and rely on page scrolling */
  max-height: none;
  overflow-y: visible;
  padding-right: 3px;
}

/* Removed internal scrollbar for Phase list to rely on page scroll */

.phase-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(15,23,42,0.95), rgba(15,23,42,0.8));
  box-shadow: 0 12px 24px rgba(0,0,0,0.7);
  cursor: pointer;
  transition: 0.18s;
  border: none;
  width: 100%;
  text-align: left;
}

.phase-item:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(90deg, rgba(56,189,248,0.3), rgba(15,23,42,0.95));
}

.phase-item--active {
  background:
    linear-gradient(90deg, rgba(34,197,94,0.4), rgba(15,23,42,0.96));
  box-shadow:
    0 6px 7px rgba(125, 0, 220, 0.7),
    0 -3px 12px rgba(56,189,248,0.5);
}

.phase-item--locked {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.phase-item--locked:hover {
  transform: none;
  background:
    linear-gradient(90deg, rgba(15,23,42,0.95), rgba(15,23,42,0.8));
}



.phase-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.phase-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.phase-name {
  font-weight: 500;
  color: #e5f5ea;
}

.phase-status {
  white-space: nowrap;
  color: #c4b5fd;
  font-size: 10px;
}

.phase-desc {
  font-size: 11px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.phase-rank {
  font-size: 10px;
  color: #facc15;
  margin-top: 2px;
}

.play-btn {
  margin-top: 9px;
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #22c55e, #a3e635);
  color: #022c22;
  cursor: pointer;
  box-shadow:
    0 18px 40px rgba(34,197,94,0.7),
    0 0 20px rgba(34,197,94,0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.18s;
}

.play-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 20px 44px rgba(34,197,94,0.8),
    0 0 24px rgba(34,197,94,0.7);
}
/* WinStreak.css - Hybrid Rift design */
.win-streak {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-family: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}

.win-streak--compact {
  padding: 4px 8px;
  font-size: 11px;
}

.win-streak-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.win-streak-icon {
  font-size: 18px;
}

.win-streak-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.win-streak-current strong,
.win-streak-best strong {
  font-weight: 600;
}

.win-streak-bar {
  position: relative;
  margin-top: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  overflow: hidden;
  border: none;
}

.win-streak-bar-fill {
  position: absolute;
  inset: 0;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #4ade80);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bonus quand on est "on fire" */
.win-streak--fire {
  border: none;
}

.win-streak--fire .win-streak-bar-fill {
  background: linear-gradient(90deg, #facc15, #fde047);
  box-shadow: 0 0 15px rgba(250, 204, 21, 0.7);
}

.win-streak-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.win-streak-jinx {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* Optionnel : glow quand on dépasse un gros record */
.win-streak--surpassed .win-streak-jinx {
  animation: win-streak-glow 0.8s infinite alternate;
}

@keyframes win-streak-glow {
  from {
    filter: drop-shadow(0 0 0px rgba(255, 215, 0, 0.0));
  }
  to {
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9));
  }
}.flux-reel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-primary);
  position: relative;
  overflow-y: visible;
}

.flux-block {
  border-radius: 18px;
  padding: 8px 9px;
  background:
    radial-gradient(circle at top left, rgba(148,163,184,0.18), rgba(15,23,42,0.96));
  box-shadow: 0 16px 34px rgba(0,0,0,0.85);
  font-size: 12px;
}

.flux-block.highlight {
  background:
    radial-gradient(circle at left, rgba(34,197,94,0.35), rgba(15,23,42,1));
  box-shadow:
    1.02325439453125px 2.062497138977051px 12px 0 rgba(0, 224, 255, 0.8),
-3.97674560546875px -3.937502861022949px 10px 0 rgba(238, 0, 255, 0.5);
   margin:10px 0;
}



.flux-block-rank {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.rank-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.2));
}

.rank-lp { 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.rank-lp-bar { 
  position: relative;
  flex: 1; 
  height: 4px; 
  background: rgba(15,23,42,0.9); 
  border-radius: 999px; 
  overflow: hidden;
}
.rank-lp-fill { 
  position: absolute;
  inset: 0;
  height: 100%; 
  background: linear-gradient(90deg, #22c55e, #4ade80); 
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); 
  transition: width 0.35s ease;
}
.rank-lp-text { 
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.rank-mastery {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  position: relative;
  cursor: default;
  user-select: none;
}

.rank-mastery-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rank-mastery-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 8px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: help;
  flex-shrink: 0;
  line-height: 1;
}

.rank-mastery-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: rgba(10, 18, 36, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  z-index: 9999;
  pointer-events: none;
  animation: rmt-fadein 0.15s ease;
}

@keyframes rmt-fadein {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.rmt-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rmt-title {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2px;
}

.rmt-body {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0;
}

.rmt-body strong {
  color: #e2e8f0;
}

.rmt-body em {
  color: #94a3b8;
  font-style: normal;
  font-weight: 600;
}

.rmt-row {
  font-size: 11px;
  line-height: 1.5;
}

.rmt-up   { color: #4ade80; }
.rmt-down { color: #f87171; }

.rmt-threshold {
  margin-top: 5px;
  font-size: 11px;
  color: #94a3b8;
}

.rmt-threshold strong {
  color: #fbbf24;
}

.rmt-sep {
  border: none;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  margin: 8px 0;
}

.rmt-arrow {
  position: absolute;
  bottom: -6px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: rgba(10, 18, 36, 0.98);
  border-right: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  transform: rotate(45deg);
}

.flux-block-history { 
  /* Allow block to grow with content; page scroll used instead */
  max-height: none; 
  overflow: visible;
}
.history-title { 
  font-size: 11px; 
  font-weight: 600; 
  color: var(--text-muted); 
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 4px;
}

.history-list { 
  margin-top: 4px;
  /* Use page scrolling rather than internal scrollbars */
  max-height: none;
  overflow-y: visible;
  padding-right: 3px;
  display: flex; 
  flex-direction: column; 
  gap: 4px;
  font-family: 'Roboto Mono', monospace;
}

.history-line { 
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 10px;
  background: rgba(15,23,42,0.96);
  box-shadow: 0 10px 24px rgba(0,0,0,0.8);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.history-top { 
  font-size: 11px; 
  color: var(--text-muted); 
  font-weight: 400;
}
.history-bottom { 
  font-size: 11px; 
  display: flex; 
  justify-content: flex-start; 
  gap: 8px; 
  align-items: center;
}
.history-lp.plus { 
  color: #bbf7d0; 
  font-weight: 600;
}
.history-lp.minus { 
  color: #fecaca; 
  font-weight: 600;
}

.history-line--success { 
  background: radial-gradient(circle at left, rgba(22,163,74,0.35), rgba(15,23,42,0.96));
  color: #bbf7d0;
}
.history-line--fail { 
  background: radial-gradient(circle at left, rgba(248,113,113,0.35), rgba(15,23,42,0.96));
  color: #fecaca;
}
.history-toggle {
  margin-left: 6px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}
.history-details {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.35;
  color: #e5e7eb;
}

/* Responsive: shrink column on small screens */
@media (max-width: 900px) {
  .flux-reel { width: 260px }
}
.cours-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cours-modal {
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(56,189,248,0.15));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(56,189,248,0.3);
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(56,189,248,0.3);
  animation: slideUp 0.4s ease;
}

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

.cours-header {
  padding: 25px 30px;
  border-bottom: 1px solid rgba(56,189,248,0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cours-header h3 {
  margin: 0;
  color: #f9fafb;
  font-size: 24px;
  font-weight: 600;
  text-shadow: 0 0 20px rgba(56,189,248,0.5);
}

.cours-close {
  background: rgba(56,189,248,0.15);
  border: 1px solid rgba(56,189,248,0.3);
  color: #38bdf8;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.cours-close:hover {
  background: rgba(56,189,248,0.25);
  border-color: rgba(56,189,248,0.5);
  transform: rotate(90deg);
  box-shadow: 0 0 15px rgba(56,189,248,0.4);
}

.cours-content {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  color: #f9fafb;
}

.cours-content h4 {
  color: #38bdf8;
  margin-top: 0;
  font-size: 20px;
  text-shadow: 0 0 20px rgba(56,189,248,0.5);
}

.cours-content p {
  line-height: 1.6;
  margin: 15px 0;
}

.cours-content code {
  background: rgba(56,189,248,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: #22d3ee;
  border: 1px solid rgba(56,189,248,0.2);
}

.cours-content .example {
  background: rgba(34,197,94,0.08);
  border-left: 4px solid #22c55e;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(34,197,94,0.1);
}

.cours-content ul {
  margin: 15px 0;
  padding-left: 25px;
}

.cours-content li {
  margin: 8px 0;
  line-height: 1.5;
}

.cours-footer {
  padding: 20px 30px;
  border-top: 1px solid rgba(56,189,248,0.2);
  display: flex;
  justify-content: center;
}

.cours-validate {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #020617;
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 
    0 4px 15px rgba(56,189,248,0.4),
    0 0 30px rgba(56,189,248,0.3);
}

.cours-validate:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(56,189,248,0.5),
    0 0 40px rgba(56,189,248,0.4);
}

.cours-validate:active {
  transform: translateY(0);
}

/* ───────── Blocs pédagogiques réutilisables (refonte des cours) ───────── */

/* Bandeau objectif en tête de cours */
.cours-content .cours-goal {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(56,189,248,0.16), rgba(168,85,247,0.12));
  border: 1px solid rgba(56,189,248,0.35);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 4px 0 18px;
  font-size: 15px;
  line-height: 1.5;
}
.cours-content .cours-goal strong { color: #38bdf8; }

/* Petites pastilles d'info (phase, niveau, prérequis) */
.cours-content .cours-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cours-content .cours-tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.3);
  color: #7dd3fc;
}

/* Titres de section : on garde h4 (déjà bleu) + un filet à gauche */
.cours-content h4 { border-left: 3px solid #38bdf8; padding-left: 10px; margin-top: 22px; }

/* Méthode pas à pas : liste ordonnée avec badges numérotés */
.cours-content ol.cours-steps { list-style: none; counter-reset: step; padding-left: 0; margin: 14px 0; }
.cours-content ol.cours-steps > li {
  counter-increment: step;
  position: relative;
  padding: 8px 8px 8px 44px;
  margin: 8px 0;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: 8px;
  line-height: 1.5;
}
.cours-content ol.cours-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 8px; top: 8px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  color: #020617; font-weight: 700; font-size: 14px;
  border-radius: 50%;
}

/* Encadrés colorés : astuce / piège / transfert / réponse */
.cours-content .cours-tip,
.cours-content .cours-warn,
.cours-content .cours-reuse,
.cours-content .cours-answer {
  border-left: 4px solid;
  border-radius: 4px;
  padding: 12px 14px;
  margin: 16px 0;
  line-height: 1.55;
}
.cours-content .cours-tip    { background: rgba(245,158,11,0.10); border-color: #f59e0b; }
.cours-content .cours-warn   { background: rgba(239,68,68,0.10);  border-color: #ef4444; }
.cours-content .cours-reuse  { background: rgba(168,85,247,0.10); border-color: #a855f7; }
.cours-content .cours-answer { background: rgba(34,197,94,0.10);  border-color: #22c55e; }
.cours-content .cours-tip strong    { color: #fbbf24; }
.cours-content .cours-warn strong   { color: #f87171; }
.cours-content .cours-reuse strong  { color: #c084fc; }
.cours-content .cours-answer strong { color: #4ade80; }

/* Touche clavier inline */
.cours-content kbd {
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.35);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 7px;
  font-family: monospace;
  font-size: 0.9em;
  color: #e0f2fe;
}

/* Tableau compact (ex. puissances de 2, classes IP) */
.cours-content table.cours-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.cours-content table.cours-table th,
.cours-content table.cours-table td {
  border: 1px solid rgba(56,189,248,0.2);
  padding: 6px 10px; text-align: center;
}
.cours-content table.cours-table th { background: rgba(56,189,248,0.12); color: #7dd3fc; }

/* ───────── Synoptiques (schémas façon composants Bit/Decimal) ───────── */
.cours-content .syn{display:flex;flex-wrap:wrap;align-items:stretch;gap:3px;font-family:monospace;margin:14px 0 4px;justify-content:center;}
.cours-content .syn-bit{min-width:20px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:4px;font-weight:700;font-size:13px;border:1px solid;}
.cours-content .syn-bit.dec{min-width:46px;font-size:14px;}
.cours-content .syn-bit.net{background:rgba(56,189,248,0.22);border-color:#38bdf8;color:#e0f2fe;}
.cours-content .syn-bit.host{background:rgba(148,163,184,0.16);border-color:#64748b;color:#e2e8f0;}
.cours-content .syn-dot{display:flex;align-items:center;color:#64748b;font-weight:700;}
.cours-content .syn-cut{width:0;border-left:3px dashed #f59e0b;margin:0 5px;align-self:stretch;}
.cours-content .syn-labels{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;font-family:system-ui,Arial,sans-serif;font-size:12px;margin:0 0 6px;}
.cours-content .syn-lab{padding:2px 9px;border-radius:6px;}
.cours-content .syn-lab.net{background:rgba(56,189,248,0.15);color:#7dd3fc;border:1px solid rgba(56,189,248,0.3);}
.cours-content .syn-lab.host{background:rgba(148,163,184,0.15);color:#cbd5e1;border:1px solid rgba(100,116,139,0.4);}
.cours-content .syn-cap{font-family:system-ui,Arial,sans-serif;font-size:12px;color:#94a3b8;text-align:center;margin:0 0 14px;}

/* ───────── Composants visuels dans les exemples (Bit/Decimal/Hexa) ───────── */
/* point séparateur d'octet : BLEU et bien visible (≠ d'un bit) */
.cours-content .syn-dot{color:#38bdf8;font-size:20px;font-weight:700;align-self:center;padding:0 3px;}
/* cellule avec son poids au-dessus (et/ou un sous-texte en dessous) */
.cours-content .syn-cell{display:flex;flex-direction:column;align-items:center;gap:2px;}
.cours-content .syn-w{font-size:10px;color:#94a3b8;font-family:monospace;line-height:1;}
.cours-content .syn-sub{font-size:10px;color:#c084fc;font-family:monospace;line-height:1;}
/* couleurs façon composants du projet */
.cours-content .syn-bit.b1{background:rgba(74,222,128,0.22);border-color:#4ade80;color:#dcfce7;}   /* Bit = 1 (vert) */
.cours-content .syn-bit.b0{background:rgba(74,222,128,0.07);border-color:#3f6f4f;color:#86efac;}    /* Bit = 0 */
.cours-content .syn-bit.dv{background:rgba(58,137,233,0.22);border-color:#3a89e9;color:#dbeafe;min-width:48px;} /* Decimal (bleu) */
.cours-content .syn-bit.hx{background:rgba(155,85,224,0.22);border-color:#9b55e0;color:#f3e8ff;min-width:34px;} /* Hexa (violet) */

/* ───────── IP / masque toujours sur UNE seule ligne (cases réduites) ───────── */
.cours-content .syn{flex-wrap:nowrap;overflow-x:auto;gap:2px;max-width:100%;}
.cours-content .syn-bit{width:16px;min-width:16px;height:26px;font-size:11px;flex:0 0 auto;}
.cours-content .syn-bit.dv{width:auto;min-width:42px;font-size:13px;}   /* octets décimaux */
.cours-content .syn-bit.hx{width:auto;min-width:30px;font-size:13px;}   /* chiffres hexa */
.cours-content .syn-dot{padding:0 1px;font-size:16px;flex:0 0 auto;}
.cours-content .syn-cut{margin:0 2px;flex:0 0 auto;}
.cours-content .syn-cell{flex:0 0 auto;}
/* léger scroll-bar discret si jamais ça dépasse */
.cours-content .syn::-webkit-scrollbar{height:6px;}
.cours-content .syn::-webkit-scrollbar-thumb{background:rgba(56,189,248,0.3);border-radius:3px;}

/* ───────── Une seule ligne, SANS scroll : les bits rétrécissent pour tenir ───────── */
.cours-content .syn{overflow:visible;gap:1px;flex-wrap:nowrap;}
.cours-content .syn-bit{box-sizing:border-box;width:15px;min-width:0;flex:0 1 15px;height:24px;font-size:11px;}
.cours-content .syn-bit.dv{flex:0 0 auto;width:auto;min-width:38px;font-size:13px;}
.cours-content .syn-bit.hx{flex:0 0 auto;width:auto;min-width:28px;font-size:13px;}
.cours-content .syn-cell{flex:0 1 auto;min-width:0;}
.cours-content .syn-dot{flex:0 0 auto;padding:0 1px;font-size:14px;}
.cours-content .syn-cut{flex:0 0 auto;margin:0 2px;}
/* ================================================================
   RankChangeModal — Cinematic rank transition overlay
   ================================================================ */

.rcm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  /* écran peu haut : la fenêtre défile au lieu d'être coupée (bouton du bas toujours atteignable) ;
     centrage vertical par margin:auto sur la carte (align-items:center couperait le haut) */
  overflow-y: auto;
  padding: 1rem 0;
  animation: rcm-overlay-in 0.25s ease forwards;
}

@keyframes rcm-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Card ---- */
.rcm-card {
  background: linear-gradient(155deg, #0d1117 0%, #161b22 55%, #1a1d2e 100%);
  border-radius: 24px;
  padding: 2.2rem 2rem 1.8rem;
  max-width: 460px;
  width: calc(100% - 2rem);
  margin: auto;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: rcm-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes rcm-card-in {
  from { transform: scale(0.55) translateY(50px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);    opacity: 1; }
}

.rcm-card.is-promotion {
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.15),
    0 0 60px rgba(255, 215, 0, 0.12),
    0 25px 60px rgba(0, 0, 0, 0.7);
}

.rcm-card.is-demotion {
  border: 1px solid rgba(239, 68, 68, 0.2);
  box-shadow:
    0 0 0 1px rgba(239, 68, 68, 0.1),
    0 0 40px rgba(239, 68, 68, 0.08),
    0 25px 60px rgba(0, 0, 0, 0.7);
}

.rcm-card.is-unlock {
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.15),
    0 0 50px rgba(99, 102, 241, 0.15),
    0 25px 60px rgba(0, 0, 0, 0.7);
}

/* ---- Counter badge ---- */
.rcm-counter {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  font-size: 0.7rem;
  color: #6b7280;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

/* ---- Phase label / icon ---- */
.rcm-phase-label {
  display: flex;
  justify-content: center;
  margin-bottom: 0.35rem;
}

.rcm-phase-icon {
  
  height: 150px;
  object-fit: contain;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.12));
  animation: rcm-phase-icon-in 0.4s 0.1s ease both;
}

@keyframes rcm-phase-icon-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 0.85; transform: scale(1); }
}

/* ---- Title ---- */
.rcm-title {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  margin: 0 0 1.8rem;
  line-height: 1;
  animation: rcm-title-drop 0.45s 0.15s ease both;
}

@keyframes rcm-title-drop {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

.rcm-title.is-promotion {
  background: linear-gradient(90deg, #f59e0b 0%, #fde68a 45%, #fbbf24 70%, #f59e0b 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rcm-title-drop 0.45s 0.15s ease both, rcm-shimmer 2.5s 0.6s linear infinite;
}

.rcm-title.is-demotion {
  color: #ef4444;
}

.rcm-title.is-unlock {
  background: linear-gradient(90deg, #818cf8 0%, #c4b5fd 45%, #a78bfa 70%, #818cf8 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rcm-title-drop 0.45s 0.15s ease both, rcm-shimmer 2.5s 0.6s linear infinite;
}

@keyframes rcm-shimmer {
  to { background-position: 250% center; }
}

/* ---- Ranks row ---- */
.rcm-ranks-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
  animation: rcm-ranks-rise 0.4s 0.35s ease both;
}

@keyframes rcm-ranks-rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ---- Rank slot ---- */
.rcm-rank-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

/* ---- Rank images ---- */
.rcm-rank-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.rcm-rank-img.old {
  opacity: 0.35;
  filter: grayscale(0.5) brightness(0.7);
  transform: scale(0.82);
}

.rcm-rank-img.new {
  animation:
    rcm-new-rank-pop 0.55s 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    rcm-rank-spin    6s   0.5s linear infinite;
  filter: drop-shadow(0 0 18px var(--rank-glow, rgba(255,215,0,0.7)));
}

@keyframes rcm-new-rank-pop {
  from { opacity: 0; transform: scale(0.2) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1)   rotate(0deg);   }
}

@keyframes rcm-rank-spin {
  0%   { transform: scale(1) rotateY(0deg);   }
  50%  { transform: scale(1) rotateY(180deg); }
  100% { transform: scale(1) rotateY(360deg); }
}

.rcm-rank-img.new.is-promotion {
  animation:
    rcm-new-rank-pop 0.55s 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    rcm-glow-pulse   2.2s 1.3s ease-in-out infinite,
    rcm-rank-spin    9s   1.3s linear infinite;
}

@keyframes rcm-glow-pulse {
  0%, 100% { filter: drop-shadow(0 0 14px var(--rank-glow, rgba(255,215,0,0.6)));  }
  50%       { filter: drop-shadow(0 0 30px var(--rank-glow, rgba(255,215,0,0.95))); }
}

/* ---- Arrow ---- */
.rcm-arrow {
  font-size: 1.6rem;
  opacity: 0.55;
  flex-shrink: 0;
  animation: rcm-arrow-in 0.3s 0.62s ease both, rcm-arrow-slide 1.6s 1.1s ease-in-out infinite;
}

@keyframes rcm-arrow-in {
  from { opacity: 0; transform: scaleX(0.1); }
  to   { opacity: 0.55; transform: scaleX(1); }
}

@keyframes rcm-arrow-slide {
  0%, 100% { opacity: 0.4; transform: translateX(0);   }
  50%       { opacity: 0.9; transform: translateX(5px); }
}

.rcm-arrow.is-demotion {
  color: #ef4444;
  animation: rcm-arrow-in 0.3s 0.62s ease both;
}

/* ---- Rank name ---- */
.rcm-rank-name {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  color: var(--rank-color, #6b7280);
  letter-spacing: 0.06em;
}

.rcm-rank-name.old {
  opacity: 0.45;
}

.rcm-rank-name.new {
  font-size: 1rem;
  font-weight: 800;
  color: var(--rank-color, #d1d5db);
  animation: rcm-name-rise 0.35s 1.05s ease both;
}

@keyframes rcm-name-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ---- EFE badge ---- */
.rcm-efe-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  margin: 0 auto 1.4rem;
  max-width: 340px;
  font-size: 0.8rem;
  color: #9ca3af;
  animation: rcm-efe-in 0.35s 1.2s ease both;
}

@keyframes rcm-efe-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}

.rcm-efe-badge.success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
  color: #86efac;
}

.rcm-efe-badge.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  color: #fca5a5;
}

/* Pastille couleur EFE */
.rcm-efe-color {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.rcm-efe-color--rouge  { background: rgba(239,68,68,0.2);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.rcm-efe-color--jaune  { background: rgba(251,191,36,0.2); color: #fde68a; border: 1px solid rgba(251,191,36,0.4); }
.rcm-efe-color--bleu   { background: rgba(96,165,250,0.2); color: #93c5fd; border: 1px solid rgba(96,165,250,0.4); }
.rcm-efe-color--vert   { background: rgba(74,222,128,0.2); color: #86efac; border: 1px solid rgba(74,222,128,0.4); }

/* Code compétence EFE */
.rcm-efe-code {
  font-family: monospace;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}

.rcm-efe-link {
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s;
}
.rcm-efe-link:hover { color: #a5b4fc; text-decoration: underline; }

/* ---- Continue button ---- */
.rcm-btn {
  padding: 0.72rem 2.4rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.14s, box-shadow 0.14s;
  animation: rcm-btn-in 0.35s 1.4s ease both;
}

@keyframes rcm-btn-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

.rcm-btn:hover  { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.45); }
.rcm-btn:active { transform: translateY(0); }

.rcm-btn.is-promotion {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #0d1117;
  box-shadow: 0 4px 18px rgba(245,158,11,0.45);
}

.rcm-btn.is-demotion {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
}

.rcm-btn.is-unlock {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 18px rgba(79,70,229,0.45);
}

/* ---- Burst particles (promotion only) ---- */
.rcm-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rcm-particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  top: 42%;
  left: 50%;
  animation: rcm-burst-out var(--dur, 1s) var(--delay, 0s) ease-out both;
  background: var(--color, #ffd700);
}

@keyframes rcm-burst-out {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% {
    transform:
      translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, 0px)))
      scale(0);
    opacity: 0;
  }
}
/* QuestionPhase10 — Le Donjon Linux (thème terminal Matrix) */

/* ── Layout général ─────────────────────────────────────────────────────── */
.q10-root {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #020802;
  border-radius: 12px;
  color: #e2e8f0;
  font-family: monospace;
}

/* ── En-tête mission ────────────────────────────────────────────────────── */
.q10-header {
  background: #0d1a0d;
  border-radius: 8px;
  padding: 9px 14px;
  border-left: 3px solid #00cc33;
}
.q10-header-title { font-size: 14px; font-weight: 700; color: #1aff66; margin-bottom: 2px; }
.q10-header-desc { font-size: 11.5px; color: #9ddc9d; line-height: 1.5; }
.q10-header-desc--hidden { font-size: 11.5px; color: #7fb87f; line-height: 1.5; font-style: italic; }
.q10-header-meta { margin-top: 5px; display: flex; gap: 14px; font-size: 11px; flex-wrap: wrap; }
.q10-meta-label { color: #8cc78c; }
.q10-meta-label code { color: #2bff63; }
.q10-meta-label code.q10-code-yellow { color: #fbbf24; }
.q10-meta-label code.q10-code-blue { color: #38bdf8; }
.q10-meta-steps { color: #8cc78c; }
.q10-meta-error { color: #ef4444; }
.q10-meta-win { color: #00ff41; }

/* ── Disposition : carte à gauche, terminal à droite ────────────────────── */
.q10-main {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.q10-main > .q10-canvas-wrap { flex: 1 1 380px; min-width: 280px; max-width: 520px; }
.q10-main > .q10-term        { flex: 1 1 320px; min-width: 280px; }

/* ── Canvas donjon ──────────────────────────────────────────────────────── */
.q10-canvas-wrap { overflow: visible; }
.q10-canvas-box { position: relative; }
.q10-canvas {
  display: block;
  width: 100%;
  max-width: 520px;          /* tuiles plus petites : carte moins envahissante */
  height: auto;
  border-radius: 6px;
  border: 1px solid #16331f;
  background: #04140a;
}

/* Infobulle au survol d'une tuile — liste lisible du contenu du dossier */
.q10-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  max-width: 240px;
  background: rgba(1, 10, 1, 0.97);
  border: 1px solid #1f6b2f;
  border-radius: 6px;
  padding: 6px 9px;
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 11px;
  line-height: 1.55;
  color: #9ddc9d;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
}
.q10-tip-title { color: #5cea7c; font-weight: 700; margin-bottom: 3px; word-break: break-all; }
.q10-tip-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q10-tip-enemy { color: #ff9b9b; }
.q10-tip-empty { color: #6f9f6f; font-style: italic; }
.q10-tip-role { color: #6f9f6f; }
.q10-tip-sep {
  color: #5cea7c;
  font-weight: 700;
  margin-top: 4px;
  padding-top: 3px;
  border-top: 1px solid #16361a;
}
.q10-legend {
  background: #030c03;
  border: 1px solid #081208;
  border-radius: 4px;
  padding: 4px 10px;
  margin-top: 4px;
  font-size: 9px;
  color: #8cc78c;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  line-height: 1.9;
}
.q10-c-green { color: #22c55e; }
.q10-c-grey { color: #64748b; }
.q10-c-red { color: #ef4444; }
.q10-c-blue { color: #3b82f6; }
.q10-c-purple { color: #a855f7; }
.q10-c-dim { color: #0a2a0a; }

/* ── Terminal Matrix ────────────────────────────────────────────────────── */
.q10-term {
  background: #010a01;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 12, 0, 0.2) 1px, rgba(0, 12, 0, 0.2) 2px);
  border: 2px solid #0a2a0a;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 255, 65, 0.06), inset 0 0 60px rgba(0, 255, 65, 0.015);
}
.q10-term-bar {
  background: #010c01;
  border-bottom: 1px solid #0a2a0a;
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.q10-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.q10-dot--r { background: #ff5f56; }
.q10-dot--y { background: #ffbd2e; }
.q10-dot--g { background: #27c93f; }
.q10-term-title { color: #00ff41; font-size: 11px; font-weight: 700; margin-left: 4px; }
.q10-term-status { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.q10-status-hint { color: #ffaa00; font-size: 10px; }
.q10-status-won { color: #00ff41; font-size: 10px; font-weight: 700; }
.q10-status-failed { color: #ff3333; font-size: 10px; font-weight: 700; }

/* ── Historique ─────────────────────────────────────────────────────────── */
.q10-history {
  overflow-y: auto;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.9;
  flex: 1 1 auto;       /* remplit la hauteur du terminal (aligné sur la carte) */
  min-height: 160px;
  max-height: 460px;
}
.q10-intro1 { color: #5fc25f; }
.q10-intro2 { color: #4f9f52; }
.q10-line { white-space: pre-wrap; word-break: break-word; color: #5cea7c; }
.q10-line--cmd { color: #00e836; font-weight: 700; }
.q10-line--error { color: #ff4d4d; }
.q10-line--success { color: #00ff41; font-weight: 700; }
.q10-line--warn { color: #ffaa00; }
.q10-line--hint { color: #2cb8ff; }
.q10-exec { color: #00ff41; }

/* ── Zone de saisie ─────────────────────────────────────────────────────── */
.q10-inputrow {
  border-top: 1px solid #0a2a0a;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  cursor: text;
}
.q10-prompt { color: #00e836; font-size: 12px; white-space: nowrap; user-select: none; flex-shrink: 0; }
.q10-inputwrap { flex: 1; position: relative; line-height: 18px; min-height: 18px; }
.q10-inputtext { color: #00e836; font-size: 12px; font-family: inherit; white-space: pre; }
.q10-cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.05em;
  vertical-align: text-bottom;
  margin-left: 1px;
  outline: 1.5px solid #00ff41;
}
.q10-cursor--on { background: #00ff41; outline: none; }
.q10-hiddeninput {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: transparent;
  caret-color: transparent;
  font-size: 12px;
  font-family: inherit;
}
.q10-enter {
  flex-shrink: 0;
  margin-left: 10px;
  padding: 2px 9px;
  border-radius: 2px;
  font-size: 11px;
  font-family: inherit;
  background: #001800;
  color: #00ff41;
  border: 1px solid #0a2a0a;
  cursor: pointer;
}
.q10-enter:disabled { background: transparent; color: #0a3a0a; border-color: #060e06; cursor: default; }

/* Suggestions de complétion Tab */
.q10-tabopts { padding: 0 14px 6px; font-size: 10px; color: #3fae6f; font-family: inherit; }

/* ── Indice ─────────────────────────────────────────────────────────────── */
.q10-hintrow { border-top: 1px solid #0a2a0a; padding: 4px 14px; display: flex; justify-content: flex-end; }
.q10-hintbtn {
  padding: 2px 10px;
  background: transparent;
  color: #2cb8ff;
  border: 1px solid #003a66;
  border-radius: 2px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}

/* ── Rappel de mission après échec ──────────────────────────────────────── */
.q10-suggest { border-top: 2px solid #4a0000; padding: 10px 14px; background: rgba(20, 0, 0, 0.75); }
.q10-suggest-wrong { color: #ff4d4d; font-weight: 700; margin-bottom: 5px; word-break: break-word; }
.q10-suggest-wrong code { color: #ff8888; }
.q10-suggest-label { color: #ffaa00; margin-bottom: 5px; font-size: 11px; }
.q10-suggest-text {
  background: #000e00;
  border: 1px solid #0a2a0a;
  border-radius: 3px;
  padding: 5px 12px;
  color: #9ddc9d;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}
.q10-suggest-foot { color: #7fb87f; font-size: 10px; margin-top: 5px; }
.q10-suggest-errors { margin: 4px 0 6px; display: flex; flex-direction: column; gap: 2px; }
.q10-suggest-errline { color: #ff8888; font-size: 11px; }
.q10-suggest-errline code { color: #ffb3b3; }

/* ── Erreur map manquante ───────────────────────────────────────────────── */
.q10-nomap { color: #ef4444; padding: 20px; font-family: monospace; }
