/* ── VARIABLES ─────────────────────────────────────────────────────────────── */
:root {
  --bg:      #0f0e17;
  --surface: #1a1929;
  --card:    #22213a;
  --accent:  #ff6b35;
  --accent2: #a8dadc;
  --correct: #57cc99;
  --wrong:   #ef476f;
  --text:    #fffffe;
  --muted:   #8b8aa8;
  --border:  rgba(255,255,255,0.07);
}

/* ── RESET & BASE ───────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -30%; left: -20%;
  width: 70%; height: 70%;
  background: radial-gradient(ellipse, rgba(255,107,53,0.12) 0%, transparent 70%);
  pointer-events: none;
}
body::after {
  content: '';
  position: fixed;
  bottom: -30%; right: -20%;
  width: 60%; height: 60%;
  background: radial-gradient(ellipse, rgba(168,218,220,0.09) 0%, transparent 70%);
  pointer-events: none;
}

/* ── LAYOUT ─────────────────────────────────────────────────────────────────── */
article{
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
}
/*.quiz-wrap {
  width: 100%;
  max-width: 720px;
  position: relative;
  z-index: 1;
}*/

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
header { margin-bottom: 2rem; }

.tag {
  display: inline-block;
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  margin-bottom: 1rem;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
}
h1 span { color: var(--accent); }

.subtitle {
  color: var(--muted);
  margin-top: 0.5rem;
  font-size: 0.92rem;
  font-weight: 300;
  line-height: 1.5;
}

/* ── TOP BAR (progress + live score) ───────────────────────────────────────── */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.live-score-label { font-family: 'Syne', sans-serif; }

.progress-bar-wrap {
  background: var(--border);
  height: 3px;
  border-radius: 2px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── QUESTION CARD ──────────────────────────────────────────────────────────── */
.question-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2rem;
  margin-bottom: 1.2rem;
  animation: slideUp 0.35s ease both;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: attr(data-n);
  position: absolute;
  top: -0.5rem; right: 1.5rem;
  font-family: 'Syne', sans-serif;
  font-size: 5rem;
  font-weight: 700;
  color: rgba(255,255,255,0.025);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

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

.question-text {
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.55;
  margin-bottom: 1.5rem;
}

/* ── SLIDER — SHARED ────────────────────────────────────────────────────────── */
input[type=range].slider {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

input[type=range].slider:focus { outline: none; }

input[type=range].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  margin-top: -8px;
  transition: transform 0.1s, box-shadow 0.1s;
}

input[type=range].slider:hover::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 0 0 4px rgba(255,107,53,0.25);
}

input[type=range].slider:disabled::-webkit-slider-thumb {
  background: var(--muted);
  box-shadow: none;
  cursor: default;
}

input[type=range].slider::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
}

input[type=range].slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

input[type=range].slider::-moz-range-track {
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
}

/* ── TRUE / FALSE SLIDER ────────────────────────────────────────────────────── */
.tf-wrap { margin-bottom: 1rem; }

.tf-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.tf-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}

.tf-label.highlight-correct { color: var(--correct); }

.tf-slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

input[type=range].tf-slider { flex: 1; }

.tf-pct {
  font-family: 'Syne', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 3rem;
  text-align: center;
  color: var(--text);
}

.tf-bar-wrap {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.6rem;
  gap: 2px;
}

.tf-bar-false {
  background: var(--wrong);
  opacity: 0.6;
  border-radius: 3px 0 0 3px;
  transition: width 0.1s;
}
.tf-bar-true {
  background: var(--correct);
  opacity: 0.6;
  border-radius: 0 3px 3px 0;
  transition: width 0.1s;
}

/* ── N-ANSWER SLIDERS ───────────────────────────────────────────────────────── */
.slider-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  border: 1.5px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 0.4rem;
}

.slider-row.row-correct {
  border-color: var(--correct);
  background: rgba(87,204,153,0.07);
}

.slider-answer {
  font-size: 0.88rem;
  line-height: 1.3;
  color: var(--text);
}

.slider-track-wrap {
  position: relative;
  height: 4px;
  display: flex;
  align-items: center;
}

.slider-track-wrap input[type=range].slider {
  position: relative;
  z-index: 2;
}

.slider-fill {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
  transition: width 0.05s;
}

.slider-pct {
  font-family: 'Syne', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 3rem;
  text-align: right;
  color: var(--text);
}

