@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0a0a;
  --surface:   #111111;
  --card:      #181818;
  --card2:     #1e1e1e;
  --border:    #252525;
  --white:     #f2f2f2;
  --grey:      #aaaaaa;
  --silver:    #666666;
  --accent:    #e63946;
  --accent2:   #ff6b6b;
  --accent-dim:#3a1014;
  --blue:      #1a6ef5;
  --green:     #16a34a;

  --nav-h:  60px;
  --bot-h:  65px;
  --side-w: 270px;

  --font-d: 'Bebas Neue', sans-serif;
  --font-b: 'Inter', sans-serif;

  --ease: cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-b);
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: var(--bot-h);
}

img { display: block; }
button { font-family: var(--font-b); }
a { text-decoration: none; color: inherit; }

/* ════════════════════════════════
   SCROLLBAR
════════════════════════════════ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--silver); }

/* ════════════════════════════════
   SIDEBAR OVERLAY
════════════════════════════════ */
#sidebar-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 299;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
#sidebar-overlay.active { opacity: 1; pointer-events: all; }

/* ════════════════════════════════
   SIDEBAR
════════════════════════════════ */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--side-w);
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform .35s var(--ease);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#sidebar.open { transform: translateX(0); }

.sb-head {
  display: flex; align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-avatar {
  width: 42px; height: 42px;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}
.sb-user-name { font-size: 14px; font-weight: 700; color: var(--white); }
.sb-user-sub  { font-size: 11px; color: var(--silver); margin-top: 1px; }
.sb-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--silver); font-size: 18px;
  cursor: pointer; padding: 4px;
  transition: color .2s;
}
.sb-close:hover { color: var(--white); }

.sb-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--silver);
  padding: 16px 18px 6px;
}

.sb-nav { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.sb-nav a {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 18px;
  font-size: 14px; font-weight: 500;
  color: var(--grey);
  border-left: 3px solid transparent;
  transition: color .2s, background .2s, border-color .2s, padding-left .2s;
}
.sb-nav a svg { flex-shrink: 0; opacity: .7; transition: opacity .2s; }
.sb-nav a:hover, .sb-nav a.active {
  color: var(--white);
  background: rgba(255,255,255,.04);
  border-left-color: var(--accent);
  padding-left: 22px;
}
.sb-nav a:hover svg, .sb-nav a.active svg { opacity: 1; }
.sb-nav a.active { color: var(--accent); }

.sb-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-request-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--grey);
  font-size: 13px; font-weight: 600;
  padding: 12px 14px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.sb-request-btn:hover { color: var(--white); border-color: var(--accent); }
.sb-request-btn span { font-size: 20px; font-weight: 300; }

/* ════════════════════════════════
   TOP NAVBAR
════════════════════════════════ */
#topnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 100;
  transition: background .3s, backdrop-filter .3s;
}
#topnav.scrolled {
  background: rgba(10,10,10,.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-burger {
  background: none; border: none;
  cursor: pointer;
  display: flex; flex-direction: column;
  gap: 5px; padding: 6px; flex-shrink: 0;
}
.nav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--white); border-radius: 2px;
  transition: background .2s, transform .3s, opacity .3s;
}
.nav-burger:hover span { background: var(--accent); }

.nav-logo {
  font-family: var(--font-d);
  font-size: 24px; letter-spacing: 3px;
  color: var(--white); flex-shrink: 0;
}
.nav-logo em { color: var(--accent); font-style: normal; }

.nav-spacer { flex: 1; }

.nav-icon-btn {
  background: none; border: none;
  color: var(--grey); cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  transition: color .2s, background .2s;
  flex-shrink: 0;
}
.nav-icon-btn:hover { color: var(--white); background: rgba(255,255,255,.07); }
.nav-icon-btn.logged-in { color: var(--accent); }

/* ════════════════════════════════
   HERO BANNER SLIDER
════════════════════════════════ */
#hero {
  position: relative;
  width: 100%;
  height: 100svh;
  max-height: 650px;
  overflow: hidden;
  margin-top: 0;
}
@media (max-width: 700px) {
  /* on phones, match the hero's height to a real banner's aspect ratio
     (~16:9-2:1) instead of near-full-screen — this is what was making
     the sharp banner look like a thin, cropped-looking strip floating
     inside a huge blurred void above/below it */
  #hero {
    height: 62vw;
    min-height: 260px;
    max-height: 400px;
  }
}

.hero-slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  opacity: 0;
  transition: opacity .7s var(--ease);
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: all; }

.hero-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
}
.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}
/* fallback when AniList has no wide banner art: blurred poster fills the
   backdrop, and a clean, uncropped poster sits centered on top of it */
.hero-bg-blur {
  filter: blur(45px) brightness(.55) saturate(1.15);
  transform: scale(1.25);
}
.hero-bg-poster {
  position: absolute;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  height: 58%; width: auto;
  max-width: 62%;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,.65);
  border: 1px solid rgba(255,255,255,.1);
}
/* real AniList banner art: shown whole, never cropped. The blurred copy
   behind it (.hero-bg-blur) fills the rest of the hero so there's no
   empty letterboxing even on tall/mobile viewports */
.hero-bg-banner {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
}
.hero-gradient {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(to bottom, rgba(10,10,10,.45) 0%, transparent 30%, transparent 50%, rgba(10,10,10,.85) 80%, #0a0a0a 100%),
    linear-gradient(to right, rgba(10,10,10,.7) 0%, transparent 60%);
}

.hero-content {
  position: absolute; bottom: 0; left: 0;
  padding: 0 20px 28px;
  max-width: 420px;
  width: 100%;
}
.hero-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.hero-title {
  font-family: var(--font-d);
  font-size: clamp(32px, 8vw, 52px);
  line-height: 1;
  letter-spacing: 3px;
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
}
.hero-tags {
  display: flex; gap: 7px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.hero-tag {
  font-size: 11px; font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.25);
  color: var(--grey);
  letter-spacing: .5px;
}
.hero-tag.status {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(230,57,70,.1);
}

.hero-actions { display: flex; gap: 10px; align-items: center; }

.btn-hero-watch {
  background: var(--white);
  color: #0a0a0a;
  border: none; border-radius: 25px;
  font-size: 14px; font-weight: 700;
  padding: 12px 26px;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: background .2s, transform .1s;
  letter-spacing: .5px;
}
.btn-hero-watch:hover { background: var(--accent); color: #fff; transform: scale(1.02); }

.btn-hero-add {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.btn-hero-add:hover { background: rgba(230,57,70,.3); border-color: var(--accent); }
.btn-hero-add.added { background: var(--accent); border-color: var(--accent); }

/* hero dots */
.hero-dots {
  position: absolute;
  bottom: 30px; right: 18px;
  display: flex; gap: 6px; align-items: center;
}
.hero-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  transition: background .3s, width .3s;
}
.hero-dot.active { width: 20px; border-radius: 3px; background: var(--white); }

/* ════════════════════════════════
   SECTION SHARED
════════════════════════════════ */
.section { padding: 28px 14px 0; }

.sec-head {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sec-title {
  font-family: var(--font-d);
  font-size: 27px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
}
.sec-title em {
  color: var(--accent); font-style: normal;
}
.sec-more {
  font-size: 12px; font-weight: 600;
  color: var(--silver);
  background: none; border: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  transition: color .2s;
}
.sec-more:hover { color: var(--accent); }

/* ════════════════════════════════
   HORIZONTAL SCROLL STRIP
════════════════════════════════ */
.hscroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex-shrink: 0; }

/* ════════════════════════════════
   TOP 10 CARDS
════════════════════════════════ */
.top10-card {
  position: relative;
  width: 130px;
  cursor: pointer;
}
.top10-rank-num {
  position: absolute;
  bottom: 30px; left: -8px;
  font-family: var(--font-d);
  font-size: 74px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,.18);
  z-index: 2;
  pointer-events: none;
  transition: -webkit-text-stroke .3s;
}
.top10-card:hover .top10-rank-num { -webkit-text-stroke-color: rgba(230,57,70,.5); }

.top10-img {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 10px; overflow: hidden;
  position: relative; z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.top10-card:hover .top10-img {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(230,57,70,.14), 0 10px 34px -10px rgba(230,57,70,.55);
}
.top10-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.top10-card:hover .top10-img img { transform: scale(1.06); }

.top10-badge {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  font-size: 9px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
}
.top10-watch-overlay {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at center, rgba(20,4,6,.35), rgba(0,0,0,.62));
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  opacity: 0; transition: opacity .3s var(--ease);
  z-index: 4;
}
.top10-card:hover .top10-watch-overlay { opacity: 1; }
.top10-play-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; padding-left: 3px;
  box-shadow: 0 0 0 0 rgba(230,57,70,.5), 0 6px 24px -4px rgba(230,57,70,.6);
  transform: scale(.7);
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1) .05s, opacity .3s ease .05s, box-shadow .3s ease;
}
.top10-card:hover .top10-play-icon {
  transform: scale(1);
  opacity: 1;
  animation: top10-pulse 1.8s ease-in-out .4s infinite;
}
@keyframes top10-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.45), 0 6px 24px -4px rgba(230,57,70,.6); }
  50%      { box-shadow: 0 0 0 9px rgba(230,57,70,0), 0 6px 24px -4px rgba(230,57,70,.6); }
}

