:root {
  color-scheme: dark;
  --bg: #100e16;
  --surface: #1b1723;
  --hover: #292132;
  --ink: #eee7d9;
  --muted: #c0b6cc;
  --gold: #d7ad58;
  --line: #4f435e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "PingFang TC", "Heiti TC", "Noto Sans CJK TC", sans-serif; }
main { width: min(1400px, 100%); margin: auto; padding: 18px clamp(16px, 3vw, 42px) 30px; }
h1, p { margin: 0; }
h1 { font: 600 clamp(28px, 4vw, 34px)/1.3 "Songti TC", serif; letter-spacing: .04em; }
header { margin-bottom: 12px; }
.eyebrow { font-size: 14px; letter-spacing: .06em; color: var(--gold); }
#status { color: var(--muted); margin-top: 4px; font-size: 16px; }
.stage { background: #08080b; outline-offset: 3px; overflow: hidden; container-type: inline-size; }
.picture { position: relative; aspect-ratio: 16/9; width: 100%; flex-shrink: 0; }
.picture video, .picture canvas { display: block; width: 100%; height: 100%; }
.picture video { object-fit: contain; }
.picture.body-picture { aspect-ratio: 48/23; overflow: hidden; }
.picture.body-picture video, .picture.body-picture canvas { height: auto; aspect-ratio: 16/9; }
.picture canvas { position: absolute; inset: 0; pointer-events: none; }
.caption-band { min-height: 64px; padding: 6px 10px; display: flex; align-items: center; justify-content: center; text-align: center; background: #08080b; }
.caption-band p { width: 100%; min-width: 0; font-size: clamp(16px, 2.3vw, 23px); font-weight: 500; line-height: 1.45; white-space: pre-line; }
.caption-band p.panel { position: absolute; clip: rect(0, 0, 0, 0); width: 1px; height: 1px; overflow: hidden; }
.caption-band p[hidden] { display: none; }
.chrome { position: relative; padding: 3px clamp(8px, 1.7vw, 22px) 7px; color: #fff; background: linear-gradient(180deg, #08080b 0%, #141217 60%, #101015 100%); }
.seek { display: flex; align-items: center; gap: 11px; min-height: 32px; }
.seek input { flex: 1; min-width: 0; height: 32px; padding: 0; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
.seek input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--gold) 0 var(--progress, 0%), #77747a var(--progress, 0%) 100%); }
.seek input::-moz-range-track { height: 4px; border-radius: 2px; background: #77747a; }
.seek input::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.seek input::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: #f1cb7e; -webkit-appearance: none; }
.seek input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #f1cb7e; }
.seek input:disabled { cursor: not-allowed; opacity: .5; }
.seek output { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; color: #e9e6e9; }
.controls { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.transport-left, .transport-right { display: flex; align-items: center; gap: clamp(2px, .7vw, 12px); }
.film-name { position: absolute; left: 50%; transform: translateX(-50%); color: #e9e7e9; font-size: 15px; letter-spacing: .06em; white-space: nowrap; pointer-events: none; }
button { min-width: 44px; min-height: 44px; padding: 8px 13px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; cursor: pointer; transition: background-color 140ms, color 140ms, border-color 140ms, transform 140ms; }
button:hover:not(:disabled) { background: var(--hover); border-color: #8d799e; }
button:active:not(:disabled) { transform: scale(.96); }
button:disabled { cursor: not-allowed; opacity: .48; }
button[aria-pressed=true], button[aria-current=true] { color: #f1d192; border-color: var(--gold); }
button:focus-visible, a:focus-visible, input:focus-visible, .stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.icon-button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 7px; border: 0; border-radius: 3px; background: transparent; color: #f8f7f8; }
.icon-button:hover:not(:disabled) { background: #ffffff1c; border: 0; color: #fff; }
.icon-button[aria-pressed=true] { border: 0; color: #f1d192; }
.icon-button .icon { display: block; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-button .icon text { fill: currentColor; stroke: none; font: 600 10px/1 "PingFang TC", sans-serif; }
.icon-button.primary { color: #fff; }
.icon-button.primary .icon { width: 31px; height: 31px; }
.icon-pause, .icon-exit, .sound-on { display: none !important; }
#play[data-playing=true] .icon-play, #fullscreen[data-active=true] .icon-enter, #sound[aria-pressed=true] .sound-off { display: none; }
#play[data-playing=true] .icon-pause, #fullscreen[data-active=true] .icon-exit, #sound[aria-pressed=true] .sound-on { display: block !important; }
.secondary-controls { display: flex; align-items: center; gap: 9px; margin-top: 8px; }
.secondary-controls button { background: transparent; }
.volume-label { font-size: 14px; color: var(--muted); margin-left: auto; }
#volume { width: 86px; height: 44px; accent-color: var(--gold); cursor: pointer; }
#volume:disabled { cursor: not-allowed; opacity: .45; }
.chapters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.chapters button { font-size: 16px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.downloads[hidden] { display: none; }
.downloads a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; color: var(--ink); font-size: 14px; text-underline-offset: 4px; border: 1px solid var(--line); border-radius: 5px; transition: background-color 140ms, border-color 140ms; }
.downloads a:hover { background: var(--hover); border-color: var(--gold); }
.note { font-size: 14px; color: var(--muted); margin-top: 10px; }
.error { font-size: 14px; color: #ffd2b4; border: 1px solid #a97055; padding: 12px; margin-top: 12px; overflow-wrap: anywhere; }
.error[hidden] { display: none; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 10; background: var(--ink); color: var(--bg); padding: 12px; transform: translateY(-180%); }
.skip:focus { transform: translateY(0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.stage:fullscreen { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; background: #08080b; }
.stage:fullscreen .picture { width: min(100%, calc((100dvh - 190px)*16/9)); max-width: 1920px; }
.stage:fullscreen .caption-band, .stage:fullscreen .chrome { width: min(100%, 1920px); flex-shrink: 0; }
.stage:fullscreen .caption-band { min-height: 64px; }
.panel-caption { display: flex; position: absolute; padding: 3px; color: #25172c; pointer-events: none; align-items: center; justify-content: center; }
.panel-caption p { width: 100%; min-width: 0; max-height: 100%; display: flex; flex-direction: row-reverse; justify-content: center; font-size: clamp(16px, 2.7cqw, 28px); font-weight: 600; line-height: 1.4; }
.vertical-column { display: block; flex: 0 0 1.4em; width: 1.4em; height: 100%; writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: .06em; white-space: nowrap; line-break: strict; word-break: normal; text-align: start; }
.panel-caption[hidden] { display: none; }
@media (min-width: 761px) {
  header, .player { width: min(100%, max(360px, calc((100dvh - 270px)*16/9))); margin-left: auto; margin-right: auto; }
  .volume-label, #volume { display: none; }
}
@media (max-width: 760px) {
  main { padding-top: 20px; }
  .caption-band { min-height: 86px; padding: 10px 8px; }
  .caption-band p { font-size: clamp(16px, 4.4vw, 18px); }
  .caption-band p.panel { display: none; }
  .picture canvas { display: none; }
  .panel-caption:not([hidden]) { display: flex; }
  .film-name { display: none; }
  .chapters { gap: 6px; }
  .chapters button { flex: 1; font-size: 16px; }
  .seek { gap: 8px; }
}
@media (max-width: 520px) {
  .chapters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .chapters button { width: 100%; min-width: 0; white-space: normal; line-height: 1.45; }
}
@container (max-width: 560px) { .film-name { display: none; } }
@media (max-width: 380px) {
  main { padding-left: 8px; padding-right: 8px; }
  .skip-ten { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  button, .downloads a { transition: none; }
  button:active:not(:disabled) { transform: none; }
}
/* Landing-page embed retains the full caption engine and the same player chrome. */
.film-embed { background: #08080b; }
.film-embed main { width: 100%; padding: 0; }
.film-embed header, .film-embed .chapters, .film-embed .downloads, .film-embed .note, .film-embed .secondary-controls { display: none; }
.film-embed .player { width: 100%; margin: 0; }
.film-embed .caption-band { min-height: 76px; }
.film-embed .caption-band p { font-size: 18px; }
@media (max-width: 400px) { .film-embed .caption-band p { font-size: 17px; } }

/* Opt-in smoked-glass embed; standalone Notflix player remains unchanged. */
.film-glass {--gold:#77df96;--ink:#eeede3;background:transparent;color-scheme:dark}
.film-glass .stage {background:transparent}
.film-glass .picture {background:#080d09}
.film-glass .film-unstarted .picture::after {position:absolute;inset:0;content:"";background:var(--film-poster) center/cover no-repeat;pointer-events:none}
.film-glass .caption-band {min-height:64px;padding:8px 12px;background:#07100bcc}
.film-glass .caption-band p {font-size:18px;line-height:1.5;color:#f4f4ec}
.film-glass .chrome {display:flex;align-items:center;gap:4px;min-height:54px;padding:4px 0;background:transparent}
.film-glass .controls,.film-glass .transport-left {display:contents}
.film-glass .seek {order:2;flex:1;min-width:0;gap:8px;min-height:44px}
.film-glass .seek input {height:44px}
.film-glass #play {order:1}
.film-glass #sound {order:3}
.film-glass .transport-right {order:4;gap:0}
.film-glass .film-name,.film-glass .skip-ten {display:none}
.film-glass .seek output {font-size:14px;color:#b6caba}
.film-glass .seek input::-webkit-slider-runnable-track {height:3px;background:linear-gradient(to right,var(--gold) 0 var(--progress,0%),#78948266 var(--progress,0%) 100%)}
.film-glass .seek input::-webkit-slider-thumb {background:#baffd0}
.film-glass .icon-button[aria-pressed=true] {color:#a8f3bf}
.film-glass .icon-button:hover:not(:disabled) {background:#84b89522;color:#e5ffec}
.film-glass .icon-button.primary {border:1px solid #6f9f7b66;border-radius:50%;color:#ccffda}
.film-glass .stage:fullscreen {background:#030806}
.film-glass .stage:fullscreen .chrome {width:100%}
.film-glass .stage:fullscreen .picture {width:min(100%,calc((100dvh - 140px)*16/9))}
@media(max-width:560px){.film-glass .seek output{display:none}.film-glass .caption-band{min-height:72px}.film-glass .caption-band p{font-size:17px}.film-glass .icon-button{padding:8px}.film-glass .icon-button .icon{width:24px;height:24px}}

.film-glass {overflow:hidden}
/* The film rectangle itself is 16:9; captions occupy no empty reserved band. */
.film-glass .stage {position:relative;aspect-ratio:16/9;overflow:hidden}
.film-glass .picture,.film-glass .picture.body-picture {position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;overflow:hidden}
.film-glass .picture video,.film-glass .picture.body-picture video {width:100%;height:100%;aspect-ratio:auto}
.film-glass .picture.body-picture video {clip-path:inset(0 0 14.8148%)}
.film-glass .caption-band {display:none;position:absolute;z-index:2;left:0;right:0;bottom:52px;min-height:0;padding:8px 12px 4px;background:linear-gradient(0deg,#020705db,#02070555);pointer-events:none}
.film-glass .has-outside-caption .caption-band {display:flex}
.film-glass .caption-band p {font-size:18px;line-height:1.45;text-shadow:0 1px 4px #000}
.film-glass .chrome {position:absolute;z-index:3;bottom:0;left:0;right:0;min-height:52px;padding:4px 8px;background:linear-gradient(0deg,#031108b3,#03110866 80%,transparent)}
.film-glass .seek input::-webkit-slider-runnable-track {background:linear-gradient(to right,#91f4ac 0 var(--progress,0%),#86b09266 var(--progress,0%) 100%)}
.film-glass .icon-button.primary {border-color:#b9fbc6cc;box-shadow:0 0 8px #89e89f1a}
.film-glass .film-unstarted .picture::after {z-index:1}
.film-glass .stage:fullscreen {aspect-ratio:auto;padding:0}
.film-glass .stage:fullscreen .picture {position:relative;inset:auto;width:min(100%,calc(100dvh*16/9));height:auto;aspect-ratio:16/9}
.film-glass .stage:fullscreen .caption-band {bottom:72px}
.film-glass .stage:fullscreen .chrome {max-width:1400px;margin-inline:auto}
@media(max-width:560px){
 .film-glass .stage {aspect-ratio:auto}
 .film-glass .picture,.film-glass .picture.body-picture {position:relative;inset:auto;aspect-ratio:16/9;height:auto}
 .film-glass .caption-band {position:relative;inset:auto;padding:8px 8px;background:#07150aa3}
 .film-glass .caption-band p {font-size:17px}
 .film-glass .chrome {position:relative;inset:auto;min-height:50px;padding:3px 0;background:#07150a33}
 .film-glass .picture.body-picture {aspect-ratio:48/23}
 .film-glass .picture.body-picture video {height:auto;aspect-ratio:16/9;clip-path:none}
 .film-glass .film-unstarted .picture {aspect-ratio:16/9}
}
/* Glass controls belong beneath the picture, without an opaque blank caption strip. */
@media(min-width:561px){
 .film-glass .stage{aspect-ratio:auto}
 .film-glass .picture,.film-glass .picture.body-picture{position:relative;inset:auto;height:auto;aspect-ratio:16/9}
 .film-glass .chrome{position:relative;inset:auto;height:52px;background:transparent}
 .film-glass .caption-band{bottom:52px}
 .film-glass .picture.body-picture video{width:100%;height:100%;aspect-ratio:auto;clip-path:inset(0 0 14.8148%)}
 .film-glass .stage:fullscreen .picture{width:min(100%,calc((100dvh - 52px)*16/9));height:auto}
 .film-glass .stage:fullscreen .chrome{position:relative;width:min(100%,1400px)}
}
/* Story exports reserve their bottom 160px for offline subtitles: crop that
   source reservation in web playback, rather than leaving a second empty bar. */
@media(min-width:561px){
 .film-glass .picture.body-picture{aspect-ratio:48/23;background:transparent}
 .film-glass .picture.body-picture video{height:auto;aspect-ratio:16/9;clip-path:none}
 .film-glass .stage:fullscreen .picture.body-picture{aspect-ratio:48/23;width:min(100%,calc((100dvh - 52px)*48/23))}
}

/* At small embed sizes a scripture must remain readable at 16px. Move the
   same DOM panel below the picture only when its original white cell cannot fit. */
.film-glass .panel-caption.panel-caption--expanded{position:relative;inset:auto;width:100%;height:auto;min-height:160px;padding:12px;background:#eee9dc;overflow:visible}
.film-glass .panel-caption--expanded p{font-size:16px;max-height:none;margin:0}
.film-glass .panel-caption--expanded[hidden]{display:none}
