:root {
  --bg: #dff6fb;
  --bg-deep: #edf4ff;
  --bg-wash: #f8fbff;
  --paper: rgba(255, 255, 255, 0.86);
  --paper-strong: #ffffff;
  --ink: #22314f;
  --muted: #7386a8;
  --line: rgba(102, 138, 198, 0.18);
  --brand: #4e9ff5;
  --brand-deep: #2c6fe4;
  --brand-soft: rgba(78, 159, 245, 0.14);
  --accent: #ffbf1f;
  --accent-soft: rgba(255, 191, 31, 0.18);
  --success: #2a8f73;
  --warning: #d29316;
  --shadow: 0 24px 60px rgba(108, 149, 214, 0.18);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Outfit", sans-serif;
  background:
    radial-gradient(circle at 10% 15%, rgba(255, 255, 255, 0.95), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(78, 159, 245, 0.14), transparent 25%),
    radial-gradient(circle at 70% 80%, rgba(255, 191, 31, 0.12), transparent 20%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 52%, var(--bg-wash) 100%);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  position: relative;
  overflow: hidden;
  padding: 18px 14px 40px;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.72), transparent 30%),
    radial-gradient(circle at 83% 14%, rgba(78, 159, 245, 0.1), transparent 24%);
}

.page-decor {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.9;
}

.page-decor-left {
  left: -34px;
  top: 260px;
  width: 96px;
  height: 96px;
  border: 14px solid rgba(78, 159, 245, 0.16);
}

.page-decor-right {
  right: -18px;
  top: 110px;
  width: 72px;
  height: 72px;
  background: linear-gradient(145deg, rgba(255, 191, 31, 0.28), rgba(78, 159, 245, 0.12));
}

.browse-shell {
  position: relative;
  max-width: 1220px;
  margin: 0 auto;
}

.brand-header,
.browse-board {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.brand-header {
  display: grid;
  gap: 18px;
  padding: 22px 20px 18px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

.brand-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(110, 214, 227, 0.18), transparent 38%),
    linear-gradient(315deg, rgba(103, 161, 255, 0.14), transparent 44%);
  z-index: -1;
}

.brand-header::before {
  content: "";
  position: absolute;
  right: -58px;
  top: -54px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(78, 159, 245, 0.18), transparent 68%);
  z-index: -1;
}

.eyebrow,
.search-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5f7da8;
}

.brand-header h1,
.catalog-toolbar h2 {
  margin: 6px 0 0;
  font-family: "Noto Serif SC", serif;
  line-height: 1.15;
}

.brand-header h1 {
  font-size: clamp(2rem, 10vw, 4.1rem);
  color: #25304d;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.52);
}

.browse-board {
  margin-top: 16px;
  padding: 18px 14px 14px;
}

.player-card {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(133, 170, 223, 0.14);
  padding: 16px;
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.player-label {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #5f7da8;
}

.player-title {
  margin: 8px 0 0;
  font-family: "Noto Serif SC", serif;
  font-size: 1.35rem;
  line-height: 1.4;
  color: #22314f;
}

.hero-ornament {
  position: relative;
  min-height: 132px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(241, 249, 255, 0.78));
  border: 1px solid rgba(133, 170, 223, 0.18);
  overflow: hidden;
}

.hero-ornament::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 30px;
  height: 1px;
  background: rgba(124, 151, 198, 0.34);
}

.hero-ornament::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  height: 48px;
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(78, 159, 245, 0.16) 20% 22%, transparent 22% 58%, rgba(255, 191, 31, 0.2) 58% 60%, transparent 60% 100%);
}

.ornament-window {
  position: absolute;
  left: 22px;
  top: 16px;
  display: flex;
  gap: 10px;
}

.ornament-window i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: block;
}

.ornament-window i:nth-child(1) {
  background: #ff7393;
}

.ornament-window i:nth-child(2) {
  background: var(--accent);
}

.ornament-window i:nth-child(3) {
  background: #29b6f6;
}

.ornament-screen {
  position: absolute;
  right: 24px;
  height: 18px;
  border-radius: 4px;
  background: rgba(78, 159, 245, 0.18);
}

.ornament-screen-primary {
  top: 58px;
  width: 88px;
}

.ornament-screen-secondary {
  top: 86px;
  width: 110px;
}

.ornament-screen-accent {
  top: 114px;
  width: 74px;
  background: rgba(255, 191, 31, 0.28);
}

.ornament-play,
.ornament-pause {
  position: absolute;
  top: 58px;
}

.ornament-play {
  width: 0;
  height: 0;
  border-top: 24px solid transparent;
  border-bottom: 24px solid transparent;
}

