/* Apex Exclusives — watch app. Same tokens as the main site (style.css). */
:root {
  --bone: #E8DDC8;
  --tusk: #C9A961;
  --blood: #7A0A0A;
  --char: #1A1614;
  --slag: #3D3530;
  --white: #F5EEE0;
  --amber: #FFB000;
  --apex-red: #FF1F2E;
  --raised: #241E1A;
  --raised-2: #2B241F;
  --line: rgba(201,169,97,0.18);
  --dim: #A89C88;
  --font-display: "Anton", "Impact", "Arial Black", Helvetica, sans-serif;
  --font-body: "Inter", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;
  --ease: cubic-bezier(.16,1,.3,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--char); color: var(--white); }
body { font: 500 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
body.modal-open { overflow: hidden; }
a { color: var(--tusk); }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
html[lang="ko"] body { word-break: keep-all; overflow-wrap: anywhere; }

.coin { width: 1.05em; height: 1.05em; vertical-align: -0.17em; margin-right: 0.28em; fill: var(--amber); stroke: #7a4b00; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- top bar ---------- */
.wbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px;
  background: rgba(20,16,14,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.wbar__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); font: 400 21px/1 var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.wbar__brand b { font-weight: 400; color: var(--tusk); }
.wbar__right { display: flex; align-items: center; gap: 8px; }
.wnav { display: flex; gap: 22px; margin-right: auto; margin-left: 26px; }
.wnav a { color: var(--dim); text-decoration: none; font: 700 12px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent; }
.wnav a:hover, .wnav a:focus-visible { color: var(--bone); border-bottom-color: var(--tusk); }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--raised); border-radius: 999px; padding: 7px 12px; font: 700 14px/1 var(--font-body); cursor: pointer; }
.chip:hover { border-color: var(--tusk); }
.chip--cards { font-size: 12px; letter-spacing: 0.04em; }
.chip--vip { background: var(--tusk); color: var(--char); border-color: var(--tusk); letter-spacing: 0.12em; font-size: 12px; }
.icon-btn { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--bone); stroke-width: 2; }
.icon-btn:hover { border-color: var(--tusk); }

.demo-banner { background: #3a2a00; color: #ffd98a; border-bottom: 1px solid #6b4e00; padding: 8px 20px; font: 600 13px/1.4 var(--font-body); text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 800 13px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--bone); background: var(--blood); border: 2px solid var(--blood); border-radius: 10px;
  padding: 14px 18px; cursor: pointer; text-decoration: none;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.btn:hover { background: #941414; border-color: var(--tusk); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn--ghost { background: transparent; border-color: var(--tusk); color: var(--tusk); }
.btn--ghost:hover { background: rgba(201,169,97,0.12); color: var(--bone); }
.btn--sm { padding: 9px 14px; font-size: 12px; letter-spacing: 0.1em; }
.btn--block { width: 100%; font-size: 15px; padding: 16px; }
.btn small { font-weight: 700; letter-spacing: 0.04em; text-transform: none; color: var(--amber); }
.linkish { background: none; border: 0; padding: 0; color: var(--tusk); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font: inherit; }

/* ---------- layout ---------- */
.wmain { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; }
.empty { color: var(--dim); text-align: center; padding: 80px 0; }

.eyebrow { font: 700 11px/1 var(--font-mono); letter-spacing: 0.32em; color: var(--tusk); margin: 0 0 16px; }

/* ---------- home ---------- */
.lead { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--char) var(--cover) center right / cover no-repeat; min-height: min(78vh, 640px); display: flex; align-items: flex-end; margin-bottom: 56px; }
.lead__veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(26,22,20,0.98) 0%, rgba(26,22,20,0.94) 46%, rgba(26,22,20,0.55) 66%, rgba(26,22,20,0.1) 88%), linear-gradient(0deg, rgba(26,22,20,0.95) 0%, rgba(26,22,20,0) 40%); }
.lead__body { position: relative; padding: 40px 40px 34px; max-width: 760px; }
.lead__title { font: 400 clamp(38px, 5.6vw, 78px)/0.95 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; color: var(--bone); margin: 0; }
.lead__zh { margin: 10px 0 0; color: var(--dim); font-size: 15px; }
/* Anton has no CJK glyphs; Chinese and Korean headings use the body face, heavy. */
:lang(zh-Hans) .lead__title, :lang(zh-Hant) .lead__title, :lang(ko) .lead__title,
:lang(zh-Hans) .block__title, :lang(zh-Hant) .block__title, :lang(ko) .block__title { font-family: var(--font-body); font-weight: 800; letter-spacing: -0.01em; line-height: 1.12; }
.lead__syn { margin: 16px 0 0; max-width: 54ch; color: var(--bone); opacity: 0.86; font-size: 16px; }
.lead__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.lead__catch { display: inline-block; margin-top: 14px; color: var(--tusk); font-size: 14px; text-underline-offset: 3px; }

/* The season as a ribbon: free episodes lit, paid ones outlined, owned ones gold. */
.rail { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; margin-top: 26px; max-width: 680px; }
.rail__ep { height: 26px; border-radius: 2px; border: 1px solid rgba(201,169,97,0.45); background: transparent; transition: transform 160ms var(--ease), background 160ms; }
.rail__ep:hover { transform: scaleY(1.25); background: rgba(201,169,97,0.35); }
.rail__ep--free { background: var(--bone); border-color: var(--bone); }
.rail__ep--open { background: var(--tusk); border-color: var(--tusk); }
.rail__key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0 0; color: var(--dim); font: 700 11px/1.4 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.rail__key .coin { margin-right: 0; }
.rail__sw { display: inline-block; width: 9px; height: 14px; border-radius: 2px; border: 1px solid rgba(201,169,97,0.45); margin-right: -6px; vertical-align: middle; }
.rail__sw--free { background: var(--bone); border-color: var(--bone); }
.rail__sw--open { background: var(--tusk); border-color: var(--tusk); }
@media (prefers-reduced-motion: no-preference) {
  .rail__ep--free { animation: rail-lit 420ms var(--ease) both; animation-delay: calc(var(--i) * 45ms + 250ms); }
  @keyframes rail-lit { from { background: transparent; border-color: rgba(201,169,97,0.45); } }
}

