/* =====================================================================
   PhysiqueRUSH — Iso-IMPACT
   Mobile-first strict · zéro scroll · rouge / blanc / noir · acier brossé
   ===================================================================== */

:root {
  --noir: #0D0D0D;
  --blanc: #F4F4F2;
  --blanc-dim: rgba(244, 244, 242, .64);
  --rouge: #D32F2F;
  --rouge-vif: #FF4545;
  --rouge-glow: rgba(211, 47, 47, .55);
  --armee: #4B5320;
  --armee-hi: #7F8A3E;
  --acier: #708090;
  --acier-hi: #A7B3BF;
  --acier-sombre: #39424B;

  --f-display: Impact, "HelveticaNeue-CondensedBlack", "Arial Narrow", "sans-serif-condensed", "Roboto Condensed", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --f-texte: Inter, "Segoe UI", Roboto, "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;

  --acier-brosse:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 1px, rgba(0, 0, 0, .05) 1px 2px, transparent 2px 4px),
    linear-gradient(180deg, #919daa 0%, #717d8a 48%, #59646f 100%);

  --pad: clamp(14px, 4.6vw, 22px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--noir); }
body {
  position: fixed;
  inset: 0;
  color: var(--blanc);
  font-family: var(--f-texte);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(112, 128, 144, .12), transparent 60%),
    radial-gradient(90% 50% at 50% 115%, rgba(211, 47, 47, .08), transparent 65%),
    var(--noir);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .016) 0 1px, transparent 1px 3px);
}
button { font: inherit; color: inherit; border: 0; background: none; outline: none; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--rouge); outline-offset: 3px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Typo ---------- */
.display {
  font-family: var(--f-display);
  font-weight: 900;
  font-synthesis: none;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: .95;
}
.t-red { color: var(--rouge); }

/* ---------- Écrans ---------- */
.app { position: fixed; inset: 0; overflow: hidden; overflow: clip; }
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding:
    calc(var(--safe-t) + 14px)
    calc(var(--safe-r) + var(--pad))
    calc(var(--safe-b) + 16px)
    calc(var(--safe-l) + var(--pad));
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .26s ease, transform .26s ease, visibility 0s linear .26s;
  overflow: hidden;
}
.screen.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

/* ---------- Marque ---------- */
.brand { display: flex; align-items: center; }
.brand__logo { display: none; width: auto; object-fit: contain; }
.brand.has-logo .brand__logo { display: block; }
.brand.has-logo .brand__word { display: none; }
.brand__word {
  font-family: var(--f-display);
  font-weight: 900;
  font-synthesis: none;
  font-style: italic;
  letter-spacing: .02em;
  line-height: 1;
}
.brand__word b { color: var(--rouge); font-weight: inherit; }
.brand--sm .brand__logo { height: 30px; max-width: 150px; }
.brand--sm .brand__word { font-size: 19px; }
.brand--xl .brand__logo { height: 92px; max-width: 280px; }
.brand--xl .brand__word { font-size: clamp(34px, 11vw, 46px); }

/* En-tête accueil : logo PR à la hauteur des capitales + ISO-IMPACT,
   taille ajustée à la place laissée par les pastilles (jamais dessous) */
.marque {
  flex: 1 1 0;
  min-width: 0;
  margin-right: 10px;
  container-type: inline-size;
}
.marque__in {
  display: flex;
  align-items: baseline;
  gap: .3em;
  font-size: 17px;
  font-size: min(23px, 12.3cqw);
}
.marque__pr {
  flex: none;
  width: auto;
  height: .78em;
  height: 1cap;
  filter: drop-shadow(0 0 5px rgba(211, 47, 47, .45));
}
.marque__nom {
  font-size: 1em;
  line-height: 1;
  letter-spacing: .045em;
  white-space: nowrap;
}

/* ---------- Boutons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  font-family: var(--f-display);
  font-weight: 900;
  font-synthesis: none;
  font-size: 20px;
  letter-spacing: .07em;
  text-transform: uppercase;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.97); filter: brightness(1.15); }
.btn svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.btn--primary {
  background: linear-gradient(180deg, #e23a3a 0%, var(--rouge) 55%, #a92222 100%);
  box-shadow: 0 0 24px rgba(211, 47, 47, .35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}
.btn--ghost {
  background: linear-gradient(180deg, #1b1b1b, #111);
  box-shadow: inset 0 0 0 1px var(--acier);
  color: var(--blanc);
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--acier-hi);
  flex: none;
}
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:active { color: var(--blanc); transform: scale(.92); }

/* =====================================================================
   SPLASH
   ===================================================================== */
.screen--splash { align-items: center; justify-content: center; gap: 18px; }
.splash__product { font-size: clamp(22px, 7vw, 30px); letter-spacing: .28em; margin-left: .28em; }
.loader {
  width: min(62vw, 240px);
  height: 8px;
  margin-top: 12px;
  border: 1px solid var(--armee);
  padding: 1px;
}
.loader__bar {
  height: 100%;
  width: 0;
  background:
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .28) 0 4px, transparent 4px 8px),
    var(--acier-brosse);
  animation: charger .6s cubic-bezier(.5, 0, .2, 1) forwards;
}
@keyframes charger { to { width: 100%; } }

/* =====================================================================
   ACCUEIL
   ===================================================================== */
.screen--home { gap: clamp(10px, 2.2dvh, 20px); }
.screen--home > .topbar, .screen--home > .level, .screen--home > .gauge, .screen--home > .week, .screen--home > .exo { flex: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
.topbar__right { display: flex; gap: 8px; }
.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px 0 9px;
  background: linear-gradient(180deg, #171717, #101010);
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.stat-chip svg { width: 20px; height: 20px; fill: var(--acier-sombre); transition: fill .3s; }
.stat-chip b { font-size: 19px; line-height: 1; }
.stat-chip--btn svg { fill: var(--acier-hi); }
.stat-chip--btn:active { transform: scale(.95); }
#streak svg { fill: var(--acier-sombre); }
.stat-chip--icon { padding: 0 9px; }
.stat-chip--icon svg { width: 21px; height: 21px; }
@media (max-width: 370px) {
  .topbar__right { gap: 6px; }
  .stat-chip { padding: 0 9px 0 7px; gap: 5px; }
  .stat-chip--icon { padding: 0 8px; }
  .brand--sm .brand__word { font-size: 15px; }
  .brand--sm .brand__logo { height: 26px; max-width: 112px; }
}
#streak.is-live svg { fill: var(--rouge); }
#streak.is-safe svg { fill: var(--rouge-vif); filter: drop-shadow(0 0 6px var(--rouge-glow)); }

/* Niveau + XP */
.level {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
}
.level--btn { width: 100%; padding: 4px 0; text-align: left; }
.level--btn:active { opacity: .75; }
.level__tag { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: var(--acier-hi); }
.level__num { font-size: 32px; line-height: .9; min-width: 1.1em; display: inline-block; }
.level__num.pop { animation: pop-num .5s cubic-bezier(.2, .9, .2, 1.4); color: var(--rouge-vif); }
@keyframes pop-num { 0% { transform: scale(2.2); filter: brightness(2.5); } 100% { transform: scale(1); filter: none; } }
.level__track {
  display: block;
  height: 9px;
  background: #171717;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  transform: skewX(-20deg);
  overflow: hidden;
}
.level__track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #a52222, var(--rouge-vif));
  box-shadow: 0 0 12px rgba(255, 69, 69, .7);
}
.level__xp {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--acier-hi);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
  text-align: right;
}

