@charset "UTF-8";
:root {
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
}

#app {
  --app-w: 100vw;
  --app-h: 100vh;
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#app[data-rotation="-90"], #app[data-rotation="90"] {
  inset: auto;
  top: 50%;
  left: 50%;
  width: var(--app-w);
  height: var(--app-h);
}
#app[data-rotation="-90"] {
  --safe-t: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-bottom, 0px);
  transform: translate(-50%, -50%) rotate(-90deg);
}
#app[data-rotation="90"] {
  --safe-t: env(safe-area-inset-right, 0px);
  --safe-r: env(safe-area-inset-bottom, 0px);
  --safe-b: env(safe-area-inset-left, 0px);
  --safe-l: env(safe-area-inset-top, 0px);
  transform: translate(-50%, -50%) rotate(90deg);
}

@supports (height: 1svh) {
  #app {
    --app-h: 100svh;
  }
}
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #0b0b0d;
  color: #f1ede4;
}

body {
  position: fixed;
  inset: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

[hidden] {
  display: none !important;
}

/*
 * Fond de l'app, derrière les slides : une trame d'écran d'instrument et une lueur centrale,
 * pour que l'écran ne soit pas un rectangle noir vide. Purement décoratif et sans animation :
 * deux pseudo-éléments posés sur #app (qui pivote avec le téléphone, kit/styles/_app.scss),
 * donc rien à mesurer pour l'ajustement du texte et rien à repeindre pendant la routine.
 *
 * Tout s'éteint vers les bords et reste très peu contrasté : le texte des slides, le cadre
 * d'instrument et l'écran noir passent par-dessus (couches : fond 0, scène 1, cadre 5, note 11,
 * jauge 30, écran noir 40, menu 50).
 */
#app::before, #app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#app::before {
  background-image: repeating-linear-gradient(0deg, rgba(247, 147, 30, 0.055) 0 1px, transparent 1px clamp(30px, 9vmin, 46px)), repeating-linear-gradient(90deg, rgba(247, 147, 30, 0.055) 0 1px, transparent 1px clamp(30px, 9vmin, 46px));
  -webkit-mask-image: radial-gradient(120% 80% at 50% 45%, #000 18%, transparent 78%);
  mask-image: radial-gradient(120% 80% at 50% 45%, #000 18%, transparent 78%);
}
#app::after {
  background: radial-gradient(70% 45% at 50% 42%, rgba(247, 147, 30, 0.13), transparent 70%);
}

#stage {
  z-index: 1;
}

#stage {
  position: absolute;
  inset: 0;
  position: fixed;
  touch-action: none;
  cursor: pointer;
}

#deck {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.slide {
  --fit: 1;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + max(28px, 7vmin)) calc(var(--safe-r) + max(22px, 7vmin)) calc(var(--safe-b) + max(28px, 7vmin)) calc(var(--safe-l) + max(22px, 7vmin));
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease, visibility 0s linear 0.45s;
}
.slide.far {
  display: none;
}
.slide.current {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition-delay: 0s;
}

[data-transition=glisse] .slide.before {
  transform: translateX(-14%);
}
[data-transition=glisse] .slide.after {
  transform: translateX(14%);
}

[data-transition=aucune] .slide,
.no-anim .slide {
  transition: none;
}

.slide-body {
  width: 100%;
  max-width: 1100px;
  text-align: center;
  overflow-wrap: normal;
  hyphens: manual;
}
.slide-body > * + * {
  margin-top: calc(var(--fit) * max(24px, 6vmin));
}
.slide-body > .etiquette + * {
  margin-top: 0;
}
.slide-body > * + .bouton,
.slide-body > * + .chargement {
  margin-top: calc(var(--fit) * max(40px, 10vmin));
}

.slide:has(> .slide-body > .etiquette) {
  padding-top: calc(var(--safe-t) + max(100px, 19vmin));
}