.top10-name {
  font-size: 12px; font-weight: 600;
  color: var(--grey);
  margin-top: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 2px;
}

/* ════════════════════════════════
   ANIME CARDS (SMALL)
════════════════════════════════ */
.anime-card {
  width: 130px; cursor: pointer;
  transition: transform .25s;
}
.anime-card:hover { transform: translateY(-4px); }

.anime-thumb {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 10px; overflow: hidden;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease);
}
.anime-card:hover .anime-thumb {
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(230,57,70,.14), 0 10px 34px -10px rgba(230,57,70,.55);
}
.anime-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease); }
.anime-card:hover .anime-thumb img { transform: scale(1.06); }

.anime-watch-overlay {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at center, rgba(20,4,6,.35), rgba(0,0,0,.62));
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  opacity: 0; transition: opacity .3s var(--ease);
  z-index: 2;
}
.anime-card:hover .anime-watch-overlay { opacity: 1; }
.anime-play-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; padding-left: 3px;
  box-shadow: 0 0 0 0 rgba(230,57,70,.5), 0 6px 22px -4px rgba(230,57,70,.6);
  transform: scale(.7);
  opacity: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1) .05s, opacity .3s ease .05s;
}
.anime-card:hover .anime-play-icon {
  transform: scale(1);
  opacity: 1;
  animation: top10-pulse 1.8s ease-in-out .4s infinite;
}

.anime-badge {
  position: absolute; top: 7px; left: 7px; z-index: 3;
  font-size: 9px; font-weight: 700;
  letter-spacing: .8px; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
}
.badge-sub    { background: var(--accent); color: #fff; }
.badge-dub    { background: var(--blue); color: #fff; }
.badge-both   { background: var(--green); color: #fff; }
.badge-format { background: rgba(0,0,0,.75); border: 1px solid rgba(255,255,255,.15); color: var(--grey); }

.anime-ep {
  position: absolute; bottom: 7px; right: 7px; z-index: 3;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.1);
  color: var(--grey);
  font-size: 9px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}

.anime-name {
  font-size: 12px; font-weight: 600;
  color: var(--grey);
  margin-top: 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 2px;
}
.anime-year { font-size: 10px; color: var(--silver); margin-top: 2px; padding: 0 2px; }

/* ════════════════════════════════
   FILTER TABS
════════════════════════════════ */
.filter-row {
  display: flex; gap: 8px;
  margin-bottom: 14px;
}
.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--silver);
  font-size: 12px; font-weight: 700;
  padding: 7px 18px; border-radius: 20px;
  cursor: pointer;
  text-transform: uppercase; letter-spacing: .8px;
  transition: color .2s, border-color .2s, background .2s;
}
.filter-btn.active, .filter-btn:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ════════════════════════════════
   BOTTOM NAVBAR
════════════════════════════════ */
#botnav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bot-h);
  background: rgba(12,12,12,.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  z-index: 200;
  display: flex; align-items: stretch;
}
.bot-tab {
  flex: 1;
  background: none; border: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: opacity .2s;
}
.bot-tab::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
  transition: width .3s var(--ease);
}
.bot-tab.active::before { width: 40px; }

.bot-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.bot-tab:active .bot-icon { transform: scale(.88); }

.bot-icon svg { transition: stroke .2s, fill .2s; }
.bot-tab .bot-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: .3px;
  color: var(--silver);
  transition: color .2s;
}
.bot-tab.active .bot-label { color: var(--accent); }
.bot-tab.active .bot-icon svg { stroke: var(--accent); }

/* ════════════════════════════════
   DETAIL PAGE
════════════════════════════════ */
#detail-page {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg);
  z-index: 400;
  overflow-y: auto;
}
#detail-page.open { display: block; }

