/* The cinema is in the browser's top layer; the page stays inert beneath it. */
body.cinema-open { overflow: hidden; }
dialog.stage-screen {
  --cinema-accent: #b1ccff;
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(1rem, 2.2vw, 2rem);
  border: 0;
  border-radius: 0;
  overflow: auto;
  color: #f0f4fc;
  background: #07090c;
  backdrop-filter: blur(20px);
  box-shadow: none;
  grid-template-rows: auto auto minmax(min(25svh, 12rem), 1fr);
  grid-auto-rows: auto;
  gap: .75rem;
  isolation: isolate;
  animation: cinema-open .25s ease-out both;
}
dialog.stage-screen[open] { display: grid; }
dialog.stage-screen::backdrop { background: #030407ef; }
dialog.stage-screen::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(0deg,#07090ce8,transparent 65%),radial-gradient(ellipse at 85% 5%,color-mix(in srgb,var(--cinema-accent) 9%,transparent),transparent 65%); }
.cinema-ambient { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: blur(40px) saturate(.75); opacity: .2; pointer-events: none; }
dialog.stage-screen .stage-screen-bar { order: 0; gap: 1.25rem; padding-bottom: .8rem; border-bottom: 1px solid #ffffff24; }
dialog.stage-screen h2 {
  font: 600 clamp(1.2rem, 2.3vw, 2rem)/1.15 var(--display);
  letter-spacing: -.035em;
  max-width: 45ch;
  overflow-wrap: anywhere;
}
dialog.stage-screen .cinema-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; flex-shrink: 0; }
dialog.stage-screen .stage-action { min-height: 2.75rem; border: 1px solid #ffffff50; border-radius: .2rem; background: #141a25; color: #edf3ff; font-size: .875rem; }
dialog.stage-screen .stage-action:hover { background: #b1ccff; color: #07090c; border-color: #b1ccff; }
dialog.stage-screen .stage-screen-media { order: 2; min-width: 0; min-height: 0; container-type: size; display: grid; place-items: center; }
dialog.stage-screen video {
  --stage-ratio: 1.77778;
  width: min(100cqw, calc(100cqh * var(--stage-ratio)));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: var(--stage-ratio);
  object-fit: contain;
  background: #000;
  box-shadow: 0 0 0 1px #ffffff18, 0 2rem 5rem #0008;
}
.cinema-project-context { order: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: .2rem 0 .65rem; }
.cinema-context-copy { min-width: 0; }
.cinema-context-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; max-width: none; color: var(--cinema-accent); font: 700 .875rem/1.5 var(--body); }
.cinema-duration { color: #b9c5d8; font-variant-numeric: tabular-nums; }
.cinema-duration::before { content: ''; display: inline-block; height: .75rem; width: 1px; background: #b9c5d84d; margin-right: 1rem; vertical-align: middle; }
.cinema-project-note { max-width: 65ch; margin-top: .25rem; color: #c3ccda; font-size: 1rem; line-height: 1.6; }
.cinema-control.cinema-inquiry { flex-shrink: 0; background: var(--cinema-accent); color: #07090c; border-color: var(--cinema-accent); }
.cinema-control.cinema-inquiry:hover { background: #edf3ff; border-color: #edf3ff; }
.cinema-toolbar { order: 5; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem 1rem; border-top: 1px solid #ffffff24; padding-top: .8rem; }
.cinema-film-navigation, .cinema-recovery { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.cinema-control {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem; padding: .55rem .85rem;
  background: #121721; color: #e6edfa; border: 1px solid #465269; border-radius: .2rem;
  font: 700 .875rem/1.3 var(--body); text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.cinema-control:hover { background: #b1ccff; color: #07090c; border-color: #b1ccff; }
.cinema-count { min-width: 4.5rem; text-align: center; color: #b0bed3; font: 500 .875rem/1.3 var(--body); font-variant-numeric: tabular-nums; }
.cinema-next-summary { max-width: 28ch; margin-inline-start: .5rem; color: #b8c4d6; font-size: .875rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
dialog.stage-screen .stage-screen-status { order: 3; margin: 0; max-width: none; min-height: 1.4rem; color: #b8c8e3; font-size: .875rem; }
dialog.stage-screen[data-playback="error"] .stage-screen-status { color: #ffc0c8; }
dialog.stage-screen .stage-screen-status:empty { display: none; }
.cinema-share-status { order: 6; margin: 0; max-width: 100%; color: var(--cinema-accent); font-size: .875rem; line-height: 1.6; overflow-wrap: anywhere; }
.cinema-share-status a { text-underline-offset: .2em; }
.cinema-end-card { order: 4; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 1.1rem; padding: .9rem 1rem; background: #0b111bd9; border: 1px solid #ffffff26; border-left: 3px solid var(--cinema-accent); }
.cinema-next-art { width: 7rem; height: 4.2rem; object-fit: cover; border: 1px solid #ffffff30; }
.cinema-end-label { margin-bottom: .2rem; color: var(--cinema-accent); font-size: .8125rem; font-weight: 700; }
dialog.stage-screen .cinema-next-title { font: 600 clamp(1.05rem,1.8vw,1.55rem)/1.2 var(--display); letter-spacing: -.025em; }
.cinema-next-category { margin-top: .2rem; color: #aab8cc; font-size: .875rem; }
.cinema-end-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cinema-end-actions [data-cinema-watch-next] { border-color: var(--cinema-accent); color: var(--cinema-accent); }
.cinema-end-actions [data-cinema-watch-next]:hover { color: #07090c; background: var(--cinema-accent); }
@keyframes cinema-open { from { opacity: 0; transform: scale(.99); } to { opacity: 1; transform: none; } }
@media (max-width: 1100px) { .cinema-next-summary { display: none; } }
@media (max-width: 640px) {
  dialog.stage-screen { padding: .85rem; gap: .65rem; }
  dialog.stage-screen .stage-screen-bar { align-items: start; }
  dialog.stage-screen .cinema-actions { max-width: 10rem; }
  dialog.stage-screen .cinema-actions .stage-action { min-height: 2.75rem; padding: .5rem .65rem; font-size: .8125rem; }
  dialog.stage-screen [data-share-project] { order: 2; }
  .cinema-toolbar { gap: .6rem; }
  .cinema-control { padding-inline: .7rem; }
  .cinema-count { min-width: 3.2rem; }
  .cinema-film-navigation { gap: .35rem; }
  .cinema-project-context { flex-wrap: wrap; gap: .65rem; padding-bottom: .3rem; }
  .cinema-project-note { font-size: 1rem; line-height: 1.5; }
  .cinema-inquiry { padding-block: .5rem; }
  .cinema-end-card { grid-template-columns: minmax(0,1fr) auto; gap: .65rem; padding: .75rem; }
  .cinema-next-art { grid-column: 2; grid-row: 1; width: 4.5rem; height: 3rem; }
  .cinema-end-copy { grid-column: 1; grid-row: 1; }
  .cinema-end-actions { grid-column: 1 / -1; }
  .cinema-end-actions .cinema-control { flex: 1; }
}
@media (max-height: 430px) {
  dialog.stage-screen { padding: .6rem 1rem; gap: .35rem; }
  dialog.stage-screen .stage-screen-bar { padding-bottom: .3rem; }
  dialog.stage-screen h2 { font-size: 1.1rem; }
  .cinema-toolbar { padding-top: .3rem; }
  .cinema-project-context { padding: 0; }
  .cinema-project-note { display: none; }
  .cinema-end-card { grid-template-columns: minmax(0,1fr) auto; padding: .4rem .65rem; }
  .cinema-next-art,.cinema-next-category,.cinema-end-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { dialog.stage-screen { animation: none; } .cinema-control { transition: none; } }
