/* Page de lecture — palette alignée sur le logo MB */
:root {
  --brand: #1a5bc8;
  --brand-hi: #4d8df5;
  --accent: var(--brand-hi);
  --bg: #0b0d12;
  --panel: #141821;
  --panel-2: #1b2030;
  --line: #262c3b;
  --fg: #eef1f7;
  --muted: #8f98ad;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

body.lock { overflow: hidden; }
[hidden] { display: none !important; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; }

/* ---------- En-tête ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.me { display: flex; align-items: center; gap: 10px; }
.who { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(77, 141, 245, .14);
  color: var(--brand-hi);
  font-size: 13px;
  font-weight: 700;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--panel-2); color: var(--fg); border-color: var(--line); }
@media (pointer: coarse) { .icon-btn { width: 42px; height: 42px; } }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

@media (min-width: 900px) {
  .page { padding: 0 16px 48px; }
  .player:not(.is-fs) { border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
}

/* ---------- Infos sous la vidéo ---------- */

.info { padding: 18px 16px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(77, 141, 245, .14);
  color: var(--brand-hi);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.soft { background: var(--panel-2); color: var(--muted); }
.title { margin: 0; font-size: clamp(20px, 4.4vw, 28px); font-weight: 750; line-height: 1.25; letter-spacing: -.01em; }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.next-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--fg);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  transition: border-color .2s, background .2s, transform .15s;
}
.next-card:hover { border-color: var(--brand-hi); background: var(--panel-2); }
.next-card:active { transform: scale(.985); }
.next-card:hover .chev { stroke: var(--brand-hi); transform: translateX(2px); }
.next-card .thumb { box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.thumb { position: relative; flex: none; width: 128px; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
}
.thumb-play::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  border-left: 11px solid #fff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}
.next-text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.next-text small { color: var(--brand-hi); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.next-text b { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.next-text span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-card .chev { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s, transform .2s; }

/* ---------- Quiz ---------- */

.quiz { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.quiz-head { display: flex; align-items: center; gap: 12px; }
.quiz-icon { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(77, 141, 245, .14); }
.quiz-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--brand-hi); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.quiz-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.quiz-text span { color: var(--muted); font-size: 13px; }
.quiz-head .pill { flex: none; min-height: 44px; }
.quiz-form { display: grid; gap: 14px; margin-top: 16px; }
.quiz-q { margin: 0; padding: 0; border: 0; min-width: 0; }
.quiz-q legend { display: flex; gap: 10px; padding: 0; margin-bottom: 10px; font-weight: 650; line-height: 1.4; }
.quiz-n { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--panel-2); color: var(--brand-hi); font-size: 13px; }
.quiz-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-choice input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brand-hi); }
.quiz-choice:has(input:checked) { border-color: var(--brand-hi); background: rgba(77, 141, 245, .12); }
.quiz-q .quiz-choice.right { border-color: #4ade80; background: rgba(74, 222, 128, .12); }
.quiz-q .quiz-choice.wrong { border-color: #f87171; background: rgba(248, 113, 113, .12); }
.quiz-choice.right::after { content: "✓"; margin-left: auto; color: #4ade80; font-weight: 800; }
.quiz-choice.wrong::after { content: "✗"; margin-left: auto; color: #f87171; font-weight: 800; }
.quiz-q:disabled .quiz-choice { cursor: default; }
.quiz-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.quiz-actions .pill { min-height: 48px; }
.quiz-actions .pill:disabled { opacity: .45; cursor: not-allowed; }
.quiz-left, .quiz-error { color: var(--muted); font-size: 14px; }
.quiz-error { margin: 0; color: #f87171; }
.quiz-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px; border-radius: 12px; background: var(--panel-2); }
.quiz-result b { font-size: 26px; font-weight: 800; }
.quiz-result span { flex: 1; min-width: 160px; color: var(--muted); }
.quiz-result.top b { color: #4ade80; }
.quiz-result.mid b { color: #fbbf24; }
.quiz-result.low b { color: #f87171; }

.tips { margin: 18px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tips kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--fg);
  font: 600 12px ui-monospace, Consolas, monospace;
  text-align: center;
}
.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--brand-hi);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.back:hover { background: rgba(77, 141, 245, .1); border-color: var(--brand-hi); }

/* ---------- Lecteur ---------- */

.player {
  position: relative;
  background: #000;
  user-select: none;
  -webkit-user-select: none;
}

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  background: #000;
}

.yt-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Iframe plus haute que la scène : la vidéo 16/9 reste entière (centrée),
   seules les bandes noires du haut et du bas — où YouTube affiche titre et logo — sont rognées. */
.yt-crop iframe {
  position: absolute;
  left: 0;
  top: -60px;
  width: 100%;
  height: calc(100% + 120px);
  border: 0;
  pointer-events: none;
}

.shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
}

/* Éléments affichés selon l'état (data-state) */
.poster, .big-play, .spinner, .endscreen, .message, .controls, .overlay-top, .center-btn { display: none; }

[data-state="loading"] .poster,
[data-state="ready"] .poster,
[data-state="starting"] .poster { display: grid; }

[data-state="ready"] .big-play { display: grid; }

[data-state="loading"] .spinner,
[data-state="starting"] .spinner,
[data-state="buffering"] .spinner { display: block; }

[data-state="playing"] .controls,
[data-state="paused"] .controls,
[data-state="buffering"] .controls { display: block; }

[data-state="playing"] .center-btn,
[data-state="paused"] .center-btn { display: grid; }

.player.is-fs[data-state="playing"] .overlay-top,
.player.is-fs[data-state="paused"] .overlay-top,
.player.is-fs[data-state="buffering"] .overlay-top { display: flex; }

[data-state="ended"] .endscreen { display: grid; }

[data-state="error"] .message,
[data-state="tapthrough"] .message { display: grid; }

/* Secours iOS : on laisse l'utilisateur toucher directement l'iframe pour la 1re lecture */
[data-state="tapthrough"] .shield { display: none; }
[data-state="tapthrough"] .yt-crop,
[data-state="tapthrough"] .yt-crop iframe { pointer-events: auto; }

/* Masquage automatique pendant la lecture */
.controls, .overlay-top, .center-btn { transition: opacity .25s; }
.player.idle[data-state="playing"] .controls,
.player.idle[data-state="playing"] .overlay-top,
.player.idle[data-state="playing"] .center-btn { opacity: 0; pointer-events: none; }
.player.idle[data-state="playing"] .shield { cursor: none; }

.poster {
  position: absolute;
  inset: 0;
  z-index: 3;
  place-items: center;
  background: #000;
}
.poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .7;
}

.big-play, .center-btn {
  position: relative;
  place-items: center;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(26, 91, 200, .92);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  transition: transform .15s, opacity .25s, background .15s;
}
.big-play:hover, .center-btn:hover { transform: scale(1.06); background: var(--brand-hi); }
.big-play svg, .center-btn svg { width: 36px; height: 36px; fill: currentColor; }
.big-play svg, .center-btn.is-play svg { margin-left: 4px; }

.center-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  margin: -38px 0 0 -38px;
}
[data-state="playing"] .center-btn { background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border: 4px solid rgba(255, 255, 255, .18);
  border-top-color: var(--brand-hi);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Titre en haut de l'image (plein écran) */
.overlay-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 5;
  flex-direction: column;
  gap: 2px;
  padding: max(14px, env(safe-area-inset-top)) 20px 40px;
  background: linear-gradient(rgba(0, 0, 0, .75), transparent);
  pointer-events: none;
}
.overlay-top span { color: #c8d3ea; font-size: 13px; }
.overlay-top b { font-size: 18px; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
@media (orientation: portrait) {
  .overlay-top { padding: 10px 14px 28px; }
  .overlay-top span { display: none; }
  .overlay-top b { font-size: 15px; }
}

/* Double-tap ±10 s */
.ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38%;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .16), transparent 70%);
}
.ripple.left { left: 0; border-radius: 0 50% 50% 0 / 0 50% 50% 0; }
.ripple.right { right: 0; border-radius: 50% 0 0 50% / 50% 0 0 50%; }
.ripple span { color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.ripple.show { animation: ripple .6s ease-out; }
@keyframes ripple { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }

/* Reprise de lecture */
.resume {
  position: absolute;
  left: 12px;
  bottom: 74px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: rgba(16, 20, 32, .9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13.5px;
  animation: rise .35s ease-out;
}
.resume button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Écran de fin (recouvre les suggestions YouTube) ---------- */

.endscreen {
  position: absolute;
  inset: 0;
  z-index: 6;
  place-items: center;
  overflow: hidden;
  background: #000;
}
.end-bg {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(18px) brightness(.4);
}
.end-content {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(460px, 100%);
  padding: 16px;
  animation: rise .4s ease-out;
}
.end-kicker { margin: 0; color: #c8d3ea; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.next-card.big { width: 100%; margin: 0; background: rgba(20, 24, 33, .85); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font: 600 15px/1 inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}
.pill.ghost { background: rgba(255, 255, 255, .14); }
.pill.ghost:hover { background: rgba(255, 255, 255, .22); }
.pill svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Message d'erreur / aide iOS ---------- */

.message {
  position: absolute;
  inset: 0;
  z-index: 7;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, #151b2b, #000 70%);
  text-align: center;
  line-height: 1.5;
}
.message p { margin: 0; max-width: 42ch; color: #c8d3ea; }
.msg-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: rgba(248, 113, 113, .14);
  color: #f87171;
  font-size: 24px;
  font-weight: 800;
}
.msg-title { font-size: 18px; }
.msg-help { color: var(--muted); font-size: 13px; }

[data-state="tapthrough"] .message {
  inset: 0 0 auto 0;
  padding: 10px;
  background: rgba(0, 0, 0, .75);
  font-size: 14px;
  pointer-events: none;
}
[data-state="tapthrough"] .msg-icon,
[data-state="tapthrough"] .msg-title,
[data-state="tapthrough"] .msg-help { display: none; }

/* ---------- Barre de contrôle ---------- */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 40px 8px max(4px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .82));
}

.bar { display: flex; align-items: center; gap: 2px; }

.ctl {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff;
  font: 700 13px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.ctl:hover, .ctl:focus-visible { background: rgba(255, 255, 255, .14); }
.ctl svg { width: 24px; height: 24px; fill: currentColor; }
.ctl svg.stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctl svg text { fill: currentColor; stroke: none; font: 800 7.5px system-ui, sans-serif; }

.time {
  margin-left: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: .92;
}
.spacer { flex: 1; }

/* Volume : le curseur se déploie au survol (ordinateur) */
.vol { display: flex; align-items: center; }
.volume { width: 0; height: 20px; opacity: 0; transition: width .2s, opacity .2s, margin .2s; }
.vol:hover .volume, .vol:focus-within .volume { width: 80px; opacity: 1; margin: 0 8px 0 2px; }

/* Vitesse */
.speed { position: static; } /* le menu se place par rapport à la barre de contrôle */
.speed-btn { width: auto; min-width: 44px; padding: 0 8px; font-size: 14px; }
/* Rangée horizontale : tient même dans la petite image d'un téléphone tenu droit */
.speed-menu {
  position: absolute;
  right: 8px;
  bottom: 54px;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 16px);
  overflow-x: auto;
  padding: 5px;
  border-radius: 999px;
  background: rgba(20, 24, 33, .96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  white-space: nowrap;
}
.speed-menu p { margin: 0 6px 0 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
.speed-menu button {
  min-width: 42px;
  padding: 7px 9px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.speed-menu button:hover { background: rgba(255, 255, 255, .1); }
.speed-menu button[aria-checked="true"] { background: var(--brand); }

/* Barre de progression : s'épaissit au survol, bulle de temps */
.seek-wrap { position: relative; padding: 0 6px; }
.seek-tip {
  position: absolute;
  bottom: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: #0b0d12;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}
.seek-tip.show { opacity: 1; }

input[type="range"] {
  --p: 0%;
  --b: 0%;
  --h: 4px;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: var(--h);
  border-radius: 3px;
  background: linear-gradient(to right,
    var(--brand-hi) var(--p),
    rgba(255, 255, 255, .45) var(--p) var(--b),
    rgba(255, 255, 255, .2) var(--b));
  transition: height .12s;
}
input[type="range"]::-moz-range-track {
  height: var(--h);
  border-radius: 3px;
  background: linear-gradient(to right,
    var(--brand-hi) var(--p),
    rgba(255, 255, 255, .45) var(--p) var(--b),
    rgba(255, 255, 255, .2) var(--b));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: calc((var(--h) - 14px) / 2);
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(77, 141, 245, .35);
  transform: scale(var(--thumb, 1));
  transition: transform .12s;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.seek { display: block; width: 100%; height: 22px; }
@media (hover: hover) {
  .seek { --thumb: 0; }
  .seek-wrap:hover .seek, .seek:focus-visible { --h: 6px; --thumb: 1; }
}

/* Mobile */
@media (hover: none) { .volume { display: none; } }
@media (max-width: 640px) {
  .who { display: none; }
  .brand { font-size: 15px; }
  .thumb { width: 112px; }
  .center-btn { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .center-btn svg { width: 30px; height: 30px; }
  .ctl { width: 40px; height: 40px; }
  .resume { bottom: 64px; }
}
@media (max-width: 420px) { .speed-menu p { display: none; } }
@media (max-width: 360px) { #backBtn, #fwdBtn { display: none; } }

/* ---------- Écran d'accueil (splash) ---------- */
/* Chronologie : 0,1 s le M et le B arrivent → 0,72 s impact + onde → 1 s reflet
   → 1,15 s titres → 1,7 s bouton « Regarder » (dès que la vidéo est prête). */

.splash {
  --brand: #1a5bc8;
  --brand-hi: #3f80ee;
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: #04060c;
  text-align: center;
  cursor: default;
}

.splash-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 42%, rgba(26, 91, 200, .45), transparent 42%),
    radial-gradient(circle at 50% 120%, rgba(63, 128, 238, .18), transparent 55%);
  animation: glowIn 1.2s ease-out both, breathe 4s 2s ease-in-out infinite;
  pointer-events: none;
}

.splash-logo {
  position: relative;
  width: min(46vw, 34vh, 240px);
  aspect-ratio: 1;
  animation: impact .55s .72s cubic-bezier(.3, 1.6, .5, 1) both, float 5s 2.2s ease-in-out infinite;
}
.splash-logo svg {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 30px rgba(26, 91, 200, .55));
}

.piece {
  transform-box: fill-box;
  transform-origin: center;
  animation: .7s cubic-bezier(.16, 1.12, .3, 1) both;
}
.piece-m { animation-name: flyM; animation-delay: .1s; }
.piece-b { animation-name: flyB; animation-delay: .14s; }

.shine {
  transform-box: fill-box;
  animation: shine 1s 1s cubic-bezier(.45, 0, .25, 1) both;
}

.shock {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--brand-hi);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.4);
  animation: shock .9s .72s cubic-bezier(.2, .7, .3, 1) forwards; /* pas "both" : invisible pendant le délai */
  pointer-events: none;
}
.shock.late { border-width: 1px; animation-delay: .84s; animation-duration: 1.1s; }

.splash-sub,
.splash-title {
  position: relative;
  max-width: 34ch;
  margin: 0;
  animation: rise .7s cubic-bezier(.2, .8, .2, 1) both;
}
.splash-sub {
  margin-top: 34px;
  color: #8ea6d6;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  animation-delay: 1.15s;
}
.splash-title {
  margin-top: 8px;
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 700;
  line-height: 1.25;
  animation-delay: 1.27s;
}

.splash-action {
  position: relative;
  display: grid;
  place-items: center;
  height: 64px;
  margin-top: 30px;
}
.splash-action > * { grid-area: 1 / 1; }

.splash-loader {
  display: flex;
  gap: 8px;
  animation: rise .5s 1.6s both;
}
.splash-loader i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-hi);
  animation: dot 1s ease-in-out infinite;
}
.splash-loader i:nth-child(2) { animation-delay: .15s; }
.splash-loader i:nth-child(3) { animation-delay: .3s; }

.splash-play {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px 16px 24px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font: 700 17px/1 inherit;
  font-family: inherit;
  letter-spacing: .02em;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.9);
  transition: opacity .45s, transform .45s cubic-bezier(.3, 1.5, .5, 1), visibility 0s .45s;
  box-shadow: 0 10px 40px rgba(26, 91, 200, .5);
}
.splash-play svg { width: 22px; height: 22px; fill: currentColor; }
.splash-play::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .5);
  animation: pulse 2s 1s infinite;
}
.splash-play:hover, .splash-play:focus-visible { transform: scale(1.05); }