.detail-topbar {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px;
  background: rgba(10,10,10,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.btn-back-d {
  background: none; border: none;
  color: var(--grey); font-size: 22px;
  cursor: pointer; padding: 2px;
  display: flex; align-items: center;
  transition: color .2s;
}
.btn-back-d:hover { color: var(--white); }
.detail-topbar-title {
  font-size: 15px; font-weight: 700;
  color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@keyframes detailFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes detailPosterIn {
  from { opacity: 0; transform: translateY(18px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes detailBgIn {
  from { opacity: 0; transform: scale(1.12); }
  to   { opacity: 1; transform: scale(1.05); }
}

.detail-hero-wrap {
  position: relative;
  height: 340px; overflow: hidden;
}
.detail-hero-bg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
}
.detail-hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  filter: brightness(.42) saturate(1.08) blur(1.5px);
  transform: scale(1.05);
}
#detail-page.open .detail-hero-bg img { animation: detailBgIn .6s var(--ease); }

.detail-hero-grad {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background:
    linear-gradient(to bottom, rgba(10,10,10,.15) 0%, transparent 32%, transparent 48%, rgba(10,10,10,.92) 82%, var(--bg) 100%),
    linear-gradient(to right, rgba(10,10,10,.55) 0%, transparent 55%);
}

.detail-hero-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0 16px 22px;
  display: flex; align-items: flex-end; gap: 16px;
}
.detail-poster-wrap {
  width: 112px; flex-shrink: 0;
  border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 44px rgba(0,0,0,.7), 0 0 0 1px rgba(0,0,0,.3);
  background: var(--card);
  aspect-ratio: 2/3;
}
#detail-page.open .detail-poster-wrap { animation: detailPosterIn .5s var(--ease) .05s both; }
.detail-poster-wrap img { width: 100%; height: 100%; object-fit: cover; }

.detail-title-block { flex: 1; min-width: 0; }
#detail-page.open .detail-title-block { animation: detailFadeUp .55s var(--ease) .12s both; }

.detail-title {
  font-family: var(--font-d);
  font-size: clamp(21px, 5.2vw, 34px);
  letter-spacing: 1px; line-height: 1.05;
  margin-bottom: 10px;
  text-shadow: 0 2px 18px rgba(0,0,0,.7), 0 1px 0 rgba(0,0,0,.3);
}
.detail-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.detail-chip {
  font-size: 10px; font-weight: 700;
  padding: 4px 11px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(20,20,20,.45);
  backdrop-filter: blur(6px);
  color: var(--grey);
  letter-spacing: .6px; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.detail-chip.live {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(230,57,70,.14);
}

.detail-body { padding: 20px 16px 34px; }
#detail-page.open .detail-body { animation: detailFadeUp .55s var(--ease) .18s both; }

.detail-meta-row {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 20px;
  font-size: 12.5px; font-weight: 700;
  color: var(--grey);
}
.detail-meta-item {
  display: inline-flex; align-items: center; gap: 5px;
}
.detail-meta-item svg { color: var(--accent2); flex-shrink: 0; }
.detail-meta-dot { color: var(--border); font-size: 10px; }

.detail-section-label {
  font-family: var(--font-d);
  font-size: 17px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 10px;
}

.detail-desc-wrap {
  position: relative;
  max-height: 4.6em;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.detail-desc-wrap::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1.6em;
  background: linear-gradient(to bottom, transparent, var(--bg));
  transition: opacity .25s;
  pointer-events: none;
}
.detail-desc-wrap.expanded { max-height: 800px; }
.detail-desc-wrap.expanded::after { opacity: 0; }

.detail-desc {
  font-size: 13.5px; line-height: 1.75;
  color: var(--grey);
  letter-spacing: .1px;
}

.detail-desc-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none;
  color: var(--accent2);
  font-size: 12px; font-weight: 700;
  letter-spacing: .3px;
  padding: 10px 0 0;
  cursor: pointer;
  transition: color .2s;
}
.detail-desc-toggle:hover { color: var(--white); }
.detail-desc-toggle.hidden { display: none; }
.ddt-chevron { transition: transform .3s var(--ease); }
.detail-desc-toggle.expanded .ddt-chevron { transform: rotate(180deg); }

.detail-actions { display: flex; gap: 10px; margin-bottom: 26px; }

.btn-watch-now {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #c62838);
  color: #fff; border: none;
  border-radius: 12px;
  font-family: var(--font-b);
  font-size: 14.5px; font-weight: 800;
  text-transform: uppercase;
  padding: 15px 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  letter-spacing: .6px;
  box-shadow: 0 10px 26px rgba(230,57,70,.35);
  transition: box-shadow .25s, transform .15s;
}
.btn-watch-now::before {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .55s var(--ease);
}
.btn-watch-now:hover { box-shadow: 0 12px 32px rgba(230,57,70,.5); transform: translateY(-1px); }
.btn-watch-now:hover::before { left: 130%; }
.btn-watch-now:active { transform: translateY(0) scale(.98); }
.btn-watch-now.is-checking { opacity: .72; }
.btn-watch-now.is-checking .btn-watch-now-icon { animation: watchCheckingPulse 1.1s ease-in-out infinite; }
@keyframes watchCheckingPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.btn-watch-now-icon {
  width: 22px; height: 22px;
  background: rgba(255,255,255,.22);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding-left: 1.5px;
  flex-shrink: 0;
}

.btn-add-list {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  color: var(--white);
  border-radius: 12px;
  font-family: var(--font-b);
  font-size: 12.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
  padding: 14px 18px;
  cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
  white-space: nowrap;
}
.btn-add-list:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-add-list.added { border-color: var(--accent); color: var(--accent2); background: rgba(230,57,70,.1); }

/* ════════════════════════════════
   WATCH PAGE  (episode player — opens from the detail page's
   Watch Now button; sub streams from the Seishiro server, dub
   streams from the Cantarella server, one button per track)
════════════════════════════════ */
#watch-page {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg);
  z-index: 450;
  overflow-y: auto;
}
#watch-page.open { display: block; }

/* ── Fetch overlay — full-viewport FIXED layer (explicit top/right/
   bottom/left, not the `inset` shorthand, for maximum browser
   compatibility), backdrop blur, with a small card dead-centered
   (not top, not bottom) showing availability check progress. z-index
   is pushed above every other layer on the site so it can never end
   up stranded behind — or above but visually indistinct from — page
   content. One icon throughout the whole flow; "checking" → "found" /
   "not-found" is communicated through the title/sub copy and a
   colour-shifting glow (via the --wfo-c1/--wfo-c2 custom properties),
   not a swapped tick/cross graphic. Auto-hides itself shortly after
   landing on a result, so the person actually sees the outcome instead
   of the panel just vanishing mid-thought. Driven by
   show/updateFetchOverlay()/hideFetchOverlay() in script.js, called
   from openDetail(). ── */
.watch-fetch-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 950;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  --wfo-c1: var(--accent2);
  --wfo-c2: var(--blue);
}
.watch-fetch-overlay.open { opacity: 1; pointer-events: auto; }
.watch-fetch-overlay.closing { opacity: 0; transition: opacity .4s ease; }
.watch-fetch-overlay.state-found { --wfo-c1: #2fe08f; --wfo-c2: var(--green); }
.watch-fetch-overlay.state-notfound { --wfo-c1: #ffab7a; --wfo-c2: var(--accent); }

.wfo-backdrop {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(6,6,8,.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.wfo-card {
  position: relative;
  z-index: 1;
  width: min(84vw, 320px);
  display: flex; flex-direction: column; align-items: center;
  gap: 16px;
  padding: 34px 26px 30px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(165deg, #161616 0%, #0d0d0d 100%);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02);
  transform: translateY(14px) scale(.96);
  opacity: 0;
  transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .35s ease;
}
.watch-fetch-overlay.open .wfo-card { transform: translateY(0) scale(1); opacity: 1; }

.wfo-icon-stack { position: relative; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center; }
.wfo-icon-stack svg { position: absolute; }

/* soft radial glow behind the icon — shifts colour with the state via
   the --wfo-c1 custom property, giving "found"/"not-found" a visual
   identity without a separate icon */
.wfo-glow {
  position: absolute;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--wfo-c1) 0%, transparent 72%);
  opacity: .3;
  filter: blur(14px);
  animation: wfoGlowPulse 1.8s ease-in-out infinite;
  transition: background .4s ease;
}
@keyframes wfoGlowPulse { 0%,100% { opacity: .22; transform: scale(.88); } 50% { opacity: .55; transform: scale(1.18); } }

/* one persistent icon — spinning rings + play glyph — recoloured by
   state instead of swapped for a tick/cross */
.wfo-ring { animation: wfoSpin 1.5s linear infinite; filter: drop-shadow(0 0 10px var(--wfo-c1)); transition: filter .4s ease; }
.wfo-ring--rev { animation: wfoSpinRev 2.3s linear infinite; }
.wfo-play { color: var(--white); animation: wfoPulse 1.6s ease-in-out infinite; transition: color .4s ease, filter .4s ease; }
@keyframes wfoSpin { to { transform: rotate(360deg); } }
@keyframes wfoSpinRev { to { transform: rotate(-360deg); } }
@keyframes wfoPulse { 0%,100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }

.watch-fetch-overlay.state-found .wfo-play,
.watch-fetch-overlay.state-notfound .wfo-play {
  animation: none; opacity: 1; transform: scale(1.12);
  color: var(--wfo-c1); filter: drop-shadow(0 0 9px var(--wfo-c2));
}

/* sparkle accents — twinkle in only on a positive result, purely
   decorative flourish rather than a status glyph */
.wfo-spark {
  position: absolute; color: var(--wfo-c1);
  opacity: 0; transform: scale(.4) rotate(0deg);
}
.wfo-spark--a { top: -6px; right: -4px; }
.wfo-spark--b { bottom: 0; left: -8px; }
.watch-fetch-overlay.state-found .wfo-spark--a { animation: wfoSparkPop .55s ease forwards; }
.watch-fetch-overlay.state-found .wfo-spark--b { animation: wfoSparkPop .55s .12s ease forwards; }
@keyframes wfoSparkPop {
  0% { opacity: 0; transform: scale(.3) rotate(0deg); }
  60% { opacity: 1; transform: scale(1.15) rotate(24deg); }
  100% { opacity: .85; transform: scale(1) rotate(18deg); }
}

.wfo-title {
  font-family: var(--font-d);
  letter-spacing: .5px;
  font-size: 20px;
  color: var(--white);
  transition: color .4s ease, text-shadow .4s ease;
}
.watch-fetch-overlay.state-found .wfo-title,
.watch-fetch-overlay.state-notfound .wfo-title { color: var(--wfo-c1); }
.watch-fetch-overlay.state-found .wfo-title { text-shadow: 0 0 18px rgba(47,224,143,.45); }
.watch-fetch-overlay.state-notfound .wfo-title { text-shadow: 0 0 18px rgba(255,171,122,.4); }
.wfo-sub {
  font-family: var(--font-b);
  font-size: 13px; font-weight: 600;
  letter-spacing: .1px;
  color: var(--silver);
  line-height: 1.4;
}

.wfo-bar { width: 130px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.wfo-bar span {
  display: block; height: 100%; width: 40%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  animation: wfoBarSlide 1.1s ease-in-out infinite;
}
@keyframes wfoBarSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }
.watch-fetch-overlay.state-found .wfo-bar span,
.watch-fetch-overlay.state-notfound .wfo-bar span {
  width: 100%; animation: none;
  background: linear-gradient(90deg, var(--wfo-c2), var(--wfo-c1));
}

.watch-player-wrap { padding: 14px 14px 0; }
.watch-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.watch-player iframe {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
.watch-player iframe.hidden { display: none; }
.watch-player-empty {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 20px;
  color: var(--silver);
  transition: opacity .2s;
}
.watch-player-empty.hidden { display: none; }
.watch-empty-icon { opacity: .4; animation: watchEmptyFloat 3.2s ease-in-out infinite; }
.watch-player-empty-title {
  font-family: var(--font-d);
  font-size: 15px; font-weight: 400; letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--grey);
}
@keyframes watchEmptyFloat { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-5px); opacity: .65; } }

/* ── Watch loading state — layered orbit rings + shimmer text + drifting
   particles instead of a plain spinner and static grey caption ── */
.watch-player-loading {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--silver);
  background:
    radial-gradient(circle at 50% 45%, rgba(230,57,70,.14), transparent 62%),
    #000;
  overflow: hidden;
}
.watch-player-loading.hidden { display: none; }

.watch-loading-orbit { position: relative; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.watch-orbit-ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; animation: watchSpin 1.4s linear infinite; filter: drop-shadow(0 0 6px rgba(230,57,70,.45)); }
.watch-orbit-ring--rev { animation: watchSpinRev 2.1s linear infinite; }
.watch-orbit-play { position: relative; color: var(--white); opacity: .9; animation: watchPulseIcon 1.6s ease-in-out infinite; }
@keyframes watchSpin { to { transform: rotate(360deg); } }
@keyframes watchSpinRev { to { transform: rotate(-360deg); } }
@keyframes watchPulseIcon { 0%,100% { opacity: .55; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.06); } }

