:root {
  --bg: #0f1115;
  --panel: #171a21;
  --raise: #1f232c;
  --line: #262a33;
  --text: #e7e9ee;
  --dim: #9aa1ad;
  --accent: #ff7755;
  --on: #2a1f1c;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
header, footer, main { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
header { display: flex; align-items: center; height: 56px; border-bottom: 1px solid var(--line); max-width: none; }
header a { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .02em; }
header a span { color: var(--accent); }
main { padding-top: 16px; padding-bottom: 32px; }
footer { color: var(--dim); font-size: .85rem; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); }

.intro { color: var(--dim); margin: 4px 0 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px 16px; }
.card { color: var(--text); text-decoration: none; display: block; }
.thumb { position: relative; display: block; }
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #000; display: block; }
.thumb .len {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .8);
  color: #fff; font-size: .8rem; padding: 1px 6px; border-radius: 4px; font-variant-numeric: tabular-nums;
}
.card h3 { font-size: 1rem; line-height: 1.35; margin: 10px 0 2px; }
.card:hover h3 { color: var(--accent); }
.card p { color: var(--dim); font-size: .9rem; margin: 4px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.player { position: relative; padding-top: 56.25%; background: #000; border-radius: 10px; overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
h1 { font-size: 1.35rem; line-height: 1.3; margin: 16px 0 4px; }
.meta { color: var(--dim); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--line);
  color: var(--text); padding: 8px 14px; border-radius: 999px; text-decoration: none; font: inherit;
  font-size: .9rem; cursor: pointer;
}
.btn:hover { background: var(--raise); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.panel + .panel { margin-top: 16px; }
.panel p { margin: 0 0 10px; }
.panel p:last-child { margin-bottom: 0; }
.panel h2 { font-size: 1rem; margin: 0 0 8px; }

.chapters { list-style: none; margin: 0 -8px; padding: 0; max-height: 70vh; overflow-y: auto; }
.chapters a { display: flex; gap: 12px; padding: 7px 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
.chapters a:hover { background: var(--raise); }
.chapters .t { color: var(--accent); font-variant-numeric: tabular-nums; min-width: 4.2em; }
.chapters li.on a { background: var(--on); }

.more { margin-top: 28px; }
.more h2 { font-size: 1.1rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--raise);
  border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; opacity: 0;
  transition: opacity .2s; pointer-events: none;
}
.toast.show { opacity: 1; }

.empty { text-align: center; padding: 64px 0; }
.empty h1 { font-size: 3rem; margin: 0; color: var(--accent); }

@media (max-width: 900px) {
  .watch { grid-template-columns: 1fr; }
  .chapters { max-height: none; }
}
