:root {
  --bg: #080b0e;
  --bg-soft: #0d1116;
  --panel: #11161c;
  --panel-2: #151b22;
  --panel-3: #1b222b;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --text: #f5f7fa;
  --muted: #929ca8;
  --muted-2: #68727d;
  --accent: #f06b2d;
  --accent-2: #ff8a47;
  --accent-soft: rgba(240,107,45,.13);
  --success: #51d68a;
  --success-soft: rgba(81,214,138,.12);
  --danger: #ff6464;
  --sidebar: 300px;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 86% 0%, rgba(240,107,45,.10), transparent 28rem),
    radial-gradient(circle at 40% 30%, rgba(70,95,112,.06), transparent 35rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
::selection { background: rgba(240,107,45,.35); color: #fff; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: rgba(9,12,16,.95);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 22px 22px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 48px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240,107,45,.45);
  background:
    linear-gradient(145deg, rgba(240,107,45,.18), transparent 55%),
    #11161b;
  box-shadow: inset 0 0 22px rgba(240,107,45,.10);
  transform: skew(-4deg);
}
.brand-mark span {
  color: var(--accent);
  font-weight: 1000;
  font-size: 25px;
  letter-spacing: -2px;
  text-shadow: 0 0 18px rgba(240,107,45,.45);
}
.eyebrow {
  margin: 0 0 2px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .19em;
  color: #a9b0b8;
}
.eyebrow.accent { color: var(--accent-2); font-size: 11px; }
.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1;
  letter-spacing: .04em;
}
.brand-subtitle {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.side-nav { padding: 18px 12px 22px; flex: 1; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.nav-total { color: var(--muted); letter-spacing: 0; }
.nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: #a9b1bb;
  transition: .18s ease;
}
.nav-item:hover { background: rgba(255,255,255,.04); color: #fff; }
.nav-item.active { background: var(--accent-soft); color: #fff; }
.nav-index { color: var(--muted-2); font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.nav-item.active .nav-index { color: var(--accent-2); }
.nav-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 650;
}
.nav-count { font-size: 10px; color: var(--muted-2); }
.nav-item.complete .nav-count { color: var(--success); }

.sidebar-actions {
  padding: 16px 14px 22px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.full { width: 100%; }
.import-label { display: grid !important; place-items: center; }

.content-wrap { margin-left: var(--sidebar); }
.topbar {
  height: 72px;
  padding: 0 clamp(18px,4vw,48px);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(8,11,14,.80);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}

.search-wrap {
  flex: 1;
  max-width: 720px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 15px;
  color: var(--muted);
  font-size: 20px;
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 48px 0 44px;
  background: rgba(255,255,255,.045);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border .18s, box-shadow .18s, background .18s;
}
.search-wrap input::placeholder { color: #707a85; }
.search-wrap input:focus {
  border-color: rgba(240,107,45,.55);
  box-shadow: 0 0 0 3px rgba(240,107,45,.10);
  background: rgba(255,255,255,.06);
}
.search-wrap kbd {
  position: absolute;
  right: 11px;
  color: var(--muted-2);
  border: 1px solid var(--line-strong);
  border-bottom-color: rgba(255,255,255,.19);
  background: #11161b;
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 10px;
}

.filter-group { display: flex; gap: 6px; }
.filter-chip {
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
  transition: .18s;
}
.filter-chip:hover { color: #fff; border-color: var(--line-strong); }
.filter-chip.active {
  color: #fff;
  border-color: rgba(240,107,45,.35);
  background: var(--accent-soft);
}

main {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 0 clamp(18px,4vw,50px) 50px;
}

.hero {
  position: relative;
  min-height: 395px;
  padding: 62px 0 42px;
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(310px,.65fr);
  gap: 40px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "II";
  position: absolute;
  z-index: -1;
  right: 7%;
  top: -8px;
  font-size: min(28vw, 370px);
  line-height: 1;
  font-weight: 1000;
  letter-spacing: -4vw;
  color: rgba(255,255,255,.012);
  transform: skew(-7deg);
  pointer-events: none;
}
.hero h2 {
  margin: 12px 0 18px;
  font-size: clamp(42px,5vw,76px);
  line-height: .94;
  letter-spacing: -.055em;
}
.hero h2 span { color: var(--accent-2); }
.hero-text {
  max-width: 710px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 23px; }
.hero-badges span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  border-radius: 7px;
  color: #a9b1bb;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .02em;
}

.global-progress-card {
  display: grid;
  grid-template-columns: 124px 1fr;
  gap: 20px;
  align-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(240,107,45,.08), transparent 45%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ring {
  --p: calc(var(--progress) * 1%);
  width: 124px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--accent) var(--p), rgba(255,255,255,.07) 0);
  position: relative;
}
.ring::before {
  content:"";
  position:absolute;
  inset: 8px;
  border-radius:50%;
  background: #11161c;
}
.ring-inner { position: relative; z-index: 1; text-align: center; }
.ring-inner strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.ring-inner span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.progress-copy .muted-label { color: var(--muted); font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.progress-copy > strong { display: block; margin: 5px 0 11px; font-size: 25px; }
.progress-copy > strong small { color: var(--muted-2); font-weight: 500; }
.progress-track {
  width: 100%;
  height: 5px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255,255,255,.07);
}
.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  border-radius: inherit;
  transition: width .28s ease;
}
.progress-copy p { margin: 10px 0 0; color: var(--muted-2); font-size: 10px; }

.toolbar-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 32px 0 18px;
}
.section-kicker {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .17em;
}
.toolbar-row h3, .section-heading h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }

.secondary-button, .danger-button {
  min-height: 36px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
  color: #b9c0c8;
  text-decoration: none;
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
  transition: .18s;
}
.secondary-button:hover { background: rgba(255,255,255,.07); color:#fff; border-color: var(--line-strong); }
.danger-button { color: #d89090; }
.danger-button:hover { background: rgba(255,100,100,.09); color: #ff8c8c; border-color: rgba(255,100,100,.25); }

.mission-section { padding: 4px 0 42px; }
.section-heading {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}
.section-heading > div { display: flex; gap: 14px; align-items: center; }
.section-number {
  color: #39414b;
  font: 800 28px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.section-progress {
  color: var(--muted);
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.missions-grid { display: grid; gap: 12px; }
.mission-card {
  scroll-margin-top: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(160deg, rgba(255,255,255,.025), transparent 34%), var(--panel);
  transition: border-color .2s, transform .2s, opacity .2s;
}
.mission-card:hover { border-color: rgba(255,255,255,.12); }
.mission-card.complete { border-color: rgba(81,214,138,.22); }
.mission-card.hidden-by-search { display: none; }

.mission-header {
  width: 100%;
  min-height: 78px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) auto auto;
  gap: 14px;
  align-items: center;
  text-align: left;
}
.mission-icon {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0c1116;
  color: var(--accent-2);
  font: 850 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.mission-card.complete .mission-icon {
  color: var(--success);
  border-color: rgba(81,214,138,.24);
  background: var(--success-soft);
}
.mission-title-wrap { min-width: 0; }
.mission-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.mission-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mission-completion {
  display: none;
  margin-top: 5px;
  color: var(--success);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.mission-card.complete .mission-completion { display: block; }
.mission-progress {
  width: 155px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
}
.mission-progress .progress-track { grid-column: 1 / -1; height: 3px; }
.mission-count { font-size: 11px; color: #c7ccd2; font-weight: 750; text-align: right; }
.mission-percent { font-size: 9px; color: var(--muted-2); }
.chevron { color: var(--muted-2); transition: transform .22s ease; }
.mission-card.open .chevron { transform: rotate(180deg); }

.mission-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
  border-top: 0 solid var(--line);
}
.mission-card.open .mission-body {
  grid-template-rows: 1fr;
  border-top-width: 1px;
}
.mission-body-inner { min-height: 0; overflow: hidden; }
.mission-content { padding: 18px; display: grid; gap: 20px; }

.challenge-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 7px;
}
.challenge-row {
  display: grid;
  grid-template-columns: 23px minmax(0,1fr);
  gap: 9px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c7ced5;
  cursor: pointer;
  transition: .16s ease;
}
.challenge-row:hover { border-color: var(--line); background: rgba(255,255,255,.025); }
.challenge-row.hidden-challenge { display:none; }
.challenge-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.fake-check {
  width: 19px;
  height: 19px;
  border: 1px solid #3b444e;
  border-radius: 5px;
  display: grid;
  place-items: center;
  margin-top: 1px;
  background: #0b1015;
  transition: .16s;
}
.fake-check::after {
  content: "✓";
  font-size: 12px;
  font-weight: 1000;
  color: #09110d;
  opacity: 0;
  transform: scale(.5);
  transition: .15s;
}
.challenge-row:has(input:checked) { color: #737d87; }
.challenge-row:has(input:checked) .fake-check {
  background: var(--success);
  border-color: var(--success);
}
.challenge-row:has(input:checked) .fake-check::after { opacity:1; transform:scale(1); }
.challenge-row:has(input:checked) .challenge-text { text-decoration: line-through; text-decoration-color: rgba(115,125,135,.55); }
.challenge-text { font-size: 12px; line-height: 1.45; }
.challenge-index { color: var(--muted-2); font: 700 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: 6px; }

.video-area {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.video-area > h4 {
  margin: 0 0 12px;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .13em;
}
.video-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.video-grid.single { grid-template-columns: minmax(0, 760px); }
.video-card {
  overflow: hidden;
  background: #0c1014;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.video-card.update-card { border-color: rgba(240,107,45,.28); }
.update-banner {
  padding: 11px 13px;
  display: flex;
  gap: 9px;
  align-items: center;
  background: var(--accent-soft);
  border-bottom: 1px solid rgba(240,107,45,.18);
}
.update-banner strong { font-size: 10px; color: var(--accent-2); text-transform: uppercase; letter-spacing:.08em; }
.update-banner span { font-size: 10px; color: #b7a097; }
.video-player {
  position: relative;
  aspect-ratio: 16/9;
  background: #050607;
  overflow: hidden;
}
.video-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-cover {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  overflow: hidden;
  background: #06080a;
  color: inherit;
}
.video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: .82;
  transition: transform .2s, opacity .2s, filter .2s;
}
.video-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.58));
  pointer-events: none;
}
.video-cover:hover img { transform: scale(1.025); opacity: .96; }
.play-badge {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  transform: translate(-50%,-50%);
  width: 68px;
  height: 48px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(240,107,45,.97);
  color:#fff;
  font-size: 20px;
  padding-left: 3px;
  box-shadow: 0 10px 30px rgba(0,0,0,.42);
  transition: transform .16s, background .16s;
}
.video-cover:hover .play-badge {
  transform: translate(-50%,-50%) scale(1.08);
  background: var(--accent-2);
}
.play-label {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
}
.video-info {
  padding: 13px;
  border-top: 1px solid var(--line);
}
.video-info h5 {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.38;
}
.video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.youtube-button {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  transition: .16s;
}
.youtube-button:hover { background: var(--accent-2); transform: translateY(-1px); }
.direct-link {
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 9px;
  word-break: break-all;
  text-decoration: none;
}
.direct-link:hover { color: var(--muted); text-decoration: underline; }

.no-video {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--muted-2);
  font-size: 10px;
}
.no-results {
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align:center;
  color: var(--muted);
  margin: 12px 0 30px;
}
.no-results-icon { font-size: 38px; color: var(--muted-2); }
.no-results h3 { color:#fff; margin:10px 0 5px; }
.no-results p { font-size: 12px; margin: 0 0 16px; }

footer {
  margin-top: 20px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.6;
}
footer strong { color: var(--muted); }
.footer-links { display:flex; flex-wrap:wrap; gap:14px; margin-top: 8px; }
.footer-links a { color: var(--muted); text-decoration:none; }
.footer-links a:hover { color:var(--accent-2); }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #171d24;
  color: #e7eaee;
  font-size: 11px;
  box-shadow: var(--shadow);
  transform: translateY(15px);
  opacity: 0;
  pointer-events: none;
  transition: .22s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1080px) {
  :root { --sidebar: 270px; }
  .hero { grid-template-columns: 1fr; }
  .global-progress-card { max-width: 520px; }
  .challenge-list { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  :root { --sidebar: 290px; }
  .sidebar {
    transform: translateX(-102%);
    transition: transform .22s ease;
    box-shadow: 30px 0 70px rgba(0,0,0,.55);
  }
  .sidebar.open { transform: translateX(0); }
  .content-wrap { margin-left: 0; }
  .menu-button { display: grid; place-items: center; }
  .topbar { padding-inline: 14px; }
  .filter-group { display:none; }
  main { padding-inline: 18px; }
  .hero { min-height: 0; padding-top: 42px; }
  .hero h2 { font-size: clamp(39px,12vw,68px); }
  .video-grid, .video-grid.single { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .search-wrap kbd { display:none; }
  .search-wrap input { padding-right: 14px; }
  .global-progress-card { grid-template-columns: 96px 1fr; padding: 18px; }
  .ring { width: 96px; }
  .mission-header {
    grid-template-columns: 36px minmax(0,1fr) auto;
    padding: 13px;
    gap: 10px;
  }
  .mission-icon { width:36px;height:36px; }
  .mission-progress { grid-column: 2 / 3; width: 100%; grid-template-columns:1fr auto; }
  .mission-progress .progress-track { grid-column:1 / 2; }
  .mission-progress .mission-percent { display:none; }
  .chevron { grid-column: 3; grid-row: 1 / span 2; }
  .challenge-row { padding-inline: 8px; }
  .video-info h5 { font-size:10px; }
  .toolbar-row { align-items:center; }
  .toolbar-row h3 { font-size:18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { transition: none !important; animation: none !important; }
}