.watch-shimmer-text {
  position: relative;
  font-family: var(--font-d);
  letter-spacing: .5px;
  font-size: 15px;
  background: linear-gradient(90deg, var(--grey) 0%, var(--white) 50%, var(--grey) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: watchShimmer 2s linear infinite;
}
@keyframes watchShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.watch-loading-particles { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.watch-loading-particles span {
  position: absolute; bottom: -6px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--accent2); opacity: 0;
  animation: watchParticleRise 3.4s ease-in infinite;
}
.watch-loading-particles span:nth-child(1) { left: 18%; animation-delay: .1s; }
.watch-loading-particles span:nth-child(2) { left: 34%; animation-delay: .9s; }
.watch-loading-particles span:nth-child(3) { left: 52%; animation-delay: 1.7s; }
.watch-loading-particles span:nth-child(4) { left: 68%; animation-delay: .5s; }
.watch-loading-particles span:nth-child(5) { left: 82%; animation-delay: 1.3s; }
@keyframes watchParticleRise {
  0% { transform: translateY(0) scale(.6); opacity: 0; }
  15% { opacity: .8; }
  85% { opacity: .5; }
  100% { transform: translateY(-120px) scale(1.1); opacity: 0; }
}

.watch-controls-row {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.watch-controls-row::-webkit-scrollbar { display: none; }
.watch-ctrl-btn {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--silver);
  font-family: var(--font-b);
  font-size: 11.5px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 8px 14px; border-radius: 20px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.watch-ctrl-btn:active { transform: scale(.95); }
.watch-ctrl-btn svg { flex-shrink: 0; transition: stroke .2s, transform .2s; }
.watch-ctrl-btn.active { color: var(--accent2); border-color: var(--accent); background: rgba(230,57,70,.1); box-shadow: 0 0 0 1px rgba(230,57,70,.18); }
.watch-ctrl-btn.active svg { transform: scale(1.08); }
.watch-ctrl-spacer { flex: 1; }
.watch-icon-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--silver);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .15s, background .2s;
}
.watch-icon-btn:hover { color: var(--white); border-color: var(--accent); transform: translateY(-1px); }
.watch-icon-btn:active { transform: scale(.92); }
.watch-icon-btn.active { color: var(--accent2); border-color: var(--accent); background: rgba(230,57,70,.1); }

.watch-nav-row {
  display: flex; gap: 10px;
  padding: 12px 14px 0;
}
.watch-nav-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font-b);
  font-size: 12.5px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 11px; border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, opacity .2s, transform .15s, background .2s;
}
.watch-nav-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(230,57,70,.06); transform: translateY(-1px); }
.watch-nav-btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.watch-nav-btn:disabled { opacity: .35; cursor: default; }

.watch-banner {
  margin: 14px 14px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--grey);
  text-align: center;
}
.watch-banner strong { color: var(--accent2); font-family: var(--font-d); letter-spacing: .4px; font-size: 14px; }
#watch-topbar-title { font-family: var(--font-d); letter-spacing: .4px; font-size: 16px; }

