:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1b2330; --muted: #667085; --line: #e3e6eb;
  --brand: #1f4e8c; --brand-ink: #fff; --ok: #1d7a46; --ok-bg: #e6f4ec; --warn: #9a5b00; --warn-bg: #fdf1dc;
  --bad: #b42318; --bad-bg: #fdecea; --etc: #1f4e8c; --eoc: #c2410c; --radius: 12px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 4px; }
a { color: var(--brand); }
code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .r { text-align: right; }
.error { color: var(--bad); background: var(--bad-bg); padding: 8px 12px; border-radius: 8px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; padding: 10px 28px;
  background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--brand);
  color: var(--brand-ink); font-weight: 800; letter-spacing: .5px; font-size: 14px; }
.brand-mark.big { width: 56px; height: 56px; font-size: 20px; border-radius: 14px; margin: 0 auto 14px; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 500; }
nav a.active, nav a:hover { background: #edf2f9; color: var(--brand); }
.who { display: flex; gap: 8px; align-items: center; font-weight: 500; }

main { max-width: 1120px; margin: 0 auto; padding: 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #c5ccd6; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: .6; cursor: default; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-align: left; }
button.link:hover { text-decoration: underline; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: #eef1f5; color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }

.login { max-width: 420px; margin: 8vh auto; text-align: center; padding: 32px; }
.login form { text-align: left; display: grid; gap: 14px; margin-top: 20px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
input, select { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; flex-wrap: wrap; }
.meter-wrap { display: grid; gap: 6px; font-size: 13px; color: var(--muted); text-align: right; }
.meter { width: 260px; height: 10px; border-radius: 99px; background: #e3e6eb; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.video-card { display: flex; gap: 14px; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.video-card:hover { border-color: #b9c6d8; box-shadow: 0 2px 10px rgba(16,24,40,.06); }
.video-card .num { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: #edf2f9;
  color: var(--brand); font-weight: 800; }
.video-card.is-done .num { background: var(--ok-bg); color: var(--ok); }
.video-card p { margin: 2px 0 8px; font-size: 13.5px; }

.crumbs { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; margin: 14px 0 18px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; background: #0e1420; border-radius: var(--radius); overflow: hidden; }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player.empty { display: grid; place-items: center; color: #c9d2e0; text-align: center; padding: 20px; }
.player.empty code { background: #222c3d; color: #fff; }
.watch-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.chapters { max-height: 560px; overflow: auto; padding: 16px; }
.chapters ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.chapters li button { display: flex; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 6px; color: var(--ink); font-size: 13.5px; line-height: 1.35; }
.chapters li button:hover { background: #f1f4f8; text-decoration: none; }
.ts { flex: none; width: 42px; color: var(--brand); font-variant-numeric: tabular-nums; font-weight: 600; }

.quiz { margin-top: 4px; } .quiz.locked { background: #fafbfc; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0 0 12px; }
.q legend { display: flex; gap: 10px; font-weight: 600; padding: 0 4px; }
.qn { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #edf2f9; color: var(--brand); display: grid; place-items: center; font-size: 13px; }
.opt { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 7px 10px; border-radius: 8px; cursor: pointer; margin-top: 4px; }
.opt:hover { background: #f5f7fa; } .opt input { margin-top: 4px; }
.q.right { border-color: #a6d8bb; background: #f6fbf8; } .q.wrong { border-color: #f1b8b2; background: #fffafa; }
.opt.answer { background: var(--ok-bg); }
.feedback:empty { display: none; } .feedback { margin-top: 8px; font-size: 14px; }
.summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 10px; background: #edf2f9; }
.summary p { margin: 0; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

.versus { margin: 16px 0; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 12px; align-items: center; margin: 10px 0; }
.bar { height: 18px; background: #eef1f5; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 99px; min-width: 4px; } .bar .etc { background: var(--etc); } .bar .eoc { background: var(--eoc); }
.team { font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.table tr.me td { background: #f3f7fd; }
.scroll { overflow-x: auto; }
.matrix .c { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.matrix td.great { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.matrix td.ok { background: #f2f8f4; } .matrix td.half { background: var(--warn-bg); color: var(--warn); } .matrix td.dim { color: #b4bcc8; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

@media (max-width: 860px) {
  .topbar { position: static; flex-wrap: wrap; gap: 10px; padding: 10px 16px; } .who { margin-left: auto; font-size: 14px; } .brand small { display: none; } nav { order: 3; width: 100%; }
  main { padding: 18px 14px; } .hero { margin-bottom: 16px; } .meter-wrap { width: 100%; text-align: left; } .meter { width: 100%; } .video-layout { grid-template-columns: 1fr; } .chapters { max-height: none; }
}

/* v2 */
.list { display: grid; gap: 12px; }
.video-card .vc-body p { margin: 2px 0 6px; }
.video-card .meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.video-card.locked { opacity: .6; cursor: not-allowed; }
.video-card.locked .num { background: #eef1f5; font-size: 18px; }
.video-card.is-done .num { font-size: 20px; }
.pill.blue { background: #e4ecf7; color: var(--brand); }
.pill.big { font-size: 14px; padding: 6px 14px; margin-top: 8px; }
.hero .btn { margin-top: 10px; }
.lead { margin: 0 0 4px; max-width: 760px; }
.hello { margin: 0; font-size: 14px; }
.login button.link.center { text-align: center; font-size: 14px; }
.btn.disabled { color: var(--muted); background: #f3f4f6; cursor: not-allowed; font-weight: 500; }
.summary { margin: 4px 0 14px; }
.summary.pass { background: var(--ok-bg); }
.locked-msg { max-width: 520px; margin: 30px auto; padding: 32px; }
.matrix td.great { font-size: 15px; }

/* v3: one-try quiz results + team progress */
.opt.ro { cursor: default; justify-content: space-between; align-items: center; }
.opt.ro:hover { background: transparent; }
.opt.answer, .opt.answer:hover { background: var(--ok-bg); }
.opt.picked-wrong, .opt.picked-wrong:hover { background: var(--bad-bg); }
.tag { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.tag.ok { color: var(--ok); background: #fff; } .tag.bad { color: var(--bad); background: #fff; }
.summary.partial { background: var(--warn-bg); }
.team-card { margin-bottom: 16px; padding: 8px 20px 12px; }
.team-card h2 { margin: 12px 0 4px; }
details.person { border-bottom: 1px solid var(--line); }
details.person:last-child { border-bottom: 0; }
details.person summary { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(170px, 1.3fr) 110px 100px;
  gap: 14px; align-items: center; padding: 12px 4px; cursor: pointer; list-style: none; }
details.person summary::-webkit-details-marker { display: none; }
details.person summary:hover { background: #f8fafc; }
details.person[open] summary { background: #f3f7fd; }
.p-name { display: grid; } .p-bar { display: grid; gap: 4px; } .p-bar .meter { width: 100%; height: 8px; }
.p-score { font-weight: 600; } .p-last { text-align: right; }
.detail { margin: 4px 0 8px; } .detail td { padding: 7px 10px; }
details.person .reset { margin: 0 0 12px 10px; }
@media (max-width: 860px) {
  details.person summary { grid-template-columns: 1fr 1fr; }
  .p-last { text-align: left; }
}

/* v4: clips + simplified team progress */
.clip-now { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.chapters li button.current { background: #edf2f9; }
.chapters li button .ts { width: 22px; }
.watch-row { justify-content: flex-start; flex-wrap: wrap; }
.watch-row #nextclip { margin-left: auto; }
.note { background: #edf2f9; color: var(--brand); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.prog .p-bar { display: grid; gap: 4px; min-width: 150px; } .prog .p-bar .meter { width: 100%; height: 8px; }
.prog td { vertical-align: middle; }
.pill { white-space: nowrap; }
/* v5: ETC vs EOC summary on Team progress */
.versus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; }
.vs-card { display: grid; gap: 10px; border-top: 4px solid var(--etc); }
.vs-card.eoc { border-top-color: var(--eoc); }
.vs-head { display: flex; justify-content: space-between; align-items: baseline; } .vs-head h2 { margin: 0; }
.vs-stats { display: flex; gap: 36px; } .vs-stats > div { display: grid; }
.big-num { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter.wide { width: 100%; height: 10px; }
.vs-card.etc .meter span { background: var(--etc); } .vs-card.eoc .meter span { background: var(--eoc); }
@media (max-width: 860px) { .versus-grid { grid-template-columns: 1fr; } }
.contest { background: #fff7e6; border: 1px solid #f5d9a6; color: #6b4500; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin: 10px 0; }