.block { margin: 0 0 64px; }
.block__title { font: 400 clamp(28px, 3.4vw, 40px)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); margin: 0 0 18px; }
.block__sub { max-width: 64ch; color: var(--dim); margin: -6px 0 26px; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tier { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.tier--vip { border-color: var(--tusk); }
.tier__k { margin: 0; font: 400 24px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; color: var(--tusk); }
.tier__v { margin: 0; color: var(--bone); flex: 1; }
.tier__on { margin: 0; color: var(--tusk); font: 700 12px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; }

.shelf { margin-bottom: 30px; }
.shelf__title { margin: 0 0 12px; font: 700 12px/1 var(--font-mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--tusk); }
.shelf__row { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; scrollbar-width: thin; }
.yt { scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; color: var(--white); text-decoration: none; }
.yt__thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.yt__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease); }
.yt:hover .yt__thumb img { transform: scale(1.04); }
.yt__badge { position: absolute; left: 8px; bottom: 8px; background: rgba(26,22,20,0.86); color: var(--bone); font: 700 10px/1 var(--font-mono); letter-spacing: 0.12em; padding: 5px 7px; border-radius: 4px; }
.yt__title { font: 400 18px/1.05 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); }
.yt__meta { color: var(--dim); font-size: 12px; line-height: 1.4; }

.qa { display: grid; gap: 8px; max-width: 820px; }
.qa__item { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 0 18px; }
.qa__item summary { cursor: pointer; list-style: none; padding: 16px 0; font-weight: 700; color: var(--bone); display: flex; justify-content: space-between; gap: 16px; }
.qa__item summary::-webkit-details-marker { display: none; }
.qa__item summary::after { content: "+"; color: var(--tusk); font: 700 18px/1 var(--font-mono); }
.qa__item[open] summary::after { content: "−"; }
.qa__item p { margin: 0 0 16px; color: var(--dim); }
.qa__item a { color: var(--tusk); }

.brandstrip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 26px; color: var(--dim); }
.brandstrip p { margin: 0; max-width: 60ch; }

@media (max-width: 900px) {
  .wbar { flex-wrap: wrap; row-gap: 6px; }
  /* The row scrolls sideways; the fade on the right says there is more. The padding lets the
     last link scroll clear of the fade. */
  .wnav { order: 3; width: 100%; margin: 0; gap: 20px; overflow-x: auto; white-space: nowrap; padding-right: 32px; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .wnav::-webkit-scrollbar { display: none; }
  .wnav a { padding: 11px 0; }
  .tiers { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .lead { border-radius: 0; margin: 0 0 44px; border-width: 0 0 1px; min-height: 0; background-position: center top; background-size: auto 62%; }
  .lead__veil { background: linear-gradient(0deg, rgba(26,22,20,1) 58%, rgba(26,22,20,0.7) 76%, rgba(26,22,20,0.15) 100%); }
  .lead__body { padding: 190px 16px 26px; }
  .rail { gap: 1px; }
  .rail__ep { height: 22px; border-radius: 1px; }
  .shelf__row { grid-auto-columns: 70%; margin-right: -16px; padding-right: 16px; }
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.card { display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--white); text-decoration: none; transition: transform 220ms var(--ease), border-color 220ms; }
.card:hover { transform: translateY(-4px); border-color: var(--tusk); }
.card__thumb { position: relative; aspect-ratio: 16 / 9; background: #000; }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__badge { position: absolute; top: 10px; left: 10px; background: var(--tusk); color: var(--char); font: 800 10px/1 var(--font-mono); letter-spacing: 0.18em; padding: 6px 9px; border-radius: 6px; }
.card__body { padding: 16px 16px 18px; }
.card__tag { font: 700 10px/1.3 var(--font-mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--tusk); margin-bottom: 8px; }
.card__title { font: 400 22px/1.05 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); margin: 0; }
.card__zh { margin: 6px 0 0; color: var(--dim); font-size: 14px; }
.card__meta { margin: 10px 0 0; color: var(--dim); font: 600 12px/1.4 var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- series page ---------- */
.player { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.player iframe, .player #playerSlot { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player__poster { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: #000 center / cover no-repeat; }
.player__poster::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.65)); }
.player__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1; width: 78px; height: 78px; border-radius: 999px; background: var(--blood); display: grid; place-items: center; box-shadow: 0 12px 30px rgba(0,0,0,0.5); transition: transform 200ms var(--ease), background 200ms; }
.player__play svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
.player__poster:hover .player__play { transform: translate(-50%, -50%) scale(1.06); background: #941414; }
.player__label { position: absolute; left: 50%; top: calc(50% + 54px); transform: translateX(-50%); z-index: 1; white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: rgba(20,16,14,0.82); font: 800 13px/1 var(--font-body); letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone); }

