/* =========================================================
   HYPERION SPORT / Diagnostic joueur
   Même système visuel que la landing :
   Navy #0D1B2A · Bleu nuit #1B263B · Ivoire #F5F5F2 · Or #D4AF37
   Titres : Barlow Condensed / Texte : Inter
   ========================================================= */

:root {
  --navy: #0D1B2A;
  --navy-deep: #0A1522;
  --night: #1B263B;
  --ivory: #F5F5F2;
  --steel: #A8B1BD;
  --gold: #D4AF37;
  --gold-hi: #E2C356;
  --gold-lo: #B8952C;
  --line: rgba(245, 245, 242, 0.10);
  --line-strong: rgba(245, 245, 242, 0.18);
  --r-md: 18px;
  --r-lg: 24px;
  --header-h: 58px;
  --font-title: "Barlow Condensed", "Oswald", "Arial Narrow", "Helvetica Neue Condensed", "DejaVu Sans Condensed", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--navy);
  color: var(--ivory);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; }

/* ---------- Fond photographique commun ---------- */

.bg-field {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: image-set(url("assets/hero-mobile.webp") type("image/webp"), url("assets/hero-mobile.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: 32% 55%;
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(90% 55% at 50% -10%, rgba(212, 175, 55, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(10, 21, 34, 0.78) 0%, rgba(13, 27, 42, 0.90) 45%, rgba(10, 21, 34, 0.96) 100%);
}

/* ---------- Typo ---------- */

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 800;
  line-height: 0.98;
  text-transform: uppercase;
}

h1 { font-size: clamp(36px, 9.4vw, 62px); font-weight: 900; }
h2 { font-size: clamp(30px, 7.4vw, 46px); }
h3 { font-size: clamp(22px, 5.4vw, 30px); line-height: 1.06; text-transform: none; font-weight: 700; }

p { margin: 0; }
a { color: inherit; }

.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.lead { margin-top: 18px; color: #D3DAE3; font-size: 16.5px; line-height: 1.62; }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(10, 21, 34, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); }
.brand img { width: 28px; height: auto; }
.brand span {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
  padding-top: 2px;
}
.brand b { color: var(--gold); font-weight: 800; }

.topbar-tag {
  color: var(--steel);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Écrans ---------- */

.screen {
  display: none;
  min-height: calc(100svh - var(--header-h));
  padding: 34px 18px calc(46px + env(safe-area-inset-bottom));
  animation: fade 0.25s ease both;
}

.screen.is-active { display: flex; align-items: center; }

@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; }
.wrap.narrow { max-width: 620px; }

/* ---------- Boutons ---------- */

.btn {
  --btn-bg: var(--gold);
  --btn-fg: #0B1522;
  --btn-bd: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 15px 28px;
  border: 1px solid var(--btn-bd);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-lg { min-height: 60px; padding: 18px 34px; font-size: 21px; }
/* Un bouton pleine largeur peut passer sur deux lignes plutôt que déborder. */
.btn-block { width: 100%; white-space: normal; line-height: 1.08; }

.btn-primary,
.btn-primary:link,
.btn-primary:visited {
  --btn-bg: var(--gold); --btn-fg: #0B1522; --btn-bd: var(--gold);
  box-shadow: 0 12px 30px rgba(212, 175, 55, 0.18);
}
.btn-primary:hover { --btn-bg: var(--gold-hi); --btn-bd: var(--gold-hi); --btn-fg: #0B1522; }
.btn-primary:active {
  --btn-bg: var(--gold-lo); --btn-bd: var(--gold-lo); --btn-fg: #0B1522;
  transform: translateY(1px); box-shadow: 0 6px 16px rgba(212, 175, 55, 0.14);
}
.btn-primary:focus-visible { outline: 3px solid rgba(212, 175, 55, 0.5); outline-offset: 3px; }

.btn:disabled,
.btn:disabled:hover { opacity: 0.42; cursor: not-allowed; transform: none; --btn-bg: var(--gold); --btn-fg: #0B1522; --btn-bd: var(--gold); }

/* ---------- Écran 1 ---------- */

#screen-hero h1 { max-width: 20ch; text-shadow: 0 2px 22px rgba(6, 12, 20, 0.5); }
#screen-hero .lead { max-width: 44ch; }
#screen-hero .btn { margin-top: 28px; }

.micro { margin-top: 15px; color: var(--steel); font-size: 13px; font-weight: 500; }

/* ---------- Panneaux ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(27, 38, 59, 0.90), rgba(13, 27, 42, 0.94));
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.42);
  padding: 28px 22px;
}

.panel.center { text-align: center; }
.panel.center .lead { margin-left: auto; margin-right: auto; max-width: 42ch; }
.panel.center .btn { margin-top: 26px; }

/* ---------- Questions ---------- */

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--steel);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 6px 8px 6px 0;
  color: var(--steel);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.back-btn:hover { color: var(--gold); }
.back-btn:focus-visible { outline: 2px solid rgba(212, 175, 55, 0.5); outline-offset: 2px; border-radius: 6px; }
.back-btn svg { width: 14px; height: 14px; }

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(245, 245, 242, 0.09);
  overflow: hidden;
  margin: 14px 0 26px;
}

.progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width 0.28s ease; }

.question-hint {
  margin-top: 12px;
  color: var(--steel);
  font-size: 13.5px;
  line-height: 1.5;
  border-left: 2px solid rgba(212, 175, 55, 0.45);
  padding-left: 12px;
}

.answers { display: grid; gap: 10px; margin: 22px 0 4px; }

.answer {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(10, 21, 34, 0.5);
  color: var(--ivory);
  padding: 15px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.42;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.answer:hover { border-color: rgba(212, 175, 55, 0.5); background: rgba(27, 38, 59, 0.7); }
.answer:focus-visible { outline: 2px solid rgba(212, 175, 55, 0.55); outline-offset: 2px; }
.answer.is-selected {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.13);
  box-shadow: inset 0 0 0 1px var(--gold);
  color: var(--ivory);
}

.quiz-actions { margin-top: 20px; }
.quiz-actions .btn { width: 100%; white-space: normal; line-height: 1.08; }

.inline-error { color: #FF9C9C; font-size: 13.5px; min-height: 18px; margin-top: 10px; }

/* ---------- Capture ---------- */

.gate-grid { display: grid; gap: 22px; justify-items: center; }
.gate-grid > * { min-width: 0; max-width: 100%; }

.gate-preview {
  width: 100%;
  max-width: 250px;
  filter: blur(7px);
  opacity: 0.45;
  transform: scale(0.97);
  pointer-events: none;
}

.gate-ready {
  display: block;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 11.5px;
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin: 22px 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--steel);
}

.input {
  width: 100%;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(10, 21, 34, 0.72);
  color: var(--ivory);
  padding: 0 15px;
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: rgba(168, 177, 189, 0.55); }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }

.privacy-line { margin-top: 16px; color: rgba(168, 177, 189, 0.72); font-size: 12.5px; line-height: 1.55; }

/* ---------- Résultat ---------- */

.result-grid { display: grid; gap: 26px; }
.result-main, .result-side { min-width: 0; }

.score-kicker {
  display: block;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 11.5px;
  margin-bottom: 10px;
}

.score-line {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: clamp(56px, 19vw, 108px);
  line-height: 0.88;
  color: var(--gold);
}
.score-line span { color: var(--ivory); font-size: 0.34em; }

.score-sub { margin-top: 6px; color: var(--steel); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }

.category-chip {
  display: inline-block;
  margin-top: 18px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  padding: 9px 16px 7px;
  background: rgba(212, 175, 55, 0.12);
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 16px;
  color: var(--ivory);
}

.diagnostic-text { margin-top: 20px; color: #D9DFE7; font-size: 16px; line-height: 1.7; }

.disclaimer {
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 2px solid rgba(212, 175, 55, 0.5);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: rgba(10, 21, 34, 0.55);
  color: var(--steel);
  font-size: 13px;
  line-height: 1.55;
}

.priorities { margin-top: 34px; }
.priority-list { display: grid; gap: 12px; margin-top: 18px; }

.priority-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(27, 38, 59, 0.62);
  padding: 18px 16px;
}

.priority-num {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  color: var(--gold);
  border-right: 1px solid rgba(212, 175, 55, 0.35);
  padding-right: 12px;
}

.priority-item strong {
  display: block;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 19px;
}

.priority-item p { margin-top: 6px; color: var(--steel); font-size: 14.5px; line-height: 1.55; }

.result-side { display: grid; gap: 14px; justify-items: center; }
.result-side > * { width: 100%; max-width: 340px; min-width: 0; margin-inline: auto; }
.result-side .btn { max-width: 340px; width: 100%; }

.share-notice { min-height: 18px; color: var(--steel); font-size: 12.5px; text-align: center; }
.share-notice.is-ok { color: #BFE3C2; }
.share-notice.is-error { color: #FF9C9C; }

.result-ig { color: var(--gold); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.result-ig:hover { text-decoration: underline; }

/* ---------- Carte résultat (aperçu) ---------- */

.share-card {
  width: 100%;
  max-width: 310px;
  margin-inline: auto;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  border: 1px solid rgba(212, 175, 55, 0.42);
  background:
    radial-gradient(70% 40% at 50% 12%, rgba(212, 175, 55, 0.16), transparent 60%),
    linear-gradient(180deg, #0D1B2A 0%, #1B263B 58%, #0A1523 100%);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  overflow: hidden;
}

.sc-top { display: flex; align-items: center; gap: 8px; }
.sc-top img { width: 24px; height: auto; }
.sc-top span {
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
}
.sc-top b { color: var(--gold); font-weight: 800; }

.sc-label { font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; font-size: 11px; color: var(--steel); }

.sc-score { font-family: var(--font-title); font-weight: 900; font-size: 78px; line-height: 0.9; color: var(--gold); margin-top: 8px; }
.sc-score span { font-size: 24px; color: var(--ivory); }

.sc-cat {
  display: inline-block;
  margin-top: 14px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px;
  padding: 7px 12px 5px;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 12px;
}

.sc-punch { margin-top: 14px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ivory); }

.sc-cta {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--steel);
}

/* ---------- Desktop ---------- */

@media (min-width: 761px) {
  :root { --header-h: 76px; }

  .topbar { padding: 0 clamp(24px, 4vw, 48px); }
  .brand img { width: 34px; }
  .brand span { font-size: 20px; }
  .topbar-tag { font-size: 11.5px; }

  .bg-field {
    background-image: image-set(url("assets/hero-desktop.webp") type("image/webp"), url("assets/hero-desktop.jpg") type("image/jpeg"));
    background-position: 60% 45%;
  }

  .screen { padding: 56px clamp(24px, 4vw, 48px) 72px; }
  .panel { padding: 38px 34px; }
  .lead { font-size: 17px; }

  .gate-grid { grid-template-columns: minmax(0, 280px) minmax(0, 460px); align-items: center; justify-content: center; gap: 40px; }
  .gate-preview { width: 100%; }

  .result-grid { grid-template-columns: minmax(0, 1fr) minmax(300px, 350px); align-items: start; gap: 46px; }
  .result-side { position: sticky; top: 100px; }
  .share-card { width: 100%; }

  .quiz-actions { display: flex; justify-content: flex-end; }
  .quiz-actions .btn { width: auto; min-width: 240px; }
}

@media (max-width: 760px) {
  .gate-preview { display: none; }
}

@media (max-width: 420px) {
  .brand span { font-size: 15px; }
  .topbar-tag { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
