.gx-fab,
.gx-ov {
    --gx-acc: var(--primary, #2563eb);
    --gx-tint: color-mix(in srgb, var(--gx-acc) 10%, #fff);
    --gx-dark:#000000;
    --gx-ink: #1e293b;
    --gx-mute: #64748b;
    --gx-line: #e2e8f0;
    --gx-okc: #35cc35; /* réponse juste */
    --gx-koc: #ff4d26; /* réponse fausse */
    --gx-head: #efcdbf; /* en-têtes de tableaux */
    --gx-left: 20px;
    --gx-bottom: 20px;
    --danger-light: #fee2e2;
}

html.gx-lock {
    overflow: hidden;
}

/* ---------- Bulle ---------- */
.gx-fab {
    position: fixed;
    left: var(--gx-left);
    bottom:30%;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px 9px 9px;
    border: 2px solid white;
    border-radius: 999px;
    background: var(--gx-acc);
    color: #fff;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.3);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.gx-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.35);
}
.gx-fab-ico {
    position: relative;
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: var(--gx-acc);
    font-size: 18px;
}
.gx-fab-ico::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: gx-ping 1.5s ease-out 24;
}
@keyframes gx-ping {
    to {
        transform: scale(1.9);
        opacity: 0;
    }
}
.gx-fab-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.gx-fab-txt b {
    font: 600 15px/1.2 var(--font-display, "Outfit", sans-serif);
}
.gx-fab-txt small {
    font: 400 12px/1.3 var(--font-body, "DM Sans", sans-serif);
    opacity: 0.85;
}
@media (max-width: 520px) {
    .gx-fab {
        padding: 8px;
    }
    .gx-fab-txt {
        display: none;
    }
}

/* ---------- Modal ---------- */
.gx-ov {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}
.gx-ov.open {
    display: flex;
}
.gx-dlg,
.gx-dlg * {
    box-sizing: border-box;
}
.gx-dlg {
    display: flex;
    flex-direction: column;
    width: min(1000px, 100%);
    max-height: min(93vh, 900px);
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    color: var(--gx-ink);
    font: 400 15px/1.5 var(--font-body, "DM Sans", system-ui, sans-serif);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35);
    animation: gx-in 0.25s ease-out;
}
@keyframes gx-in {
    from {
        transform: translateY(14px) scale(0.98);
        opacity: 0;
    }
}
.gx-dlg h2,
.gx-dlg h3,
.gx-dlg p,
.gx-dlg ol,
.gx-dlg ul {
    margin: 0;
}
.gx-dlg button,
.gx-dlg select,
.gx-dlg input {
    font-family: inherit;
}

.gx-hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 4px;
}
.gx-hd h2 {
    font: 700 18px/1.2 var(--font-display, "Outfit", sans-serif);
    color: var(--gx-ink);letter-spacing: 0.1rem;text-align: center;
}
.gx-hd p {
    margin-top: 2px;
    color: var(--gx-dark);
    font-size: 14px;
}
.gx-x {
  position: relative;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50% !important;
  background: red;
  border: 1px solid transparent !important;
  color: white;
  font-weight: bolder;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans);
  font-size: 1.25rem;
  padding:0 10px;
}
.gx-x:hover {
  background: var(--primary);
  color: white;
  border-color: var(--danger-light);transform: rotate(90deg);
}

.gx-tabs {
    display: flex;
    gap: 4px;
    padding: 5px 10px;
    overflow-x: none;
    border-bottom: 1px solid var(--gx-line);
}
.gx-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: none;
    padding: 7px 14px 7px 0;
    border: 0.25px solid #97a3b4;
    border-radius: 999px;
    background: var(--gx-line);
    color:#000000;
    font-weight: 600;
    font-size: 14.5px;height: 23px;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: 5px;
    margin-left:20px;
}
.gx-tab:hover {
    background: #f1f5f9;
}
.gx-tab.on {
    background: var(--gx-tint);
    color: var(--gx-acc);
}
.gx-num {
    display: grid;
    place-items: center;
    width: 22px;margin-left:0;
    height: 22px;
    border-radius: 50%;
    background: var(--gx-mute);
    color:white;
    font-size: 12px;
}
.gx-tab.on .gx-num {
    background: var(--gx-acc);
    color: #fff;
}
.gx-tab.done .gx-num {
    background: #15803d;
    color: #fff;
}

.gx-bd {
    flex: 1;
    min-height: 0;
    padding: 22px;
    overflow-y: auto;
}
.gx-ft {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid var(--gx-line);
    background: #f8fafc;
}
.gx-sp {
    flex: 1;
}

.gx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
}
.gx-main {
    background: var(--gx-acc);
    color: #fff;
}
.gx-main:hover {
    filter: brightness(1.1);
}
.gx-line {
    background: #fff;
    border-color: var(--gx-acc);
    color: var(--gx-acc);
}
.gx-ghost {
    background: transparent;
    color: var(--gx-mute);
}
.gx-ghost:hover {
    color: var(--gx-ink);
}
.gx-dlg :focus-visible {
    outline: 3px solid var(--gx-acc);
    outline-offset: 2px;
}

