/* Episode player page (/dramas/<slug>/<n>; OpenDesign watch.html, 10 Nov 2026): a full-screen
   vertical feed, one 9:16 slide per episode, after the storefront's motion player. The stage is always dark; the
   Episodes and Details sheets follow the site theme. No inline styles: positions and sizes are classes here. */
.watch-body { --deep: oklch(13% 0.006 60); --stage-fg: oklch(97% 0.004 80); --stage-muted: oklch(80% 0.006 80); --glass: oklch(0% 0 0 / .38); --cta: oklch(56% 0.19 25); --cta-hover: oklch(48% 0.17 25); background: var(--deep); overflow: hidden; }

/* desktop wordmark, outside the frame */
.w-brand { position: fixed; top: 18px; left: 24px; z-index: 40; display: none; align-items: center; gap: 8px; color: var(--stage-fg); text-decoration: none; font: 600 18px/1 var(--font-display); }
.w-brand em { font-style: normal; color: oklch(72% 0.16 22); }
.w-brand:hover { text-decoration: underline; text-underline-offset: 4px; }

.feed { position: fixed; inset: 0; z-index: 30; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; }
.feed::-webkit-scrollbar { display: none; }
.slide { position: relative; height: 100dvh; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; scroll-snap-stop: always; }
.frame-wrap { position: relative; width: 100%; height: 100%; }
.frame { position: absolute; inset: 0; overflow: hidden; background: oklch(0% 0 0); color: var(--stage-fg); container-type: inline-size; }
.frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.tap { position: absolute; inset: 0; border: 0; background: transparent; cursor: default; }
.tap:focus-visible { outline: 2px solid oklch(100% 0 0); outline-offset: -4px; }

/* shades + chrome */
.chrome { transition: opacity .3s; }
.frame.hide .chrome, .frame-wrap.hide .rail { opacity: 0; pointer-events: none; }
.topbar { position: absolute; inset: 0 0 auto 0; z-index: 10; display: flex; align-items: center; gap: 8px; padding: max(12px, env(safe-area-inset-top)) 12px 40px; background: linear-gradient(to bottom, oklch(0% 0 0 / .55), transparent); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .t { min-width: 0; flex: 1; font: 700 15px/1.3 var(--font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; color: var(--stage-fg); }
.topbar .t:hover { text-decoration: underline; text-underline-offset: 3px; }
.rb { position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: var(--stage-fg); cursor: pointer; text-decoration: none; }
.rb:hover { background: oklch(0% 0 0 / .6); }
.rb:focus-visible { outline: 2px solid oklch(100% 0 0); outline-offset: 2px; }
.rb svg { width: 19px; height: 19px; }
.rb[aria-pressed="true"] { background: oklch(100% 0 0); color: oklch(13% 0.006 60); }
.rb[aria-pressed="true"]:hover { background: oklch(88% 0.004 80); }

.bottom { position: absolute; inset: auto 0 0 0; z-index: 10; padding: 80px 16px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to top, oklch(0% 0 0 / .8), oklch(0% 0 0 / .25) 60%, transparent); pointer-events: none; }
.bottom > * { pointer-events: auto; }
.bottom .meta { padding-right: 64px; text-shadow: 0 1px 4px oklch(0% 0 0 / .6); }
.pos { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--stage-fg); font: 600 11.5px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.pos:hover { text-decoration: underline; text-underline-offset: 3px; }
.pos svg { width: 13px; height: 13px; }
.pos .free { color: var(--stage-muted); }
.bottom h2 { margin: 2px 0 0; font: 700 15.5px/1.35 var(--font-body); letter-spacing: 0; color: var(--stage-fg); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seekrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 500 11.5px var(--font-mono); color: var(--stage-muted); }
.seekrow span { width: 40px; font-variant-numeric: tabular-nums; }
.seekrow span:first-child { text-align: right; }
.seekrow input { flex: 1; min-width: 0; height: 24px; accent-color: oklch(100% 0 0); cursor: pointer; }
.seekrow input:focus-visible { outline: 2px solid oklch(100% 0 0); outline-offset: 2px; border-radius: 4px; }

.center-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: oklch(0% 0 0 / .45); backdrop-filter: blur(4px); color: oklch(100% 0 0); pointer-events: none; }
.center-play svg { width: 28px; height: 28px; margin-left: 4px; }
.center-play[hidden] { display: none; }
.flash { position: absolute; top: 50%; width: 64px; height: 64px; margin-top: -32px; display: grid; place-items: center; border-radius: 50%; background: oklch(0% 0 0 / .45); font: 700 13px var(--font-body); color: oklch(100% 0 0); pointer-events: none; animation: wflash .6s ease forwards; }
.flash.l { left: 12%; }
.flash.r { right: max(12%, 80px); }
@keyframes wflash { from { opacity: 1; } to { opacity: 0; } }
.sound { position: absolute; left: 50%; top: max(68px, calc(env(safe-area-inset-top) + 56px)); z-index: 20; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: oklch(0% 0 0 / .62); backdrop-filter: blur(6px); color: oklch(100% 0 0); font: 600 13px var(--font-body); cursor: pointer; }
.sound:hover { background: oklch(0% 0 0 / .8); }
.sound svg { width: 15px; height: 15px; }

