:root {
  --bg: #0b0e1a;
  --bg-alt: #0f1324;
  --surface: #141a2e;
  --surface-2: #1b2340;
  --line: rgba(160, 180, 255, 0.12);
  --line-strong: rgba(160, 180, 255, 0.22);
  --text: #eaedf7;
  --muted: #98a1bd;
  --cyan: #3acfff;
  --purple: #b044ff;
  --grad: linear-gradient(120deg, var(--purple), var(--cyan));
  --youtube: #ff3b3b;
  --discord: #5865f2;
  --live: #3ee08f;
  --radius: 14px;
  --radius-sm: 9px;
  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  background-position: -1px -1px;
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(176, 68, 255, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 30%, rgba(58, 207, 255, 0.10), transparent 60%),
    linear-gradient(180deg, transparent 0%, var(--bg) 85%);
  pointer-events: none;
  z-index: -1;
}

img { max-width: 100%; display: block; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 600; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
  margin: 0 0 12px;
}

.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.lede { font-size: 1.12rem; color: var(--muted); max-width: 58ch; margin: 0 0 28px; }
.muted { color: var(--muted); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 26, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sm { font-size: 1rem; }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a:not(.btn) { color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; }
.site-nav a:not(.btn):hover { color: var(--text); text-decoration: none; background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.nav-toggle { display: none; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; font: 500 0.9rem var(--font-body); cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--grad); box-shadow: 0 6px 24px -8px rgba(176, 68, 255, 0.7); }
.btn-primary:hover { box-shadow: 0 10px 30px -8px rgba(58, 207, 255, 0.7); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-yt { background: var(--youtube); margin-left: 6px; }
.btn-discord { background: var(--discord); }

.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.stat-row { display: flex; gap: 36px; margin: 36px 0 0; padding: 0; }
.stat-row div { margin: 0; }
.stat-row dt { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.stat-row dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }

.section { padding: 56px 0; }
.section-tight { padding-top: 8px; }
.section-alt { background: linear-gradient(180deg, rgba(20, 26, 46, 0.6), rgba(20, 26, 46, 0.2)); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.link-arrow { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.link-arrow::after { content: " →"; }

.page-head { padding: 64px 0 32px; }

.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.video-grid-sm { grid-template-columns: repeat(4, 1fr); gap: 16px; }

.video-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.video-card:hover { text-decoration: none; }
.video-card:hover .thumb img { transform: scale(1.04); }
.video-card:hover .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.video-card:hover .video-title { color: var(--cyan); }

.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(11, 14, 26, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.play::after {
  content: "";
  position: absolute;
  left: 22px;
  top: 17px;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

.video-meta { display: flex; flex-direction: column; gap: 4px; }
.video-title { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.15s; }
.video-sub { font-size: 0.85rem; color: var(--muted); }

.video-card-big .thumb { border-radius: 18px; box-shadow: 0 30px 70px -30px rgba(176, 68, 255, 0.55), 0 0 0 1px var(--line-strong); }
.video-card-big .play { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
.video-card-big .video-title { font-size: 1.15rem; }

.skeleton { aspect-ratio: 16 / 9; border-radius: 18px; background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.series-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.series-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: border-color 0.2s, transform 0.2s; }
.series-card:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-2px); }
.series-thumb { aspect-ratio: 16 / 7; background: var(--grad); opacity: 0.95; }
.series-thumb img { width: 100%; height: 100%; object-fit: cover; }
.series-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; align-items: flex-start; }
.series-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-strong); }
.badge-live { color: var(--live); border-color: rgba(62, 224, 143, 0.35); background: rgba(62, 224, 143, 0.08); }
.badge-live::before { content: "● "; }

.discord-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 40px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(88, 101, 242, 0.22), rgba(176, 68, 255, 0.14));
  border: 1px solid rgba(88, 101, 242, 0.4);
}
.discord-band p { margin: 0; color: var(--muted); }
.discord-band h2 { margin-bottom: 8px; }

.series-list { display: flex; flex-direction: column; gap: 28px; }
.series-block { background: rgba(20, 26, 46, 0.75); border: 1px solid var(--line); border-radius: 18px; padding: 26px; scroll-margin-top: 90px; }
.series-block-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.series-block-head h2 { margin: 10px 0 6px; }
.series-block-head p { margin: 0; max-width: 60ch; }
.series-actions { display: flex; gap: 10px; flex-shrink: 0; }
.mod-peek { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }
.mod-peek span { color: var(--text); font-weight: 600; }

