/* Mode diaporama du lecteur : panneau d'édition des vues + barre de lecture (js/play/presentation.js) */

/* ---------- panneau d'édition ---------- */
#panel-pres { position: fixed; top: 64px; right: 14px; bottom: 14px; width: 350px; z-index: 11; display: flex; flex-direction: column; padding: 4px 14px 14px;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--glass-line); border-radius: 18px; box-shadow: 0 18px 50px -18px rgba(22, 26, 37, .45);
  backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3); overflow-y: auto;
  transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; transition: transform .38s var(--ease), opacity .25s ease; }
#panel-pres.open { transform: none; opacity: 1; pointer-events: auto; }
.pres-head { display: flex; align-items: center; justify-content: space-between; }
.pres-head h3 { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }
.pres-head h3 .i { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.pres-head h3 .n { font-size: .74rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--surface3); color: var(--muted); }
.pres-help { margin: 0 0 10px; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.pres-actions { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-bottom: 12px; }
.pres-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pres-card { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.pres-card.on { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-ring); }
.pres-thumb { position: relative; width: 96px; height: 54px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface3); cursor: pointer; display: grid; place-items: center; color: var(--faint); }
.pres-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s var(--ease); }
.pres-thumb:hover img { transform: scale(1.06); }
.pres-thumb em { position: absolute; left: 4px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(22, 26, 37, .78); color: #fff; font: 700 .7rem/18px system-ui; text-align: center; font-style: normal; }
.pres-fields { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pres-fields input[type=text], .pres-fields textarea, .pres-fields select, .pres-row input { border: 1px solid var(--line2); border-radius: 7px; background: var(--field); padding: 4px 7px; font-size: .8rem; min-width: 0; }
.pres-fields input[type=text] { font-weight: 650; }
.pres-fields textarea { resize: vertical; min-height: 28px; font-size: .76rem; }
.pres-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.pres-row label { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); }
.pres-row input[type=number] { width: 52px; }
.pres-tools { grid-column: 1; display: flex; gap: 0; align-items: center; }
.pres-tools .btn { width: 24px; height: 24px; min-width: 0; padding: 0; justify-content: center; }
.pres-opts { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: .82rem; }
.pres-opts label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pres-opts small { color: var(--faint); font-size: .72rem; }
#btn-pres.has::after { content: ''; width: 6px; height: 6px; margin-left: 2px; border-radius: 50%; background: var(--accent); }

/* ---------- lecture ---------- */
body.presenting #hud-top, body.presenting #minimap, body.presenting #help, body.presenting #crosshair, body.presenting #prompt, body.presenting #zone-toast,
body.presenting #build-bar, body.presenting #build-panel, body.presenting #touch-ui, body.presenting #panel-pres { display: none !important; }
body.presenting canvas { cursor: none; }
body.presenting.pres-ui canvas { cursor: default; }
#pres-hud { position: fixed; inset: auto 0 0 0; z-index: 16; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 16px 22px; pointer-events: none; }
#pres-hud > * { pointer-events: auto; }
.pres-caption { max-width: min(760px, 92vw); padding: 14px 22px; border-radius: 16px; text-align: center; color: #fff; background: rgba(14, 18, 28, .62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: pres-in .5s var(--ease); pointer-events: none; }
.pres-caption.empty { display: none; }
.pres-caption b { display: block; font-size: clamp(1.1rem, 2.6vw, 1.7rem); font-weight: 750; letter-spacing: -.02em; }
.pres-caption b:empty { display: none; }
.pres-caption p { margin: 4px 0 0; font-size: clamp(.86rem, 1.6vw, 1.05rem); line-height: 1.45; color: rgba(255, 255, 255, .9); white-space: pre-line; }
.pres-caption p:empty { display: none; }
.pres-controls { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: 999px; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s var(--ease); }
body.pres-ui .pres-controls { opacity: 1; transform: none; }
.pres-controls .btn.icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 50%; background: transparent; border-color: transparent; box-shadow: none; }
.pres-controls .btn.icon:hover:not(:disabled) { background: rgba(22, 26, 37, .07); }
.pres-controls .btn.on { background: var(--accent-soft); color: var(--accent); }
.pres-controls .sep { width: 1px; height: 20px; background: var(--line2); margin: 0 4px; }
#pres-count { min-width: 56px; text-align: center; font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.pres-progress { position: fixed; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .25); pointer-events: none; }
.pres-progress span { display: block; height: 100%; background: var(--accent); transition: width .5s var(--ease); }
@keyframes pres-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 760px) { #panel-pres { width: auto; left: 14px; top: auto; height: 55vh; } }
.pres-tools .btn:first-child .i { transform: rotate(-90deg); }
.pres-row select { flex: 1 1 70px; }
