/* ==========================================================================
   Evangel A.R.K — streaming layout
   Ember-black ground, Evangel red gradient (#8F0000 to #490000), gold accents.
   ========================================================================== */
:root {
  --bg: #0b0607;
  --surface: #150a0b;
  --surface-2: #1d1011;
  --text: #f6efe6;
  --muted: #b9aca2;
  --faint: #857a72;
  --ember: #8f0000;
  --ember-deep: #490000;
  --gold: #c59a2e;
  --gold-soft: #efcf86;
  --glass: rgba(28, 12, 13, .6);
  --glass-border: rgba(239, 207, 134, .15);
  --font-display: Poppins, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: Poppins, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --header-top: 14px;
  --header-h: 58px;
  --head-space: calc(var(--header-top) + var(--header-h));
  --gutter: clamp(16px, 3.2vw, 48px);
  --card-w: clamp(240px, 21vw, 320px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(143, 0, 0, .20), transparent 62%),
    radial-gradient(900px 520px at -10% 38%, rgba(73, 0, 0, .22), transparent 62%),
    var(--bg);
}
body.has-player { padding-bottom: 96px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: #1a0b0c; padding: 10px 16px; border-radius: 10px; font-weight: 800;
}
.skip-link:focus { top: 12px; }

/* ---------- Header: glass bar ---------- */
.topbar {
  position: fixed; z-index: 70; top: var(--header-top); left: 0; right: 0; margin: 0 auto;
  width: min(1520px, calc(100% - 28px)); height: var(--header-h);
  display: flex; align-items: center; gap: 18px; padding: 0 12px 0 14px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .38);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 0 0 auto; }
