/* Trousse commune Finaxis au salon. Mobile d'abord. */
@font-face {
  font-family: "Inter";
  src: url("/kit/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #30466a;
  --navy-deep: #1c2b45;
  --teal: #00adb5;
  --teal-dark: #06737a;
  --teal-soft: #e6f7f8;
  --ink: #0f172a;
  --slate: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f7fa;
  --card: #ffffff;
  --amber: #ffb020;
  --amber-soft: #fff5dc;
  --red: #e5484d;
  --red-soft: #fdecec;
  --green: #18a058;
  --green-soft: #e7f6ee;
  --grad: linear-gradient(100deg, #30466a 0%, #00adb5 100%);
  --grad-deep: linear-gradient(140deg, #1c2b45 0%, #30466a 45%, #0b8f96 100%);
  --radius: 20px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; letter-spacing: -0.02em; line-height: 1.15; }
p { text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal-dark); }
[hidden] { display: none !important; }

/* Structure */
.fx-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.fx-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.fx-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy-deep); font-weight: 800; font-size: 18px; letter-spacing: -0.03em; }
.fx-logo img { height: 24px; width: auto; display: block; }
.fx-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.fx-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(24, 160, 88, 0.5); animation: fx-pulse 2s infinite; }
.fx-progress { height: 4px; background: var(--line); }
.fx-progress > i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 0 4px 4px 0; transition: width 0.35s ease; }
.fx-main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; }
.fx-screen { padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 16px; animation: fx-in 0.35s ease both; }
.fx-foot { padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--muted); }
.fx-foot a { color: var(--muted); }

