:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel2: #1a1f2a;
  --line: rgba(255, 255, 255, 0.08);
  --text: #eceae4;
  --muted: #9aa0ab;
  --gold: #f2c75c;
  --ok: #5fd39a;
  --bad: #ff7a7a;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 Inter, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; gap: 20px; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 48px); background: rgba(11, 13, 18, 0.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 18px; white-space: nowrap; }
.brand__logo { width: 32px; height: 32px; border-radius: 9px; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M7 18v-4M11 22V10M15 25V7M19 21v-10M23 17v-2' stroke='%230b0d12' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center/100%; }
.toplink { color: var(--muted); font-size: 14px; }
.toplink:hover { color: var(--gold); }

main { padding: 22px clamp(16px, 4vw, 48px) 60px; max-width: 1400px; margin: 0 auto; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
h1 { font-size: clamp(22px, 3vw, 30px); line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: 0.01em; }
.muted { color: var(--muted); }

/* danh sách */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 22px; }
.card { display: flex; gap: 16px; padding: 14px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); transition: 0.2s; }
.card:hover { border-color: rgba(242, 199, 92, 0.55); transform: translateY(-2px); }
.card img, .card .noposter { width: 108px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px; background: var(--panel2); flex: none; }
.card h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.card p { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 10px; background: rgba(242, 199, 92, 0.12); color: var(--gold); white-space: nowrap; }
.chip--ok { background: rgba(95, 211, 154, 0.14); color: var(--ok); }
.chip--bad { background: rgba(255, 122, 122, 0.14); color: var(--bad); }

/* trang tập */
.back { display: inline-block; color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.back:hover { color: var(--gold); }
.ep { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .ep { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 22px; }

.tabs { display: flex; gap: 8px; margin: 16px 0 12px; }
.tabs button { padding: 7px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.tabs button.is-on { background: var(--gold); color: #111; border-color: var(--gold); font-weight: 600; }
.stage video { display: block; width: min(100%, 380px); aspect-ratio: 9 / 16; margin: 0 auto 14px; border-radius: 12px; background: #000; }

.transport { display: flex; align-items: center; gap: 14px; }
.playbtn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--gold); cursor: pointer; flex: none; position: relative; }
.playbtn::after { content: ''; position: absolute; left: 20px; top: 16px; border-left: 16px solid #111; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.playbtn.is-playing::after { left: 18px; top: 17px; width: 5px; height: 18px; border: 0; background: #111; box-shadow: 10px 0 0 #111; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13.5px; min-width: 96px; text-align: right; }
.wave { position: relative; flex: 1; height: 86px; cursor: pointer; }
.wave canvas { width: 100%; height: 100%; display: block; }
.scenes { position: relative; height: 26px; margin-top: 6px; }
.scenes button { position: absolute; top: 0; height: 22px; border: 0; border-left: 2px solid rgba(242, 199, 92, 0.6); background: rgba(255, 255, 255, 0.04); color: var(--muted); font-size: 11.5px; text-align: left; padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.scenes button:hover, .scenes button.is-on { color: var(--text); background: rgba(242, 199, 92, 0.14); }

.script { max-height: 70vh; overflow: auto; padding-right: 6px; scroll-behavior: smooth; }
.scene-h { margin: 18px 0 8px; font-weight: 650; color: var(--gold); font-size: 14px; }
.scene-h small { display: block; color: var(--muted); font-weight: 400; font-style: italic; font-size: 13px; }
.ln { display: flex; gap: 10px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.ln:hover { background: rgba(255, 255, 255, 0.04); }
.ln.is-on { background: rgba(242, 199, 92, 0.12); }
.ln b { flex: none; width: 46px; font-size: 13px; }
.ln span { flex: 1; }
.ln time { flex: none; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }

.cast { display: grid; gap: 12px; }
.who { display: flex; gap: 12px; }
.who i { width: 12px; height: 12px; border-radius: 50%; margin-top: 6px; flex: none; }
.who p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.dl { list-style: none; margin: 0; padding: 0; }
.dl li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl li:last-child { border: 0; }
.dl a { color: var(--gold); }
.dl small { color: var(--muted); }
.qc { width: 100%; border-collapse: collapse; font-size: 13px; }
.qc td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qc td:first-child { width: 18px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.src { font-size: 13px; color: var(--muted); padding-left: 18px; margin: 0; }
.src li { margin-bottom: 6px; }