/* subtitles, drawn by the page (text size is a choice) */
.cue { position: absolute; inset-inline: 0; bottom: 150px; z-index: 9; display: flex; justify-content: center; padding: 0 60px; pointer-events: none; transition: bottom .3s; }
.frame.hide .cue { bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px)); }
.cue p { margin: 0; padding: 5px 12px; border-radius: 8px; background: oklch(0% 0 0 / .7); color: oklch(100% 0 0); font-weight: 600; line-height: 1.35; text-align: center; white-space: pre-line; }
.cue[hidden] { display: none; }
.cue.s0 p { font-size: 14px; } .cue.s1 p { font-size: 16.5px; } .cue.s2 p { font-size: 20px; }

.cc-menu { position: absolute; right: 12px; top: calc(max(12px, env(safe-area-inset-top)) + 52px); z-index: 30; width: 240px; max-height: 60%; overflow: auto; padding: 4px 0; border: 1px solid oklch(100% 0 0 / .1); border-radius: 14px; background: oklch(0% 0 0 / .86); backdrop-filter: blur(10px); color: oklch(100% 0 0); }
.cc-menu[hidden] { display: none; }
.cc-menu button.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 16px; border: 0; background: transparent; color: inherit; font: 500 14px var(--font-body); text-align: left; cursor: pointer; }
.cc-menu button.opt:hover, .cc-menu button.opt:focus-visible { background: oklch(100% 0 0 / .1); outline: none; }
.cc-menu button.opt .ck { width: 14px; font: 600 13px var(--font-mono); visibility: hidden; }
.cc-menu button.opt[aria-checked="true"] .ck { visibility: visible; }
.cc-menu .sizes { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding: 10px 16px 6px; border-top: 1px solid oklch(100% 0 0 / .1); font-size: 12px; color: oklch(100% 0 0 / .72); }
.cc-menu .sizes div { display: flex; gap: 4px; }
.cc-menu .sizes button { width: 32px; height: 32px; border: 0; border-radius: 999px; background: transparent; color: oklch(100% 0 0); font-weight: 700; cursor: pointer; }
.cc-menu .sizes button.z0 { font-size: 11px; } .cc-menu .sizes button.z1 { font-size: 14px; } .cc-menu .sizes button.z2 { font-size: 17px; }
.cc-menu .sizes button:hover { background: oklch(100% 0 0 / .1); }
.cc-menu .sizes button[aria-pressed="true"] { background: oklch(100% 0 0); color: oklch(0% 0 0); }

/* last seconds of the last free episode: name the locked one */
.teaser { position: absolute; left: 50%; top: calc(max(12px, env(safe-area-inset-top)) + 56px); z-index: 11; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); min-height: 40px; padding: 0 14px; border-radius: 999px; background: oklch(0% 0 0 / .66); backdrop-filter: blur(8px); color: oklch(100% 0 0); font: 600 13px var(--font-body); text-decoration: none; white-space: nowrap; }
.teaser:hover { background: oklch(0% 0 0 / .85); }
.teaser svg { width: 14px; height: 14px; flex: none; }
.teaser[hidden] { display: none; }

