:root {
  --bg: #090C14;
  --bg-2: #111627;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #F2F4FA;
  --muted: #8E96AD;
  --blue: #019EF9;
  --violet: #A660E4;
  --action: #5F5AFF;
  --green: #22C55E;
  --orange: #F37142;
  --red: #FF4D5E;
  --grad: linear-gradient(135deg, #019EF9 0%, #5F5AFF 55%, #A660E4 100%);
  --accent: #5F5AFF;
  --accent-ink: #FFFFFF;
  --accent-glow: rgba(95, 90, 255, 0.35);
  --font-title: "Bricolage Grotesque", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(90% 50% at 50% -10%, rgba(95, 90, 255, 0.22) 0%, rgba(1, 158, 249, 0.08) 40%, var(--bg) 75%);
  min-height: 100dvh;
}

.app {
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: calc(env(safe-area-inset-top) + 20px) 20px calc(env(safe-area-inset-bottom) + 20px);
}

.top { text-align: center; }
.top h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.top .sub {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.mode {
  appearance: none;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 16px;
  min-height: 68px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.1s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.mode:active { transform: scale(0.97); }
.mode-name { font-size: 1.05rem; font-weight: 700; }
.mode-range { font-size: 0.8rem; opacity: 0.85; }
.mode.is-active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 20px 12px;
  min-height: 300px;
}

.label {
  margin: 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.number {
  font-family: var(--font-title);
  font-size: clamp(130px, 42vw, 220px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 6px 24px var(--accent-glow));
  min-width: 2ch;
  transition: transform 0.15s ease-out, opacity 0.15s;
}
.number[data-state="idle"] { opacity: 0.3; filter: none; }
.number[data-state="spinning"] { opacity: 0.85; filter: none; }
.number[data-state="final"] { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }

@keyframes pop {
  0%   { transform: scale(0.6); opacity: 0.4; }
  60%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.hint {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  min-height: 1.3em;
}

.draw {
  appearance: none;
  border: 0;
  border-radius: 22px;
  min-height: 92px;
  width: 100%;
  background: var(--grad);
  color: #fff;
  font: inherit;
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(95, 90, 255, 0.28);
  transition: transform 0.1s, filter 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.draw:active { transform: scale(0.97); }
.draw:disabled {
  cursor: default;
  filter: saturate(0.3) brightness(0.6);
  box-shadow: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .number[data-state="final"] { animation: none; }
  .mode, .draw, .number { transition: none; }
}

/* ===== Écrans d'évaluation (ajouts, la roulette garde son style) ===== */
.screen { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.screen[hidden] { display: none; }
.app { gap: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; justify-content: center; }

.top.with-back {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; text-align: center; gap: 4px;
}
.top.with-back:not(:has(.home-btn)) { grid-template-columns: 44px 1fr 44px; }
.back {
  appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text);
  width: 44px; height: 44px; border-radius: 14px; font-size: 1.8rem; line-height: 1; cursor: pointer; touch-action: manipulation;
  display: flex; align-items: center; justify-content: center; padding: 0 0 4px;
}
.home-btn { font-size: 1.4rem; padding: 0; }

.btn-secondary {
  appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text);
  border-radius: 18px; min-height: 60px; padding: 12px 16px; font: inherit; font-size: 1.1rem; font-weight: 700;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; width: 100%;
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.4; }
.btn-danger {
  appearance: none; border: 1px solid rgba(255, 99, 99, 0.5); background: rgba(255, 99, 99, 0.12); color: #ffb3b3;
  border-radius: 18px; min-height: 56px; padding: 12px 16px; font: inherit; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; touch-action: manipulation; width: 100%;
}
.draw.small { min-height: 68px; font-size: 1.2rem; }
.draw.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.25); box-shadow: none; }

.notice { margin: 0; text-align: center; color: var(--muted); font-size: 0.95rem; }
.legal { margin: 0; font-size: 0.78rem; line-height: 1.35; color: var(--muted); text-align: center; }
.warn {
  margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(243, 113, 66, 0.14);
  border: 1px solid rgba(243, 113, 66, 0.5); color: #ffc3ad; font-size: 0.95rem; text-align: center;
}

.progress {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
.progress li {
  height: 6px; border-radius: 3px; background: var(--panel-border); position: relative;
}
.progress li.done { background: rgba(1, 158, 249, 0.6); }
.progress li.current { background: var(--grad); }
.progress li button { position: absolute; inset: -14px 0; width: 100%; background: transparent; border: 0; cursor: pointer; }

.step-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.nav .btn-secondary { min-height: 68px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field textarea {
  appearance: none; width: 100%; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text);
  border-radius: 14px; padding: 14px; font: inherit; font-size: 1.15rem; min-height: 56px;
}
.field textarea { min-height: 72px; resize: vertical; font-size: 1rem; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.field .static { padding: 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--panel-border); font-size: 1.1rem; }

.card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.card .tip { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.35; }

.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.row .name { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.rate { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.rate button {
  appearance: none; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04); color: var(--text);
  min-height: 48px; border-radius: 12px; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; touch-action: manipulation;
}
.rate button.on { background: var(--green); color: #06230f; border-color: var(--green); }
.rate button[data-v="0"].on { background: var(--red); border-color: var(--red); color: #fff; }
.rate button[data-v="0.5"].on { background: var(--orange); border-color: var(--orange); color: #fff; }

.score-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; }
.score-line strong { font-size: 1.5rem; color: #fff; font-family: var(--font-title); }

.stage.compact { min-height: 220px; flex: 0 0 auto; }
.stage.compact .number { font-size: clamp(90px, 30vw, 140px); }

.chrono { text-align: center; display: flex; flex-direction: column; gap: 4px; padding: 16px 8px; }
.chrono .time { font-family: var(--font-title); font-size: clamp(64px, 20vw, 96px); font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.chrono .remain { font-size: 1.1rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.chrono.over .time { color: var(--red); }
.chrono .over-flag { display: none; font-weight: 800; color: var(--red); letter-spacing: 0.08em; }
.chrono.over .over-flag { display: block; }
.chrono-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.chrono-btns .draw.small { min-height: 64px; font-size: 1rem; }
.chrono-btns .btn-secondary { min-height: 64px; font-size: 1rem; }

.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; align-items: center; }
.stepper button { appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); min-height: 52px; border-radius: 12px; font-size: 1.6rem; cursor: pointer; touch-action: manipulation; }
.stepper output { text-align: center; font-size: 1.6rem; font-weight: 800; }

.elim { padding: 10px 14px; border-radius: 12px; background: rgba(255, 77, 94, 0.14); border: 1px solid rgba(255, 77, 94, 0.5); color: #ffb4bb; font-weight: 800; text-align: center; letter-spacing: 0.04em; }

.bilan { display: flex; flex-direction: column; gap: 10px; }
.bilan table { width: 100%; border-collapse: collapse; font-size: 1rem; table-layout: fixed; }
.bilan td { padding: 8px 4px; border-bottom: 1px solid var(--panel-border); vertical-align: middle; overflow-wrap: anywhere; }
.bilan td:first-child { width: 58%; }
.bilan td:last-child { text-align: right; font-weight: 700; white-space: normal; }
.bilan .total { font-size: 1.3rem; }
.bilan .total td:last-child { color: #fff; font-family: var(--font-title); font-size: 1.5rem; }
.bilan .total td { font-size: 1.1rem; }
.card { overflow: hidden; }
.bilan .meta { color: var(--muted); font-size: 0.95rem; margin: 0; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item { appearance: none; text-align: left; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); border-radius: 16px; padding: 14px; font: inherit; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; min-height: 64px; }
.item .n { font-weight: 700; font-size: 1.1rem; grid-column: 1; grid-row: 1; }
.item .d { color: var(--muted); font-size: 0.9rem; grid-column: 1; grid-row: 2; }
.item .s { font-weight: 800; color: #fff; font-size: 1.3rem; grid-column: 2; grid-row: 1 / span 2; text-align: right; font-family: var(--font-title); }
.item .s.pending { color: var(--orange); font-size: 0.9rem; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; }
  .app { display: none !important; }
  .print-only { display: block; font-family: Helvetica, Arial, sans-serif; color: #000; padding: 10mm; }
  .print-only h1 { font-size: 20pt; margin: 0 0 4pt; }
  .print-only p { margin: 2pt 0; }
  .print-only table { width: 100%; border-collapse: collapse; margin: 10pt 0; }
  .print-only td { border-bottom: 1px solid #999; padding: 5pt 2pt; }
  .print-only td:last-child { text-align: right; font-weight: bold; }
  .print-only .total td { font-size: 14pt; font-weight: bold; }
  .print-only .elim { color: #b00; font-weight: bold; }
  .print-only .legal { font-size: 9pt; color: #444; margin-top: 12pt; }
}

.link { appearance: none; background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 6px; }

.addrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.addrow .btn-secondary { min-height: 56px; width: auto; padding: 0 18px; }
.x { appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); width: 44px; height: 44px; border-radius: 12px; font-size: 1.4rem; cursor: pointer; touch-action: manipulation; }
.elim.ok { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.55); color: #9af0b8; }
.item .s { font-size: 1rem; }

.order-stage { min-height: 260px; }
.order-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.order-list li { font-size: 1.25rem; font-weight: 700; color: var(--text); padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); }
.order-list.spinning li { color: var(--muted); }
.order-list.final li { color: #fff; background: rgba(95, 90, 255, 0.18); border: 1px solid rgba(95, 90, 255, 0.35); }
.order-list li.pop { animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 4px; }
.brand .mark { width: 44px; height: 44px; border-radius: 13px; background: var(--grad); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(95, 90, 255, 0.35); }
.brand .mark svg { width: 26px; height: 26px; }
.brand .by { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.brand .by strong { color: #fff; font-family: var(--font-title); letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.field label, .grp { color: var(--muted); }
.card { background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035)); }
.stage { background: linear-gradient(180deg, rgba(95, 90, 255, 0.10), rgba(255,255,255,0.03)); border-color: rgba(95, 90, 255, 0.25); }
@media (prefers-reduced-motion: reduce) { .order-list li.pop { animation: none; } }

.rate.n2 { grid-template-columns: repeat(2, 56px); }
.rate.n4 { grid-template-columns: repeat(4, 50px); }
.rate button[data-v="E"].on, .rate button[data-v="NON"].on { background: var(--red); border-color: var(--red); color: #fff; }
.rate button[data-v="OUI"].on { background: var(--green); border-color: var(--green); color: #06230f; }
.score-line .e { color: var(--red); }
.row .name { font-size: 0.95rem; }

.rate.n5 { grid-template-columns: repeat(5, 44px); gap: 4px; }
.rate.n5 button { min-height: 46px; font-size: 1rem; }
.row .name small { display: block; font-weight: 400; }

.apprec { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-top: 1px solid var(--panel-border); }
.apprec strong { font-size: 0.85rem; color: var(--blue); }
.apprec span { white-space: pre-wrap; }

.qdraw { font-family: var(--font-title); font-size: clamp(34px, 9vw, 48px); font-weight: 800; line-height: 1.15; color: #fff; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stage.compact .qdraw { min-height: 2.3em; display:flex; align-items:center; justify-content:center; }
.bilan .card p { margin: 4px 0; }

.grp { margin: 10px 0 2px; font-size: 0.85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.item-row { padding: 6px 0; border-top: 1px solid var(--panel-border); }
.item-row .name { font-size: 0.95rem; }
.help { appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--blue); width: 30px; height: 30px; border-radius: 50%; font-weight: 800; cursor: pointer; margin-left: 6px; vertical-align: middle; }
.help-txt { margin: 0 0 6px; padding: 8px 10px; border-radius: 10px; background: rgba(1, 158, 249, 0.08); border-left: 3px solid var(--blue); color: var(--text); font-size: 0.9rem; line-height: 1.4; }
.trate button[data-v="0"].on { background: var(--red); border-color: var(--red); color: #fff; }

ul.help-txt { padding-left: 18px; }
ul.help-txt li { margin: 2px 0; }

.btn-mini { appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 0.8rem; font-weight: 700; cursor: pointer; white-space: nowrap; align-self: start; }
.card .help-txt.book { display: none; }
.card.texts-on .help-txt.book { display: block; }

.bilan .verdict { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; }
.bilan .vlabel { font-size: 1rem; color: var(--muted); }
.bilan .vbadge { display: block; text-align: center; padding: 12px; border-radius: 14px; font-family: var(--font-title); font-weight: 800; font-size: 1.3rem; letter-spacing: 0.06em; background: var(--panel-2); color: var(--text); }
.bilan .vbadge.fav { background: rgba(34, 197, 94, 0.18); border: 1px solid rgba(34, 197, 94, 0.55); color: #9af0b8; }
.bilan .vbadge.defav { background: rgba(255, 77, 94, 0.16); border: 1px solid rgba(255, 77, 94, 0.5); color: #ffb4bb; }
.print-only .vbadge { display: inline-block; font-weight: bold; }

.print-only .verdict { margin: 8pt 0; }
.print-only .vlabel { margin-right: 8pt; }

.qbig { margin: 6px 0 0; font-size: 1.05rem; line-height: 1.4; color: var(--text); max-width: 34ch; }
.qrow .name { display: flex; flex-direction: column; gap: 2px; }
.qref { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.qtxt { font-weight: 500; font-size: 0.95rem; line-height: 1.35; }
.ans-btn { margin: 2px 0 6px; }
.help-txt.ans { border-left-color: var(--green); background: rgba(34, 197, 94, 0.08); }
.qrecap { margin: 4px 0; line-height: 1.35; }
.qrecap em { color: #9af0b8; font-style: normal; }

.signbox { display: flex; justify-content: center; margin: 8px 0 2px; }
.signbox .sign { height: 104px; width: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4)); }
.signmini { display: inline-block; vertical-align: middle; margin-right: 8px; }
.signmini .sign { height: 40px; width: auto; }
.qtxt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.piste-img { background: #fff; border-radius: 12px; padding: 6px; overflow: hidden; }
.piste-img img { width: 100%; height: auto; display: block; }
.piste.compact .piste-img { padding: 4px; }
#piste-stage { min-height: 200px; }
#piste-stage .number { font-size: clamp(90px, 28vw, 130px); }

.zoom { position: fixed; inset: 0; background: #fff; z-index: 50; }
.zoom[hidden] { display: none; }
.zoom-scroll { position: absolute; inset: 0; overflow: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: center; justify-content: center; }
.zoom img { transform: rotate(90deg); width: 96vh; max-width: none; height: auto; flex: 0 0 auto; }
.zoom.big .zoom-scroll { display: block; }
.zoom.big img { transform: none; width: 200vw; margin: 40vh 0; }
@media (orientation: landscape) { .zoom img { transform: none; width: 96vw; } .zoom.big img { width: 200vw; margin: 20vh 0; } }
.zoom-hint { position: fixed; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 10px); margin: 0; text-align: center; font-size: 0.85rem; color: #333; }
.zoom-close { position: fixed; top: calc(env(safe-area-inset-top) + 12px); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #111; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.piste-img { cursor: zoom-in; }

/* remarques en un appui */
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 8px; }
.tags-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; width: 100%; }
.tag { appearance: none; border: 1px solid var(--panel-border); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; touch-action: manipulation; transition: background 0.15s, color 0.15s, transform 0.1s; }
.tag:active { transform: scale(0.94); }
.tag.on { background: var(--orange); border-color: var(--orange); color: #fff; }
/* débrief */
.debrief { display: flex; flex-direction: column; gap: 12px; }
.dtotal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.dtotal > span { color: var(--muted); } .dtotal > strong { font-family: var(--font-title); font-size: 1.8rem; }
.dtotal .verdict { width: 100%; padding-top: 4px; }
.dhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; font-size: 1.05rem; }
.dhead strong { font-family: var(--font-title); font-size: 1.3rem; white-space: nowrap; }
.ditem { border-top: 1px solid var(--panel-border); padding-top: 6px; }
.dq { margin: 4px 0; font-size: 1.02rem; line-height: 1.4; } .dq small { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.da { margin: 2px 0 6px; padding: 8px 10px; border-radius: 10px; background: rgba(34, 197, 94, 0.1); border-left: 3px solid var(--green); color: var(--text); font-size: 0.95rem; line-height: 1.4; }
ul.da { padding-left: 26px; } ul.da li { margin: 2px 0; }
.dok { margin: 4px 0; color: #9af0b8; }
.dtags { margin: 6px 0 0; color: var(--orange); font-size: 0.9rem; }
.dcomment { margin: 6px 0 0; font-style: italic; color: var(--muted); }
/* animations */
.screen { animation: screen-in 0.28s ease-out both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.progress li { transition: background 0.4s ease; }
.rate button, .trate button { transition: background 0.15s, color 0.15s, transform 0.12s; }
.rate button.on, .trate button.on { animation: pick 0.25s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes pick { 0% { transform: scale(0.85); } 100% { transform: scale(1); } }
.card { animation: card-in 0.3s ease-out both; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.chrono.flash { animation: flash 0.5s ease-in-out 5; }
@keyframes flash { 0%, 100% { box-shadow: none; } 50% { box-shadow: 0 0 0 4px var(--red) inset; } }
.item:active, .btn-secondary:active, .draw:active { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) { .screen, .card, .rate button.on, .trate button.on, .chrono.flash { animation: none; } }

.progress[hidden] { display: none; }

.tags[hidden] { display: none; }

.rate.n3 { grid-template-columns: repeat(3, 52px); }
.bilan td.grp { padding-top: 12px; border-bottom: 0; text-align: left !important; font-size: 0.72rem; }
.stack[hidden] { display: none; }
.stacked.item-row { display: grid; gap: 8px; padding: 10px 0; }
.stacked.item-row .rate.n5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stacked.item-row .name { font-size: 0.95rem; font-weight: 600; line-height: 1.2; }

/* Fiche circulation, structure du certificat d'examen */
.fiche { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 16px; padding: 12px 10px; margin-bottom: 12px; }
.fiche-title { font-family: 'Bricolage Grotesque', Inter, sans-serif; font-weight: 800; font-size: 0.95rem; text-align: center; border: 1px solid var(--panel-border); border-radius: 8px; padding: 8px; margin-bottom: 8px; }
.fiche-id { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 10px; }
.fiche-id td { border: 1px solid var(--panel-border); padding: 4px 6px; }
.fiche-id td:first-child { color: var(--muted); width: 32%; }
.bilan .fiche-grid, .fiche-grid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 0.62rem; line-height: 1.15; }
.bilan .fiche-grid th, .bilan .fiche-grid td, .fiche-grid th, .fiche-grid td { border: 1px solid rgba(255,255,255,0.18); padding: 3px 2px; text-align: center; vertical-align: middle; overflow-wrap: normal; word-break: normal; hyphens: auto; font-size: 0.62rem; font-weight: 400; }
.bilan .fiche-grid th.lbl, .bilan .fiche-grid td.lbl { text-align: left; width: 36%; padding-left: 4px; }
.bilan .fiche-grid thead th { font-weight: 700; }
.bilan .fiche-id td { padding: 4px 6px; border-bottom: 1px solid var(--panel-border); font-size: 0.8rem; }
.bilan .fiche-id td:first-child { width: 32%; } .bilan .fiche-id td:last-child { text-align: left; font-weight: 600; }
.bilan .fiche-grid thead th, .fiche-grid thead th { font-weight: 700; background: rgba(95,90,255,0.22); }
.bilan .fiche-grid th.auto-h, .fiche-grid th.auto-h { font-size: 0.55rem; background: rgba(166,96,228,0.3); }
.bilan .fiche-grid th.vert, .fiche-grid th.vert { height: 84px; width: 9%; padding: 0; }
.fiche-grid th.vert span { display: block; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 600; font-size: 0.6rem; margin: 0 auto; white-space: nowrap; }
.bilan .fiche-grid td.sect, .fiche-grid td.sect { background: linear-gradient(90deg, rgba(1,158,249,0.35), rgba(95,90,255,0.35)); font-weight: 700; text-align: center; }
.fiche-grid td.sect.left { text-align: left; padding-left: 4px; }
.bilan .fiche-grid th.lv, .bilan .fiche-grid td.lv, .fiche-grid th.lv, .fiche-grid td.lv { width: 7%; font-weight: 800; color: #0b0f18; }
.fiche-grid .lv-E { background: #d81e05; color: #fff; } .fiche-grid .lv-0 { background: #f0652b; } .fiche-grid .lv-1 { background: #f6a04a; } .fiche-grid .lv-2 { background: #f3e05a; } .fiche-grid .lv-3 { background: #27c93f; }
.fiche-grid td.lv { opacity: 0.35; font-size: 0.8rem; }
.fiche-grid td.lv.on { opacity: 1; box-shadow: inset 0 0 0 2px #fff; }
.fiche-grid td.na { background: rgba(255,255,255,0.08); color: var(--muted); }
.fiche-grid td.auto { background: rgba(255,255,255,0.03); }
.bilan .fiche-grid td.val, .fiche-grid td.val { font-weight: 800; font-size: 0.78rem; white-space: nowrap; }
.bilan .fiche-grid tr.sub td.lbl, .bilan .fiche-grid tr.tot td.lbl, .bilan .fiche-grid td.sect { font-weight: 700; }
.fiche-grid td.blank { border: 0; }
.fiche-bilan { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; border: 1px solid var(--panel-border); border-radius: 8px; overflow: hidden; font-weight: 800; }
.fiche-bilan span { padding: 10px; text-align: center; }
.fiche-bilan .res.fav { background: var(--green); color: #06230f; } .fiche-bilan .res.defav { background: var(--red); color: #fff; }
.fiche-note { font-size: 0.68rem; color: var(--muted); margin: 8px 0 0; text-align: center; }
@media print { .fiche { border-color: #000; color: #000; background: #fff; } .fiche-grid th, .fiche-grid td, .fiche-id td { border-color: #000; } .fiche-grid thead th, .bilan .fiche-grid td.sect, .fiche-grid td.sect { background: #c9c9ff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; } .fiche-grid td.lv, .fiche-grid th.lv { -webkit-print-color-adjust: exact; print-color-adjust: exact; } .fiche-grid td.lv.on { box-shadow: inset 0 0 0 2px #000; } }
.bilan .fiche-grid th.niv { font-size: 0.6rem; }
.bilan .fiche-grid thead th.lv-E { background: #d81e05; color: #fff; } .bilan .fiche-grid thead th.lv-0 { background: #f0652b; color: #0b0f18; } .bilan .fiche-grid thead th.lv-1 { background: #f6a04a; color: #0b0f18; } .bilan .fiche-grid thead th.lv-2 { background: #f3e05a; color: #0b0f18; } .bilan .fiche-grid thead th.lv-3 { background: #27c93f; color: #0b0f18; }
.bilan .fiche-grid th.vert, .fiche-grid th.vert { height: 76px; }