.brand-mark { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-copy strong { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .09em; white-space: nowrap; }
.brand-copy span { color: var(--muted); font-size: 10px; letter-spacing: .04em; white-space: nowrap; }

.main-nav { display: flex; gap: 4px; margin-right: auto; }
.main-nav a {
  white-space: nowrap; padding: 9px 15px; border-radius: 11px; font-weight: 700; font-size: 14.5px; color: #e9dfd4;
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover { background: rgba(255, 255, 255, .08); }
.main-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }
.nav-live::after { content: ' \2197'; font-size: .8em; color: var(--faint); }

.top-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; color: #efe6db;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, .1); }
.icon-btn.active { background: var(--text); color: #1a0b0c; }
.icon-btn:active { transform: scale(.94); }
.count-dot {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--gold); color: #1a0b00; font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
}

/* ---------- Dim layer and header panels ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 60; background: rgba(7, 2, 3, .68);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s .25s;
}
.scrim.show { opacity: 1; visibility: visible; transition: opacity .25s ease; }

.panel {
  position: fixed; z-index: 66; top: calc(var(--head-space) + 10px);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .2s ease, transform .26s var(--ease), visibility 0s .26s;
  background: rgba(24, 10, 11, .78);
  -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
  border: 1px solid var(--glass-border); border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
.panel.open { opacity: 1; visibility: visible; transform: none; transition: opacity .2s ease, transform .26s var(--ease); }
.search-panel { left: 0; right: 0; margin: 0 auto; width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - var(--head-space) - 30px); overflow: auto; }
.topics-panel { right: calc(50vw - min(1520px, 100vw - 28px) / 2); width: min(560px, calc(100vw - 28px)); }

.search-field {
  display: flex; align-items: center; gap: 12px; margin: 14px; padding: 0 16px; height: 54px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); border: 1.5px solid rgba(239, 207, 134, .6);
}
.search-field svg { width: 22px; height: 22px; color: var(--muted); flex: 0 0 auto; }
.search-field input {
  flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; font-size: 17px; font-weight: 600;
}
.search-field input::placeholder { color: #9d9188; font-weight: 500; }
.search-field input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.search-hint { padding: 2px 22px 8px; color: var(--muted); font-size: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 20px 20px; }
.topic-chip {
  border: 1px solid rgba(239, 207, 134, .2); background: rgba(255, 255, 255, .05); color: #eadfd3;
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
  transition: border-color .18s ease, background .18s ease;
}
.topic-chip:hover { border-color: var(--gold-soft); background: rgba(239, 207, 134, .1); }
.sr-list { list-style: none; margin: 0; padding: 0 8px 6px; }
.sr-item {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: none; border: 0;
  padding: 8px 10px; border-radius: 12px;
}
.sr-item:hover, .sr-item:focus-visible { background: rgba(255, 255, 255, .08); }
.sr-item img { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; background: #241213; }
.sr-item span { min-width: 0; display: block; }
.sr-item strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-item small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.sr-all {
  display: flex; align-items: center; justify-content: space-between; width: calc(100% - 16px); margin: 2px 8px 10px;
  padding: 12px 14px; border-radius: 12px; border: 0; background: rgba(239, 207, 134, .09); color: var(--gold-soft); font-weight: 700;
}
.sr-all svg { width: 16px; height: 16px; }

.panel-label { color: var(--faint); font-size: 11.5px; letter-spacing: .2em; font-weight: 800; margin: 18px 22px 8px; }
.topics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; padding: 0 14px 8px; max-height: min(58vh, 440px); overflow-y: auto; }
.topics-grid button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; border-radius: 10px; padding: 11px 10px; font-weight: 700; font-size: 14.5px;
}
.topics-grid button:hover { background: rgba(255, 255, 255, .08); }
.topics-grid small { color: var(--faint); font-weight: 600; font-size: 12px; }
.panel-link { display: block; padding: 14px 22px 18px; color: var(--gold-soft); font-weight: 700; border-top: 1px solid rgba(255, 255, 255, .08); }
.panel-link:hover { color: #fff; }

/* ---------- Views ---------- */
.view { display: none; }
.view.active { display: block; }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-slides { display: grid; }
.hero-slide {
  grid-area: 1 / 1; position: relative; min-height: clamp(560px, 88vh, 780px);
  opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s 1s;
}
.hero-slide.active { opacity: 1; visibility: visible; transition: opacity 1s ease, visibility 0s; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); }
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 6, 7, .94) 0%, rgba(11, 6, 7, .62) 44%, rgba(11, 6, 7, .12) 78%),
    radial-gradient(circle at 0% 0%, rgba(143, 0, 0, .6), rgba(73, 0, 0, .28) 46%, transparent 72%),
    linear-gradient(0deg, var(--bg) 0%, rgba(11, 6, 7, 0) 40%);
}
.hero-inner {
  position: relative; max-width: 1520px; margin: 0 auto; height: 100%; min-height: inherit;
  padding: calc(var(--head-space) + 36px) calc(var(--gutter) + 8px) 88px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 40px;
}
.hero-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: var(--gold-soft); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.pill { background: linear-gradient(135deg, var(--gold), #a47a1c); color: #1a0b00; padding: 5px 10px; border-radius: 999px; font-size: 10.5px; }
.pill-soft { background: rgba(239, 207, 134, .16); color: var(--gold-soft); border: 1px solid rgba(239, 207, 134, .3); }
.hero-title {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5vw, 66px); line-height: 1.08; letter-spacing: -.025em;
  margin: 16px 0 14px; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { margin: 0 0 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.hero-desc { margin: 0; max-width: 52ch; color: #d9cdc1; line-height: 1.6; font-size: 15px; }
.hero-actions { display: flex; align-items: center; gap: 12px; margin-top: 26px; }
.hero-actions .btn-round { width: 54px; height: 54px; }
.hero-art { justify-self: center; width: min(100%, 470px); }
.hero-art img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: #1a0d0e;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .6), 0 0 0 1px rgba(239, 207, 134, .2), 0 0 130px rgba(143, 0, 0, .38);
}
.hero-dots { position: absolute; left: 0; right: 0; bottom: 22px; z-index: 3; display: flex; justify-content: center; gap: 2px; }
.hero-dot { width: 38px; height: 22px; padding: 0; border: 0; background: none; display: grid; align-items: center; }
.hero-dot i { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .28); position: relative; overflow: hidden; }
.hero-dot i::after { content: ''; position: absolute; inset: 0; background: var(--gold-soft); transform: scaleX(0); transform-origin: left; }
.hero-dot.active i::after { animation: hero-fill 9s linear forwards; }
.hero.paused .hero-dot.active i::after { animation-play-state: paused; }
@keyframes hero-fill { to { transform: scaleX(1); } }

.mission {
  font-family: var(--font-display); font-weight: 400; text-align: center; letter-spacing: .01em; color: var(--gold-soft);
  font-size: clamp(16px, 2vw, 21px); margin: 4px auto 22px; padding: 0 var(--gutter); opacity: .92;
}

/* ---------- Rows ---------- */
#rows { max-width: 1600px; margin: 0 auto; padding-bottom: 20px; }
.row { position: relative; margin-bottom: 10px; }
.row-head { display: flex; align-items: baseline; gap: 16px; padding: 0 var(--gutter); margin: 12px 0 6px; }
.row-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(21px, 2.1vw, 27px); letter-spacing: -.01em; }
.see-more { display: inline-flex; align-items: center; gap: 2px; color: var(--gold-soft); font-weight: 800; font-size: 14px; }
.see-more svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.see-more:hover { color: #fff; }
.see-more:hover svg { transform: translateX(3px); }
.row-wrap { position: relative; }
.row-track {
  display: flex; gap: 14px; overflow-x: auto; padding: 8px var(--gutter) 20px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.row-track::-webkit-scrollbar { display: none; }
.row-track .card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.row-arrow {
  position: absolute; top: 8px; z-index: 5; width: 56px; height: calc(var(--card-w) * 9 / 16);
  border: 0; display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s ease;
}
.row-arrow svg { width: 30px; height: 30px; }
.row-arrow.prev { left: 0; background: linear-gradient(90deg, rgba(11, 6, 7, .92), rgba(11, 6, 7, 0)); }
.row-arrow.next { right: 0; background: linear-gradient(270deg, rgba(11, 6, 7, .92), rgba(11, 6, 7, 0)); }
.row-wrap:hover .row-arrow, .row-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .row-arrow { display: none; } }

/* ---------- Cards: landscape frame, square art, blurred backdrop ---------- */
.card { min-width: 0; cursor: pointer; }
.card:focus-visible { outline: none; }
.card:focus-visible .thumb { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #1a0d0e; isolation: isolate;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .38), inset 0 0 0 1px rgba(239, 207, 134, .08);
  transition: transform .3s var(--ease), box-shadow .3s ease;
}
.thumb-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb-art {
  position: absolute; left: 50%; top: 0; height: 100%; width: auto; aspect-ratio: 1; transform: translateX(-50%);
  object-fit: cover; box-shadow: 0 0 30px rgba(0, 0, 0, .55);
}
.thumb-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play-glyph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(0deg, rgba(0, 0, 0, .3), transparent 50%); }
.play-glyph svg { width: 46px; height: 46px; padding: 12px 11px 12px 14px; border-radius: 50%; background: rgba(11, 6, 7, .62); border: 1.5px solid rgba(255, 255, 255, .75); }
.chip { position: absolute; right: 8px; bottom: 9px; background: rgba(0, 0, 0, .78); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.badge {
  position: absolute; top: 0; right: 0; z-index: 2; background: var(--text); color: #1a0b0c; font-size: 10px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; padding: 4px 8px; border-bottom-left-radius: 8px;
}
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .24); z-index: 2; }
.progress i { display: block; height: 100%; background: var(--gold-soft); }
.card-title { margin: 11px 2px 3px; font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin: 0 2px; color: var(--faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) {
  .card:not(.placeholder):hover .thumb { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(0, 0, 0, .5), 0 0 0 2px rgba(239, 207, 134, .45); }
}

.card.placeholder { cursor: default; }
.thumb-soon {
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 0% 0%, #8f0000, #490000 58%, #260000);
}
.soon-mark { position: absolute; right: -14px; bottom: -22px; width: 46%; max-width: 150px; opacity: .22; }
.soon-label { position: relative; color: var(--gold-soft); font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.card.placeholder .card-title { color: #cdbfb3; }

/* ---------- Hover panel (desktop) and bottom sheet (touch) ---------- */
.pop {
  position: fixed; z-index: 65; opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.96); transform-origin: center top;
  transition: opacity .18s ease, transform .24s var(--ease), visibility 0s .24s;
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.pop.show { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .18s ease, transform .24s var(--ease); }
.pop .thumb, .sheet .thumb { border-radius: 0; box-shadow: none; transform: none; }
.peek-body { padding: 16px 18px 20px; }
.peek-body h3 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 23px; line-height: 1.15; }
.peek-meta { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.peek-badge { margin: -6px 0 12px; color: var(--gold-soft); font-weight: 800; font-size: 13px; }
.peek-actions { display: flex; align-items: center; gap: 10px; }
.peek-actions .btn-primary { flex: 1; }
.peek-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.peek-tags span { font-size: 11.5px; color: #d9cbbe; border: 1px solid rgba(239, 207, 134, .2); padding: 4px 10px; border-radius: 999px; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; border-top: 1px solid var(--glass-border);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(105%); visibility: hidden; transition: transform .32s var(--ease-drawer), visibility 0s .32s;
  box-shadow: 0 -30px 80px rgba(0, 0, 0, .6);
}
.sheet.open { transform: none; visibility: visible; transition: transform .32s var(--ease-drawer); }
.sheet-grab { width: 42px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .26); margin: 10px auto; }
.sheet .peek-actions .btn-primary { height: 50px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px; font-weight: 800; font-size: 14.5px; white-space: nowrap;
  transition: transform .15s ease, background .2s ease, border-color .2s ease;
}
.btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.btn:active { transform: scale(.97); }
.btn-primary { background: #f5ede1; color: #1a0b0c; }
.btn-primary:hover { background: #fff; }
.btn-primary .ico { fill: currentColor; stroke: none; }
.btn-primary small { font-weight: 700; font-size: 12.5px; opacity: .62; }
.btn-primary .sub:empty { display: none; }
.btn-lg { height: 54px; padding: 0 30px; font-size: 16px; }
.btn-round { width: 46px; height: 46px; padding: 0; background: rgba(255, 255, 255, .11); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.btn-round:hover { background: rgba(255, 255, 255, .22); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: var(--text); border: 1px solid rgba(255, 255, 255, .16); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }

/* ---------- Grid pages (topic, series, search, My List) ---------- */
.grid-head { max-width: 1520px; margin: 0 auto; padding: calc(var(--head-space) + 44px) var(--gutter) 24px; }
.kicker { margin: 0 0 10px; color: var(--gold-soft); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.grid-head h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5vw, 58px); line-height: 1.05; letter-spacing: -.02em; }
.grid-intro { max-width: 62ch; margin: 14px 0 0; color: var(--muted); line-height: 1.65; }
.grid-count { margin: 12px 0 0; color: var(--faint); font-size: 13px; font-weight: 600; }
.grid { max-width: 1520px; margin: 0 auto; padding: 0 var(--gutter) 70px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px 16px; }
.empty-state { max-width: 520px; margin: 0 auto; padding: 40px var(--gutter) 110px; text-align: center; color: var(--muted); }
.empty-state h3 { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--text); margin-bottom: 8px; }

/* ---------- Series page ---------- */
.page-intro { max-width: 1520px; margin: 0 auto; padding: calc(var(--head-space) + 44px) var(--gutter) 24px; }
.page-intro h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.02em; line-height: 1.05; }
.intro-copy { margin: 14px 0 0; max-width: 60ch; color: var(--muted); line-height: 1.65; }
.series-grid { max-width: 1520px; margin: 0 auto; padding: 8px var(--gutter) 90px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.series-card {
  position: relative; isolation: isolate; overflow: hidden; min-height: 220px; padding: 26px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; gap: 22px;
  border: 1px solid var(--glass-border); border-radius: 18px;
  background: radial-gradient(circle at 0% 0%, #6f0000, #2c0000 65%);
  transition: border-color .2s ease, transform .25s var(--ease);
}
.series-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11, 6, 7, .92), rgba(11, 6, 7, .45) 70%, rgba(11, 6, 7, .2)); }
.series-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.series-card:hover { border-color: rgba(239, 207, 134, .5); }
.series-card:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }
.series-label { color: var(--gold-soft); font-size: 10.5px; letter-spacing: .2em; font-weight: 800; }
.series-card h2 { margin: 8px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.08; letter-spacing: -.02em; }
.series-card p { margin: 10px 0 0; max-width: 44ch; color: rgba(255, 255, 255, .7); line-height: 1.55; font-size: 14px; }
.outline-button {
  display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 11px 17px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28); font-weight: 700; font-size: 13px;
}
.outline-button svg { width: 14px; height: 14px; }
.series-card .outline-button { pointer-events: none; }
.outline-button:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