.watch-servers {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 16px 14px 0;
}
.watch-server-btn {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--grey);
  font-family: var(--font-b);
  font-size: 13.5px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px; border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.watch-server-btn:not(.disabled):hover { transform: translateY(-1px); color: var(--white); }
.watch-server-btn:not(.disabled):active { transform: translateY(0) scale(.97); }
.watch-server-btn svg { opacity: .7; transition: opacity .2s; }
.watch-server-btn.sub.active { border-color: var(--accent); color: var(--white); background: rgba(230,57,70,.12); box-shadow: 0 0 0 1px rgba(230,57,70,.25), 0 8px 20px rgba(230,57,70,.18); }
.watch-server-btn.dub.active { border-color: var(--blue); color: var(--white); background: rgba(26,110,245,.12); box-shadow: 0 0 0 1px rgba(26,110,245,.25), 0 8px 20px rgba(26,110,245,.18); }
.watch-server-btn.active svg { opacity: 1; }
.watch-server-btn.active::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  margin-left: 2px;
  animation: watchServerPing 1.4s ease-in-out infinite;
}
.watch-server-btn.sub.active::after { color: var(--accent2); }
.watch-server-btn.dub.active::after { color: var(--blue); }
@keyframes watchServerPing { 0%,100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.watch-server-btn.disabled { opacity: .4; cursor: default; }
.watch-server-track {
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  color: var(--silver);
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

.watch-episode-toolbar {
  display: flex; gap: 8px;
  padding: 22px 14px 0;
}
.watch-select-wrap { position: relative; flex-shrink: 0; }
.watch-select-wrap select {
  appearance: none;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 12.5px; font-weight: 600;
  padding: 10px 30px 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.watch-select-wrap select:hover, .watch-select-wrap select:focus { border-color: var(--accent); }
.watch-select-wrap::after {
  content: '';
  position: absolute; right: 12px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--silver);
  border-bottom: 2px solid var(--silver);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.watch-ep-search {
  flex: 1; min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 12.5px;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.watch-ep-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,57,70,.12); }
.watch-ep-search::placeholder { color: var(--silver); }

.watch-ep-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 16px 14px 40px;
}
.watch-ep-num {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--grey);
  font-family: var(--font-d);
  letter-spacing: .3px;
  font-size: 15px; font-weight: 700;
  padding: 12px 0; border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
}
.watch-ep-num:hover { border-color: var(--accent); color: var(--white); transform: translateY(-1px); }
.watch-ep-num:active { transform: translateY(0) scale(.94); }
.watch-ep-num.active {
  background: linear-gradient(155deg, var(--accent), #a4222c);
  border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 16px rgba(230,57,70,.35);
}
.watch-ep-num.active::after {
  content: '';
  position: absolute; left: 50%; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%;
  background: #fff; opacity: .85;
  transform: translateX(-50%);
  animation: watchEpActivePulse 1.3s ease-in-out infinite;
}
@keyframes watchEpActivePulse { 0%,100% { opacity: .5; transform: translateX(-50%) scale(.8); } 50% { opacity: 1; transform: translateX(-50%) scale(1.3); } }

/* ════════════════════════════════
   SEARCH MODAL
════════════════════════════════ */
#search-modal {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--bg);
  z-index: 500;
  padding: var(--nav-h) 0 var(--bot-h);
  display: none; flex-direction: column;
}
#search-modal.open { display: flex; }

.search-bar-wrap {
  padding: 14px 14px 0;
  display: flex; align-items: center; gap: 10px;
}
.search-input-wrap {
  flex: 1; position: relative;
}
.search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 15px; font-weight: 500;
  padding: 12px 16px 12px 42px;
  outline: none;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--silver); }
.search-icon-in {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--silver); pointer-events: none;
}
.search-cancel {
  background: none; border: none;
  color: var(--accent); font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; padding: 4px;
}

#search-results {
  flex: 1; overflow-y: auto; padding: 16px 14px;
}
.search-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.search-results-grid .anime-card { width: 100%; }

/* active "Search: term" chip, like a filter tag you can clear */
.search-active-chip-row { padding: 14px 14px 0; }
.search-active-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 12px; font-weight: 600;
  padding: 6px 8px 6px 14px;
  border-radius: 20px;
}
.search-active-chip button {
  background: rgba(255,255,255,.1);
  border: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  color: var(--white);
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.search-active-chip button:hover { background: var(--accent); }

/* list-row results — thumb + title/eps/tags, one row per hit */
.search-results-list { display: flex; flex-direction: column; gap: 4px; }
.search-result-row {
  display: flex; gap: 12px;
  padding: 10px 6px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.search-result-row:hover, .search-result-row:active { background: var(--card); }
.search-result-thumb {
  width: 64px; height: 90px; flex-shrink: 0;
  border-radius: 8px; overflow: hidden;
  background: var(--card);
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; padding-top: 2px; }
.search-result-title {
  font-size: 14.5px; font-weight: 700;
  color: var(--white);
  margin-bottom: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result-eps { font-size: 12px; color: var(--silver); margin-bottom: 6px; }
.search-result-tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11px; font-weight: 600;
  color: var(--silver);
  text-transform: uppercase; letter-spacing: .4px;
}
.search-result-tags span:not(:last-child)::after { content: '•'; margin-left: 6px; opacity: .5; }
.search-result-tags .airing { color: var(--accent); }

/* ════════════════════════════════
   INFO SHEET  (FAQ / Terms / Privacy / Request Series)
════════════════════════════════ */
#sheet-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,.6);
  z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
#sheet-overlay.active { opacity: 1; pointer-events: auto; }

#info-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-height: 82vh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  z-index: 601;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  box-shadow: 0 -20px 60px rgba(0,0,0,.5);
}
#info-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 10px auto 4px;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 14px;
  border-bottom: 1px solid var(--border);
}
.sheet-title { font-size: 17px; font-weight: 800; color: var(--white); }
.sheet-close {
  width: 30px; height: 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.sheet-body { flex: 1; overflow-y: auto; padding: 18px; }

/* FAQ accordion */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: none;
  color: var(--white); font-size: 14px; font-weight: 700;
  text-align: left;
  padding: 14px 16px;
  cursor: pointer;
}
.faq-chevron { flex-shrink: 0; color: var(--silver); transition: transform .25s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); color: var(--accent); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding: 0 16px 16px; font-size: 13px; line-height: 1.6; color: var(--silver); }

/* Terms / Privacy prose */
.sheet-prose h4 { font-size: 14px; font-weight: 800; color: var(--white); margin: 18px 0 6px; }
.sheet-prose h4:first-of-type { margin-top: 4px; }
.sheet-prose p { font-size: 13.5px; line-height: 1.7; color: var(--silver); }
.sheet-updated { font-style: italic; opacity: .7; margin-bottom: 14px !important; }

/* Request Series form */
.request-form { display: flex; flex-direction: column; }
.request-label { font-size: 12px; font-weight: 700; color: var(--silver); text-transform: uppercase; letter-spacing: .5px; margin: 14px 0 8px; }
.request-label:first-child { margin-top: 0; }
.request-label span { text-transform: none; font-weight: 500; opacity: .7; }
.request-input, .request-textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 14px; font-family: inherit;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s;
}
.request-input:focus, .request-textarea:focus { border-color: var(--accent); }
.request-input::placeholder, .request-textarea::placeholder { color: var(--silver); }
.request-textarea { min-height: 90px; resize: vertical; }
.request-send-btn {
  margin-top: 20px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 13px;
  cursor: pointer;
  transition: transform .1s, background .2s;
}
.request-send-btn:hover { transform: scale(1.01); }
.request-note { font-size: 11.5px; color: var(--silver); opacity: .75; margin-top: 10px; text-align: center; }

