/*
 * Ze Score · feuille de style de la web app.
 *
 * Choix : thème sombre (noir, violet #BC23ED, blanc), le même que le logo et l'écran TV.
 * Pensée d'abord pour le téléphone, juste après une séance : gros chiffres, grosses zones à toucher.
 * Police Outfit (titres et chiffres) hébergée sur notre serveur : rien n'est chargé chez Google,
 * donc aucune donnée de visite ne part chez un tiers.
 */

@font-face { font-family: "Outfit"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/outfit-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/outfit-latin-800-normal.woff2") format("woff2"); }

:root {
  --bg: #000;
  --surface: #111114;
  --surface-2: #1b1b20;
  --line: #2b2b33;
  --text: #fff;
  --soft: #e6e6ec;
  --muted: #a5a5b0;
  --violet: #bc23ed;
  --violet-soft: rgba(188, 35, 237, .16);
  --violet-line: rgba(188, 35, 237, .55);
  --danger: #ff7a7a;
  --ok: #5ee39a;
  --radius: 20px;
  --display: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête et pied */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
}
.brand img { display: block; height: 28px; width: auto; }
.nav { display: flex; gap: 6px; min-width: 0; }
.nav a {
  text-decoration: none; font: 600 14px/1 var(--display);
  padding: 10px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
}
.nav .nav-me { color: var(--violet); }
.wrap { flex: 1; width: 100%; max-width: 560px; margin: 0 auto; padding: 4px 16px 40px; }
.foot {
  display: flex; justify-content: center; gap: 18px; color: var(--muted); font-size: 13px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

/* Texte */
h1, h2, .num { font-family: var(--display); }
h1 { font-weight: 800; font-size: clamp(28px, 8vw, 38px); line-height: 1.08; letter-spacing: -.01em; margin: 10px 0 14px; }
h2 { font-weight: 600; font-size: 20px; line-height: 1.25; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.alt { text-align: center; color: var(--muted); margin-top: 18px; }
.prose { padding-left: 20px; }
.prose li { margin-bottom: 8px; }

/* Blocs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.card > :last-child { margin-bottom: 0; }
.notice { background: var(--violet-soft); border: 1px solid var(--violet-line); border-radius: 14px; padding: 12px 14px; color: var(--soft); }
.error { color: var(--danger); font-weight: 600; }
.pill { display: inline-block; vertical-align: middle; font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--violet); color: #fff; margin-left: 6px; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  width: 100%; min-height: 54px; padding: 0 20px; margin: 0;
  border: 0; border-radius: 999px; background: var(--violet); color: #fff;
  font: 600 17px/1.15 var(--display); text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.danger { background: #3b0e14; color: #ffc0c0; border: 1px solid #63202a; }
.small-btn { width: auto; min-height: 44px; font-size: 15px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }

/* Formulaires */
.form { margin-top: 8px; }
.field { margin: 0 0 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 54px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font-size: 18px; font-family: inherit;
}
.field input:focus { border-color: var(--violet); outline: none; box-shadow: 0 0 0 3px var(--violet-soft); }
.pin { font-family: var(--display) !important; font-size: 26px !important; letter-spacing: .55em; text-align: center; padding-left: .55em !important; }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.hint b { color: var(--soft); font-weight: 600; }
.hint.ok { color: var(--ok); }
.hint.bad, .has-error .hint { color: var(--danger); }
.has-error input { border-color: var(--danger); }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.suggest[hidden] { display: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--violet-line); background: var(--violet-soft); color: var(--text);
  font: 600 14px/1 var(--display); cursor: pointer; text-decoration: none;
}
.chip.on { background: var(--violet); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; font-size: 15px; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--violet); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Accueil */
.hero { padding-top: 12px; }
.hero-logo { display: block; width: 238px; height: auto; margin: 8px 0 24px; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 24px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; margin-bottom: 14px; color: var(--soft); font-size: 17px; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--violet-soft); border: 1px solid var(--violet-line); font: 800 18px/1 var(--display); color: var(--text);
}
.stat-points { font-size: 56px; font-weight: 800; line-height: 1; margin: 6px 0 4px; color: var(--violet); }
.stat-points span, .score span { font-size: .38em; color: var(--text); margin-left: .15em; }
.stat .btn { margin-top: 14px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpis div { display: flex; flex-direction: column; }
.kpis b { font-size: 30px; font-weight: 800; line-height: 1.1; }
.kpis span { color: var(--muted); font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; }
.list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.list-main { display: flex; flex-direction: column; min-width: 0; }
.list-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--muted); }
.list-pts { font-weight: 800; color: var(--violet); }
.tip[hidden] { display: none; }