/* Jauge du jour : 12 = volume optimal · 13 à 16 = zone optimale · médailles 4 / 8 / 12 */
.gauge__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.gauge__lbl { font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--acier-hi); transition: color .3s; }
.gauge__count { font-size: 22px; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.gauge__count b { font-weight: inherit; transition: color .3s; }
.gauge__count i { font-style: normal; color: var(--acier); }
.gauge[data-zone="optimale"] .gauge__lbl { color: #e3b53c; }
.gauge[data-zone="optimale"] .gauge__count b { color: var(--rouge-vif); }
.gauge[data-zone="au-dela"] .gauge__lbl { color: var(--acier); }
.gauge[data-zone="au-dela"] .gauge__count b { color: var(--acier-hi); }
.gauge__bars, .gauge__medals {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  column-gap: 3px;
  padding: 0 3px;
}
.gauge__bars i {
  display: block;
  height: 13px;
  transform: skewX(-20deg);
  background: #191919;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  transition: background .3s, box-shadow .3s, filter .3s;
}
.gauge__bars i:nth-child(12) { margin-right: 3px; }
.gauge__bars i.is-zone { background: #141414; box-shadow: inset 0 0 0 1px rgba(227, 181, 60, .32); }
.gauge__bars i.is-full {
  background: linear-gradient(180deg, #ff5a5a 0%, var(--rouge) 45%, #9e1f1f 100%);
  box-shadow: inset 0 0 0 1px #ff6262, 0 0 10px rgba(211, 47, 47, .55);
}
.gauge__bars i.is-zone.is-full { box-shadow: inset 0 0 0 1px #f0c75a, 0 0 10px rgba(227, 181, 60, .45); }
.gauge[data-zone="au-dela"] .gauge__bars i.is-full { filter: saturate(.55) brightness(.85); }
.gauge__bars i.is-new { animation: impact-charge .55s cubic-bezier(.2, .9, .25, 1.2) both; }
@keyframes impact-charge {
  0%   { opacity: 0; transform: skewX(-20deg) scaleY(2.6); filter: brightness(3); }
  60%  { opacity: 1; filter: brightness(2); }
  100% { opacity: 1; transform: skewX(-20deg) scaleY(1); filter: none; }
}
.gauge__medals { position: relative; margin-top: 5px; height: 12px; }
.gauge__medals > * { grid-row: 1; }
.gauge__zone {
  align-self: center;
  height: 2px;
  margin-left: 4px;
  background: linear-gradient(90deg, rgba(227, 181, 60, .55), rgba(227, 181, 60, .12));
}
.gm {
  justify-self: end;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1e1e1e;
  box-shadow: inset 0 0 0 1px #343434;
  transition: background .3s, box-shadow .3s;
  z-index: 1;
}
.gm--bronze.is-on { background: radial-gradient(circle at 35% 30%, #f0b27a, #cd7f32 60%, #6b3d1f); box-shadow: 0 0 9px rgba(205, 127, 50, .85); }
.gm--argent.is-on { background: radial-gradient(circle at 35% 30%, #fff, #dfe5ea 55%, #5f6870); box-shadow: 0 0 9px rgba(223, 229, 234, .8); }
.gm--or.is-on { background: radial-gradient(circle at 35% 30%, #fff0a8, #e3b53c 55%, #7a560c); box-shadow: 0 0 11px rgba(227, 181, 60, .95); }
.gm.is-new, .wk.is-new { animation: medal-pop .6s cubic-bezier(.2, .9, .2, 1.5) 1s both; }
@keyframes medal-pop { 0% { transform: scale(0); } 60% { transform: scale(2.2); } 100% { transform: scale(1); } }
.wk.is-new { animation-name: medal-pop-losange; }
@keyframes medal-pop-losange { 0% { transform: rotate(45deg) scale(0); } 60% { transform: rotate(45deg) scale(2.2); } 100% { transform: rotate(45deg) scale(1); } }

/* Semaine : 28 · 56 · 84 */
.week {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}
.week__tag { font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--acier-hi); }
.week__track {
  position: relative;
  display: block;
  height: 7px;
  margin-right: 6px;
  background: #171717;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
}
.week__track i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8f1d1d, var(--rouge-vif));
  box-shadow: 0 0 10px rgba(255, 69, 69, .55);
  transition: width .9s cubic-bezier(.2, .9, .25, 1);
}
.wk {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  transform: rotate(45deg);
  background: #1e1e1e;
  box-shadow: inset 0 0 0 1px #3a3a3a;
}
.wk--bronze.is-on { background: linear-gradient(135deg, #f0b27a, #cd7f32 55%, #6b3d1f); box-shadow: 0 0 8px rgba(205, 127, 50, .85); }
.wk--argent.is-on { background: linear-gradient(135deg, #fff, #dfe5ea 55%, #5f6870); box-shadow: 0 0 8px rgba(223, 229, 234, .8); }
.wk--or.is-on { background: linear-gradient(135deg, #fff0a8, #e3b53c 55%, #7a560c); box-shadow: 0 0 10px rgba(227, 181, 60, .95); }
.week__txt { font-size: 10.5px; font-weight: 700; color: var(--acier-hi); font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.week__txt b { font-size: 15px; color: var(--blanc); font-weight: 900; }
.week.is-complete .week__txt b { color: #e3b53c; }

/* Carte exercice */
.exo {
  position: relative;
  background: linear-gradient(180deg, #161616, #0f0f0f);
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
}
.exo::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--acier-brosse);
}
.exo.swap { animation: brouillage .45s steps(6, end); }
@keyframes brouillage {
  0%   { transform: translateX(0); filter: none; }
  25%  { transform: translateX(-5px); filter: brightness(1.8) contrast(1.4); }
  50%  { transform: translateX(4px); filter: brightness(1.4); }
  75%  { transform: translateX(-2px); filter: brightness(1.2); }
  100% { transform: translateX(0); filter: none; }
}
.exo__body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 12px 12px 14px;
}
.exo__media {
  position: relative;
  width: clamp(62px, 19vw, 82px);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: inset 0 0 0 1px var(--armee);
  background:
    repeating-linear-gradient(-45deg, rgba(75, 83, 32, .22) 0 6px, transparent 6px 12px),
    #101010;
  overflow: hidden;
  transition: transform .12s ease;
}
.exo__media:active { transform: scale(.94); }
.exo__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.exo__media.has-img .exo__img { opacity: .75; }
.exo__play {
  position: relative;
  display: grid;
  place-items: center;
  width: 46%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #1e1e1e, #070707 70%);
  border: 2px solid var(--rouge);
  box-shadow: 0 0 12px rgba(211, 47, 47, .55), inset 0 0 8px rgba(211, 47, 47, .3);
  animation: incandescence 2.4s ease-in-out infinite;
}
.exo__play svg { width: 52%; height: 52%; margin-left: 8%; fill: var(--blanc); }
.exo__demo {
  position: relative;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .26em;
  margin-left: .26em;
  text-transform: uppercase;
  color: var(--blanc);
  text-shadow: 0 1px 2px #000;
}
.exo__info { min-width: 0; }
.exo__group { font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--rouge); }
.exo__name {
  margin: 3px 0 9px;
  padding-top: .1em;
  font-size: clamp(19px, 5.9vw, 26px);
  line-height: 1.08;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.exo__chips { display: flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  box-shadow: inset 0 0 0 1px var(--acier);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--acier-hi);
  font-variant-numeric: tabular-nums;
}
.chip--uni {
  box-shadow: inset 0 0 0 1px var(--rouge);
  color: var(--blanc);
}
.exo__swap { width: 34px; height: 30px; margin-left: auto; }
.exo__swap svg { width: 20px; height: 20px; }

/* Corps musclé — zone travaillée illuminée en rouge (image à venir) */
.exo__corps {
  position: relative;
  align-self: stretch;
  width: clamp(44px, 14vw, 62px);
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(ellipse 60% 40% at 50% 45%, rgba(211, 47, 47, .22), transparent 70%), #0f0f0f;
  box-shadow: inset 0 0 0 1px #262626;
  overflow: hidden;
}
.exo__corps::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rouge-vif);
  box-shadow: 0 0 10px 3px rgba(255, 60, 60, .7);
  animation: incandescence 2.4s ease-in-out infinite;
}
.exo__corps-zone { font-size: 11px; letter-spacing: .12em; color: var(--acier); }
.exo__corps-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; }
.exo__corps.has-img { background: transparent; box-shadow: none; }
.exo__corps.has-img::before, .exo__corps.has-img .exo__corps-zone { display: none; }
.exo__corps.has-img .exo__corps-img { opacity: 1; }

.rotation {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 0 14px 13px;
}
.rotation li {
  padding-top: 6px;
  border-top: 3px solid #262626;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-align: center;
  color: #4d555d;
}
.rotation li.is-done { border-top-color: var(--acier); color: var(--acier); }
.rotation li.is-current { border-top-color: var(--rouge); color: var(--blanc); box-shadow: 0 -6px 12px -6px var(--rouge-glow); }

/* Bouton central LANCER L'IMPACT */
.launch {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
}
.launch__btn {
  --s: min(62cqw, 86cqh, 280px);
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: radial-gradient(circle at 50% 32%, #1e1e1e 0%, #0b0b0b 58%, #050505 100%);
  border: 3px solid var(--rouge);
  animation: incandescence 2.4s ease-in-out infinite;
  transition: transform .12s ease;
}
@supports not (width: 1cqw) { .launch__btn { --s: min(56vw, 30vh, 260px); } }
.launch__btn::before {
  content: "";
  position: absolute;
  inset: calc(var(--s) * -.07);
  border-radius: 50%;
  border: 1px dashed rgba(112, 128, 144, .55);
  animation: rotation 40s linear infinite;
  pointer-events: none;
}
.launch__btn::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 1px solid rgba(211, 47, 47, .22);
  pointer-events: none;
}
.launch__btn:active { transform: scale(.94); }
.launch__small {
  font-size: calc(var(--s) * .05);
  font-weight: 800;
  letter-spacing: .45em;
  margin-left: .45em;
  text-transform: uppercase;
  color: var(--blanc-dim);
}
.launch__big { font-size: calc(var(--s) * .175); color: var(--blanc); text-shadow: 0 0 18px rgba(211, 47, 47, .5); }
.launch__line { width: calc(var(--s) * .16); height: 3px; margin-top: 6px; background: var(--rouge); box-shadow: 0 0 10px var(--rouge); }
@keyframes incandescence {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0), 0 0 16px rgba(211, 47, 47, .45), inset 0 0 14px rgba(211, 47, 47, .22);
    border-color: #c22a2a;
  }
  50% {
    box-shadow: 0 0 0 10px rgba(211, 47, 47, .07), 0 0 44px rgba(255, 60, 60, .75), inset 0 0 28px rgba(211, 47, 47, .4);
    border-color: #ff4040;
  }
}
@keyframes rotation { to { transform: rotate(360deg); } }

/* =====================================================================
   EFFORT — glow progressif (--heat de 0 à 1 pendant la contraction)
   ===================================================================== */
.screen--session {
  --heat: 0;
  --accent: var(--armee-hi);
  gap: clamp(8px, 1.6dvh, 16px);
}
.screen--session[data-phase="effort"] { --accent: var(--rouge); }

.session__heat {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 85% 75% at 50% 50%, transparent 38%, rgba(211, 47, 47, .42) 100%),
    radial-gradient(ellipse 120% 45% at 50% 115%, rgba(255, 69, 69, .45), transparent 70%);
  transition: opacity .5s;
}
.screen--session[data-phase="effort"] .session__heat {
  opacity: calc(.3 + var(--heat) * .7);
  animation: battement calc(1.25s - var(--heat) * .5s) ease-in-out infinite;
}
@keyframes battement {
  0%, 100% { filter: brightness(.75); }
  16% { filter: brightness(1.45); }
  32% { filter: brightness(.95); }
  48% { filter: brightness(1.3); }
}

.session__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex: none;
}
.session__meta { min-width: 0; }
.session__group { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--rouge); }
.session__name {
  margin-top: 2px;
  padding-top: .1em;
  font-size: clamp(20px, 6.3vw, 28px);
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Arrêt : maintien */
.abort {
  --hold: 900ms;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #121212;
  box-shadow: inset 0 0 0 1px #3a4047;
  overflow: hidden;
  touch-action: none;
  color: var(--acier-hi);
}
.abort__fill {
  position: absolute;
  inset: 0;
  background: var(--rouge);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .18s ease;
}
.abort.is-holding .abort__fill { transform: scaleY(1); transition: transform var(--hold) linear; }
.abort__x { position: relative; font-size: 15px; }
.abort.is-holding { color: var(--blanc); }
.abort.appel { animation: appel .45s ease 2; }
@keyframes appel {
  50% { transform: scale(1.25); box-shadow: inset 0 0 0 2px var(--rouge-vif), 0 0 18px rgba(255, 60, 60, .8); color: var(--blanc); }
}

/* Ligne de temps */
.timeline { position: relative; display: flex; gap: 4px; height: 18px; flex: none; }
.tl__seg {
  position: relative;
  flex-basis: 0;
  min-width: 10px;
  background: #151515;
  box-shadow: inset 0 0 0 1px #2a2a2a;
  overflow: hidden;
}
.tl__seg i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--armee), var(--armee-hi)); }
.tl__seg--effort i { background: linear-gradient(90deg, #a52222, var(--rouge-vif)); box-shadow: 0 0 10px rgba(255, 69, 69, .6); }
.tl__seg.is-active { box-shadow: inset 0 0 0 1px var(--acier); }
.tl__seg--effort.is-active { box-shadow: inset 0 0 0 1px var(--rouge); }
.tl__seg span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  color: rgba(244, 244, 242, .85);
  text-shadow: 0 1px 2px #000;
}

/* Scène : vidéo + libellé + chrono se partagent la hauteur restante (zéro scroll) */
.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  container-type: size;
}

/* Vidéo carrée de l'exercice */
.demo {
  --v: min(58vw, 28vh, 320px);
  --v: min(80cqw, 48cqh, 340px);
  position: relative;
  flex: none;
  width: var(--v);
  height: var(--v);
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, rgba(75, 83, 32, .2) 0 8px, transparent 8px 16px),
    #0f0f0f;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  transition: box-shadow .3s;
}
.demo::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--acier-brosse);
  z-index: 2;
}
.demo__mono { font-size: calc(var(--v) * .24); letter-spacing: .06em; color: var(--acier-hi); text-shadow: 0 2px 0 #000; opacity: .55; }
.demo__img, .demo__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s;
}
.demo.has-img .demo__img, .demo.has-video .demo__video { opacity: 1; }
.demo.has-video .demo__img { opacity: 0; }
.demo.has-img .demo__mono, .demo.has-video .demo__mono { visibility: hidden; }
.screen--session[data-phase="effort"] .demo {
  box-shadow:
    inset 0 0 0 2px var(--rouge),
    0 0 calc(8px + var(--heat) * 26px) rgba(255, 60, 60, calc(.3 + var(--heat) * .5));
}