.etiquette {
  position: absolute;
  top: calc(var(--safe-t) + max(52px, 10vmin));
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border: 1px solid rgba(247, 147, 30, 0.45);
  border-radius: 999px;
  color: #f7931e;
  white-space: nowrap;
  font: 600 clamp(12px, 3.2vmin, 18px)/1 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.titre {
  margin: 0;
  font: 400 calc(var(--fit) * clamp(32px, 11vmin, 120px))/1.12 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  letter-spacing: 0.01em;
  text-wrap: balance;
}
.titre strong {
  font-weight: inherit;
}
.titre:only-child {
  font-size: calc(var(--fit) * clamp(46px, 17vmin, 180px));
}

.grand {
  margin: 0;
  font: 300 calc(var(--fit) * clamp(80px, 34vmin, 380px))/1 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
  font-variant-numeric: lining-nums;
  letter-spacing: -0.02em;
  color: #f7931e;
}

.texte {
  font-size: calc(var(--fit) * clamp(22px, 7vmin, 64px));
  line-height: 1.38;
  text-wrap: balance;
}
.texte p {
  margin: 0;
}
.texte p + p {
  margin-top: 0.8em;
}
.slide-body:not(:has(> .titre, > .grand)) > .texte {
  font-size: calc(var(--fit) * clamp(26px, 9vmin, 76px));
  line-height: 1.28;
}

strong {
  font-weight: 600;
  color: #f7931e;
}

.image {
  display: block;
  max-width: 100%;
  max-height: calc(var(--fit) * var(--app-h) * 0.6);
  margin-inline: auto;
  object-fit: contain;
}
.slide-body:has(> :not(.image)) .image {
  max-height: calc(var(--fit) * var(--app-h) * 0.36);
}

.chargement {
  width: min(100%, 560px);
  margin-inline: auto;
  text-align: center;
}

/*
 * Cadran de chargement (stage/deck.ts : buildCadran) : un camembert qui se remplit derrière un
 * anneau de progression, le pourcentage au centre. La part remplie est posée par
 * stage/loading.ts, en pour-cent : --part pour le camembert, stroke-dasharray pour l'anneau.
 */
.chargement-cadran {
  --part: 0%;
  position: relative;
  width: calc(var(--fit) * clamp(150px, 46vmin, 280px));
  aspect-ratio: 1;
  margin-inline: auto;
}
.chargement-cadran::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: conic-gradient(rgba(247, 147, 30, 0.22) var(--part), rgba(247, 147, 30, 0.04) 0);
}
.chargement-cadran svg {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.chargement-piste,
.chargement-arc {
  fill: none;
  stroke-width: 5;
}

.chargement-piste {
  stroke: rgba(241, 237, 228, 0.14);
}

.chargement-arc {
  stroke: #f7931e;
  stroke-linecap: round;
  stroke-dasharray: 0 100;
  filter: drop-shadow(0 0 calc(var(--fit) * 10px) rgba(247, 147, 30, 0.45));
}

.chargement-etape {
  margin: calc(var(--fit) * max(18px, 4vmin)) 0 0;
  min-height: 1.3em;
  color: rgba(241, 237, 228, 0.6);
  font: 500 calc(var(--fit) * clamp(15px, 4vmin, 26px))/1.3 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.04em;
  text-wrap: balance;
}
.chargement-etape.apparait {
  animation: etape-apparition 0.45s ease-out both;
}

@keyframes etape-apparition {
  from {
    opacity: 0;
    transform: translateY(calc(var(--fit) * 6px));
  }
}
.chargement-termine {
  margin: calc(var(--fit) * max(28px, 7vmin)) 0 0;
  font: 600 calc(var(--fit) * clamp(22px, 6.5vmin, 48px))/1.25 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  color: #f7931e;
  text-wrap: balance;
  animation: termine-apparition 0.6s ease-out both;
}

@keyframes termine-apparition {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.chargement-pourcent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 600 calc(var(--fit) * clamp(30px, 11vmin, 64px))/1 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  color: #f1ede4;
}

.bouton {
  position: relative;
  max-width: 100%;
  min-height: max(56px, var(--fit) * 72px);
  padding: calc(var(--fit) * 0.6em) calc(var(--fit) * 1.6em);
  border: 2px solid #f7931e;
  border-radius: 999px;
  background: rgba(247, 147, 30, 0.12);
  color: #f7931e;
  font: 600 calc(var(--fit) * clamp(20px, 6vmin, 36px))/1.1 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 0 calc(var(--fit) * 28px) rgba(247, 147, 30, 0.25);
  animation: bouton-apparition 0.7s ease-out both, bouton-pulse 2.4s ease-in-out 0.7s infinite;
}
.bouton::before {
  content: "";
  position: absolute;
  inset: -24px;
}
.bouton:active {
  background: rgba(247, 147, 30, 0.3);
  transform: scale(0.97);
}

@keyframes bouton-apparition {
  from {
    opacity: 0;
  }
}
@keyframes bouton-pulse {
  50% {
    box-shadow: 0 0 calc(var(--fit) * 44px) rgba(247, 147, 30, 0.45);
  }
}
.langues {
  position: absolute;
  top: calc(var(--safe-t) + max(26px, 6vmin));
  right: calc(var(--safe-r) + max(18px, 5vmin));
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}
.langues button {
  min-width: 46px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(241, 237, 228, 0.6);
  font: 600 14px/1 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.12em;
  cursor: pointer;
  touch-action: manipulation;
}
.langues button[aria-checked=true] {
  border-color: rgba(247, 147, 30, 0.8);
  background: rgba(247, 147, 30, 0.16);
  color: #f7931e;
}

#frame {
  --inset: 12px;
  --coin: clamp(22px, 7vmin, 40px);
  --trait: rgba(247, 147, 30, .55);
  position: fixed;
  z-index: 5;
  inset: calc(var(--safe-t) + var(--inset)) calc(var(--safe-r) + var(--inset)) calc(var(--safe-b) + var(--inset)) calc(var(--safe-l) + var(--inset));
  pointer-events: none;
}
#frame .coin {
  position: absolute;
  width: var(--coin);
  height: var(--coin);
  border: 0 solid var(--trait);
}
#frame .haut-gauche {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
}
#frame .haut-droite {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
}
#frame .bas-gauche {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
}
#frame .bas-droite {
  bottom: 0;
  right: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
}
#frame .graduations {
  position: absolute;
  top: calc(var(--coin) + 16px);
  bottom: calc(var(--coin) + 16px);
  width: 10px;
  opacity: 0.5;
  background: repeating-linear-gradient(180deg, var(--trait) 0 1px, transparent 1px 60px) left/10px 100% no-repeat, repeating-linear-gradient(180deg, var(--trait) 0 1px, transparent 1px 12px) left/5px 100% no-repeat;
}
#frame .gauche {
  left: 0;
}
#frame .droite {
  right: 0;
  transform: scaleX(-1);
}
#frame .repere {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(247, 147, 30, 0.7);
  font: 600 10px/1 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}