.filter-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.toolbar-right { display: flex; gap: 10px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 15px; font: 500 0.9rem var(--font-body); cursor: pointer; transition: all 0.15s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--grad); color: #fff; border-color: transparent; }
.chip-count { font-size: 0.78rem; opacity: 0.7; }
[data-type-chips] .chip[aria-pressed="true"] { background: var(--surface-2); color: var(--text); border-color: var(--cyan); }

.search input, .sort select { background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); border-radius: 10px; padding: 10px 14px; font: 0.95rem var(--font-body); }
.search input { width: 260px; max-width: 100%; }
.sort select { cursor: pointer; }
.search input:focus, .sort select:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

.result-count { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; min-height: 1.4em; }

.mod-list-head, .mod-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 76px minmax(0, 230px) 104px; gap: 16px; align-items: center; }
.mod-list-head { padding: 0 16px 8px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.mod-list { list-style: none; margin: 0; padding: 0; background: rgba(20, 26, 46, 0.85); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mod-list li + li { border-top: 1px solid var(--line); }
.mod-row { padding: 10px 16px; color: var(--text); transition: background 0.15s; }
.mod-row:hover { text-decoration: none; background: var(--surface-2); }
.mod-row:hover .mod-name { color: var(--cyan); }
.mod-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.mod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mod-initial { font: 700 1.2rem var(--font-display); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mod-main { display: flex; flex-direction: column; min-width: 0; }
.mod-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.15s; }
.mod-main .video-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-note { font-size: 0.84rem; opacity: 0.85; }
.mod-updated { font-size: 0.85rem; color: var(--muted); text-align: right; }
.mod-list .empty { border: 0; border-radius: 0; }

.type-badge { justify-self: start; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 6px; }
.type-code { background: rgba(176, 68, 255, 0.16); color: #cf9bff; }
.type-asset { background: rgba(58, 207, 255, 0.12); color: var(--cyan); }
.type-map { background: rgba(62, 224, 143, 0.12); color: var(--live); }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 0.72rem; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); color: var(--muted); white-space: nowrap; }

.panel { background: rgba(20, 26, 46, 0.85); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.panel h2 { font-size: 1.35rem; }
.community-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 20px; align-items: start; }
.panel-discord { background: linear-gradient(160deg, rgba(88, 101, 242, 0.25), rgba(20, 26, 46, 0.9)); border-color: rgba(88, 101, 242, 0.4); }
.discord-id { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.discord-id h2 { margin: 0 0 4px; }
.discord-id p { margin: 0; }
.discord-icon { flex: 0 0 60px; height: 60px; border-radius: 16px; background: var(--discord); overflow: hidden; }
.discord-icon img { width: 100%; height: 100%; }

.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.steps strong { color: var(--text); }

.link-list, .check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.link-list a { display: flex; justify-content: space-between; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 500; }
.link-list a:hover { text-decoration: none; background: #222b4d; }
.link-list span { color: var(--muted); font-weight: 400; font-size: 0.88rem; }
.check-list li { padding-left: 28px; position: relative; color: var(--muted); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 5px; background: var(--grad); }

.support-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.panel-feature { background: linear-gradient(150deg, rgba(176, 68, 255, 0.2), rgba(58, 207, 255, 0.08)); border-color: rgba(176, 68, 255, 0.35); }
.panel-feature h2 { font-size: 1.8rem; margin-top: 14px; }
.panel-feature p { color: var(--muted); max-width: 44ch; }

.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--radius); text-align: center; grid-column: 1 / -1; margin: 0; }

.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 32px 0 40px; background: rgba(11, 14, 26, 0.85); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--text); }
.fine { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 0.8rem; opacity: 0.75; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid-sm { grid-template-columns: repeat(2, 1fr); }
  .community-grid, .support-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 20px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
  }
  .nav-open .site-nav { display: flex; }
  .btn-yt { margin: 8px 0 0; }
  .hero { padding-top: 44px; }
  .stat-row { gap: 24px; }
  .discord-band { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
  .series-block { padding: 20px; }
  .series-block-head { flex-direction: column; }
  .toolbar-right { flex: 1 1 100%; }
  .search { flex: 1 1 auto; }
  .search input { width: 100%; }
  .mod-list-head { display: none; }
  .mod-row { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; }
  .mod-thumb { width: 40px; height: 40px; }
  .mod-series, .mod-updated { display: none; }
}

@media (max-width: 520px) {
  .video-grid, .video-grid-sm { grid-template-columns: 1fr; }
  .stat-row dd { font-size: 1.5rem; }
}

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