/* Côté (unilatéral) — incrusté en bas de la vidéo */
.phase__side {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 12px;
  background: var(--rouge);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--blanc);
  box-shadow: 0 0 14px rgba(211, 47, 47, .6);
  white-space: nowrap;
}

/* Libellé de phase */
.phase {
  position: relative;
  flex: none;
  width: 100%;
  text-align: center;
}
.phase::before {
  content: "";
  position: absolute;
  inset: -3px 0;
  background: linear-gradient(90deg, transparent, rgba(211, 47, 47, .5) 18%, rgba(211, 47, 47, .5) 82%, transparent);
  opacity: 0;
}
.phase__label {
  position: relative;
  font-size: clamp(22px, 7vw, 32px);
  line-height: 1.05;
  white-space: nowrap;
  color: var(--acier-hi);
}
.phase__lbl { position: relative; }
.dots { position: absolute; left: 100%; bottom: 0; white-space: nowrap; }
.dots i { font-style: normal; opacity: 0; animation: 2s steps(1, end) infinite; }
.dots i:nth-child(1) { animation-name: point-1; }
.dots i:nth-child(2) { animation-name: point-2; }
.dots i:nth-child(3) { animation-name: point-3; }
@keyframes point-1 { 0% { opacity: 0; } 25%, 100% { opacity: 1; } }
@keyframes point-2 { 0% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes point-3 { 0% { opacity: 0; } 75%, 100% { opacity: 1; } }

/* CONTRACTION ISO MAX ! — clignotement d'alerte */
.screen--session[data-phase="effort"] .phase::before { animation: bande .5s steps(1, end) infinite; }
.screen--session[data-phase="effort"] .phase__label { animation: alarme .5s steps(1, end) infinite; }
@keyframes bande { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes alarme {
  0%  { color: var(--blanc); text-shadow: 0 1px 0 #000, 0 0 14px rgba(0, 0, 0, .6); }
  50% { color: var(--rouge-vif); text-shadow: 0 0 22px rgba(255, 40, 40, 1), 0 0 46px rgba(255, 40, 40, .7); }
}
.slam { animation: slam .34s cubic-bezier(.2, .9, .2, 1.15) both; }
@keyframes slam {
  0%   { opacity: 0; transform: scale(1.2); filter: blur(3px); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}

/* Anneau chrono */
.ring {
  --d: min(92cqw, 100cqh, 300px);
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  container-type: size;
}
.ring > * { grid-area: 1 / 1; }
@supports not (width: 1cqw) {
  .ring { --d: min(70vw, 30vh, 300px); }
  .demo { --v: min(58vw, 28vh, 320px); }
}
.ring__core {
  width: calc(var(--d) * .86);
  height: calc(var(--d) * .86);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 60, 60, calc(.1 + var(--heat) * .38)) 0%, rgba(211, 47, 47, calc(.05 + var(--heat) * .15)) 45%, transparent 70%);
  opacity: 0;
  transition: opacity .4s;
}
.screen--session[data-phase="effort"] .ring__core {
  opacity: 1;
  animation: souffle calc(1.25s - var(--heat) * .5s) ease-in-out infinite;
}
@keyframes souffle { 0%, 100% { transform: scale(.94); } 20% { transform: scale(1.05); } 45% { transform: scale(.98); } 60% { transform: scale(1.03); } }
.ring__svg {
  width: var(--d);
  height: var(--d);
  transform: rotate(-90deg);
  overflow: visible;
}
.ring__ticks { fill: none; stroke: rgba(112, 128, 144, .45); stroke-width: 6; stroke-dasharray: 1.4 9.49; }
.ring__track { fill: none; stroke: #1b1b1b; stroke-width: 12; }
.ring__prog { fill: none; stroke: var(--armee-hi); stroke-width: 12; transition: stroke .25s; }
.screen--session[data-phase="effort"] .ring__prog {
  stroke: var(--rouge-vif);
  stroke-width: calc(12px + var(--heat) * 5px);
  filter: drop-shadow(0 0 calc(5px + var(--heat) * 14px) rgba(255, 60, 60, .95));
}
.screen--session[data-phase="effort"] .ring__ticks { stroke: rgba(255, 90, 90, calc(.35 + var(--heat) * .4)); }
.ring__time {
  font-size: calc(var(--d) * .33);
  line-height: .9;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--blanc);
  pointer-events: none;
}
.screen--session[data-phase="effort"] .ring__time {
  text-shadow: 0 0 calc(8px + var(--heat) * 36px) rgba(255, 60, 60, calc(.3 + var(--heat) * .6));
}
.screen--session.is-final .ring__time {
  color: var(--rouge-vif);
  text-shadow: 0 0 34px rgba(255, 60, 60, .95);
  animation: coup 1s ease-out infinite;
}
@keyframes coup { 0% { transform: scale(1.15); } 40%, 100% { transform: scale(1); } }

/* Encouragements en direct */
.encourage {
  position: relative;
  flex: none;
  min-height: 84px;
  min-height: clamp(62px, 10dvh, 86px);
  display: grid;
  place-items: center;
  padding: 8px 14px;
  text-align: center;
  background: linear-gradient(90deg, transparent, rgba(211, 47, 47, .14) 30%, rgba(211, 47, 47, .14) 70%, transparent);
  border-top: 1px solid rgba(211, 47, 47, .35);
  border-bottom: 1px solid rgba(211, 47, 47, .35);
  visibility: hidden;
  opacity: 0;
}
.encourage.is-on { visibility: visible; opacity: 1; }
.encourage__txt {
  font-size: clamp(20px, 6.6vw, 30px);
  line-height: 1.02;
  text-shadow: 0 0 calc(10px + var(--heat) * 20px) rgba(255, 60, 60, .7);
}
.encourage.is-final { background: linear-gradient(90deg, transparent, rgba(211, 47, 47, .32) 25%, rgba(211, 47, 47, .32) 75%, transparent); border-color: var(--rouge-vif); }
.encourage.is-final .encourage__txt { color: var(--blanc); }

/* =====================================================================
   RÉSULTAT
   ===================================================================== */
.screen--done {
  gap: clamp(8px, 2dvh, 20px);
  padding-top: calc(var(--safe-t) + clamp(14px, 4dvh, 48px));
}
.done__hero { display: flex; flex-direction: column; align-items: center; margin-top: auto; flex: none; }
.done__plus {
  font-size: min(36vw, 17vh, 160px);
  font-size: min(36vw, 17dvh, 160px);
  line-height: .82;
  color: var(--rouge);
  text-shadow: 0 0 44px rgba(211, 47, 47, .75);
}
.done__plus.pop { animation: explose .55s cubic-bezier(.2, .9, .2, 1.3) both; }
@keyframes explose {
  0%   { opacity: 0; transform: scale(.1); filter: brightness(3); }
  55%  { opacity: 1; transform: scale(1.3); filter: brightness(1.8); }
  100% { transform: scale(1); filter: none; }
}
.done__unit {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--blanc-dim);
}
.done__xp {
  flex: none;
  align-self: center;
  text-align: center;
  font-size: min(12vw, 6.5vh, 52px);
  font-size: min(12vw, 6.5dvh, 52px);
  color: var(--blanc);
  text-shadow: 0 0 24px rgba(255, 69, 69, .85);
  opacity: 0;
  font-variant-numeric: tabular-nums;
}
.done__xp.pop { animation: xp-pop .6s cubic-bezier(.2, .9, .2, 1.3) both; }
@keyframes xp-pop {
  0%   { opacity: 0; transform: scale(.2); }
  55%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 1; transform: scale(1); }
}
.screen--done > .level, .screen--done > .gauge, .screen--done > .week { flex: none; }
.next {
  flex: none;
  padding: 11px 14px;
  background: linear-gradient(180deg, #151515, #0f0f0f);
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
}
.next__lbl { font-size: 10px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--acier-hi); }
.next__group { margin-top: 5px; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--rouge); }
.next__name {
  margin-top: 2px;
  padding-top: .1em;
  font-size: clamp(18px, 5.8vw, 25px);
  line-height: 1.08;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.done__actions {
  flex: none;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  margin-top: auto;
}
.btn--icon { padding: 0; }
.btn--icon svg { width: 24px; height: 24px; }

/* =====================================================================
   TROPHÉES
   ===================================================================== */
.screen--trophees { gap: 12px; padding-bottom: 0; }
.tro__top { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 8px; margin-left: -8px; }
.tro__title { font-size: 30px; }
.tro__count { font-size: 22px; color: var(--acier); }
.tro__count b { font-weight: inherit; color: var(--blanc); }
.tro__bar { height: 6px; background: #171717; box-shadow: inset 0 0 0 1px var(--acier-sombre); transform: skewX(-20deg); overflow: hidden; }
.tro__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a52222, var(--rouge-vif)); box-shadow: 0 0 10px rgba(255, 69, 69, .7); transition: width .6s ease; }
.tro__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tro__stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 4px 8px;
  background: linear-gradient(180deg, #161616, #0f0f0f);
  box-shadow: inset 0 0 0 1px #262626;
}
.tro__stats b { font-size: 22px; line-height: 1; }
.tro__stats span { font-size: 8.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--acier-hi); text-align: center; }
.tro__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 0 calc(var(--pad) * -1);
  padding: 4px var(--pad) calc(var(--safe-b) + 28px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 24px), transparent);
}
.tro__cat {
  display: flex;
  justify-content: space-between;
  margin: 18px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #262626;
  font-family: var(--f-texte);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--acier-hi);
}
.tro__cat span:last-child { color: var(--rouge); }
.tro__grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 8px; }
.tro__item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.tro__item:active { transform: scale(.94); }
.tro__nom {
  margin-top: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--blanc);
}
.tro__legende {
  margin-top: 3px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--blanc-dim);
}
.tro__item.is-locked .tro__nom { color: #6b7076; }
.tro__item.is-locked .tro__legende { color: #565b60; }

/* =====================================================================
   MÉDAILLES — l'image seule ; la rareté = halo teinté + rayons + ◆
   ===================================================================== */
.medal-bloc { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.medal {
  --size: 64px;
  --m1: #6b3d1f; --m2: #cd7f32; --m3: #f0b27a;
  --halo: rgba(205, 127, 50, .6);
  --halo-k: .2;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #0b0b0b;
  box-shadow:
    0 calc(var(--size) * .05) calc(var(--size) * .14) rgba(0, 0, 0, .7),
    0 0 calc(var(--size) * .06) var(--halo),
    0 0 calc(var(--size) * var(--halo-k)) var(--halo);
}
/* Disque de secours (symbole) tant que l'image n'est pas en ligne */
.medal::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #262626, #080808 72%);
  box-shadow: inset 0 0 calc(var(--size) * .12) var(--halo);
}
.medal__glyph {
  position: relative;
  z-index: 1;
  font-size: calc(var(--size) * .4);
  line-height: 1;
  letter-spacing: 0;
  color: var(--m3);
  text-shadow: 0 0 calc(var(--size) * .1) var(--m2), 0 2px 0 #000;
  white-space: nowrap;
}
.medal[data-len="2"] .medal__glyph { font-size: calc(var(--size) * .36); }
.medal[data-len="3"] .medal__glyph { font-size: calc(var(--size) * .29); }
.medal[data-len="4"] .medal__glyph { font-size: calc(var(--size) * .23); }
.medal[data-len="5"] .medal__glyph { font-size: calc(var(--size) * .19); }

/* Image de la récompense : tout le disque, telle que générée */
.medal__img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s;
}
.medal.has-img .medal__img { opacity: 1; }
.medal.has-img .medal__glyph,
.medal.has-img::before { visibility: hidden; }

/* Teinte du halo par rang (plus le rang est rare, plus il rayonne) */
.medal--argent { --m1: #5f6870; --m2: #dfe5ea; --m3: #ffffff; --halo: rgba(223, 229, 234, .6); --halo-k: .23; }
.medal--or { --m1: #7a560c; --m2: #e3b53c; --m3: #fff0a8; --halo: rgba(242, 190, 50, .75); --halo-k: .27; }
.medal--diamant { --m1: #22323d; --m2: #bfe9ff; --m3: #ffffff; --halo: rgba(150, 220, 255, .8); --halo-k: .32; }
.medal--diamant .medal__glyph { color: #fff; }
.medal--legendaire { --m1: #5a0f0f; --m2: #D32F2F; --m3: #ff8a8a; --halo: rgba(255, 69, 69, .85); --halo-k: .34; animation: halo-pulse 1.8s ease-in-out infinite; }
.medal--legendaire .medal__glyph { color: #fff; }
@keyframes tour { to { transform: rotate(360deg); } }
@keyframes halo-pulse {
  0%, 100% { box-shadow: 0 calc(var(--size) * .05) calc(var(--size) * .14) rgba(0, 0, 0, .7), 0 0 calc(var(--size) * .06) rgba(255, 69, 69, .8), 0 0 calc(var(--size) * .26) rgba(255, 69, 69, .6); }
  50% { box-shadow: 0 calc(var(--size) * .05) calc(var(--size) * .14) rgba(0, 0, 0, .7), 0 0 calc(var(--size) * .08) rgba(255, 69, 69, .95), 0 0 calc(var(--size) * .44) rgba(255, 69, 69, .9); }
}
.medal.is-locked { filter: grayscale(1) brightness(.4) contrast(1.15); box-shadow: none; animation: none; }

/* Losanges de rareté : 1 Bronze → 5 Légendaire */
.rang { display: flex; gap: max(3px, calc(var(--size) * .045)); }
.rang i {
  width: max(5px, calc(var(--size) * .07));
  height: max(5px, calc(var(--size) * .07));
  transform: rotate(45deg);
  background: var(--rc);
  box-shadow: 0 0 max(3px, calc(var(--size) * .05)) var(--rc);
}
.rang--bronze { --rc: #cd7f32; }
.rang--argent { --rc: #dfe5ea; }
.rang--or { --rc: #e3b53c; }
.rang--diamant { --rc: #bfe9ff; }
.rang--legendaire { --rc: #ff4545; }
.medal-bloc.is-locked .rang { opacity: .4; }
.medal-bloc.is-locked .rang i { box-shadow: none; }

/* =====================================================================
   CONNEXION — sobre, une seule colonne, tient sur tous les écrans
   ===================================================================== */
.screen--login { justify-content: center; }
.login {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 4.5vh, 34px);
}
.login__marque {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .3em;
  font-size: clamp(30px, 10vw, 44px);
}
.login__pr {
  flex: none;
  width: auto;
  height: .78em;
  height: 1cap;
  filter: drop-shadow(0 0 8px rgba(211, 47, 47, .5));
}
.login__nom { font-size: 1em; line-height: 1; letter-spacing: .045em; white-space: nowrap; }
.login__form { display: flex; flex-direction: column; gap: 12px; }
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ__lbl {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--acier-hi);
}
.champ__input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: #131313;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  color: var(--blanc);
  font: 600 16px/1 var(--f-texte);
  user-select: text;
  -webkit-user-select: text;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow .15s;
}
.champ__input:focus { box-shadow: inset 0 0 0 2px var(--rouge); }
.champ__input:-webkit-autofill { -webkit-text-fill-color: var(--blanc); box-shadow: inset 0 0 0 1px var(--acier-sombre), inset 0 0 0 60px #131313; }
.login__msg { min-height: 1.35em; font-size: 13px; font-weight: 600; text-align: center; color: #ff6b6b; }
.login__msg.is-ok { color: var(--acier-hi); }
.login__form .btn { margin-top: 2px; }
.btn.is-busy { opacity: .55; pointer-events: none; }
.login__lien {
  align-self: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--acier-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.login__lien:disabled { opacity: .5; }
.login__pied { text-align: center; font-size: 13px; color: var(--blanc-dim); }
.login__pied a { color: var(--rouge-vif); font-weight: 800; text-decoration: none; }
@media (max-height: 560px) {
  .champ__input { height: 46px; }
  .login__form { gap: 9px; }
}

/* =====================================================================
   RÉGLAGES
   ===================================================================== */
.screen--reglages { gap: 14px; }
.regl {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #151515, #0f0f0f);
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
}
.regl__ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 10px 16px;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
.regl__ligne + .regl__ligne { border-top: 1px solid #232323; }
.regl__txt { display: flex; flex-direction: column; gap: 3px; }
.regl__txt b { font-family: var(--f-display); font-weight: 900; font-synthesis: none; font-size: 19px; letter-spacing: .03em; text-transform: uppercase; }
.regl__txt small { font-size: 12px; color: var(--blanc-dim); }
.regl--danger { box-shadow: inset 0 0 0 1px rgba(211, 47, 47, .45); }
.regl__effacer b { color: var(--rouge-vif); }
.regl__effacer svg { width: 22px; height: 22px; fill: var(--rouge-vif); flex: none; }
.regl__effacer:active { background: rgba(211, 47, 47, .12); }
.regl__compte { cursor: default; }
.regl__compte small { overflow-wrap: anywhere; }
.regl__btn {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blanc);
  box-shadow: inset 0 0 0 1px var(--acier);
}
.regl__btn:active { background: rgba(255, 255, 255, .06); }
.regl__version { margin-top: auto; text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: #4d555d; }

.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: #222;
  box-shadow: inset 0 0 0 1px var(--acier-sombre);
  cursor: pointer;
  transition: background .2s, box-shadow .2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--acier-hi);
  transition: transform .2s ease, background .2s;
}
.switch:checked { background: var(--rouge); box-shadow: 0 0 12px rgba(211, 47, 47, .5); }
.switch:checked::after { transform: translateX(22px); background: var(--blanc); }

/* Feuilles compactes (série, confirmation) */
.sheet--petit .sheet__body {
  max-width: 400px;
  padding: 18px 18px 20px;
  background: linear-gradient(180deg, #171717, #0e0e0e);
  box-shadow: inset 0 0 0 1px var(--acier-sombre), 0 20px 50px rgba(0, 0, 0, .7);
}
.serie__hero { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.serie__flamme { width: 54px; height: 54px; fill: var(--rouge-vif); filter: drop-shadow(0 0 14px rgba(255, 60, 60, .8)); }
.serie__val { font-size: 84px; line-height: .9; text-shadow: 0 0 30px rgba(211, 47, 47, .6); }
.serie__unite { font-size: 11px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--blanc-dim); }
.serie__etat {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 12px;
  background: rgba(211, 47, 47, .1);
  box-shadow: inset 0 0 0 1px rgba(211, 47, 47, .35);
}
.serie__etat[data-etat="ok"] { color: #e3b53c; background: rgba(227, 181, 60, .08); box-shadow: inset 0 0 0 1px rgba(227, 181, 60, .4); }
.serie__etat[data-etat="off"] { color: var(--blanc-dim); background: transparent; box-shadow: inset 0 0 0 1px var(--acier-sombre); }
.serie__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.serie__stats div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; box-shadow: inset 0 0 0 1px #262626; }
.serie__stats b { font-size: 26px; line-height: 1; }
.serie__stats span { font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--acier-hi); }
.serie__next { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.serie__next > div:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.serie__next-lbl { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--acier-hi); }
.serie__next b { font-size: 20px; line-height: 1.05; }
.serie__next small { font-size: 12px; color: var(--blanc-dim); }

.confirm { gap: 14px; }
.confirm__titre { font-size: 34px; color: var(--rouge-vif); }
.confirm__txt { font-size: 14px; line-height: 1.45; color: var(--blanc-dim); }
.confirm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.btn--danger {
  position: relative;
  overflow: hidden;
  background: #2a0d0d;
  box-shadow: inset 0 0 0 1px var(--rouge);
  color: var(--blanc);
  touch-action: none;
}
.btn--danger .btn__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #a52222, var(--rouge-vif));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s ease;
}
.btn--danger.is-holding .btn__fill { transform: scaleX(1); transition: transform 1.4s linear; }
.btn--danger .btn__lbl { position: relative; }

/* =====================================================================
   DÉMONSTRATION — vidéo de l'exercice en attente
   ===================================================================== */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 14px) calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 16px) calc(var(--pad) + var(--safe-l));
  background: rgba(8, 8, 8, .98);
  overflow: hidden;
  overflow: clip;
}
.sheet.is-in { animation: fondu .2s ease both; }
.sheet.is-in .sheet__body { animation: monte .3s cubic-bezier(.2, .9, .2, 1.1) both; }
.sheet__body {
  width: 100%;
  max-width: 440px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2dvh, 16px);
}
.sheet__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sheet__meta { min-width: 0; }
.sheet__group { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--rouge); }
.sheet__name {
  margin-top: 2px;
  padding-top: .1em;
  font-size: clamp(22px, 7vw, 30px);
  line-height: 1.08;
}
.sheet__close { margin: -6px -8px 0 0; }
.sheet__video {
  --v: min(100%, 56vh);
  --v: min(100%, 56dvh);
  position: relative;
  align-self: center;
  width: var(--v);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  background:
    repeating-linear-gradient(-45deg, rgba(75, 83, 32, .2) 0 10px, transparent 10px 20px),
    #0f0f0f;
  box-shadow: inset 0 0 0 1px var(--acier-sombre), 0 0 0 1px #000, 0 0 30px rgba(211, 47, 47, .18);
}
.sheet__video::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--acier-brosse);
  z-index: 3;
}
.sheet__mono { font-size: clamp(54px, 18vw, 90px); letter-spacing: .06em; color: var(--acier-hi); opacity: .5; text-shadow: 0 2px 0 #000; }
.sheet__soon { font-size: 10px; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; color: var(--acier); }
.sheet__img, .sheet__vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.sheet__video.has-img .sheet__img, .sheet__video.has-video .sheet__vid { opacity: 1; }
.sheet__video.has-video .sheet__img { opacity: 0; }
.sheet__video.has-img .sheet__mono, .sheet__video.has-img .sheet__soon,
.sheet__video.has-video .sheet__mono, .sheet__video.has-video .sheet__soon { visibility: hidden; }
.sheet__sound {
  position: absolute;
  z-index: 4;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(13, 13, 13, .75);
  box-shadow: inset 0 0 0 1px var(--acier);
  color: var(--blanc);
}
.sheet__sound svg { width: 20px; height: 20px; fill: currentColor; }
.sheet__sound .is-on { display: none; }
.sheet__sound.is-on .is-on { display: block; }
.sheet__sound.is-on .is-off { display: none; }
.sheet__sound.is-on { box-shadow: inset 0 0 0 1px var(--rouge); }
.sheet__chips { display: flex; justify-content: center; gap: 8px; }

/* =====================================================================
   RÉVÉLATION — explosion d'apparition
   ===================================================================== */
.reveal {
  --rv: #ff4545;
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 20px) calc(var(--pad) + var(--safe-r)) calc(var(--safe-b) + 20px) calc(var(--pad) + var(--safe-l));
  background: rgba(6, 6, 6, .95);
  overflow: hidden;
  overflow: clip;
}
.reveal[data-rarete="bronze"] { --rv: #cd7f32; }
.reveal[data-rarete="argent"] { --rv: #dfe5ea; }
.reveal[data-rarete="or"] { --rv: #e3b53c; }
.reveal[data-rarete="diamant"] { --rv: #bfe9ff; }
.reveal[data-rarete="legendaire"] { --rv: #ff4545; }
.reveal__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 38%, var(--rv) 0%, transparent 52%);
  opacity: .22;
}
.reveal__rays {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 180vmax;
  height: 180vmax;
  margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, var(--rv) 0deg 4deg, transparent 4deg 15deg);
  opacity: .13;
  -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  mask-image: radial-gradient(circle, #000 0%, transparent 55%);
  animation: rotation 28s linear infinite;
}
.reveal__wave {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border-radius: 50%;
  border: 4px solid var(--rv);
  box-shadow: 0 0 30px var(--rv);
  opacity: 0;
}
.reveal.is-in .reveal__wave { animation: onde .9s ease-out .12s both; }
@keyframes onde { 0% { transform: scale(.2); opacity: 1; } 100% { transform: scale(14); opacity: 0; } }
.reveal__body {
  position: relative;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.reveal__kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .32em;
  margin-left: .32em;
  text-transform: uppercase;
  color: var(--rv);
}
.reveal__medal { perspective: 900px; margin: 10px 0 8px; }
.reveal.is-in .reveal__medal .medal { animation: piece .95s cubic-bezier(.2, .9, .2, 1.15) both; }
@keyframes piece {
  0%   { opacity: 0; transform: scale(0) rotateY(720deg); }
  55%  { opacity: 1; transform: scale(1.22) rotateY(0deg); }
  100% { transform: scale(1); }
}
.reveal__medal .medal { isolation: isolate; box-shadow: 0 0 14px var(--rv), 0 0 60px var(--rv); }
.reveal__medal .medal.is-locked { box-shadow: none; }
/* Couronne de rayons à la teinte du rang, collée à l'image */
.reveal__medal .medal::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -62%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--rv) 0deg 3deg, transparent 3deg 11.25deg);
  -webkit-mask: radial-gradient(closest-side, transparent 40%, #000 46%, rgba(0, 0, 0, .35) 72%, transparent 100%);
  mask: radial-gradient(closest-side, transparent 40%, #000 46%, rgba(0, 0, 0, .35) 72%, transparent 100%);
  opacity: .75;
  animation: tour 30s linear infinite;
  pointer-events: none;
}
.reveal__medal .medal.is-locked::after { opacity: .35; }
.reveal__title {
  max-width: 100%;
  font-size: clamp(32px, 10vw, 50px);
  line-height: .98;
  overflow-wrap: break-word;
  text-shadow: 0 0 28px var(--rv);
}
.reveal.is-in .reveal__title { animation: slam .45s cubic-bezier(.2, .9, .2, 1.15) .35s both; }
.reveal__sub { font-size: 14px; font-weight: 600; color: var(--blanc-dim); }
.reveal__xp { font-size: 30px; color: var(--blanc); text-shadow: 0 0 20px rgba(255, 69, 69, .9); }
.reveal.is-in .reveal__xp { animation: xp-pop .6s cubic-bezier(.2, .9, .2, 1.3) .55s both; }
.reveal.is-fiche .reveal__xp { font-size: 20px; color: var(--acier-hi); text-shadow: none; }
.reveal__progress { width: 70%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.reveal__progress > div { width: 100%; height: 8px; background: #191919; box-shadow: inset 0 0 0 1px var(--acier-sombre); transform: skewX(-20deg); overflow: hidden; }
.reveal__progress i { display: block; height: 100%; background: linear-gradient(90deg, #a52222, var(--rouge-vif)); }
.reveal__progress span { font-size: 12px; font-weight: 800; color: var(--acier-hi); font-variant-numeric: tabular-nums; }
.reveal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
}
.reveal__actions .btn[hidden] + .btn { grid-column: 1 / -1; }
.reveal.is-in .reveal__actions { animation: monte .4s ease .7s both; }
@keyframes monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal.is-fiche { animation: fondu .2s ease both; }
.reveal.is-fiche .reveal__rays { opacity: .08; }
.reveal.is-fiche .reveal__glow { opacity: .12; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   FX GLOBAUX
   ===================================================================== */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 35; }
.flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  background: radial-gradient(circle at 50% 50%, var(--flash, rgba(255, 90, 90, .6)), transparent 72%);
}
.flash.is-on { animation: flash .5s ease-out; }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }

.app.shake-1 { animation: secousse-1 .3s linear; }
.app.shake-2 { animation: secousse-2 .5s linear; }
@keyframes secousse-1 {
  0%, 100% { transform: none; }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
}
@keyframes secousse-2 {
  0%, 100% { transform: none; }
  10% { transform: translate(-7px, 4px) rotate(-.4deg); }
  25% { transform: translate(6px, -5px) rotate(.4deg); }
  40% { transform: translate(-5px, 3px); }
  55% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, 2px); }
  85% { transform: translate(1px, -1px); }
}

/* =====================================================================
   PETITS ÉCRANS — tout tient sans scroller, du 320×480 au 430×932
   ===================================================================== */
@media (max-height: 720px) {
  .exo__body { padding: 14px 4px 10px 12px; gap: 10px; }
  .exo__media { width: clamp(54px, 16vw, 68px); }
  .stage { gap: 8px; }
}
@media (max-height: 640px) {
  .screen { padding-top: calc(var(--safe-t) + 10px); padding-bottom: calc(var(--safe-b) + 12px); }
  .gauge__head { margin-bottom: 5px; }
  .gauge__bars i { height: 11px; }
  .screen--home, .screen--session { gap: 8px; }
  .topbar { min-height: 34px; }
  .stat-chip { height: 34px; }
  .level__num { font-size: 27px; }
  .exo__name { font-size: 18px; margin: 3px 0 7px; }
  .rotation { padding-bottom: 10px; }
  .timeline { height: 14px; }
  .session__name { font-size: 19px; }
  .next__group { display: none; }
  .gauge__medals { margin-top: 4px; }
}
@media (max-height: 560px) {
  .rotation { display: none; }
  .gauge__medals { height: 10px; margin-top: 3px; }
  .gm { width: 10px; height: 10px; }
  .week__track { height: 6px; }
  .exo__body { padding: 12px 4px 10px 10px; }
  .exo__media { width: 48px; }
  .exo__corps { min-height: 80px; width: 42px; }
  .exo__name { font-size: 16px; -webkit-line-clamp: 3; margin-bottom: 6px; }
  .gauge__head { margin-bottom: 5px; }
  .gauge__count { font-size: 19px; }
  .stat-chip { height: 32px; }
  .session__name { font-size: 17px; }
  .next__lbl { display: none; }
  .next { padding: 8px 12px; }
  .done__unit { margin-top: 4px; }
  .btn { min-height: 50px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .rotation, .gauge__medals { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .launch__btn, .launch__btn::before, .session__heat, .ring__core, .reveal__rays,
  .phase::before, .phase__label, .dots i, .medal, .medal::after { animation: none !important; }
  .dots i { opacity: 1; }
  .slam, .pop, .swap, .is-new, .shake-1, .shake-2 { animation-duration: .01ms !important; }
}