#frame .haut {
  top: 2px;
}
#frame .bas {
  bottom: 2px;
  display: flex;
  align-items: center;
  gap: 7px;
}
#frame .bas i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f7931e;
  box-shadow: 0 0 8px #f7931e;
  animation: voyant 1.6s ease-in-out infinite;
}

@keyframes voyant {
  50% {
    opacity: 0.25;
  }
}
#note,
#hold-ring,
#black {
  position: fixed;
  pointer-events: none;
}

#note {
  z-index: 11;
  left: calc(var(--safe-l) + 12px);
  right: calc(var(--safe-r) + 12px);
  bottom: calc(var(--safe-b) + 14px);
  max-height: calc(var(--app-h) * 0.32);
  overflow: hidden;
  margin-inline: auto;
  max-width: 720px;
  padding: 10px 14px;
  border-left: 3px solid #f7931e;
  border-radius: 8px;
  background: rgba(20, 20, 24, 0.88);
  color: rgba(241, 237, 228, 0.85);
  font: 15px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  white-space: pre-line;
  text-align: left;
}

#hold-ring {
  z-index: 30;
  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;
  opacity: 0;
}
#hold-ring svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
#hold-ring circle {
  fill: none;
  stroke-width: 6;
}
#hold-ring .track {
  stroke: rgba(241, 237, 228, 0.18);
}
#hold-ring .fill {
  stroke: #f7931e;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