/* Résultat du scan */
.result { padding-top: 4px; }
.score { font-size: clamp(76px, 26vw, 120px); font-weight: 800; color: var(--violet); line-height: .9; letter-spacing: -.03em; margin: 14px 0 10px; }
.score span { letter-spacing: 0; }
.video { font-size: clamp(24px, 6.5vw, 30px); margin: 0 0 4px; }
.meta { color: var(--muted); }
.breakdown { list-style: none; padding: 0; margin: 14px 0; border-top: 1px solid var(--line); }
.breakdown li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--soft); }
.breakdown b { font: 800 18px/1 var(--display); color: var(--text); white-space: nowrap; }
.kcal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.kcal b { font-size: 22px; }
.kcal span { color: var(--muted); font-size: 14px; }

/* Avis : étoiles (sans JavaScript) et ressenti */
.stars { border: 0; padding: 0; margin: 0 0 14px; }
.stars legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.stars-row { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.stars-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-row label { width: 46px; height: 46px; cursor: pointer; display: grid; place-items: center; }
.stars-row label::before { content: "★"; font-size: 38px; line-height: 1; color: #3a3a44; transition: color .1s ease, transform .1s ease; }
.stars-row input:checked ~ label::before { color: var(--violet); }
.stars-row input:focus-visible + label { outline: 3px solid var(--violet); border-radius: 10px; }
.stars-row label:active::before { transform: scale(.9); }
.q { font-weight: 600; margin-bottom: 8px; }
.feels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn.feel { min-height: 58px; padding: 0 6px; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); }
.btn.feel:hover { border-color: var(--violet-line); }

/* Classements */
.boards-gym { font-weight: 600; color: var(--soft); margin-bottom: 12px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tabs > label {
  text-align: center; padding: 11px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font: 600 15px/1 var(--display); cursor: pointer; text-transform: none;
}
.tabs > .panel { grid-column: 1 / -1; display: none; }
#tab-month:checked + label, #tab-all:checked + label { background: var(--violet); border-color: var(--violet); }
#tab-month:checked ~ .panel-month, #tab-all:checked ~ .panel-all { display: block; }
#tab-month:focus-visible + label, #tab-all:focus-visible + label { outline: 3px solid var(--violet); outline-offset: 2px; }
.board { list-style: none; margin: 12px 0 0; padding: 0; }
.board li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.board li:nth-child(odd) { background: rgba(255, 255, 255, .035); }
.board .rk { font: 800 16px/1 var(--display); color: var(--muted); text-align: center; }
.board li:nth-child(-n+3) .rk { color: var(--violet); }
.board .ps { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .pt { font-weight: 800; }
.board li.me { background: var(--violet-soft); box-shadow: inset 0 0 0 1px var(--violet-line); }
.board li.gap { display: block; text-align: center; color: var(--muted); padding: 0; background: none; letter-spacing: .3em; }
.empty { margin: 14px 2px 2px; }
.gyms { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }

/* Profil */
.state-tag { font: 600 15px/1 var(--display); color: var(--muted); }
.state-tag.on { color: var(--ok); }
.danger-zone summary { cursor: pointer; font: 600 17px/1.3 var(--display); color: #ffc0c0; list-style-position: inside; }
.danger-zone[open] summary { margin-bottom: 12px; }

/* États : scan refusé, erreur */
.state { padding-top: 24px; }
.state-mark { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 18px; background: var(--violet-soft); border: 1px solid var(--violet-line); position: relative; }
.state-mark::before, .state-mark::after { content: ""; position: absolute; left: 50%; width: 6px; border-radius: 3px; background: var(--violet); transform: translateX(-50%); }
.state-mark::before { top: 14px; height: 24px; }
.state-mark::after { bottom: 13px; height: 6px; }
.state .btn { margin-top: 20px; }

@media (min-width: 600px) {
  .wrap { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