.ws__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.ws__now { font: 400 22px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; color: var(--bone); }
.ws__of { color: var(--dim); font-size: 16px; }
.ws__ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctl { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 700 13px/1 var(--font-body); cursor: pointer; }
.ctl:hover { border-color: var(--tusk); }
.check { display: inline-flex; align-items: center; gap: 7px; font: 600 13px/1.3 var(--font-body); color: var(--dim); cursor: pointer; }
.check input { accent-color: var(--tusk); width: 16px; height: 16px; }

.ws__info { padding: 22px 2px 8px; max-width: 760px; }
.ws__title { font: 400 clamp(32px, 4.4vw, 52px)/0.98 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); margin: 0; }
.ws__zh { color: var(--dim); margin: 8px 0 0; }
.ws__syn { margin: 14px 0 0; }
.ws__price { margin: 14px 0 0; color: var(--dim); font-size: 14px; }
.ws__h { font: 700 11px/1 var(--font-mono); letter-spacing: 0.3em; text-transform: uppercase; color: var(--tusk); margin: 28px 0 14px; }

.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; }
.ep { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 58px; border-radius: 9px; border: 1px solid var(--line); background: var(--raised); cursor: pointer; transition: border-color 160ms, background 160ms; }
.ep:hover { border-color: var(--tusk); }
.ep__n { font: 400 19px/1 var(--font-display); color: var(--bone); }
.ep__tag { font: 700 10px/1 var(--font-mono); letter-spacing: 0.08em; color: var(--dim); }
.ep__tag .coin { width: 11px; height: 11px; margin-right: 2px; }
.ep--locked { background: #1d1815; }
.ep--locked .ep__n { color: var(--dim); }
.ep--now { border-color: var(--tusk); background: rgba(201,169,97,0.16); box-shadow: inset 0 0 0 1px var(--tusk); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,6,5,0.74); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal__card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 26px 22px 22px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.modal__x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; background: transparent; color: var(--dim); font-size: 26px; line-height: 1; cursor: pointer; }
.modal__x:hover { color: var(--bone); }
.mtitle { font: 400 30px/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); margin: 0 30px 10px 0; }
.msub { font: 700 11px/1 var(--font-mono); letter-spacing: 0.28em; text-transform: uppercase; color: var(--tusk); margin: 22px 0 12px; }
.muted { color: var(--dim); margin: 0 0 16px; font-size: 14px; }
.need { color: var(--amber); font-weight: 700; margin: 0 0 14px; }
.adoffer { margin: 0 0 18px; }
.adoffer .fine { margin-top: 8px; }
.fine { color: var(--dim); font-size: 12px; margin: 10px 0 0; }
.fine.legal { margin-top: 20px; }

.vipcard { margin-top: 18px; padding: 16px; border-radius: 12px; border: 1px solid var(--tusk); background: linear-gradient(135deg, rgba(201,169,97,0.16), rgba(122,10,10,0.16)); }
.vipcard__head { font-weight: 700; margin-bottom: 12px; }
.vipcard__tag { background: var(--tusk); color: var(--char); font: 800 11px/1 var(--font-body); letter-spacing: 0.14em; padding: 4px 7px; border-radius: 5px; margin-right: 6px; }
.vipcard__plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .vipcard__plans { grid-template-columns: 1fr; } }

.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised-2); cursor: pointer; transition: border-color 160ms; }
.pack:hover { border-color: var(--tusk); }
.pack:disabled { opacity: 0.55; cursor: wait; }
.pack__coins { font: 800 19px/1 var(--font-body); color: var(--bone); }
.pack__bonus { font: 700 11px/1 var(--font-mono); color: var(--amber); }
.pack__bonus--none { visibility: hidden; }
.pack__price { font: 700 14px/1 var(--font-body); color: var(--dim); margin-top: 4px; }
.pack__label { position: absolute; top: -9px; right: 8px; background: var(--apex-red); color: #fff; font: 800 9px/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; }

.acct { display: grid; gap: 8px; margin-bottom: 14px; }
.acct > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: var(--raised-2); }
.acct__k { color: var(--dim); font-size: 13px; }
.acct__v { font-weight: 700; text-align: right; }
.acct__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ytm { margin-bottom: 16px; }
.ytm__steps { margin: 0 0 12px; padding-left: 18px; font-size: 14px; display: grid; gap: 6px; }
.ytm__code { font: 700 15px/1.4 var(--font-mono); letter-spacing: 0.06em; padding: 2px 6px; border-radius: 6px; background: var(--raised-2); user-select: all; }
.ytm__ok { font-weight: 700; margin: 8px 0 0; }
.emailform { display: flex; gap: 8px; }
.emailform input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--char); color: var(--white); font: inherit; }
.emailform input:focus { outline: 2px solid var(--tusk); outline-offset: 1px; }

/* ---------- sign-in ---------- */
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #fff; color: #1f1f1f; border-color: #dadce0; text-transform: none; letter-spacing: 0; font: 600 14px/1 var(--font-body); padding: 12px 14px; }
.btn--google:hover { background: #f2f2f2; color: #1f1f1f; }
.btn--google .g { width: 18px; height: 18px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; margin: 14px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: 700 13px/1 var(--font-body); padding: 10px 0; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--tusk); }
.authform { display: grid; gap: 8px; }
.authform input { min-width: 0; padding: 11px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--char); color: var(--white); font: inherit; }
.authform input:focus { outline: 2px solid var(--tusk); outline-offset: 1px; }
.authlinks { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.icon-btn--dot { position: relative; }
.icon-btn--dot::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.savecard { position: fixed; right: 16px; bottom: 16px; z-index: 55; width: min(360px, calc(100% - 32px)); background: var(--raised); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 16px; box-shadow: 0 18px 40px rgba(0,0,0,0.55); }
.savecard__x { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--dim); font-size: 22px; line-height: 1; cursor: pointer; }
.savecard__t { margin: 0 24px 6px 0; font: 700 15px/1.3 var(--font-body); color: var(--white); }
.savecard__p { margin: 0 0 14px; color: var(--dim); font-size: 13px; line-height: 1.5; }
.savecard__actions { display: grid; gap: 8px; justify-items: start; }
.savecard__actions .btn { width: 100%; }
/* The card owns the bottom of the screen; messages move to the top so they don't cover its buttons. */
body.has-savecard .toast { top: 70px; bottom: auto; }