.ornament-play-left {
  left: 28px;
  border-right: 40px solid var(--brand-deep);
  filter: drop-shadow(20px 0 0 rgba(255, 255, 255, 0.7));
}

.ornament-play-right {
  left: 134px;
  border-left: 40px solid #29b6f6;
}

.ornament-pause {
  left: 92px;
  width: 34px;
  height: 48px;
  background:
    linear-gradient(90deg, var(--accent) 0 40%, transparent 40% 58%, var(--accent) 58% 100%);
}

.category-rail {
  display: flex;
  gap: 12px;
  margin: 6px 0 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-rail::-webkit-scrollbar {
  display: none;
}

.category-pill {
  border: 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  cursor: pointer;
  min-width: max-content;
  border: 1px solid rgba(133, 170, 223, 0.16);
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.category-pill strong,
.category-pill span {
  display: block;
}

.category-pill strong {
  font-size: 0.96rem;
}

.category-pill span {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.category-pill.is-active {
  transform: translateY(-1px);
  background: linear-gradient(145deg, #78b7fb, var(--brand-deep));
  color: #f7fbff;
  box-shadow: 0 12px 24px rgba(78, 159, 245, 0.24);
}

.category-pill.is-active span {
  color: rgba(247, 251, 255, 0.8);
}

.lesson-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 2px;
}

.lesson-card {
  border: 1px solid rgba(133, 170, 223, 0.1);
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 250, 255, 0.88));
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.lesson-card:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

.lesson-card:hover,
.lesson-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(78, 159, 245, 0.24);
  box-shadow: 0 14px 28px rgba(108, 149, 214, 0.14);
}

.lesson-card.is-active {
  border-color: rgba(78, 159, 245, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(232, 244, 255, 0.98)),
    #ffffff;
}

.lesson-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.lesson-action {
  flex: none;
  white-space: nowrap;
  align-self: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(78, 159, 245, 0.12);
  color: var(--brand-deep);
  font-size: 0.74rem;
  font-weight: 700;
}

.lesson-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.lesson-teacher {
  margin: 6px 0 0;
  color: var(--brand-deep);
  font-size: 0.86rem;
  font-weight: 700;
}

.lesson-path {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.lesson-summary {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.empty-state {
  padding: 28px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  text-align: center;
}

.player-stage {
  margin-top: 14px;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(41, 53, 80, 0.98), rgba(30, 38, 59, 0.98)),
    #252f48;
  min-height: 0;
}

.player-stage-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
  color: #d8e7ff;
  text-align: center;
}

.player-host,
.player-host iframe,
.player-host video,
.player-host .video-js,
.player-host .bjc-player-wrapper {
  width: 100%;
  height: 100% !important;
}

.player-host {
  height: 100%;
  min-height: 0;
  position: relative;
}

.player-host .bjc-player-wrapper {
  position: relative;
  min-height: 0;
}

.player-host .video-js,
.player-host .vjs-tech {
  position: absolute !important;
  inset: 0;
  display: block;
}

.player-host .vjs-poster,
.player-host .vjs-tech,
.player-host .vjs-control-bar,
.player-host .vjs-big-play-button {
  z-index: 1;
}

.player-error {
  margin: 14px 0 0;
  color: #c65454;
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (min-width: 860px) {
  .page-shell {
    padding: 28px 24px 56px;
  }

  .brand-header {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: center;
    padding: 30px 28px;
  }

  .browse-board {
    padding: 22px 18px 18px;
  }

  .player-card {
    position: sticky;
    top: 24px;
    z-index: 2;
  }

  .player-stage,
  .player-stage-empty,
  .player-host {
    min-height: 0;
  }
}

@media (max-width: 859px) {
  .hero-ornament {
    min-height: 108px;
  }

  .ornament-screen-primary {
    width: 72px;
  }

  .ornament-screen-secondary {
    width: 92px;
  }

  .ornament-play-left {
    left: 22px;
    border-top-width: 20px;
    border-bottom-width: 20px;
    border-right-width: 34px;
  }

  .ornament-play-right {
    left: 118px;
    border-top-width: 20px;
    border-bottom-width: 20px;
    border-left-width: 34px;
  }

  .ornament-pause {
    left: 76px;
    width: 28px;
    height: 40px;
  }

  .player-stage,
  .player-stage-empty,
  .player-host {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .brand-header,
  .browse-board,
  .lesson-card,
  .category-pill,
  .player-card {
    animation: rise 520ms ease both;
  }

  .lesson-card:nth-child(2n) {
    animation-delay: 40ms;
  }

  .lesson-card:nth-child(3n) {
    animation-delay: 80ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