/* ---------- Énoncés ---------- */
.gx-h {
    margin: 18px 0 0;
    font: 700 18px/1.3 var(--font-display, "Outfit", sans-serif);
}
.gx-lead {
    margin-bottom: 8px;
}
.gx-ops {
    padding-left: 22px;
    margin-bottom: 6px !important;
}
.gx-inv {
    list-style: none;
    padding: 0;color:#000000;
    margin: 6px 0 4px !important;
}
.gx-inv li {
    display: flex;
    gap: 10px;
    padding: 2px 0;
}
.gx-inv li::before {
    content: "–";
}
.gx-inv li span {
    min-width: 270px;
}
.gx-inv li b {
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Tableaux (modèle du site) ---------- */
.gx-tw {
    margin-top: 12px;
    overflow-x: auto;
}
.gx-tb {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}
.gx-tb th,
.gx-tb td {
    padding: 6px;
    border: 1px solid #e3cbbf;
    vertical-align: middle;
}
.gx-tb thead th {
    padding: 12px 8px;
    background: var(--gx-head);
    color: #3a1c10;
    font-weight: 700;
    text-align: center;
}
.gx-tb td {
    background: #fff;
}
.gx-tb tr.ok > td,
.gx-tb td.ok {
    background: var(--gx-okc);
}
.gx-tb tr.ko > td,
.gx-tb td.ko {
    background: var(--gx-koc);
}

.gx-c {
    display: block;
    width: 100%;
    padding: 9px 8px;
    border: 1px solid #b5c4d8;
    border-radius: 6px;
    background: #f4f8fe;
    color: var(--gx-ink);
    font-size: 14.5px;
}
.gx-m {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.gx-box {
    display: block;
    padding: 9px 8px;
    border: 1px solid #b5c4d8;
    border-radius: 6px;
    background: #fff;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Bilan et compte de résultat */
.gx-sub {
    padding: 8px 10px !important;
    background: #e9f0fc !important;
    color: #1e3a6e;
    font-weight: 700;
    font-style: italic;
}
.gx-tot td {
    background: #fff;
    font-weight: 700;
    text-align: center;
    padding: 10px 6px;
}
.gx-bilt {
    min-width: 640px;
}

/* Vrai / Faux */
.gx-tft {
    min-width: 560px;
}
.gx-tft thead th {
    background: #dce6f2;
    color: #1e293b;
}
.gx-tft th:not(:first-child) {
    width: 90px;
}
.gx-aff {
    padding: 10px 12px !important;
}
.gx-tc {
    text-align: center;
}
.gx-radio {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
}
.gx-radio input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.gx-dot {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 2px solid #1e293b;
    border-radius: 50%;
    background: #fff;
    pointer-events: none;
}
.gx-radio input:checked + .gx-dot::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1e293b;
}
.gx-radio input:focus-visible + .gx-dot {
    outline: 3px solid var(--gx-acc);
    outline-offset: 2px;
}

/* QCM */
.gx-qcm-q {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--gx-line);
    border-radius: 10px;
}
.gx-qcm-q .gx-lead {
    margin-bottom: 0;
    font-weight: 600;
}
.gx-qcm-q.ok {
    border-color: var(--gx-okc);
    background: color-mix(in srgb, var(--gx-okc) 10%, #fff);
}
.gx-qcm-q.ko {
    border-color: var(--gx-koc);
    background: color-mix(in srgb, var(--gx-koc) 8%, #fff);
}
.gx-qcm-opts {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}
.gx-radio-opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--gx-line);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}
.gx-radio-opt:hover {
    background: #f8fafc;
}
.gx-radio-opt input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
.gx-radio-opt .gx-dot {
    flex: none;
}
.gx-radio-opt input:checked + .gx-dot::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1e293b;
}
.gx-radio-opt:has(input:checked) {
    border-color: var(--gx-acc);
    background: var(--gx-tint);
}
.gx-radio-opt input:focus-visible + .gx-dot {
    outline: 3px solid var(--gx-acc);
    outline-offset: 2px;
}

/* Boutons « pilule » et messages */
.gx-bt {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}
.gx-pill {
    padding: 10px 22px;
    border: 1.5px solid #7aa7ff;
    border-radius: 999px;
    background: #fff;
    color: var(--gx-ink);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}
.gx-pill:hover {
  background-color: #dc8b6f;
  color:#ffffff;
  border: 1px solid #aaa;
}
.gx-res {
    margin-top: 12px;
    font-weight: 700;
}
.gx-res:empty {
    display: none;
}
.gx-res.ok {
    display: inline-block;
    padding: 6px 14px;
    background: #c9efd8;
    color: #0f6b34;
}
.gx-res.ko {
    color: #e0431c;
}
.gx-res.bub {
    display: inline-block;
    padding: 10px 20px;
    border: 2.5px solid #e91e63;
    border-radius: 18px;
    background: #fff;
    color: var(--gx-ink);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
}

/* Résultat */
.gx-score {
    text-align: center;
}
.gx-big {
    font: 800 60px/1 var(--font-display, "Outfit", sans-serif);
    color: var(--gx-acc);
}
.gx-big small {
    font-size: 26px;
    color: var(--gx-mute);
    font-weight: 600;
}
.gx-msg {
    margin: 8px 0 18px;
    font-size: 16px;
}
.gx-rows {
    display: grid;
    gap: 10px;
    margin: 0 auto 22px;
    max-width: 480px;
    text-align: left;
}
.gx-row {
    display: grid;
    grid-template-columns: 150px 1fr 48px;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}
.gx-bar {
    height: 10px;
    border-radius: 99px;
    background: var(--gx-line);
    overflow: hidden;
}
.gx-bar i {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--gx-acc);
}
.gx-row b {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.gx-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}
.gx-sub2 {
    margin-top: 14px;
    color:var(--gx-koc);
    font-size: 15.5px;font-weight: bolder;
}

@media (prefers-reduced-motion: reduce) {
    .gx-fab,
    .gx-fab-ico::after,
    .gx-dlg {
        animation: none;
        transition: none;
    }
}