/* ---------- toast & footer ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; background: var(--bone); color: var(--char); font-weight: 700; padding: 12px 18px; border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.5); max-width: calc(100% - 32px); text-align: center; }
.wfoot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 22px 20px 30px; border-top: 1px solid var(--slag); color: var(--dim); font-size: 13px; }
.wfoot a { color: var(--dim); }
.wfoot a:hover { color: var(--tusk); }

@media (max-width: 640px) {
  .wbar { padding: 8px 12px; }
  .wbar__brand span { font-size: 17px; }
  .wbar__brand b { display: none; }
  .wmain { padding: 0 0 48px; }
  .player { border-radius: 0; border-left: 0; border-right: 0; }
  .ws__bar, .ws__info, .ws__h, .eps, .block, .brandstrip, .empty { margin-left: 16px; margin-right: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- legal pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 34px 20px 64px; }
.doc h1 { font: 400 clamp(36px, 5vw, 56px)/1 var(--font-display); text-transform: uppercase; letter-spacing: 0.02em; color: var(--bone); margin: 0 0 6px; }
.doc .updated { color: var(--dim); font-size: 13px; margin: 0 0 28px; }
.doc h2 { font: 400 22px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.03em; color: var(--tusk); margin: 30px 0 10px; }
.doc p, .doc li { color: var(--white); }
.doc ul { padding-left: 20px; }

/* ---------- language menu ---------- */
.lang { position: relative; }
.lang__btn { width: auto; padding: 0 10px 0 8px; gap: 5px; display: inline-flex; align-items: center; font: 700 12px/1 var(--font-body); color: var(--bone); }
.lang__btn svg { width: 16px; height: 16px; }
.lang__menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 150px; padding: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.5); display: grid; gap: 2px; }
.lang__menu button { text-align: left; background: none; border: 0; border-radius: 6px; padding: 10px 12px; font: 600 14px/1.2 var(--font-body); cursor: pointer; }
.lang__menu button:hover, .lang__menu button[aria-checked="true"] { background: rgba(201,169,97,0.16); color: var(--tusk); }
.ws__langs { margin: 12px 0 0; color: var(--dim); font-size: 14px; }

/* ---------- episode player ---------- */
.vp { position: absolute; inset: 0; background: #000; color: #fff; overflow: hidden; outline: none; container-type: inline-size; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.vp__video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.vp svg { width: 22px; height: 22px; fill: currentColor; }
.vp svg .ln { fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.vp__ui, .vp__spin, .vp__ripple, .vp__cc { pointer-events: none; }
.vp__ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; opacity: 0; transition: opacity 220ms var(--ease); background: linear-gradient(180deg, rgba(0,0,0,0.55) 0, transparent 22%, transparent 62%, rgba(0,0,0,0.78) 100%); }
.vp.ui-on .vp__ui, .vp.is-paused .vp__ui { opacity: 1; }
.vp.ui-on .vp__ui *, .vp.is-paused .vp__ui * { pointer-events: auto; }
.vp__top { padding: 12px 16px; }
.vp__title { font: 700 14px/1.3 var(--font-body); text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.vp__bottom { padding: 0 10px 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.vp__row { display: flex; align-items: center; gap: 2px; }
.vp__flex { flex: 1; }
.vp__btn { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 6px; border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
.vp__btn:hover { background: rgba(255,255,255,0.12); }
.vp__btn:focus-visible, .vp__opt:focus-visible, .vp__big:focus-visible { outline: 2px solid var(--tusk); outline-offset: 1px; }
.vp__pill { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--font-mono); letter-spacing: 0.06em; }
.vp__pill.is-cc .vp__pilltxt { color: var(--tusk); }
.vp__time { font: 600 12px/1 var(--font-mono); padding: 0 8px; white-space: nowrap; opacity: 0.9; }
.vp__seek { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; --p: 0%; }
.vp__seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--apex-red) var(--p), rgba(255,255,255,0.3) var(--p)); }
.vp__seek::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.3); }
.vp__seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--apex-red); }
.vp__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: #fff; border: 0; }
.vp__seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }

.vp__big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(122,10,10,0.88); color: #fff; display: none; place-items: center; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.vp__big svg { width: 32px; height: 32px; margin-left: 3px; }
.vp.is-paused:not(.is-loading) .vp__big { display: grid; }
.vp__spin { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff; opacity: 0; }
.vp.is-loading .vp__spin { opacity: 1; animation: vp-spin 0.8s linear infinite; }
@keyframes vp-spin { to { transform: rotate(360deg); } }
.vp__err { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(20,16,14,0.92); color: var(--bone); font: 700 14px/1.4 var(--font-body); cursor: pointer; z-index: 3; }

.vp__ripple { position: absolute; top: 50%; width: 84px; height: 84px; margin-top: -42px; border-radius: 50%; background: rgba(255,255,255,0.16); display: grid; place-items: center; opacity: 0; }
.vp__ripple span { position: absolute; bottom: 16px; font: 800 11px/1 var(--font-mono); }
.vp__ripple svg { margin-top: -10px; }
.vp__ripple--l { left: 12%; }
.vp__ripple--r { right: 12%; }
.vp__ripple.is-on { animation: vp-ripple 600ms var(--ease); }
@keyframes vp-ripple { 0% { opacity: 1; transform: scale(0.85); } 100% { opacity: 0; transform: scale(1.1); } }