/* ════════════════════════════════
   SKELETON
════════════════════════════════ */
.skel {
  background: linear-gradient(90deg, var(--card) 25%, var(--card2) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 8px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ════════════════════════════════
   TOAST
════════════════════════════════ */
#toast {
  position: fixed; bottom: calc(var(--bot-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 13px; font-weight: 500;
  padding: 11px 22px; border-radius: 10px;
  z-index: 999;
  opacity: 0;
  transition: opacity .3s, transform .3s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════
   EMPTY / ERROR STATES
════════════════════════════════ */
.state-box {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--silver);
  width: 100%;
}
.state-box svg { opacity: .35; }
.state-title { font-size: 14px; font-weight: 700; color: var(--grey); }
.state-sub   { font-size: 12px; line-height: 1.6; max-width: 280px; }
.state-retry {
  margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 12px; font-weight: 700;
  padding: 9px 20px; border-radius: 20px;
  cursor: pointer;
  transition: border-color .2s;
}
.state-retry:hover { border-color: var(--accent); }

/* ════════════════════════════════
   BROWSE PAGE
════════════════════════════════ */
#browse-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--bot-h);
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
  padding-bottom: 24px;
}
#browse-page.open { display: block; }

/* ════════════════════════════════
   RECENT PAGE  (reuses browse-grid/catalog-card + filter-row look)
════════════════════════════════ */
#recent-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--bot-h);
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
  padding-bottom: 24px;
}
#recent-page.open { display: block; }

/* ════════════════════════════════
   MY LIST PAGE  (reuses browse-grid/catalog-card look)
════════════════════════════════ */
#mylist-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--bot-h);
  background: var(--bg);
  z-index: 150;
  overflow-y: auto;
  padding-bottom: 24px;
}
#mylist-page.open { display: block; }

.mylist-card { position: relative; }
.mylist-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(10,10,10,.75);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  color: var(--white);
  font-size: 13px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background .2s, border-color .2s;
}
.mylist-remove:hover { background: var(--accent); border-color: var(--accent); }

/* ════════════════════════════════
   LOGIN / REGISTER PAGES
════════════════════════════════ */
#login-page, #register-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 700;
  overflow-y: auto;
}
#login-page.open, #register-page.open { display: block; }

.auth-body {
  max-width: 420px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  display: flex;
  flex-direction: column;
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  margin-bottom: 44px;
}
.auth-logo-mark {
  width: 34px; height: 34px;
  background: var(--white);
  color: var(--bg);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo span { font-family: var(--font-d); font-size: 22px; letter-spacing: .5px; color: var(--white); }

.auth-title {
  font-family: var(--font-d);
  font-size: 30px; letter-spacing: .5px;
  text-align: center;
  color: var(--white);
  margin-bottom: 8px;
}
.auth-sub {
  text-align: center;
  font-size: 14px;
  color: var(--silver);
  margin-bottom: 28px;
}

.auth-btn {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 14.5px; font-weight: 700;
  padding: 15px;
  margin-bottom: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: border-color .2s, background .2s;
}
.auth-btn:hover { border-color: var(--accent); background: var(--card2); }
.auth-btn-google svg { flex-shrink: 0; }
.auth-btn-strong { background: var(--accent); border-color: var(--accent); }
.auth-btn-strong:hover { background: var(--accent2); border-color: var(--accent2); }

/* Google sign-in — google.accounts.id.prompt() (One Tap), fired from our
   own custom button, silently does nothing in a lot of real browsers now
   (third-party-cookie phase-out, FedCM eligibility rules, a previously
   dismissed prompt) — no error, no callback, the button just looks dead.
   So instead we render Google's own official button into this layer,
   stacked exactly over our styled button and left effectively invisible,
   so the actual click the person makes lands on Google's real, FedCM-
   aware widget — see initGoogleButtons()/renderGoogleButtons() in
   script.js. While nothing has rendered into it yet (missing Client ID,
   GSI script blocked/slow) it's `:empty`, so clicks fall through to the
   visible fallback button underneath, which still explains what's wrong. */
.gsi-google-wrap { position: relative; }
.gsi-real-btn {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  z-index: 2;
  opacity: .01;
  overflow: hidden;
  border-radius: 12px;
}
.gsi-real-btn:empty { pointer-events: none; }
.gsi-real-btn > div { width: 100% !important; }
.gsi-real-btn iframe { width: 100% !important; height: 100% !important; }

.auth-switch {
  text-align: center;
  font-size: 13.5px;
  color: var(--silver);
  margin: 4px 0 26px;
}
.auth-switch a { color: var(--white); font-weight: 700; text-decoration: underline; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 10px 0 20px;
  color: var(--silver);
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--silver);
  opacity: .75;
  margin-top: 4px;
  line-height: 1.5;
}
.auth-btn-anilist:hover { border-color: #02A9FF; }
.auth-btn-mal:hover { border-color: #2E51A2; }

.request-send-btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--silver);
  margin-top: 10px;
}
.request-send-btn-ghost:hover { border-color: var(--accent); color: var(--white); }

/* ════════════════════════════════
   COMMUNITY — post list, detail, comments, create-post sheet
════════════════════════════════ */
#community-page, #community-detail-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--bot-h);
  background: var(--bg);
  overflow-y: auto;
}
#community-page { z-index: 150; }
#community-detail-page { z-index: 400; bottom: 0; }
#community-page.open, #community-detail-page.open { display: block; }

.community-list { padding: 10px 14px 90px; display: flex; flex-direction: column; gap: 10px; }

.community-post-card {
  display: flex; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .2s;
}
.community-post-card:hover { border-color: var(--accent); }

.cp-votes {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex-shrink: 0;
  padding-top: 2px;
}
.cp-vote-btn {
  background: none; border: none;
  color: var(--silver);
  font-size: 13px;
  cursor: pointer;
  width: 24px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 5px;
  transition: color .15s, background .15s;
}
.cp-vote-btn:hover { background: var(--card2); color: var(--white); }
.cp-vote-btn.active-up { color: var(--green); }
.cp-vote-btn.active-down { color: var(--accent); }
.cp-score { font-size: 13px; font-weight: 800; color: var(--white); }