.splash.ready .splash-loader { visibility: hidden; }
.splash.ready .splash-play {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .45s, transform .45s cubic-bezier(.3, 1.5, .5, 1);
}
.splash.ready { cursor: pointer; }

/* Sortie : le logo plonge vers l'utilisateur, l'écran s'efface sur la vidéo */
.splash.leaving { pointer-events: none; animation: fadeOut .5s .1s ease-in both; }
.splash.leaving .splash-logo { animation: zoomOut .6s cubic-bezier(.6, 0, .8, .4) both; }
.splash.leaving .splash-sub,
.splash.leaving .splash-title,
.splash.leaving .splash-action { animation: sink .3s ease-in both; }

@keyframes glowIn { from { opacity: 0; transform: scale(.7); } }
@keyframes breathe { 50% { opacity: .7; transform: scale(1.06); } }
@keyframes flyM {
  from { opacity: 0; transform: translateX(-160%) rotate(-28deg) scale(.7); }
  60% { opacity: 1; }
}
@keyframes flyB {
  from { opacity: 0; transform: translateX(160%) rotate(28deg) scale(.7); }
  60% { opacity: 1; }
}
@keyframes impact {
  0% { transform: scale(1); }
  35% { transform: scale(1.09); }
  100% { transform: scale(1); }
}
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes shine {
  from { transform: translateX(0); }
  to { transform: translateX(760px); }
}
@keyframes shock {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.1); }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes dot { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); } 100% { box-shadow: 0 0 0 18px rgba(255, 255, 255, 0); } }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }
@keyframes zoomOut { to { opacity: 0; transform: scale(2.4); } }
@keyframes sink { to { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) {
  .splash *, .splash *::after { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .splash.leaving { animation-duration: .2s; }
}

/* ---------- Invitation à tourner le téléphone ---------- */

.rotate-hint {
  position: fixed;
  left: 50%;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(calc(100vw - 32px), 380px);
  padding: 12px 10px 12px 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: rgba(16, 20, 32, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  color: #fff;
  transform: translateX(-50%);
  animation: hintIn .5s cubic-bezier(.2, 1.2, .4, 1) both;
}
.rotate-hint.leaving { animation: hintOut .3s ease-in both; }

.rotate-icon { flex: none; width: 56px; height: 56px; overflow: visible; }
.rotate-icon * { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rotate-icon .screen { fill: rgba(63, 128, 238, .35); stroke: none; }
.rotate-icon .play { fill: #fff; stroke: none; }

/* Le téléphone pivote d'un quart de tour, marque une pause en paysage, puis recommence */
.rotate-phone {
  transform-box: fill-box;
  transform-origin: center;
  animation: phoneTurn 2.8s cubic-bezier(.65, 0, .35, 1) infinite;
}
.rotate-arrow path { stroke: #3f80ee; }
.rotate-arrow {
  stroke-dasharray: 40;
  animation: arrowDraw 2.8s ease-in-out infinite;
}

.rotate-text { display: grid; gap: 2px; min-width: 0; font-size: 13px; line-height: 1.35; }
.rotate-text strong { font-size: 15px; }
.rotate-text span { color: #a9b4cc; }

.rotate-close {
  flex: none;
  align-self: flex-start;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #c9d1e4;
  font-size: 14px;
  cursor: pointer;
}

@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 24px) scale(.96); } }
@keyframes hintOut { to { opacity: 0; transform: translate(-50%, 16px); } }
@keyframes phoneTurn {
  0%, 18% { transform: rotate(0); }
  45%, 78% { transform: rotate(90deg); }
  100% { transform: rotate(0); }
}
@keyframes arrowDraw {
  0%, 8% { stroke-dashoffset: 40; opacity: 1; }
  40% { stroke-dashoffset: 0; opacity: 1; }
  75% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 40; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rotate-phone { animation: none; transform: rotate(90deg); }
  .rotate-arrow { animation: none; stroke-dashoffset: 0; }
}

/* ---------- Plein écran (natif ou simulé sur iPhone) ---------- */

.player.is-fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}
.player.is-fs .stage {
  width: min(100vw, 177.78vh);
  width: min(100vw, 177.78dvh);
}

/* Écran noir anti-capture : couvre tout le lecteur, y compris en plein écran */
.privacy {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  background: #000;
  color: #9aa3b2;
  font-size: 14px;
}
.privacy[hidden] { display: none; }
.privacy b { color: #fff; font-size: 17px; }

/* ---------- Retour visuel à l'appui (écrans tactiles) ---------- */

.ctl, .pill, .resume button, .speed-menu button, .icon-btn, .rotate-close { transition: background .15s, transform .1s; }
.ctl:active, .pill:active, .resume button:active, .speed-menu button:active, .icon-btn:active, .rotate-close:active { transform: scale(.92); }
.big-play:active, .center-btn:active { transform: scale(.94); }

/* ---------- Mouvement réduit (hors écran d'accueil, déjà géré) ---------- */

@media (prefers-reduced-motion: reduce) {
  .resume, .end-content, .rotate-hint, .ripple.show { animation-duration: .01ms !important; }
  .spinner { animation-duration: 1.6s; }
  .next-card, .next-card .chev, .big-play, .center-btn { transition: none; }
}