#hold-ring.run {
  animation: ring-show 0.2s ease var(--ring-delay) forwards;
}
#hold-ring.run .fill {
  animation: ring-fill var(--ring-duration) linear var(--ring-delay) forwards;
}

@keyframes ring-show {
  to {
    opacity: 1;
  }
}
@keyframes ring-fill {
  to {
    stroke-dashoffset: 0;
  }
}
#black {
  z-index: 40;
  inset: 0;
  background: #000;
}

#menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  background: #0b0b0d;
  color: #f1ede4;
}

.sheet {
  width: 100%;
  max-width: 560px;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
  padding: calc(var(--safe-t) + 22px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 32px) calc(var(--safe-l) + 16px);
}
.sheet button {
  min-height: 46px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  color: #f1ede4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(241, 237, 228, 0.14);
  cursor: pointer;
}
.sheet button.primary {
  border-color: transparent;
  background: #f7931e;
  color: #1a0f02;
  font-weight: 600;
}
.sheet button.link {
  width: 100%;
  margin-top: 6px;
  border: none;
  background: none;
  color: rgba(241, 237, 228, 0.6);
  font-size: 13px;
  text-decoration: underline;
}

.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.menu-head h1 {
  margin: 0;
  font: 400 30px/1.1 "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;
}
.menu-head span {
  color: rgba(241, 237, 228, 0.6);
  font-variant-numeric: tabular-nums;
}

.menu-version {
  -webkit-user-select: text;
  user-select: text;
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(241, 237, 228, 0.6);
  font-variant-numeric: tabular-nums;
}

.card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #151518;
  border: 1px solid rgba(241, 237, 228, 0.08);
}

.row-label {
  margin-bottom: 10px;
  font-size: 15px;
  color: rgba(241, 237, 228, 0.6);
}

.hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(241, 237, 228, 0.6);
}

.slide-list {
  display: grid;
  gap: 6px;
  max-height: calc(var(--app-h) * 0.42);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet .slide-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-align: left;
  line-height: 1.3;
}
.sheet .slide-list button.current {
  border-color: #f7931e;
  background: rgba(247, 147, 30, 0.12);
}
.slide-list .num {
  flex: none;
  min-width: 2ch;
  color: #f7931e;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}
.sheet .seg button {
  min-height: 40px;
  border-color: transparent;
  background: transparent;
}
.sheet .seg button[aria-checked=true] {
  background: rgba(247, 147, 30, 0.16);
  color: #f7931e;
  box-shadow: inset 0 0 0 1px #f7931e;
}

.options {
  display: grid;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  font-size: 15px;
  cursor: pointer;
}
.toggle-row + .toggle-row {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(241, 237, 228, 0.08);
}
.toggle-row input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: #f7931e;
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.status small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: rgba(241, 237, 228, 0.6);
}

.dot {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #5d5a55;
}
.dot.lock {
  background: #7fe0a0;
  box-shadow: 0 0 10px rgba(127, 224, 160, 0.7);
}
.dot.video {
  background: #f0c36a;
  box-shadow: 0 0 10px rgba(240, 195, 106, 0.6);
}

.about {
  display: grid;
  gap: 8px;
}

.about-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  color: rgba(241, 237, 228, 0.6);
}
.about-row span {
  -webkit-user-select: text;
  user-select: text;
  color: #f1ede4;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 4px 0 12px;
}

.help {
  font-size: 14px;
  color: rgba(241, 237, 228, 0.6);
}
.help summary {
  cursor: pointer;
}
.help ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.mes-tours {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  margin: 4px 0 12px;
  border-radius: 12px;
  font-size: 15px;
  color: #f1ede4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(241, 237, 228, 0.14);
  text-decoration: none;
}