/* Subtitles: drawn above the controls, sized to the player width. */
.vp__cc { position: absolute; left: 6%; right: 6%; bottom: 7%; display: flex; flex-direction: column; align-items: center; gap: 0.15em; transition: bottom 220ms var(--ease); z-index: 1; }
.vp.ui-on .vp__cc, .vp.is-paused .vp__cc { bottom: 76px; }
.vp__cc span { font: 700 clamp(15px, 3.4cqw, 40px)/1.3 var(--font-body); text-align: center; color: #fff; background: rgba(0,0,0,0.55); padding: 0.08em 0.4em; border-radius: 4px; text-shadow: 0 1px 2px rgba(0,0,0,0.9); white-space: pre-wrap; }

.vp__menu { position: absolute; right: 10px; bottom: 72px; z-index: 4; width: min(300px, calc(100% - 20px)); max-height: calc(100% - 88px); overflow-y: auto; padding: 8px; background: rgba(20,16,14,0.96); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,0.6); overscroll-behavior: contain; }
.vp__sec + .vp__sec { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.vp__h { font: 700 10px/1 var(--font-mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--tusk); padding: 8px 10px 6px; }
.vp__opt { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 8px 10px 8px 30px; border: 0; border-radius: 8px; background: none; color: #fff; text-align: left; font: 600 14px/1.2 var(--font-body); cursor: pointer; position: relative; }
.vp__opt:hover { background: rgba(255,255,255,0.08); }
.vp__opt.is-on::before { content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--tusk); }
.vp__opt small { color: var(--dim); font-weight: 600; }
.vp__chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 4px 4px; }
.vp__chips .vp__opt { width: auto; padding: 8px 12px; min-height: 36px; background: rgba(255,255,255,0.06); }
.vp__chips .vp__opt.is-on { background: var(--tusk); color: var(--char); }
.vp__chips .vp__opt.is-on::before { display: none; }
.vp__chips .vp__opt.is-on small { color: inherit; opacity: 0.7; }

.vp.is-full .vp__title { font-size: 16px; }
.vp.is-full .vp__top { padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); }
.vp.is-full .vp__bottom { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }

/* Narrow player: fewer buttons, roomier touch targets. */
@container (max-width: 520px) {
  .vp__btn--wide, .vp__btn--vol { display: none; }
  .vp__time { font-size: 11px; padding: 0 4px; }
  .vp__title { font-size: 12px; }
  .vp__big { width: 60px; height: 60px; }
  .vp.ui-on .vp__cc, .vp.is-paused .vp__cc { bottom: 70px; }
}
@media (pointer: coarse) {
  .vp__btn { min-width: 44px; height: 44px; }
  .vp__seek { height: 28px; }
  .vp__seek::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -7px; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  /* Keep the player in view while the episode list scrolls under it. */
  .ws .player { position: sticky; top: var(--wbar-h, 52px); z-index: 20; }
  .wbar__right { gap: 6px; }
  .lang__btn #langCode { display: none; }
  .lang__btn { width: 36px; padding: 0; justify-content: center; }
  .eps { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
  .ws__ctl { width: 100%; }
  .ws__ctl .ctl { flex: 1; padding: 11px 12px; }
  .ws__ctl .check { width: 100%; padding: 4px 0; }
  .modal { align-items: flex-end; padding: 0; }
  .modal__card { width: 100%; max-height: 92svh; border-radius: 16px 16px 0 0; padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .toast { bottom: max(22px, env(safe-area-inset-bottom)); }
  .savecard { right: 16px; left: 16px; width: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) {
  #joinVip { display: none; }
}
/* Phone held sideways: fit the whole player on screen. */
@media (orientation: landscape) and (max-height: 520px) {
  /* Sideways is for watching: keep the bar to one line so the player fits. */
  .wnav { display: none; }
  .wmain { padding-top: 0; }
  .ws .player { position: relative; top: auto; width: min(100%, calc((100svh - 60px) * 16 / 9)); margin: 0 auto; }
}

/* Help: AI assistant and the form to reach a person (watch/help.js) */
.help-fab { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--bone); font: 700 14px/1 var(--font-body); cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,0.45); transition: transform 0.22s ease, opacity 0.22s ease; }
.help.is-tucked .help-fab, .help.is-typing .help-fab { transform: translateY(calc(100% + 28px)); opacity: 0; pointer-events: none; }
.help-fab:hover { border-color: var(--tusk); }
.help-fab__q { width: 24px; height: 24px; border-radius: 999px; background: var(--tusk); color: var(--char); display: grid; place-items: center; font-weight: 800; }
.help.is-open .help-fab, body.modal-open .help-fab, body.has-savecard .help-fab { display: none; }
.help-panel { position: fixed; right: 16px; bottom: 16px; z-index: 45; width: min(380px, calc(100% - 32px)); height: min(600px, calc(100svh - 32px)); display: flex; flex-direction: column; background: var(--char); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 44px rgba(0,0,0,0.6); overflow: hidden; }
.help-panel[hidden] { display: none; }
.help-panel__bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--slag); }
.help-panel__title { flex: 1; margin: 0; font: 700 16px/1.2 var(--font-body); color: var(--bone); }
.help-panel__new { background: none; border: 0; color: var(--tusk); font: 600 13px/1 var(--font-body); cursor: pointer; padding: 6px; min-height: 36px; }
.help-panel__close { font-size: 20px; color: var(--bone); }
.help-log { flex: 1; min-height: 110px; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.help-msg { margin: 0; max-width: 88%; padding: 10px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.help-msg--ai { align-self: flex-start; background: var(--raised); color: var(--bone); border-top-left-radius: 4px; }
.help-msg--me { align-self: flex-end; background: var(--blood); color: var(--white); border-top-right-radius: 4px; white-space: pre-wrap; }
.help-msg--sys { align-self: stretch; max-width: none; background: none; border: 1px dashed var(--line); color: var(--dim); font-size: 13px; }
.help-msg--typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px; }
.help-msg--typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: help-dot 1.2s ease-in-out infinite; }
.help-msg--typing i:nth-of-type(2) { animation-delay: 0.15s; }
.help-msg--typing i:nth-of-type(3) { animation-delay: 0.3s; }
@keyframes help-dot { 0%, 60%, 100% { opacity: 0.35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .help-msg--typing i { animation: none; opacity: 0.7; } }
.help-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.help-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.help-chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--bone); font: 600 14px/1.25 var(--font-body); text-align: left; cursor: pointer; }
.help-chip:hover, .help-chip:focus-visible { border-color: var(--tusk); color: var(--white); }
.help-retry { align-self: flex-start; margin-top: -4px; }
.help-chip:focus-visible, .help-retry:focus-visible, .help-person:focus-visible, .help-send:focus-visible { outline: 2px solid var(--tusk); outline-offset: 1px; }
.help-past { flex: 1; min-height: 110px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.help-past[hidden], .help-log[hidden] { display: none; }
.help-past__back { align-self: flex-start; }
.help-past__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-past__item { width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--bone); font: 500 14px/1.4 var(--font-body); cursor: pointer; }
.help-past__item:hover, .help-past__item:focus-visible { border-color: var(--tusk); }
.help-past__item:focus-visible, .help-past__back:focus-visible, .help-panel__new:focus-visible { outline: 2px solid var(--tusk); outline-offset: 1px; }
.help-past__when { margin: 0; color: var(--dim); font-size: 12px; }
.help-past__first { overflow-wrap: anywhere; }
.help-past__note { margin: 4px 0 0; color: var(--dim); font-size: 12px; line-height: 1.4; }
.help-msg a { color: var(--tusk); }
.help-ask { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--slag); }
.help-ask[hidden], .help-form[hidden] { display: none; }
.help-ask textarea, .help-form textarea, .help-form input[type=email] { width: 100%; resize: none; background: var(--raised); color: var(--bone); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 500 14px/1.4 var(--font-body); }
.help-ask textarea { min-height: 44px; max-height: 120px; }
.help-ask textarea:focus, .help-form textarea:focus, .help-form input:focus { outline: 2px solid var(--tusk); outline-offset: 1px; }
.help-send { flex-shrink: 0; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--tusk); color: var(--char); display: grid; place-items: center; cursor: pointer; }
.help-send:hover { filter: brightness(1.08); }
.help-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.help-form { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--slag); overflow-y: auto; max-height: 62%; flex-shrink: 0; }
.help-form h3 { margin: 0; font: 700 15px/1.3 var(--font-body); color: var(--bone); }
.help-form__lead { margin: -4px 0 0; color: var(--dim); font-size: 13px; }
.help-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--dim); }
.help-form .help-form__check { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--bone); }
.help-form__check input { margin-top: 3px; accent-color: var(--tusk); }
.help-form__err { margin: 0; min-height: 1em; color: var(--amber); font-size: 13px; }
.help-form__row { display: flex; justify-content: space-between; gap: 8px; }
.help-panel__foot { padding: 6px 12px 10px; display: flex; align-items: center; gap: 10px; }
.help-person { flex-shrink: 0; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--tusk); font: 700 13px/1.2 var(--font-body); cursor: pointer; }
.help-person:hover { border-color: var(--tusk); }
.help-person[hidden] { display: none; }
.help-ai { flex: 1; min-width: 0; margin: 0; color: var(--dim); font-size: 11px; line-height: 1.35; }
/* Phones: a full-screen chat. The height and top follow the visual viewport (set in help.js) so the
   box stays above the keyboard; the footer steps aside while the keyboard is up. */
@media (max-width: 480px) {
  html.help-lock, html.help-lock body { overflow: hidden; }
  .help-panel { top: var(--help-top, 0); right: 0; bottom: auto; left: 0; width: 100%; height: var(--help-h, 100%); border: 0; border-radius: 0; box-shadow: none; }
  .help-panel__bar { gap: 4px; padding: calc(4px + env(safe-area-inset-top, 0px)) 4px 4px 16px; }
  .help-panel__new { min-height: 44px; padding: 6px 10px; }
  .help-panel__close { width: 44px; height: 44px; border: 0; background: none; font-size: 26px; }
  .help-msg { font-size: 15px; }
  .help-panel__foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .help.help-kb .help-panel__foot { display: none; }
  .help-fab__label { display: none; }
  .help-fab { padding: 10px; }
}
@media (orientation: landscape) and (max-height: 520px) { .help-fab { display: none; } }

/* Ads for viewers without VIP (watch/ads.js). Space is reserved so the page doesn't jump. */
.adslot { margin: 28px auto; max-width: 970px; min-height: 120px; }
.adslot__label { margin: 0 0 6px; color: var(--dim); font: 600 11px/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; }
.adslot ins[data-ad-status="unfilled"] { display: none !important; }
@media (max-width: 640px) { .adslot { min-height: 280px; } }

