/* Lecteur public de DémoPlan : sombre, couleur principale de la publication (--accent), lisible en iframe 16:9. */
:root { color-scheme: dark; --bg: #0f0d24; --bar: #1b1840; --text: #f4f3fa; --muted: #b9b7d6; --accent: #d62b4e; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
#lecteur { display: flex; flex-direction: column; height: 100%; }
.frame { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; background: #000; }
video { width: 100%; height: 100%; flex: 1 1 0; min-height: 0; object-fit: contain; background: #000; display: block; cursor: pointer; }
video::cue { font-size: 1.15em; background: rgba(15, 13, 36, 0.85); }
.seek { flex: none; position: relative; height: 18px; background: var(--bar); padding: 0 12px; display: flex; align-items: center; }
.seek input { width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
.marks { position: absolute; inset: 0 12px; pointer-events: none; }
.marks i { position: absolute; top: 5px; width: 2px; height: 8px; background: var(--text); opacity: 0.55; }
.bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 12px 10px; background: var(--bar); }
.time { font: 500 12.5px/1 ui-monospace, "JetBrains Mono", monospace; color: var(--muted); white-space: nowrap; }
.spacer { flex: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon, .chip { border: 0; background: rgba(255, 255, 255, 0.08); color: var(--text); border-radius: 8px; height: 32px; min-width: 36px; padding: 0 10px; font-weight: 600; }
.icon:hover, .chip:hover { background: rgba(255, 255, 255, 0.16); }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.menu { position: absolute; right: 12px; bottom: 64px; min-width: 220px; padding: 6px; background: #181536; border: 1px solid #3d3a6b; border-radius: 12px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5); }
.menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; }
.menu button[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.menu button:hover { background: rgba(255, 255, 255, 0.08); }
.menu small { color: var(--muted); }
.chapters { flex: none; margin: 0; padding: 8px 12px; list-style: none; display: flex; gap: 6px; overflow-x: auto; background: var(--bg); }
.chapters button { border: 1px solid #3d3a6b; background: transparent; border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.parts { padding-bottom: 0; }
.parts button[aria-current="true"] { border-color: var(--accent); }
.chapters .at { color: var(--muted); margin-right: 6px; font-family: ui-monospace, monospace; font-size: 12px; }
.message { margin: auto; padding: 32px 24px; text-align: center; display: flex; flex-direction: column; gap: 6px; max-width: 480px; }
.message strong { font-size: 18px; }
.message span { color: var(--muted); }
.message .retry, .notice .retry { align-self: center; margin-top: 8px; }
/* Mise en tampon et lecture interrompue : par-dessus la vidéo, sans couvrir la barre. */
.buffering, .notice { position: absolute; z-index: 3; left: 50%; top: 40%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 18px; border-radius: 12px; background: rgba(15, 13, 36, 0.85); text-align: center; max-width: min(420px, calc(100% - 24px)); }
.buffering { flex-direction: row; pointer-events: none; }
.buffering i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: var(--accent); animation: tourne 0.9s linear infinite; }
.notice span { color: var(--muted); }
@keyframes tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .buffering i { animation: none; } }
@media (max-width: 480px) { .time { display: none; } .menu { left: 12px; right: 12px; } }

/* Couche avatar (Lot 2 E4) : vidéo carrée superposée, forme et coin choisis par le studio, masquable et déplaçable. */
.avatar { position: absolute; z-index: 2; aspect-ratio: 1 / 1; overflow: visible; transition: opacity .2s; }
.avatar[data-corner="bottomRight"] { right: 16px; bottom: 78px; }
.avatar[data-corner="bottomLeft"] { left: 16px; bottom: 78px; }
.avatar[data-corner="topRight"] { right: 16px; top: 16px; }
.avatar[data-corner="topLeft"] { left: 16px; top: 16px; }
.avatar video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1F1C43; box-shadow: 0 8px 24px rgba(15, 13, 36, .3); }
.avatar[data-shape="circle"] video { border-radius: 50%; }
.avatar[data-shape="rounded"] video { border-radius: 18%; }
.avatar[data-shape="rectangle"] video { border-radius: 8px; }
.avatar.off { opacity: 0; pointer-events: none; }
.av-tools { position: absolute; top: -6px; right: -6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.avatar:hover .av-tools, .avatar:focus-within .av-tools { opacity: 1; }
.av-tool { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(15, 13, 36, .85); color: #fff; cursor: pointer; }
.av-show { position: absolute; z-index: 2; right: 16px; bottom: 72px; height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(15, 13, 36, .85); color: #fff; font: 600 12.5px system-ui, sans-serif; cursor: pointer; }
@media (max-width: 480px) { .avatar[data-corner^="bottom"] { bottom: 62px; } .av-show { bottom: 58px; } }
/* Écrans tactiles : cibles d'au moins 44 px. */
@media (pointer: coarse) {
  .icon, .chip { height: 44px; min-width: 44px; }
  .menu button, .chapters button { min-height: 44px; }
  .av-tool { width: 44px; height: 44px; }
  .av-show { height: 44px; bottom: 96px; }
  .seek { height: 28px; }
  .menu { bottom: 96px; }
  .avatar[data-corner^="bottom"] { bottom: 100px; }
}
