/* Révision permis B · Auto-école St Marc
   Style sobre et précis : neutres chauds, une seule couleur d'accent (le bleu St Marc),
   le jaune du logo en touche, des transitions courtes avec une courbe « ressort ». */

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --text: #171717;
  --text-2: #6b6b6b;
  --text-3: #a3a3a0;
  --line: rgba(0, 0, 0, .08);
  --line-strong: rgba(0, 0, 0, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .06);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .04), 0 16px 40px rgba(0, 0, 0, .10);
  --blue: #358ed2;
  --blue-ink: #1f6fb0;
  --yellow: #f5d92d;
  --vi: #7c5cff;
  --ve: #12a37a;
  --good: #16a34a;
  --good-bg: #eaf7ee;
  --bad: #e5484d;
  --bad-bg: #fdecec;
  --warn-bg: #fff7dd;
  --warn-line: #e2b400;
  --pill: #ffffff;
  --radius: 20px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --surface: #18181b;
    --surface-2: #222226;
    --text: #f2f2f2;
    --text-2: #a1a1a6;
    --text-3: #6e6e74;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 16px 40px rgba(0, 0, 0, .5);
    --blue: #4ea3e6;
    --blue-ink: #7cbcf0;
    --vi: #a08bff;
    --ve: #3fd0a4;
    --good: #4ade80;
    --good-bg: #13291b;
    --bad: #ff6b6f;
    --bad-bg: #331618;
    --warn-bg: #2b240d;
    --warn-line: #d6aa16;
    --pill: #34343a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 16px calc(24px + var(--safe-b));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, .switch input:focus-visible + .switch-track {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- Bandeau de l'auto-école ---------- */