/* ---------- Live and community ---------- */
.live-grid { max-width: 1520px; margin: 0 auto; padding: 10px var(--gutter) 100px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.live-card { position: relative; overflow: hidden; min-height: 200px; padding: 26px; border: 1px solid var(--glass-border); border-radius: 18px; background: var(--surface); }
.partner-card { grid-column: 1 / -1; min-height: 0; display: flex; flex-direction: column; align-items: flex-start; background: linear-gradient(120deg, #2a1306, var(--surface) 62%); }
.partner-card p { margin-bottom: 20px; max-width: 46ch; }
.platform-head { display: flex; align-items: center; gap: 12px; }
.platform-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 25px; }
.platform-icon { width: 30px; height: 30px; display: block; flex: 0 0 auto; }
.live-card p { position: relative; z-index: 2; margin: 20px 0 24px; max-width: 500px; color: #bcaea3; line-height: 1.6; font-size: 14.5px; }
.live-card .outline-button, .live-card .btn { position: relative; z-index: 2; }
.card-glow { position: absolute; width: 220px; height: 150px; right: -40px; bottom: -50px; border-radius: 50%; filter: blur(50px); opacity: .13; }
.glow-red { background: red; }
.glow-gold { background: #ffbd35; }
.glow-blue { background: #1e88c8; }
.glow-green { background: #1f8c53; }

/* ---------- Teaching page ---------- */
#teachingDetail { position: relative; max-width: 1520px; margin: 0 auto; padding: calc(var(--head-space) + 24px) var(--gutter) 60px; }
.detail-backdrop { position: absolute; z-index: -1; top: 0; left: 50%; width: 100vw; margin-left: -50vw; height: min(660px, 92vh); overflow: hidden; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; }
.detail-backdrop::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(143, 0, 0, .55), transparent 62%),
    linear-gradient(0deg, var(--bg) 2%, rgba(11, 6, 7, .62) 62%, rgba(11, 6, 7, .82));
}
.back-button { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 18px -6px; padding: 8px 12px 8px 6px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; }
.back-button svg { width: 18px; height: 18px; }
.back-button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.detail-hero { display: grid; grid-template-columns: minmax(240px, 420px) minmax(0, 1fr); gap: clamp(28px, 4.5vw, 64px); align-items: center; padding: 8px 0 46px; }
.detail-hero.is-video { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.detail-art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 20px; background: #1a0d0e; box-shadow: 0 40px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(239, 207, 134, .2); }
.video-frame { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; box-shadow: 0 40px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(239, 207, 134, .2); }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.detail-kicker { color: var(--gold-soft); font-size: 11.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.detail-info h1 { margin: 12px 0 10px; font-family: var(--font-display); font-weight: 600; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.05; letter-spacing: -.025em; text-wrap: balance; }
.detail-sub { margin: 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 24px; }
.detail-tag { padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(239, 207, 134, .22); background: rgba(255, 255, 255, .05); color: #e3d7cb; font-size: 12px; font-weight: 700; }
.detail-tag:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pending-pill { display: inline-flex; align-items: center; height: 46px; padding: 0 18px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); color: var(--muted); font-size: 14px; font-weight: 700; }
.detail-body { border-top: 1px solid rgba(255, 255, 255, .09); padding-top: 30px; max-width: 760px; }
.detail-body h3 { margin: 0 0 12px; font-size: 12.5px; letter-spacing: .18em; color: var(--faint); }
.note-placeholder { padding: 20px 22px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); color: var(--muted); }
.note-placeholder p { margin: 0 0 10px; line-height: 1.7; font-size: 14.5px; }
.note-placeholder p:last-child { margin-bottom: 0; }
.detail-related { margin: 36px calc(var(--gutter) * -1) 0; }

/* ---------- Player ---------- */
.player {
  position: fixed; z-index: 55; left: 0; right: 0; margin: 0 auto; bottom: max(12px, env(safe-area-inset-bottom));
  width: min(980px, calc(100% - 24px));
  display: grid; grid-template-columns: 48px minmax(0, 1.1fr) auto minmax(170px, 1.7fr) 36px; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: 18px;
  background: rgba(26, 11, 12, .82); -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid var(--glass-border); box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.player-art { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; cursor: pointer; background: #241213; }
.player-meta { min-width: 0; cursor: pointer; }
.player-meta strong { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-meta span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-controls { display: flex; align-items: center; gap: 4px; }
.p-btn { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: #efe6db; }
.p-btn svg { width: 24px; height: 24px; }
.p-btn:hover { background: rgba(255, 255, 255, .1); }
.p-main { width: 46px; height: 46px; background: var(--text); color: #1a0b0c; }
.p-main:hover { background: #fff; }
.p-main svg { width: 22px; height: 22px; }
.p-close { width: 32px; height: 32px; color: var(--muted); }
.p-close svg { width: 18px; height: 18px; }
.player-seek { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.player-seek span { min-width: 38px; text-align: center; }
.player-seek input { flex: 1; min-width: 0; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 20px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--gold-soft) var(--pct, 0%), rgba(255, 255, 255, .22) var(--pct, 0%)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--gold-soft); border: 0; }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .22); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--gold-soft); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--gold-soft); }

.toast {
  position: fixed; z-index: 90; left: 50%; bottom: 30px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: #1a0b0c; padding: 11px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  transition: opacity .22s ease, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.has-player .toast { bottom: 112px; }

/* ---------- Footer ---------- */
.footer { max-width: 1520px; margin: 0 auto; padding: 26px var(--gutter); border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 20px; color: var(--faint); font-size: 12.5px; }
.footer-tagline { flex: 1; text-align: center; }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: #a99a8e; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.footer-links .ico { width: 21px; height: 21px; }
.footer-links a { transition: transform .18s ease, filter .18s ease; }
.footer-links a:hover { color: var(--gold-soft); transform: translateY(-2px); }
.ico { fill: currentColor; stroke: none; }
.platform-icon { color: var(--gold-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .brand-copy span { display: none; }
  .live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --card-w: min(72vw, 300px); --header-top: 10px; --header-h: 54px; }
  .topbar { width: calc(100% - 20px); gap: 6px; padding: 0 8px 0 10px; }
  .brand-copy { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .main-nav { gap: 0; margin-left: 4px; }
  .main-nav a { padding: 8px 10px; font-size: 13.5px; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn svg { width: 21px; height: 21px; }
  .topics-panel { right: 10px; width: calc(100vw - 20px); }
  .search-panel { width: calc(100vw - 20px); }

  .hero-slide { min-height: 0; }
  .hero-inner { grid-template-columns: 1fr; gap: 22px; padding: calc(var(--head-space) + 22px) 20px 64px; align-content: start; }
  .hero-art { order: -1; width: min(60vw, 280px); }
  .hero-art img { border-radius: 16px; }
  .hero-title { font-size: clamp(34px, 10.5vw, 46px); margin-top: 12px; }
  .hero-desc { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-actions { margin-top: 20px; }
  .hero-actions .btn-lg { flex: 1; padding: 0 16px; }
  .hero-shade { background:
    linear-gradient(180deg, rgba(11, 6, 7, .35) 0%, rgba(11, 6, 7, .72) 42%, rgba(11, 6, 7, .96) 100%),
    radial-gradient(circle at 0% 0%, rgba(143, 0, 0, .55), transparent 68%); }

  .series-grid, .live-grid { grid-template-columns: 1fr; }
  .series-card { min-height: 190px; padding: 22px; }
  .detail-hero, .detail-hero.is-video { grid-template-columns: 1fr; gap: 26px; }
  .detail-art { max-width: min(78vw, 340px); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px 14px; }
  .footer { flex-wrap: wrap; justify-content: center; text-align: center; }
  .footer-tagline { flex: 0 0 100%; order: 3; }

  .player { grid-template-columns: 44px minmax(0, 1fr) auto 32px; grid-template-areas: 'art meta controls close' 'seek seek seek seek'; gap: 6px 10px; padding: 10px 12px 8px; }
  .player-art { grid-area: art; width: 44px; height: 44px; }
  .player-meta { grid-area: meta; }
  .player-controls { grid-area: controls; }
  .player-seek { grid-area: seek; }
  .p-close { grid-area: close; }
  .p-btn { width: 34px; height: 34px; }
  .p-main { width: 42px; height: 42px; }
  body.has-player { padding-bottom: 130px; }
  body.has-player .toast { bottom: 140px; }
}
@media (max-width: 380px) {
  .nav-live { display: none; }
  .main-nav a { padding: 8px 8px; }
}
@media (max-width: 340px) {
  .topbar { gap: 2px; padding: 0 4px 0 8px; }
  .icon-btn { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .hero-dot.active i::after { animation: none; transform: scaleX(1); }
}