/* ---------- comments, discussion, danmaku, likes (watch/social.js, watch/danmaku.js) ---------- */
/* Wide screens: episodes and comments beside the player, like Tencent Video. */
/* Narrower: one column in page order. The wrapper steps aside so the player can stay
   pinned to the top for the whole page, not just its own box. */
.ws--social .ws__main { display: contents; }
.ws--social .ws__side { margin-top: 12px; }
@media (min-width: 1100px) {
  .ws--social { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "main side" "info side" "ad ad"; column-gap: 20px; align-items: start; }
  .ws--social .ws__main { display: block; grid-area: main; min-width: 0; }
  .ws--social .ws__side { grid-area: side; margin-top: 0; }
  .ws--social .ws__info { grid-area: info; }
  .ws--social .ws__ad { grid-area: ad; }
  /* Room at the bottom for the Help button, which would otherwise cover Send. */
  .ws--social .ws__side { position: sticky; top: 72px; height: min(calc(100vh - 160px), 760px); }
}
.ws__side { display: flex; flex-direction: column; min-height: 0; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sp__tabs { display: flex; border-bottom: 1px solid var(--line); flex: none; }
.sp__tab { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); font: 700 14px/1 var(--font-body); padding: 14px 0 12px; cursor: pointer; }
.sp__tab.is-on { color: var(--bone); border-bottom-color: var(--tusk); }
.sp__n { font: 600 12px/1 var(--font-mono); color: var(--dim); margin-left: 2px; }
.sp__panel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px; }
.sp__panel .eps { margin: 0; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); }
.sp__sort { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.sp__sortb { background: none; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font: 700 12px/1 var(--font-body); padding: 6px 12px; cursor: pointer; }
.sp__sortb.is-on { color: var(--char); background: var(--tusk); border-color: var(--tusk); }
.sp__epnote { margin-left: auto; color: var(--dim); font: 600 12px/1 var(--font-mono); }
.sp__empty { color: var(--dim); text-align: center; padding: 28px 8px; font-size: 14px; }
.sp__moreb { display: block; width: 100%; margin-top: 8px; background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); padding: 9px; cursor: pointer; font: 700 12px/1 var(--font-body); }
/* The box stays at the bottom of the panel, always within reach. */
.sp__compose { flex: none; border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--raised); }
.sp__input { width: 100%; resize: none; min-height: 40px; max-height: 140px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--char); color: var(--white); font: 15px/1.4 var(--font-body); }
.sp__input:focus { outline: 2px solid var(--tusk); outline-offset: 1px; }
.sp__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.sp__spoil { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font: 600 13px/1 var(--font-body); cursor: pointer; }
.sp__spoil input { accent-color: var(--tusk); }
.sp__replying { display: flex; align-items: center; justify-content: space-between; color: var(--tusk); font: 600 12px/1.2 var(--font-body); margin-bottom: 6px; }
.sp__x { background: none; border: 0; color: var(--dim); font-size: 20px; cursor: pointer; line-height: 1; }
.sp__err { color: #ff9a8a; font-size: 13px; margin: 0; }
.sp__reasons { display: grid; gap: 8px; margin: 6px 0 12px; }
.sp__reasons label { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.sp__reasons input { accent-color: var(--tusk); }
.sp__reportform textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--char); color: var(--white); font: inherit; margin-bottom: 10px; resize: vertical; }