/* side rail: over the video on phones, beside the frame on desktop */
.rail { position: absolute; right: 8px; bottom: 112px; z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: opacity .3s; }
.rail .ri { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 52px; border: 0; background: none; color: var(--stage-fg); font: 600 11px var(--font-body); text-decoration: none; cursor: pointer; text-shadow: 0 1px 3px oklch(0% 0 0 / .6); }
.rail .ri .c { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 999px; background: var(--glass); backdrop-filter: blur(6px); }
.rail .ri:hover .c { background: oklch(0% 0 0 / .62); }
.rail .ri:focus-visible { outline: none; }
.rail .ri:focus-visible .c { outline: 2px solid oklch(100% 0 0); outline-offset: 2px; }
.rail .ri svg { width: 20px; height: 20px; }
.rail .ri[disabled] { opacity: .35; cursor: default; }
.rail .nav { display: none; flex-direction: column; gap: 10px; padding-top: 6px; }

/* lock card (the hand-off) and the other states */
.backdrop { position: absolute; inset: -6%; background-size: cover; background-position: center; filter: blur(18px); opacity: .5; transform: scale(1.06); }
.state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 72px 22px 40px; overflow-y: auto; background: oklch(0% 0 0 / .42); }
.state .card { width: 100%; max-width: 312px; padding: 20px; border: 1px solid oklch(100% 0 0 / .15); border-radius: 20px; background: oklch(0% 0 0 / .6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; color: oklch(100% 0 0); }
.state .card .ic { display: block; width: 22px; height: 22px; margin: 0 auto; }
.state .card .eb { margin: 10px 0 0; font: 600 11px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--stage-muted); }
.state .card h3 { margin: 6px 0 0; font: 500 22px/1.2 var(--font-display); color: oklch(100% 0 0); text-wrap: balance; }
.state .card p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.45; color: oklch(100% 0 0 / .78); }
.state .card .facts { display: grid; gap: 4px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: oklch(100% 0 0 / .07); font-size: 13px; text-align: left; color: oklch(100% 0 0 / .85); }
.state .card .facts b { color: oklch(100% 0 0); }
.state .card .facts .src { display: block; font: 500 11px/1.4 var(--font-mono); color: oklch(100% 0 0 / .6); }
.state .card .facts .src a { color: inherit; }
.wbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px; margin-top: 14px; padding: 0 16px; border: 1px solid transparent; border-radius: 999px; font: 700 15px var(--font-body); text-decoration: none; cursor: pointer; }
.wbtn svg { width: 15px; height: 15px; }
.wbtn.cta { background: var(--cta); border-color: var(--cta); color: oklch(99% 0 0); }
.wbtn.cta:hover { background: var(--cta-hover); border-color: var(--cta-hover); }
.wbtn.ghost { margin-top: 8px; background: transparent; border-color: oklch(100% 0 0 / .3); color: oklch(100% 0 0); }
.wbtn.ghost:hover { background: oklch(100% 0 0 / .12); border-color: oklch(100% 0 0 / .5); }
.wbtn:focus-visible { outline: 2px solid oklch(100% 0 0); outline-offset: 3px; }
.state .card .note { margin-top: 8px; font-size: 12px; color: oklch(100% 0 0 / .65); }
.state .card .back { display: inline-flex; align-items: center; min-height: 40px; margin-top: 4px; font-size: 12.5px; color: oklch(100% 0 0 / .75); text-decoration: underline; text-underline-offset: 2px; }
.state .card .back:hover { color: oklch(100% 0 0); }
.others { width: 100%; max-width: 312px; }
.others .eb { margin: 0 0 8px; font: 600 11px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--stage-muted); }
.others a { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 8px 10px; border-radius: 14px; background: oklch(0% 0 0 / .5); color: oklch(100% 0 0); text-decoration: none; }
.others a + a { margin-top: 6px; }
.others a:hover { background: oklch(0% 0 0 / .72); }
.others img { width: 42px; height: 56px; object-fit: cover; border-radius: 6px; }
.others b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.others small { font-size: 12px; color: oklch(100% 0 0 / .7); }
.others svg { width: 16px; height: 16px; }