/* ── CONFIRM BUTTON ─────────────────────────────────────────────────────────── */
.slider-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 1rem 0 0.75rem;
  font-style: italic;
}

.btn-confirm {
  display: inline-block;
  background: transparent;
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.4rem;
  border: 1.5px solid var(--accent);
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.btn-confirm:hover:not(:disabled) {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.btn-confirm:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── FEEDBACK ───────────────────────────────────────────────────────────────── */
.feedback {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 0.7rem;
  font-size: 0.875rem;
  line-height: 1.5;
  display: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  animation: fadeIn 0.3s ease;
}

.feedback.show { display: block; }

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

.fb-explanation {
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.fb-explanation strong { color: var(--text); }

.fb-score {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.83rem;
  color: var(--text);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pts {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 2rem;
}

.pts-pos { background: rgba(87,204,153,0.15);  color: var(--correct); }
.pts-neg { background: rgba(239,71,111,0.15);  color: var(--wrong);   }

.load-error {
  color: var(--wrong);
  padding: 1rem;
  font-size: 0.9rem;
}

/* ── RESULT PANEL ───────────────────────────────────────────────────────────── */
.result-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 2.5rem 2rem;
  text-align: center;
  display: none;
  animation: slideUp 0.4s ease both;
  margin-top: 1rem;
}

.result-panel.show { display: block; }

.score-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.score-ring svg { transform: rotate(-90deg); }

.ring-bg   { fill: none; stroke: var(--surface); stroke-width: 8; }
.ring-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  stroke: var(--accent);
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-num-wrap {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  line-height: 1;
  text-align: center;
}

.score-num {
  font-family: 'Syne', sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  display: block;
}

.score-max {
  font-size: 0.72rem;
  color: var(--muted);
  display: block;
}

.result-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.quiz-topic-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  float: right;
}

.result-sub {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto 2rem;
}

.btn-restart {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(255,107,53,0.3);
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,107,53,0.45);
}
mjx-math{
    margin: .5em;
}
.btn-back{
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: 'Syne', sans-serif;
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(255,107,53,0.3);
}
.topic-card{
    margin: .8em;
    padding: 0em .3em 0em .3em;
}
.topic-card:hover{
    margin: .8em;
    padding: 0em .3em 0em .3em;
}
.topic-count{
    text-decoration: italic;
    font-size: 0.5rem;
    display:block;
}
.topic-num{
    display: none;
    font-weight: 700;
}
nav{
    display: inline-block;
}
#enonce {
    background: var(--accent2);
    color: #000;
    border: 1px solid var(--border);
    border-radius: 1.2rem;
    padding: .8rem 1rem .8rem 2rem;
    margin-bottom: 1.2rem;
    animation: slideUp 0.35s ease both;
    position: relative;
    overflow: hidden;
}
#enonce:empty{
    display:none
}
/* ══════════════════════════════════════════════════════════════════════════════
   ABOUT PAGE
══════════════════════════════════════════════════════════════════════════════ */
.about-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.about-section {
  padding: 2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  margin-bottom: 1rem;
  animation: slideUp 0.35s ease both;
}

.about-section h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.about-section p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.about-section p:last-child { margin-bottom: 0; }

.about-section p strong { color: var(--text); }
.about-section p em     { color: var(--accent2); font-style: italic; }

/* MathJax display blocks inside about */
.about-section .MathJax_Display,
.about-section mjx-container[display="true"] {
  margin: 1rem 0;
  color: var(--text);
}

/* ── Odds table ─────────────────────────────────────────────────────────────── */
.odds-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.odds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.odds-table th {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.75rem 1rem;
  text-align: left;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.odds-table td {
  padding: 0.65rem 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.odds-table tr:last-child td { border-bottom: none; }

.odds-table td:first-child {
  font-family: 'Syne', sans-serif;
  font-weight: 650;
  color: var(--accent2);
}

.odds-table tr.row-mid td {
  background: rgba(255,107,53,0.06);
  color: var(--muted);
  font-style: italic;
}

/* ── Score examples ─────────────────────────────────────────────────────────── */
.score-examples {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.2rem 0;
}

.score-ex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  padding: 0.65rem 1rem;
  border-radius: 0.6rem;
  flex-wrap: wrap;
}

.score-ex-pct {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  min-width: 3.5rem;
}

.score-ex-label {
  flex: 1;
  font-size: 0.83rem;
  color: var(--muted);
}