.band {
  position: relative;
  margin: -12px -16px 18px;
  padding: 16px 16px 14px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .55), transparent 55%),
    var(--yellow);
  color: #10324f;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 10px 30px -12px rgba(180, 150, 0, .45);
  overflow: hidden;
}
.band::after {
  /* Liseré façon marquage routier */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--blue) 0 22px, transparent 22px 34px);
  opacity: .9;
}
.band-main { display: flex; align-items: center; gap: 14px; }
.logo {
  height: 70px;
  width: auto;
  flex: none;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .18));
  transition: transform .5s var(--spring);
}
.logo:hover { transform: rotate(-3deg) scale(1.04); }
.band-text { min-width: 0; }
.band-text p { margin: 0; }
.band-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #1f6fb0; }
.band-name { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.03em; color: #0f4c81; }
.band-stage {
  display: inline-block;
  margin-top: 6px !important;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .01em;
}
.band-offer { font-size: 13px; font-weight: 600; margin-top: 4px !important; color: #2d4a63; }

.band-contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 6px;
}
.contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  transition: transform .16s var(--ease-out), background .2s ease;
}
.contact:hover { background: #fff; }
.contact:active { transform: scale(.97); }
.contact-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  font-size: 14px;
}
.contact-txt { display: grid; min-width: 0; line-height: 1.25; }
.contact-txt b { font-size: 14px; color: #0f4c81; }
.contact-txt span { font-size: 12px; color: #4a5d6e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.contact-txt .tel { font-size: 13px; font-weight: 700; color: #10324f; font-variant-numeric: tabular-nums; }

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.title-row > div { flex: 1; min-width: 0; }
.title-row h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.title-row p { margin: 0; font-size: 13px; color: var(--text-2); }

.ring {
  position: relative;
  width: 46px;
  height: 46px;
  border: 0;
  padding: 0;
  background: none;
  flex: none;
  transition: transform .2s var(--ease-out);
}
.ring:active { transform: scale(.94); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring-bg { stroke: var(--line-strong); }
.ring-fg {
  stroke: var(--good);
  stroke-linecap: round;
  stroke-dasharray: 97.4;
  stroke-dashoffset: 97.4;
  transition: stroke-dashoffset .8s var(--ease);
}
.ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

/* ---------- Contrôle segmenté ---------- */
.segmented {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px;
  isolation: isolate;
}
.segmented button {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  padding: 9px 8px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 550;
  color: var(--text-2);
  transition: color .2s ease, transform .15s var(--ease-out);
  white-space: nowrap;
}
.segmented button:active { transform: scale(.97); }
.segmented button[aria-selected="true"],
.segmented button[aria-checked="true"] { color: var(--text); }
.seg-pill {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  border-radius: 11px;
  background: var(--pill);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .06);
  transition: transform .45s var(--ease), width .45s var(--ease);
}
.segmented.small button { font-size: 14px; padding: 7px 6px; }
.tabs { margin-bottom: 14px; }

/* ---------- Filtres ---------- */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.filters .segmented { flex: 1; }

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  width: 40px;
  height: 24px;
  border-radius: 99px;
  background: var(--line-strong);
  padding: 2px;
  transition: background .25s ease;
}
.switch-thumb {
  display: block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .4s var(--spring);
}
.switch input:checked + .switch-track { background: var(--blue); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }

/* ---------- Pile de cartes ---------- */
.stack {
  position: relative;
  flex: 1;
  display: grid;
  min-height: 420px;
  padding-bottom: 14px;
}
.stack > * { grid-area: 1 / 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card.ghost {
  align-self: start;
  height: 200px;
  pointer-events: none;
  transform-origin: 50% 0;
  transition: transform .5s var(--ease), opacity .3s ease;
}
.card.ghost.g1 { transform: translateY(-8px) scale(.95); opacity: .7; }
.card.ghost.g2 { transform: translateY(-16px) scale(.9); opacity: .4; }
.stack.is-empty .card.ghost { opacity: 0; }
.stack.solo .card.ghost { display: none; }

.card.fiche {
  position: relative;
  z-index: 2;
  align-self: start;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
  transition: transform .5s var(--ease), opacity .4s ease;
}
.card.fiche.dragging { transition: none; cursor: grabbing; }
.card.fiche.enter { opacity: 0; transform: translateY(14px) scale(.96); }
.card.fiche.leave { pointer-events: none; }

.swipe-hint {
  position: absolute;
  top: 18px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.swipe-hint.next { right: 18px; background: var(--blue); color: #fff; }
.swipe-hint.prev { left: 18px; background: var(--surface-2); color: var(--text-2); }

.fiche-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.chips { display: flex; gap: 6px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid currentColor;
}
.chip.VI { color: var(--vi); }
.chip.VE { color: var(--ve); }
.chip.ok { color: var(--good); background: var(--good-bg); border-color: transparent; animation: pop .45s var(--spring); }

.qa { padding: 14px 0 2px; border-top: 1px solid var(--line); margin-top: 12px; }
.qa:first-of-type { border-top: 0; margin-top: 4px; }
.qa-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin: 0 0 4px;
}
.qa-q { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }

.reveal-btn {
  margin-top: 10px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--blue-ink);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background .2s ease, transform .15s var(--ease-out), opacity .2s ease;
}
.reveal-btn:hover { background: var(--surface-2); }
.reveal-btn:active { transform: scale(.97); }
.qa.open .reveal-btn { display: none; }

.answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s var(--ease);
}
.answer > div { overflow: hidden; }
.answer-inner {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--good-bg);
  font-size: 15px;
  line-height: 1.5;
  opacity: 0;
  filter: blur(6px);
  transform: translateY(-4px);
  transition: opacity .4s ease, filter .4s ease, transform .5s var(--ease);
}
.answer-inner.missing { background: var(--warn-bg); box-shadow: inset 3px 0 0 var(--warn-line); font-style: italic; }
.answer-inner.complement { display: flex; gap: 14px; align-items: flex-start; }
.visual {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent);
}
.visual svg { width: 40px; height: 40px; fill: var(--c); }
.complement-txt small {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 600;
  opacity: .6;
}
.qa.open .answer { grid-template-rows: 1fr; }
.qa.open .answer-inner { opacity: 1; filter: none; transform: none; }