/* Cartes */
.fx-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.fx-card--flat { box-shadow: none; border: 1px solid var(--line); }
.fx-card--tint { background: var(--teal-soft); box-shadow: none; }
.fx-card--amber { background: var(--amber-soft); box-shadow: none; }
.fx-hero { background: var(--grad-deep); color: #fff; border-radius: 24px; padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.fx-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(0, 173, 181, 0.55), transparent 70%); pointer-events: none; }
.fx-hero > * { position: relative; z-index: 1; }
.fx-hero h1 { font-size: 32px; font-weight: 800; }
.fx-hero p { color: rgba(255, 255, 255, 0.86); font-size: 17px; }
.fx-kicker { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(255, 255, 255, 0.16); color: #fff; }
.fx-kicker--ink { background: var(--teal-soft); color: var(--teal-dark); }
.fx-kicker--amber { background: var(--amber); color: #3d2a00; }

/* Texte */
.fx-q { font-size: 25px; font-weight: 800; }
.fx-h2 { font-size: 19px; font-weight: 700; }
.fx-help { color: var(--muted); font-size: 15px; }
.fx-muted { color: var(--muted); }
.fx-small { font-size: 13px; }
.fx-center { text-align: center; align-items: center; }
.fx-big { font-size: 68px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-big small { font-size: 0.32em; font-weight: 700; letter-spacing: 0; margin-left: 6px; }
.fx-num { font-variant-numeric: tabular-nums; }

/* Boutons */
.fx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 22px;
  border: 0; border-radius: 999px; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 17px; text-decoration: none; text-align: center;
  box-shadow: 0 6px 18px rgba(0, 173, 181, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}
.fx-btn:active { transform: scale(0.98); box-shadow: 0 2px 8px rgba(0, 173, 181, 0.25); }
.fx-btn:disabled { opacity: 0.45; box-shadow: none; }
.fx-btn--light { background: #fff; color: var(--navy-deep); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }
.fx-btn--ghost { background: transparent; color: var(--navy); box-shadow: none; border: 1.5px solid var(--line); }
.fx-btn--amber { background: var(--amber); color: #3d2a00; box-shadow: 0 6px 18px rgba(255, 176, 32, 0.35); }
.fx-btn--sm { min-height: 48px; padding: 8px 16px; font-size: 15px; width: auto; }
.fx-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fx-row > * { flex: 1 1 0; min-width: 0; }
.fx-stack { display: flex; flex-direction: column; gap: 10px; }

/* Choix */
.fx-opts { display: flex; flex-direction: column; gap: 10px; }
.fx-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 16px; min-height: 58px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 16px;
  font-size: 16px; font-weight: 600; line-height: 1.3;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.fx-opt small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.fx-opt:active { transform: scale(0.985); }
.fx-opt[aria-pressed="true"], .fx-opt.is-on { border-color: var(--teal); background: var(--teal-soft); }
.fx-opt .fx-tick { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cbd5e1; display: grid; place-items: center; transition: all 0.12s; }
.fx-opt[aria-pressed="true"] .fx-tick, .fx-opt.is-on .fx-tick { border-color: var(--teal); background: var(--teal); }
.fx-opt[aria-pressed="true"] .fx-tick::after, .fx-opt.is-on .fx-tick::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.fx-opt > span { flex: 1; }

/* Curseur */
.fx-range { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: transparent; margin: 0; }
.fx-range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: linear-gradient(90deg, var(--teal) var(--fill, 50%), var(--line) var(--fill, 50%)); }
.fx-range::-moz-range-track { height: 10px; border-radius: 999px; background: var(--line); }
.fx-range::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--teal); }
.fx-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2); }
.fx-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 3px solid var(--teal); box-shadow: 0 3px 10px rgba(15, 23, 42, 0.2); }
.fx-range-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Formulaires */
.fx-field { display: flex; flex-direction: column; gap: 6px; }
.fx-field > span { font-size: 13px; font-weight: 600; color: var(--slate); }
.fx-input, .fx-select, .fx-textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; background: #fff;
  border: 1.5px solid var(--line); border-radius: 14px; font-size: 16px; outline: none;
  color: var(--ink);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.fx-input::placeholder, .fx-textarea::placeholder { color: #94a3b8; opacity: 1; }
.fx-textarea { min-height: 96px; resize: vertical; }
.fx-input:focus, .fx-select:focus, .fx-textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0, 173, 181, 0.15); }
.fx-hero .fx-input { border-color: transparent; }
.fx-check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font-size: 15px; line-height: 1.35; cursor: pointer; }
.fx-check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--teal); }
.fx-check:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.fx-check--legal { border: 0; background: transparent; padding: 4px 2px; font-size: 13px; color: var(--muted); }
.fx-check--legal:has(input:checked) { background: transparent; }
.fx-error { color: var(--red); font-size: 14px; font-weight: 600; }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Résultat */
.fx-facts { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 15px; }
.fx-facts dt { color: var(--muted); }
.fx-facts dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.fx-bar { position: relative; height: 12px; border-radius: 999px; background: var(--line); overflow: visible; }
.fx-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--grad); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fx-bar > b { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; left: 0; border-radius: 50%; background: #fff; border: 4px solid var(--teal); box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2); transition: left 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fx-bar-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }

.fx-duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.fx-duel-side { border-radius: 16px; padding: 14px 10px; background: var(--bg); text-align: center; display: flex; flex-direction: column; gap: 2px; border: 2px solid transparent; min-width: 0; }
.fx-duel-side.is-win { background: var(--amber-soft); border-color: var(--amber); }
.fx-duel-side strong { font-size: 30px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.fx-duel-side span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-duel-side em { font-style: normal; font-size: 12px; font-weight: 700; color: #8a5a00; min-height: 18px; }
.fx-duel-vs { align-self: center; font-weight: 800; font-size: 13px; color: var(--muted); }

.fx-qr { align-self: center; width: 208px; height: 208px; padding: 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; }
.fx-qr svg { width: 100%; height: 100%; display: block; }
.fx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fx-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font-size: 15px; }
.fx-list li.is-me { background: var(--teal-soft); font-weight: 700; }
.fx-list li.is-new { animation: fx-pop 0.5s ease; background: var(--amber-soft); }
.fx-list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-list li .fx-rank { flex: none; width: 24px; color: var(--muted); font-weight: 700; font-size: 13px; }
.fx-list li .fx-grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-dark); font-size: 13px; font-weight: 700; }
.fx-pill--amber { background: var(--amber-soft); color: #8a5a00; }
.fx-pill--red { background: var(--red-soft); color: #b3262b; }
.fx-pill--green { background: var(--green-soft); color: #0e7a40; }
.fx-divider { height: 1px; background: var(--line); border: 0; margin: 4px 0; }

.fx-challenge { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--amber); color: #3d2a00; font-weight: 600; font-size: 15px; line-height: 1.35; }
.fx-challenge svg { flex: none; }

.fx-toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; width: fit-content; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateY(20px); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); opacity: 0; transition: all 0.25s ease; z-index: 50; text-align: center; }
.fx-toast.is-on { opacity: 1; transform: none; }
.fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
.fx-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--teal); animation: fx-spin 0.8s linear infinite; margin: 40px auto; }

@keyframes fx-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fx-pop { 0% { transform: scale(0.9); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: none; opacity: 1; } }
@keyframes fx-pulse { 0% { box-shadow: 0 0 0 0 rgba(24, 160, 88, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(24, 160, 88, 0); } 100% { box-shadow: 0 0 0 0 rgba(24, 160, 88, 0); } }
@keyframes fx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

@media (min-width: 560px) {
  body { background: linear-gradient(180deg, #e9eef4, #f4f7fa 320px); }
  .fx-screen { padding-top: 28px; }
}
