/* ==========================================================================
   css/cinematic.css — story-cinematic overlay (#cine-root, spec §3.1/§3.2/§6).
   Z tier: the whole overlay is z-index 60 (01 §2.10 "60 cutchrome / 62 cards /
   64 SKIP" — children stack INSIDE the overlay's own stacking context, so no
   existing rule needs renumbering).  It sits above #hud (z 10) and toasts
   (z 46) and below the modal tiers (namecard 95/96, referral 97, admin 100).
   Letterbox = the overlay's own black background wherever the 16:9 stage does
   not fill the viewport (gallery 08 §4: full-bleed picture, NO DOM bars).
   ========================================================================== */

#cine-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
}

/* ---- the 16:9 picture block: fixed 480×270 backing, CSS-scaled (DPR-free) ---- */
#cine-stage {
  position: relative;
  flex: 0 0 auto;
  line-height: 0;
  background: #000;
}
#cine {
  display: block;
  width: 480px;               /* overwritten by the engine's sizeStage() */
  height: 270px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #000;
}

/* ---- DOM caption strip: directly BELOW the picture, inside the overlay ---- */
#cine-text {
  box-sizing: border-box;
  flex: 0 0 auto;
  height: 64px;               /* FIXED: stage sizing never reflows mid-shot */
  padding: 3px 8px;
  background: #2a2418;        /* toast-chrome strip colours (gallery capstrip) */
  border: 2px solid #8a6a3a;
  border-top-width: 0;
  color: #e8d8b8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  overflow: hidden;
  text-align: center;
  line-height: 1.1;
}
#cine-text canvas { image-rendering: pixelated; }
#cine-text:empty::after { content: "\00a0"; }

/* ---- SKIP: small chrome, ≥44 px hit area, top-right, 0.5 s entry guard ---- */
.cine-skip {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top, 0px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  min-height: 44px;
  min-width: 56px;
  padding: 8px 10px;
  font-size: 11px;
  background: #26301c;
  z-index: 64;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s linear;
}
.cine-skip.on {                       /* added 0.5 s after mount */
  opacity: 1;
  pointer-events: auto;
}
.cine-skip.voted {                    /* co-op vote cast: locked + idempotent */
  background: #1b1f30;
  color: #9fb0d8;
  cursor: default;
}

/* ---- co-op vote chip: pinned under SKIP, hidden unless a vote is running ---- */
.cine-skipstat {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: calc(8px + env(safe-area-inset-right, 0px));
  font-size: 11px;
  z-index: 64;
}
.cine-skipstat[hidden],
.cine-skipstat[style*="display: none"] { display: none !important; }

/* ---- phone: shorter caption strip (stage width snaps ≤1×, §3.2) ---- */
@media (max-width: 760px) {
  #cine-text { height: 48px; font-size: 11px; padding: 2px 6px; }
  .cine-skip { font-size: 11px; }
}

/* ---- reduced motion: keep the chrome, drop the movement (01 §4.8) ---- */
@media (prefers-reduced-motion: reduce) {
  .cine-skip { transition: none; }
}