/* sheets: Episodes and Details (bottom sheet on phones, centred on desktop) */
.sheet { margin: auto 0 0; width: 100%; max-width: none; max-height: 84dvh; padding: 0; border: 1px solid var(--border); border-radius: 22px 22px 0 0; background: var(--surface); color: var(--fg); overflow: hidden; }
.sheet::backdrop { background: oklch(0% 0 0 / .55); }
.sheet .in { display: flex; flex-direction: column; max-height: 84dvh; padding: 16px 20px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; }
.sh-head { display: flex; align-items: flex-start; gap: 12px; }
.sh-head .tt { min-width: 0; flex: 1; }
.sh-head b { display: block; font: 600 17px/1.3 var(--font-body); }
.sh-head small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.sh-head img { width: 64px; height: 85px; object-fit: cover; border-radius: 8px; flex: none; }
.x { width: 44px; height: 44px; margin: -6px -8px 0 0; flex: none; display: grid; place-items: center; border: 0; border-radius: 999px; background: transparent; color: var(--fg); cursor: pointer; }
.x:hover { background: var(--fg-soft); }
.x svg { width: 18px; height: 18px; }
.ptabs { display: flex; gap: 20px; margin-top: 14px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.ptabs button { flex: none; margin-bottom: -1px; padding: 0 0 8px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 600 13px var(--font-mono); cursor: pointer; min-height: 36px; }
.ptabs button:hover { color: var(--fg); }
.ptabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.pgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.pgrid button { position: relative; display: flex; align-items: center; justify-content: center; gap: 4px; height: 48px; border: 1px solid transparent; border-radius: 10px; background: var(--fg-soft); color: var(--fg); font: 600 15px var(--font-mono); cursor: pointer; }
.pgrid button:hover { border-color: var(--line-strong); }
.pgrid button.seen { color: var(--muted); }
.pgrid button.seen:hover { color: var(--fg); }
.pgrid button[aria-current="true"] { background: var(--fg); color: var(--bg); }
.pgrid button svg { width: 10px; height: 10px; }
.pgrid button .lk { position: absolute; top: 6px; right: 6px; color: var(--muted); }
.pkey { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.pkey svg { width: 11px; height: 11px; }
.pkey a { color: var(--fg); }
.d-take { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--fg); }
.d-take .lbl { display: flex; gap: 8px; align-items: center; font: 600 11px var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.d-take p { margin: 8px 0 0; font: 500 19px/1.35 var(--font-display); }
.d-syn { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg); }
.d-syn.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more { align-self: flex-start; min-height: 36px; padding: 0; border: 0; background: none; color: var(--fg); font: 600 13px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.d-facts { margin: 12px 0 0; display: grid; }
.d-facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.d-facts dt { font: 600 11px/1.6 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.d-facts dd { margin: 0; }
.sheet .src { margin-top: 8px; font: 500 12px/1.4 var(--font-mono); color: var(--muted); }
.d-acts { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 16px; }

.w-toast { position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); z-index: 60; transform: translate(-50%, -8px); padding: 9px 16px; border-radius: 999px; background: oklch(0% 0 0 / .82); color: oklch(100% 0 0); font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; }
.w-toast.show { opacity: 1; transform: translate(-50%, 0); }

@container (max-width: 340px) { .topbar .rb[data-a="full"] { display: none; } }

@media (min-width: 1024px) {
  .w-brand { display: inline-flex; }
  .frame-wrap { width: auto; height: calc(100dvh - 48px); aspect-ratio: 9 / 16; max-width: calc(100vw - 240px); }
  .frame { border-radius: 20px; box-shadow: 0 30px 80px oklch(0% 0 0 / .6); }
  .rail { right: auto; left: calc(100% + 20px); bottom: 16px; }
  .frame-wrap.hide .rail { opacity: 1; pointer-events: auto; }
  .rail .nav { display: flex; }
  .bottom .meta { padding-right: 0; }
  .sheet { margin: auto; max-width: 560px; border-radius: 22px; }
  .pgrid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  :root:fullscreen .frame-wrap { height: 100dvh; }
  :root:fullscreen .frame { border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .feed { scroll-behavior: auto; } .flash { animation: none; opacity: 0; } }