/* One comment */
.pc { padding: 12px 2px; border-bottom: 1px solid var(--line); }
.pc:last-of-type { border-bottom: 0; }
.pc--reply { padding: 10px 0 6px 12px; border-bottom: 0; border-left: 2px solid var(--line); margin-top: 6px; }
.pc__head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pc__name { font: 700 13px/1.2 var(--font-body); color: var(--bone); }
.pc__name--gone { color: var(--dim); font-weight: 600; }
.pc__tag { font: 600 11px/1 var(--font-mono); color: var(--dim); }
.pc__staff { font: 800 10px/1 var(--font-body); letter-spacing: 0.08em; color: var(--char); background: var(--tusk); border-radius: 4px; padding: 3px 5px; }
.pc__at { margin-left: auto; font: 600 11px/1 var(--font-mono); color: var(--dim); }
.pc__body { margin: 6px 0 0; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.pc__body--gone { color: var(--dim); font-style: italic; }
.pc__held { margin: 6px 0 0; font: 600 12px/1.3 var(--font-body); color: var(--amber); }
.pc__spoil { margin-top: 6px; width: 100%; text-align: left; border: 1px dashed var(--line); border-radius: 8px; background: rgba(201,169,97,0.06); color: var(--dim); padding: 10px 12px; cursor: pointer; font: 600 13px/1.2 var(--font-body); }
.pc__tools { display: flex; gap: 14px; margin-top: 8px; }
.pc__t { background: none; border: 0; padding: 4px 0; color: var(--dim); font: 600 12px/1 var(--font-body); cursor: pointer; }
.pc__t:hover, .pc__t.is-on { color: var(--tusk); }
.pc__dmt { font: 700 11px/1 var(--font-mono); color: var(--char); background: var(--tusk); border-radius: 4px; padding: 3px 5px; }
.pc__more { background: none; border: 0; padding: 6px 0 0; color: var(--tusk); font: 700 12px/1 var(--font-body); cursor: pointer; }

/* The row under the player: like, comments, share */
.ws__acts { display: flex; align-items: center; gap: 6px; }
.act { display: inline-flex; align-items: center; gap: 6px; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--bone); font: 700 13px/1 var(--font-body); cursor: pointer; }
.act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.act:hover { border-color: var(--tusk); }
.act--like.is-on { color: #ff6b6b; border-color: rgba(255,107,107,0.5); }
.act--like.is-on svg { fill: currentColor; }
@media (prefers-reduced-motion: no-preference) { .act--like.is-on svg { animation: likepop 260ms var(--ease); } }
@keyframes likepop { 50% { transform: scale(1.25); } }

/* Danmaku over the top half of the picture; subtitles keep the bottom. */
.vp__dm { position: absolute; left: 0; right: 0; top: 4%; height: 92%; overflow: hidden; pointer-events: none; z-index: 1; }
.vp__dmi { position: absolute; left: 100%; white-space: nowrap; font: 700 var(--dm-size, 18px)/1.2 var(--font-body); color: #fff; text-shadow: 0 0 2px #000, 0 1px 3px rgba(0,0,0,0.9); will-change: transform; }
.vp__dmi.is-me { outline: 1px solid rgba(255,255,255,0.85); border-radius: 4px; padding: 0 4px; }
.vp__dmbtn { font: 800 12px/1 var(--font-body); padding: 0 8px; }
.vp__dmbtn.is-off { opacity: 0.45; text-decoration: line-through; }
.vp__dmform { display: flex; align-items: center; gap: 4px; margin-left: 4px; flex: 0 1 260px; min-width: 0; }
.vp__dminput { flex: 1; min-width: 0; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); background: rgba(0,0,0,0.45); color: #fff; font: 13px/1 var(--font-body); }
.vp__dminput:focus { outline: none; border-color: var(--tusk); }
.vp__dmsend { height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--tusk); color: var(--char); font: 800 12px/1 var(--font-body); cursor: pointer; }
/* The phone's box under the player (the control bar has no room) */
.ws__dm { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: var(--char); border-bottom: 1px solid var(--line); }
.ws__dm input { flex: 1; min-width: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--white); font: 14px/1 var(--font-body); }
.ws__dm input:focus { outline: 2px solid var(--tusk); outline-offset: 1px; }
.ws__dmtoggle { height: 36px; min-width: 36px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--bone); font: 800 13px/1 var(--font-body); cursor: pointer; }
.ws__dmtoggle.is-off { opacity: 0.45; text-decoration: line-through; }
.ws__dmsend { height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--tusk); color: var(--char); font: 800 13px/1 var(--font-body); cursor: pointer; }
@media (min-width: 1100px) { .wmain:has(.ws--social) { max-width: 1440px; } }
/* Below the two-column width the panel grows with the page and the box sticks to the bottom of the screen. */
@media (max-width: 1099px) {
  .ws--social .ws__side { overflow: visible; }
  .ws--social .sp__panel { overflow: visible; }
  .ws--social .sp__tabs { position: sticky; top: calc(var(--wbar-h, 52px) + 56.25vw + 52px); z-index: 18; background: var(--raised); border-radius: 12px 12px 0 0; }
  /* Keep Send clear of the Help button in the corner (with its label up to 480 px). */
  .ws--social .sp__row { padding-right: 130px; }
  .ws--social .sp__compose { position: sticky; bottom: 0; z-index: 18; border-radius: 0 0 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (min-width: 641px) and (max-width: 1099px) { .ws--social .sp__tabs { position: static; } }
@media (max-width: 760px) {
  /* The phone has its own box and switch under the player; the control bar has no room for them. */
  .vp__dmform, .vp__dmbtn { display: none; }
  .ws__dm { display: flex; }
  .ws--social .ws__side { margin: 12px 16px 0; }
  .ws__acts { width: 100%; }
}
@media (max-width: 480px) {
  .ws--social .sp__row { padding-right: 60px; }
}
/* Phones held upright: the box stays under the player, which stays at the top. */
@media (max-width: 640px) { .ws__dm { position: sticky; z-index: 19; top: calc(var(--wbar-h, 52px) + 56.25vw); } }
@media (orientation: landscape) and (max-height: 520px) { .ws__dm { position: static; } }

/* ---------- pages written by the Worker (src/pages.js): guides, and the app's text before it runs ---------- */
.ssr h3 { font: 700 18px/1.3 var(--font-body); color: var(--bone); margin: 22px 0 6px; }
.ssr h3 a { color: inherit; text-decoration: none; }
.ssr-meta { color: var(--dim); font-size: 13px; margin: 0 0 8px; }
.ssr-item { margin: 0 0 18px; }
.guide__facts { color: var(--tusk); font: 700 12px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; margin: 6px 0 18px; }
.guide__player { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); margin: 0 0 14px; }
.guide__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.guide__more { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.guide__more a { display: block; color: var(--white); text-decoration: none; }
.guide__more img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); margin-bottom: 6px; }
.guide__more span { display: block; font-weight: 700; line-height: 1.3; }
.guide__more small { display: block; color: var(--dim); font-size: 12px; line-height: 1.4; margin-top: 4px; }
.guide__langs a, .guide__langs b { white-space: nowrap; }
.guide__langs b { color: var(--white); font-weight: 700; }
.ssr-faq { margin: 0 0 8px; }
.ssr-faq dt { font-weight: 700; color: var(--white); margin-top: 14px; }
.ssr-faq dd { margin: 4px 0 0; color: var(--dim); line-height: 1.55; overflow-wrap: anywhere; }
.guide .btn { text-decoration: none; }

/* Touch screens: iOS zooms the page into any field set below 16px, so fields stay at 16px. */
@media (pointer: coarse) {
  .help-ask textarea, .help-form textarea, .help-form input[type=email], .sp__input, .sp__reportform textarea, .vp__dminput, .ws__dm input { font-size: 16px; }
}