.judge {
  display: none;
  gap: 8px;
  margin-top: 10px;
}
.qa.open .judge { display: flex; animation: rise .4s var(--ease); }
.judge button {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .15s var(--ease-out), background .2s ease, border-color .2s ease, color .2s ease;
}
.judge button:active { transform: scale(.96); }
.judge .yes:hover { border-color: var(--good); color: var(--good); }
.judge .no:hover { border-color: var(--bad); color: var(--bad); }
.qa.judged .judge button { pointer-events: none; opacity: .35; }
.qa.judged-yes .judge .yes { opacity: 1; background: var(--good); border-color: var(--good); color: #fff; animation: pop .4s var(--spring); }
.qa.judged-no .judge .no { opacity: 1; background: var(--bad); border-color: var(--bad); color: #fff; animation: shake .4s ease; }

/* ---------- Vide ---------- */
.empty {
  align-self: center;
  justify-self: center;
  text-align: center;
  color: var(--text-2);
  max-width: 280px;
  z-index: 1;
}
.empty-emoji { font-size: 44px; animation: drive 2.4s var(--ease) infinite; }
.empty p { margin: 6px 0; }
.empty .hint { font-size: 13px; color: var(--text-3); }
.stack:not(.is-empty) .empty { display: none; }

/* ---------- Boutons et barre du bas ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .16s var(--ease-out), background .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.97); }
.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.btn.primary:disabled { opacity: .35; cursor: default; transform: none; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; }
.ghost-btn .check, .known-btn .check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-size: 12px;
  color: transparent;
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .4s var(--spring);
}
.ghost-btn.on .check, .known-btn.on .check { background: var(--good); border-color: var(--good); color: #fff; transform: scale(1.1); }

.bar {
  position: sticky;
  bottom: calc(10px + var(--safe-b));
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 8px;
  margin: 0 -8px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  backdrop-filter: blur(14px) saturate(1.6);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
}
.bar .btn { flex: 1; white-space: nowrap; }
.bar .btn.primary { flex: 1.25; }
.icon-btn {
  flex: none;
  width: 50px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  transition: transform .16s var(--ease-out);
}
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

/* ---------- Défi ---------- */
.intro, .result {
  text-align: center;
  display: grid;
  gap: 14px;
  padding: 10px 0 20px;
  animation: rise .5s var(--ease);
}
.intro h2, .result h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.intro p { margin: 0; color: var(--text-2); }
.intro-emoji, .result-emoji { font-size: 56px; line-height: 1; animation: bob 2.6s ease-in-out infinite; }
.best { font-size: 14px; color: var(--text-3); min-height: 1.5em; }

.hud { margin-bottom: 14px; }
.hud-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.hud-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--vi));
  transition: width .6s var(--ease);
}
.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.hud-right { display: flex; gap: 6px; }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pill.bump { animation: pop .45s var(--spring); }
.streak.hot { background: var(--yellow); color: #3a2d00; border-color: transparent; }

.float-pt {
  position: absolute;
  right: 18px;
  font-weight: 750;
  color: var(--good);
  pointer-events: none;
  animation: floatUp .9s var(--ease) forwards;
}

.res-score { margin: 0; font-size: 64px; font-weight: 750; letter-spacing: -.05em; line-height: 1; }
.res-score small { font-size: 26px; color: var(--text-3); font-weight: 600; }
#res-text { margin: 0; color: var(--text-2); }
.res-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0;
}
.res-stats div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 6px;
  display: grid;
  gap: 2px;
}
.res-stats strong { font-size: 22px; letter-spacing: -.03em; }
.res-stats span { font-size: 12px; color: var(--text-2); }

