:root {
  --background: #06101d;
  --surface: #0c1929;
  --surface-light: #12243a;
  --surface-lighter: #182f4a;
  --text: #f7f9fc;
  --muted: #9fb0c7;
  --accent: #ff3b30;
  --accent-hover: #ff625a;
  --blue: #4b8dff;
  --football: #35c875;
  --hockey: #58a6ff;
  --basketball: #ff9f43;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --header-height: 78px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 0%, rgba(42, 101, 190, 0.18), transparent 34rem),
    var(--background);
}
body.menu-open { overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.container { width: min(1220px, calc(100% - 32px)); margin-inline: auto; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header and rich navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 14, 26, 0.94);
  backdrop-filter: blur(18px);
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: var(--header-height);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, #ff645b, #d9160c);
  box-shadow: 0 9px 28px rgba(255, 59, 48, 0.28);
  font-size: 0.92rem;
  font-weight: 800;
}
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { letter-spacing: -0.03em; }
.brand-copy small { margin-top: 5px; color: var(--muted); font-size: 0.66rem; font-weight: 600; }
.primary-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}
.nav-menu-button,
.nav-direct-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  color: #c9d5e4;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}
.nav-menu-button:hover,
.nav-menu-button.active,
.nav-direct-button:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.football-nav:hover, .football-nav.active { color: #7ae3a6; }
.hockey-nav:hover, .hockey-nav.active { color: #8ec5ff; }
.basketball-nav:hover, .basketball-nav.active { color: #ffc17e; }
.youtube-button,
.action-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms ease, background 160ms ease;
}
.youtube-button:hover,
.action-button:hover { background: var(--accent-hover); transform: translateY(-2px); }
.mobile-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  place-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.mobile-nav-toggle span:not(.sr-only) { width: 20px; height: 2px; border-radius: 2px; background: white; }

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  border-top: 1px solid var(--line);
  background: rgba(7, 18, 32, 0.985);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}
.mega-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-panel { display: none; gap: 28px; padding-block: 30px 36px; }
.mega-panel.active { display: grid; }
.mega-feature {
  display: grid;
  align-content: end;
  min-height: 245px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  padding: 26px;
  overflow: hidden;
  color: white;
  text-align: left;
  background:
    linear-gradient(180deg, transparent 5%, rgba(5, 16, 29, 0.96) 90%),
    url("https://images.unsplash.com/photo-1461896836934-ffe607ba8211?auto=format&fit=crop&w=1000&q=82") center / cover;
  box-shadow: var(--shadow);
}
.mega-feature-kicker { color: #9bc1ff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; }
.mega-feature strong { margin-top: 8px; max-width: 460px; font-size: clamp(1.45rem, 2.8vw, 2.35rem); line-height: 1.08; letter-spacing: -0.04em; }
.mega-feature > span:not(.mega-feature-kicker) { margin-top: 10px; max-width: 540px; color: #bdcbe0; line-height: 1.6; }
.mega-feature em { margin-top: 18px; color: white; font-size: 0.84rem; font-style: normal; font-weight: 800; }
.mega-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mega-columns.four-columns { grid-template-columns: repeat(4, 1fr); }
.mega-group {
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 17px;
  background: rgba(255, 255, 255, 0.025);
}
.mega-group h2 { margin: 0 0 11px; color: #7890ae; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }
.mega-group button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 9px;
  color: #d7e0ed;
  background: transparent;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 650;
}
.mega-group button:hover, .mega-group button.active { color: white; background: rgba(75, 141, 255, 0.13); }
.mega-group button span { min-width: 28px; border-radius: 999px; padding: 3px 7px; color: var(--muted); background: rgba(255, 255, 255, 0.07); text-align: center; font-size: 0.66rem; }
.mega-sport-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px 20px;
}
.football-heading { background: linear-gradient(100deg, rgba(53, 200, 117, 0.17), transparent 70%); }
.hockey-heading { background: linear-gradient(100deg, rgba(88, 166, 255, 0.17), transparent 70%); }
.basketball-heading { background: linear-gradient(100deg, rgba(255, 159, 67, 0.17), transparent 70%); }
.mega-sport-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.09); font-size: 1.45rem; }
.mega-sport-heading div { display: grid; gap: 4px; }
.mega-sport-heading small { color: var(--muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.mega-sport-heading strong { font-size: 1.05rem; }
.mega-sport-heading button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 15px;
  color: white;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 750;
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(7, 17, 31, 0.79), rgba(7, 17, 31, 0.97)),
    url("https://images.unsplash.com/photo-1461896836934-ffe607ba8211?auto=format&fit=crop&w=1900&q=85") center / cover;
}
.hero-content { padding-block: 92px 96px; text-align: center; }
.eyebrow { margin: 0 0 18px; color: #8db8ff; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.17em; }
h1 { max-width: 900px; margin: 0 auto; font-size: clamp(2.55rem, 6.5vw, 5.5rem); line-height: 0.98; letter-spacing: -0.065em; }
.hero-copy { max-width: 730px; margin: 24px auto 32px; color: #c7d4e6; font-size: clamp(1rem, 2vw, 1.15rem); line-height: 1.65; }
.search-wrap { position: relative; max-width: 760px; margin-inline: auto; }
.search-icon { position: absolute; top: 50%; left: 19px; color: #8ca2bd; font-size: 1.35rem; transform: translateY(-50%); pointer-events: none; }
#searchInput {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 18px 80px 18px 53px;
  color: var(--text);
  outline: none;
  background: rgba(8, 20, 36, 0.9);
  box-shadow: var(--shadow);
}
#searchInput:focus { border-color: #8db8ff; box-shadow: 0 0 0 4px rgba(141, 184, 255, 0.13), var(--shadow); }
.clear-search { position: absolute; top: 50%; right: 13px; border: 0; border-radius: 999px; padding: 7px 11px; color: #c6d3e3; background: rgba(255, 255, 255, 0.08); transform: translateY(-50%); font-size: 0.75rem; font-weight: 700; }
.hero-shortcuts { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; max-width: 900px; margin: 23px auto 0; }
.hero-shortcuts button { border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; padding: 9px 13px; color: #d5deeb; background: rgba(7, 17, 31, 0.58); font-size: 0.76rem; font-weight: 700; backdrop-filter: blur(8px); }
.hero-shortcuts button:hover { border-color: rgba(141, 184, 255, 0.55); color: white; background: rgba(34, 77, 135, 0.55); }

/* Library */
.main-content { min-height: 55vh; padding-block: 40px 82px; }
.setup-panel { margin-bottom: 30px; border: 1px solid rgba(255, 184, 77, 0.35); border-radius: 18px; padding: 22px; background: rgba(255, 184, 77, 0.08); }
.setup-panel h2 { margin-top: 0; }
.setup-panel code { color: #ffd18a; }
.category-dashboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 46px; }
.category-tile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  min-height: 138px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 19px;
  overflow: hidden;
  color: white;
  text-align: left;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  transition: transform 170ms ease, border-color 170ms ease;
}
.category-tile:hover { transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.25); }
.football-tile { background: linear-gradient(145deg, rgba(53, 200, 117, 0.2), var(--surface) 72%); }
.hockey-tile { background: linear-gradient(145deg, rgba(88, 166, 255, 0.2), var(--surface) 72%); }
.basketball-tile { background: linear-gradient(145deg, rgba(255, 159, 67, 0.2), var(--surface) 72%); }
.collection-tile { background: linear-gradient(145deg, rgba(155, 103, 255, 0.2), var(--surface) 72%); }
.tile-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.09); font-size: 1.35rem; }
.category-tile > span:nth-child(2) { display: grid; gap: 4px; }
.category-tile small { color: var(--muted); font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; }
.category-tile strong { font-size: 1.02rem; }
.category-tile em { color: #b5c2d3; font-size: 0.7rem; font-style: normal; }
.category-tile b { position: absolute; top: 14px; right: 14px; border-radius: 999px; padding: 5px 8px; color: #dce7f4; background: rgba(255, 255, 255, 0.07); font-size: 0.66rem; }
.library-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-eyebrow { margin: 0 0 7px; color: #83aef0; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.library-header h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -0.045em; }
.filter-description { margin: 8px 0 0; max-width: 720px; color: var(--muted); line-height: 1.55; }
.library-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.library-controls label { color: var(--muted); font-size: 0.75rem; font-weight: 700; }
#sortSelect { border: 1px solid var(--line); border-radius: 11px; padding: 10px 34px 10px 12px; color: white; outline: none; background: var(--surface-light); }
.clear-filter { border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; color: #dce6f3; background: transparent; font-weight: 700; }
.clear-filter:hover { background: rgba(255, 255, 255, 0.06); }
.active-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 13px; }
.filter-path { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 0.78rem; }
.filter-path b { color: #536a85; }
.filter-path strong { color: #dce7f5; }
.video-count, .status { color: var(--muted); }
.video-count { margin: 0; font-size: 0.76rem; font-weight: 700; }
.status { margin: 23px 0; text-align: center; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 23px; }
.video-card { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(180deg, var(--surface-light), var(--surface)); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16); transition: transform 180ms ease, border-color 180ms ease; }
.video-card:hover { border-color: rgba(141, 184, 255, 0.45); transform: translateY(-5px); }
.thumbnail-link { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #050b13; }
.thumbnail { width: 100%; height: 100%; object-fit: cover; transition: transform 250ms ease; }
.video-card:hover .thumbnail { transform: scale(1.035); }
.sport-badge, .duration-badge { position: absolute; bottom: 11px; border-radius: 999px; padding: 6px 9px; color: white; background: rgba(2, 8, 17, 0.87); font-size: 0.65rem; font-weight: 800; letter-spacing: 0.05em; backdrop-filter: blur(8px); }
.sport-badge { left: 11px; text-transform: uppercase; }
.duration-badge { right: 11px; }
.card-body { padding: 18px; }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.published-date, .view-count { margin: 0 0 9px; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.video-title { display: -webkit-box; min-height: 3.2em; margin: 0 0 12px; overflow: hidden; font-size: 1.01rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; margin-bottom: 16px; }
.video-tag { border-radius: 999px; padding: 5px 8px; color: #aabbd0; background: rgba(255, 255, 255, 0.055); font-size: 0.61rem; font-weight: 700; text-transform: capitalize; }
.watch-link { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; color: #8db8ff; font-size: 0.82rem; font-weight: 800; text-decoration: none; }
.watch-link:hover { color: white; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 38px; }
.action-button.secondary { border: 1px solid var(--line); background: var(--surface-light); }
.action-button:disabled { cursor: wait; opacity: 0.58; transform: none; }
.empty-state { padding: 75px 20px; text-align: center; }
.empty-state > span { color: #56708f; font-size: 3rem; }
.empty-state h2 { margin: 12px 0 8px; }
.empty-state p { color: var(--muted); }
.empty-state button { border: 0; border-radius: 999px; padding: 11px 17px; color: white; background: #285fa8; font-weight: 800; }

footer { border-top: 1px solid var(--line); background: rgba(3, 10, 20, 0.75); }
.footer-content { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 130px; color: var(--muted); }
.footer-content strong { color: white; font-size: 1.15rem; }
.footer-content p { margin: 6px 0 0; max-width: 540px; font-size: 0.8rem; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-links button, .footer-links a { border: 0; border-radius: 999px; padding: 9px 12px; color: #c2cede; background: rgba(255, 255, 255, 0.055); font-size: 0.72rem; font-weight: 700; text-decoration: none; }

@media (max-width: 1060px) {
  .category-dashboard { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega-columns.four-columns { grid-template-columns: repeat(2, 1fr); }
  .primary-nav { gap: 0; }
  .nav-menu-button, .nav-direct-button { padding-inline: 9px; font-size: 0.78rem; }
}

@media (max-width: 850px) {
  :root { --header-height: 70px; }
  .top-nav { justify-content: space-between; }
  .mobile-nav-toggle { display: grid; margin-left: auto; }
  .youtube-button { display: none; }
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    width: 100%;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    background: rgba(6, 16, 29, 0.99);
    flex-direction: column;
    align-items: stretch;
  }
  .primary-nav.mobile-open { display: flex; }
  .nav-menu-button, .nav-direct-button { justify-content: space-between; width: 100%; padding: 13px 12px; font-size: 0.86rem; }
  .mega-menu { top: calc(100% + 286px); max-height: calc(100vh - 356px); }
  .mega-panel { padding-block: 18px 24px; }
  .mega-columns, .mega-columns.four-columns { grid-template-columns: 1fr; }
  .mega-sport-heading { grid-template-columns: auto 1fr; }
  .mega-sport-heading button { grid-column: 1 / -1; }
  .library-header { align-items: flex-start; flex-direction: column; }
  .footer-content { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 30px; }
}

@media (max-width: 650px) {
  .container { width: min(100% - 22px, 1220px); }
  .brand-copy small { display: none; }
  .hero-content { padding-block: 65px 70px; }
  .category-dashboard, .video-grid { grid-template-columns: 1fr; }
  .category-dashboard { margin-bottom: 38px; }
  .category-tile { min-height: 116px; }
  .active-filter-bar { align-items: flex-start; flex-direction: column; }
  .library-controls { width: 100%; }
  #sortSelect { flex: 1; }
  .mega-feature { min-height: 220px; }
  .mega-menu { top: calc(100% + 286px); }
}