.cp-body { flex: 1; min-width: 0; }
.cp-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--silver);
  margin-bottom: 8px; flex-wrap: wrap;
}
.cp-dot { opacity: .5; }
.cp-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.cp-avatar-fallback {
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.cp-author { color: var(--white); font-weight: 600; }
.cp-tag {
  display: inline-block;
  font-size: 10px; font-weight: 800;
  letter-spacing: .4px;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}
.tag-suggestions { background: rgba(2,169,255,.15); color: #4fc3ff; }
.tag-bugs        { background: rgba(255,140,0,.15);  color: #ff9d3d; }
.tag-help        { background: rgba(130,110,255,.18); color: #a394ff; }
.tag-general     { background: rgba(60,120,255,.15); color: #6d9bff; }
.tag-feedback    { background: rgba(22,163,74,.15); color: #4ade80; }

.cp-title { font-size: 15px; font-weight: 800; color: var(--white); margin-bottom: 5px; }
.cp-excerpt {
  font-size: 12.5px; color: var(--silver);
  line-height: 1.5;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cp-comments {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--silver);
}

.community-fab {
  position: fixed; right: 18px; bottom: calc(var(--bot-h) + 18px);
  width: 54px; height: 54px;
  background: var(--accent);
  border: none; border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(230,57,70,.4);
  cursor: pointer;
  z-index: 160;
  transition: transform .15s, background .2s;
}
.community-fab:hover { transform: scale(1.06); background: var(--accent2); }
.community-fab.hidden { display: none; }

/* post detail */
.cd-body { padding: 18px 16px 60px; max-width: 640px; margin: 0 auto; }
.cd-author-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cd-author-row .cp-avatar { width: 42px; height: 42px; }
.cd-author-line { font-size: 14px; color: var(--white); }
.cd-author-line .cp-tag { margin-left: 6px; vertical-align: middle; }
.cd-time { font-size: 12px; color: var(--silver); margin-top: 2px; }
.cd-title { font-size: 22px; font-weight: 800; color: var(--white); margin-bottom: 10px; line-height: 1.3; }
.cd-text { font-size: 14.5px; line-height: 1.7; color: var(--grey); margin-bottom: 18px; white-space: pre-wrap; }

.cd-actions {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.cd-vote-group { display: flex; align-items: center; gap: 10px; }
.cd-vote-group .cp-vote-btn { width: 32px; height: 32px; background: var(--card); border: 1px solid var(--border); font-size: 15px; }
.cd-score { font-size: 15px; font-weight: 800; color: var(--white); min-width: 20px; text-align: center; }
.cd-comment-count { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--silver); }

.cd-comments-h { font-size: 16px; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.cd-comment-box { margin-bottom: 22px; }
.cd-login-bar {
  display: block; width: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--silver);
  font-size: 13.5px; font-weight: 600;
  padding: 14px;
  cursor: pointer;
  margin-bottom: 22px;
  transition: border-color .2s, color .2s;
}
.cd-login-bar:hover { border-color: var(--accent); color: var(--white); }

.cd-comment-list { display: flex; flex-direction: column; gap: 18px; }
.cd-no-comments { color: var(--silver); font-size: 13px; text-align: center; padding: 20px 0; }
.cd-comment { display: flex; gap: 10px; }
.cd-comment .cp-avatar { width: 34px; height: 34px; flex-shrink: 0; }
.cd-comment-body { flex: 1; min-width: 0; }
.cd-comment-head { font-size: 13.5px; color: var(--white); margin-bottom: 3px; }
.cd-comment-head span { color: var(--silver); font-weight: 500; font-size: 12px; margin-left: 6px; }
.cd-comment-text { font-size: 13.5px; color: var(--grey); line-height: 1.6; margin-bottom: 6px; }
.cd-comment-actions { display: flex; align-items: center; gap: 16px; }
.cd-cvote {
  background: none; border: none;
  color: var(--silver);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex; align-items: center; gap: 5px;
  transition: color .15s, background .15s;
}
.cd-cvote:hover { background: var(--card2); color: var(--white); }
.cd-cvote.active-up { color: var(--green); }
.cd-cvote.active-down { color: var(--accent); }
.cd-creply {
  background: none; border: none;
  color: var(--silver);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  cursor: pointer;
}
.cd-creply:hover { color: var(--accent); }

/* create-post sheet (type picker) */
.cp-type-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.cp-type-chip {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--silver);
  font-size: 11px; font-weight: 800;
  letter-spacing: .4px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: border-color .2s, background .2s, color .2s;
}
.cp-type-chip.selected { color: var(--white); border-color: currentColor; }
.cp-type-chip.tag-suggestions.selected { background: rgba(2,169,255,.15); border-color: #4fc3ff; color: #4fc3ff; }
.cp-type-chip.tag-bugs.selected        { background: rgba(255,140,0,.15); border-color: #ff9d3d; color: #ff9d3d; }
.cp-type-chip.tag-help.selected        { background: rgba(130,110,255,.18); border-color: #a394ff; color: #a394ff; }
.cp-type-chip.tag-general.selected     { background: rgba(60,120,255,.15); border-color: #6d9bff; color: #6d9bff; }
.cp-type-chip.tag-feedback.selected    { background: rgba(22,163,74,.15); border-color: #4ade80; color: #4ade80; }

.cat-search-row {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 14px 0;
}
.cat-search-wrap {
  flex: 1; position: relative;
}
.cat-search-icon {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--silver); pointer-events: none;
}
.cat-search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--white);
  font-size: 14px; font-weight: 500;
  padding: 12px 14px 12px 38px;
  outline: none;
  transition: border-color .2s;
}
.cat-search-input:focus { border-color: var(--accent); }
.cat-search-input::placeholder { color: var(--silver); }

.cat-icon-btn {
  flex-shrink: 0;
  width: 42px; height: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--grey);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.cat-icon-btn:hover { color: var(--white); border-color: var(--accent); }

.browse-filters-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s var(--ease);
}
.browse-filters-panel.open { max-height: 160px; }

.browse-sort-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 14px 14px 0;
  scrollbar-width: none;
}
.browse-sort-row::-webkit-scrollbar { display: none; }

.browse-genre-row {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 10px 14px 4px;
  scrollbar-width: none;
}
.browse-genre-row::-webkit-scrollbar { display: none; }

.chip-btn {
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--silver);
  font-size: 12px; font-weight: 700;
  padding: 7px 16px; border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase; letter-spacing: .6px;
  transition: color .2s, border-color .2s, background .2s;
}
.chip-btn.active, .chip-btn:hover {
  color: #fff; background: var(--accent); border-color: var(--accent);
}

.browse-body { padding: 18px 14px 0; min-height: 40vh; }

.browse-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px 10px;
}
@media (min-width: 480px) {
  .browse-grid { grid-template-columns: repeat(4, 1fr); }
}

/* catalog-style card: poster, then meta row, then bold title (no overlay badges) */
.catalog-card { cursor: pointer; }
.catalog-thumb {
  width: 100%; aspect-ratio: 2/3;
  border-radius: 10px; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color .25s;
}
.catalog-card:hover .catalog-thumb { border-color: var(--accent); }
.catalog-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.catalog-card:hover .catalog-thumb img { transform: scale(1.06); }

.catalog-meta {
  display: flex; gap: 8px;
  margin-top: 8px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
  color: var(--silver);
}
.catalog-meta .airing { color: var(--accent2); }

.catalog-title {
  font-size: 13px; font-weight: 700;
  color: var(--white);
  margin-top: 3px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.browse-load-more {
  display: block;
  margin: 22px auto 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--white);
  font-size: 13px; font-weight: 700;
  padding: 12px 30px; border-radius: 24px;
  cursor: pointer;
  letter-spacing: .4px;
  transition: border-color .2s, background .2s;
}
.browse-load-more:hover { border-color: var(--accent); }
.browse-load-more:disabled { opacity: .5; cursor: default; }
.browse-load-more.hidden { display: none; }

/* ════════════════════════════════
   SCHEDULE PAGE
════════════════════════════════ */
#schedule-page {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; bottom: var(--bot-h);
  background: var(--bg);
  z-index: 150;
  flex-direction: column;
}
#schedule-page.open { display: flex; }

.schedule-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 20px;
}

.sched-day-label {
  font-family: var(--font-d);
  font-size: 22px; letter-spacing: 1.5px;
  color: var(--white);
  margin: 4px 0 14px;
}
.sched-day-label em { color: var(--accent); font-style: normal; }

.sched-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .2s;
}
.sched-row:hover { background: var(--card); }
.sched-row + .sched-row { border-top: 1px solid var(--border); }