/* ---------- Tiroir ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, .4);
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed;
  z-index: 21;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 0 16px calc(16px + var(--safe-b));
  transform: translateY(105%);
  transition: transform .5s var(--ease);
  visibility: hidden;
}
.sheet.open { transform: translateY(0); visibility: visible; }
.sheet.dragging { transition: none; }
.sheet-handle { padding: 10px 0 6px; cursor: grab; touch-action: none; }
.sheet-handle span { display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 0 auto; }
.sheet-head h2 { margin: 4px 0 10px; font-size: 20px; letter-spacing: -.02em; }
.sheet-head input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); margin: 10px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.dot:first-child { margin-left: 0; }
.dot.vi { background: var(--vi); }
.dot.ve { background: var(--ve); }
.dot.ok { background: var(--good); }

.grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  padding: 2px 0 12px;
  overscroll-behavior: contain;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  font-weight: 650;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  transition: transform .15s var(--ease-out), background .2s ease;
}
.tile::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 99px;
}
.tile.VI::before { background: var(--vi); }
.tile.VE::before { background: var(--ve); }
.tile.ok { background: var(--good-bg); color: var(--good); border-color: transparent; }
.tile.current { outline: 2px solid var(--blue); outline-offset: 1px; }
.tile:active { transform: scale(.92); }
.no-result { text-align: center; color: var(--text-2); }
.reset {
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 13px;
  text-decoration: underline;
  padding: 6px;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: calc(86px + var(--safe-b));
  transform: translateX(-50%);
  width: min(92vw, 380px);
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.toast {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 550;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.toast.in { opacity: 0; transform: translateY(16px) scale(.96); }
.toast.out { opacity: 0; transform: translateY(10px) scale(.96); }
.toast .t-msg { flex: 1; }
.toast button {
  border: 0;
  border-radius: 8px;
  padding: 5px 10px;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  color: inherit;
  font-size: 13px;
  font-weight: 650;
}

#confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; width: 100%; height: 100%; }

.foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ---------- Animations ---------- */
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes drive { 0% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 100% { transform: translateX(-10px); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-36px) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (min-width: 640px) {
  .band { margin: 0 0 20px; border-radius: 26px; }
  .logo { height: 86px; }
  .band-name { font-size: 36px; }
}

/* ---------- Compteur kilométrique ---------- */
.odo {
  --h: 1.25em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 32px;
}
.odo-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--text-3);
}
.odo-win {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 9px;
  background: linear-gradient(#cfcfcf, #8d8d8d);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.odo-d {
  position: relative;
  width: .82em;
  height: var(--h);
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(#050505, #1f1f1f 50%, #050505);
}
.odo-d:last-child { background: linear-gradient(#050505, #1f1f1f 50%, #050505); }
.odo-d::after {
  /* Ombre de tambour : les chiffres « tournent » derrière la vitre */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .75), transparent 32%, transparent 68%, rgba(0, 0, 0, .75));
  pointer-events: none;
}
.odo-strip {
  display: block;
  will-change: transform;
}
.odo-strip span {
  display: block;
  height: var(--h);
  line-height: var(--h);
  text-align: center;
  color: #f5f5f0;
  font-weight: 700;
  font-family: "DIN Alternate", "Bahnschrift", "Roboto Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}
.odo-d.blank .odo-strip { opacity: 0; }
.odo.big { font-size: 64px; gap: 0; justify-content: center; }
.odo.big .odo-tag { display: none; }
.odo.big .odo-win { padding: 6px; border-radius: 16px; gap: 4px; }
.odo.big .odo-d { border-radius: 10px; }

/* ---------- Pavé numérique ---------- */
.picker { display: grid; gap: 12px; text-align: center; padding-bottom: 4px; overflow-y: auto; }
.picker h2 { margin: 4px 0 2px; font-size: 20px; letter-spacing: -.02em; }
.pick-info {
  margin: 0;
  min-height: 2.9em;
  font-size: 14px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pick-info.has-q { color: var(--text); font-weight: 550; }
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.keypad button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px 0;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform .12s var(--ease-out), background .15s ease;
}
.keypad button:active { transform: scale(.93); background: var(--line-strong); }
.keypad .ok { background: var(--blue); color: #fff; border-color: transparent; font-size: 18px; }

/* ---------- Boutons de choix ---------- */
.known-btn .check { width: 26px; height: 26px; font-size: 14px; }
.known-btn.on { border-color: var(--good); }
.dice { display: inline-block; }
.dice.roll { animation: diceRoll .7s var(--ease); }
@keyframes diceRoll {
  0% { transform: rotate(0) scale(1); }
  40% { transform: rotate(-200deg) scale(1.3); }
  100% { transform: rotate(-360deg) scale(1); }
}