.sched-time {
  width: 56px; flex-shrink: 0;
  font-size: 13px; font-weight: 700;
  color: var(--accent);
  text-align: center;
}
.sched-time span {
  display: block; font-size: 9px; font-weight: 600;
  color: var(--silver); margin-top: 1px;
}
.sched-thumb {
  width: 48px; height: 68px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
}
.sched-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sched-info { flex: 1; min-width: 0; }
.sched-title {
  font-size: 13px; font-weight: 600; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sched-meta { font-size: 11px; color: var(--silver); margin-top: 3px; }
.sched-ep-badge {
  flex-shrink: 0;
  background: var(--accent-dim);
  color: var(--accent2);
  font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 12px;
  white-space: nowrap;
}

.schedule-day-bar {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 10px;
  background: rgba(12,12,12,.97);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.schedule-day-bar::-webkit-scrollbar { display: none; }

.sched-day-btn {
  flex: 1;
  min-width: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--silver);
  font-size: 12px; font-weight: 700;
  padding: 10px 6px; border-radius: 10px;
  cursor: pointer;
  text-transform: uppercase; letter-spacing: .4px;
  transition: color .2s, background .2s, border-color .2s;
}
.sched-day-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.sched-day-btn.today:not(.active) { color: var(--accent2); border-color: var(--accent-dim); }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 380px) {
  .top10-card, .anime-card { width: 115px; }
  .hero-title { font-size: 30px; }
  }

/* ══════════════════════════════════════════════════════════════════
   VERIFICATION GATE — non-dismissable overlay shown on the watch page
   when a visitor hasn't verified (or verification expired) and the
   shortener is on. No close button, no ESC/backdrop-click handling —
   intentional, matches "can't be cancelled" in the spec.
   ══════════════════════════════════════════════════════════════════ */
#verify-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(6,6,8,0.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
  padding: 20px;
}
#verify-gate.show { opacity: 1; pointer-events: all; }
.verify-gate-card {
  width: 100%; max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: 0 30px 70px -25px rgba(0,0,0,.8);
  transform: translateY(10px) scale(.97);
  transition: transform .25s var(--ease);
}
#verify-gate.show .verify-gate-card { transform: none; }
.verify-gate-icon {
  width: 54px; height: 54px; margin: 0 auto 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  color: #1a0708;
}
.verify-gate-card h2 {
  font-family: var(--font-d); font-size: 24px; letter-spacing: .4px;
  color: var(--white); margin-bottom: 10px;
}
.verify-gate-card p {
  font-family: var(--font-b); font-size: 13.5px; color: var(--grey);
  line-height: 1.55; margin-bottom: 24px;
}
#verify-gate-btn {
  width: 100%; border: none; padding: 15px;
  border-radius: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-b); font-weight: 800; font-size: 14.5px;
  text-transform: uppercase; letter-spacing: .6px;
  color: #1a0708;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 26px -10px rgba(230,57,70,.55);
  transition: filter .15s, transform .1s, box-shadow .2s;
}
#verify-gate-btn svg { flex-shrink: 0; }
#verify-gate-btn:hover { filter: brightness(1.08); box-shadow: 0 14px 32px -10px rgba(230,57,70,.7); }
#verify-gate-btn:active { transform: scale(.98); }
#verify-gate-btn:disabled { opacity: .6; cursor: default; }

/* ══════════════════════════════════════════════════════════════════
   BROADCAST POPUP — centered card, appears over the middle of the page
   and disappears again; the owner's "duration" controls how long the
   whole campaign keeps showing this on page loads, not how long any
   single popup stays up.
   ══════════════════════════════════════════════════════════════════ */
#broadcast-popup {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
#broadcast-popup.show { opacity: 1; pointer-events: all; }

#broadcast-popup .bc-backdrop {
  position: absolute; inset: 0;
  background: rgba(4,4,6,.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

/* animated rotating-gradient border — a ring of color spinning behind
   the card, visible only in the thin gap left by .bc-card's inset */
#broadcast-popup .bc-border-wrap {
  position: relative; z-index: 1;
  width: min(88vw, 400px);
  border-radius: 22px;
  padding: 2.5px;
  overflow: hidden;
  transform: scale(.92);
  transition: transform .4s cubic-bezier(.16,.9,.3,1.15);
}
#broadcast-popup.show .bc-border-wrap { transform: scale(1); }
#broadcast-popup .bc-border-wrap::before {
  content: '';
  position: absolute; inset: -60%;
  background: conic-gradient(from 0deg, transparent 0%, var(--accent) 18%, var(--accent2) 32%, transparent 50%, transparent 100%);
  animation: bc-border-spin 3.2s linear infinite;
}
@keyframes bc-border-spin { to { transform: rotate(360deg); } }

#broadcast-popup .bc-card {
  position: relative; z-index: 1;
  background: linear-gradient(165deg, var(--card2), var(--card) 80%);
  border-radius: 20px;
  padding: 30px 26px 26px;
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.75);
}

#broadcast-popup .bc-close {
  position: absolute; top: 14px; right: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: none; color: var(--silver); cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
#broadcast-popup .bc-close:hover { background: rgba(255,255,255,.1); color: var(--white); transform: rotate(90deg); }

#broadcast-popup .bc-icon {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 8px 22px -6px rgba(230,57,70,.65);
  color: #1a0708;
  position: relative;
}
#broadcast-popup .bc-icon::after {
  content: ''; position: absolute; inset: -6px; border-radius: 16px;
  border: 1.5px solid rgba(230,57,70,.5);
  animation: bc-ring 2.2s ease-out infinite;
}
@keyframes bc-ring {
  0%   { transform: scale(.85); opacity: .9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Heading structure: "ANNOUNCEMENT" (display font, large) then the
   ANICROX tagline underneath it, both above a separate nested box that
   holds the owner's actual message — matches the requested layout. */
#broadcast-popup .bc-heading {
  font-family: var(--font-d); font-size: 26px; font-weight: 400;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--white); line-height: 1;
}
#broadcast-popup .bc-tagline {
  font-family: var(--font-b); font-size: 11px; font-weight: 700;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent2); margin-top: 6px; margin-bottom: 20px;
}
#broadcast-popup .bc-msg-box {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
#broadcast-popup .bc-msg {
  font-family: var(--font-b); font-size: 14px; font-weight: 500;
  color: var(--grey); line-height: 1.55;
}

/* drains from full to empty over the popup's own visible duration —
   gives a clear, polished sense of "this is about to go away" instead
   of it just vanishing unannounced */
#broadcast-popup .bc-progress {
  height: 3px; margin-top: 22px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform-origin: left center;
  animation: bc-drain linear forwards;
  box-shadow: 0 0 8px rgba(230,57,70,.6);
}
@keyframes bc-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
