/* ═══════════════════════════════════════════════════
   MarvelVault — style.css
   Cinematic dark premium design
═══════════════════════════════════════════════════ */

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

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

html { scroll-behavior: smooth; }

body {
  background: #0a0a0f;
  color: #e8e8f0;
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

:root {
  --red: #e50914;
  --red-dark: #b20710;
  --gold: #f5c518;
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #1a1a24;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #555568;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.6);
  --nav-h: 60px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── NAV ─── */
nav#topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
nav#topnav.scrolled {
  background: rgba(8,8,12,0.95);
  box-shadow: 0 1px 0 var(--glass-border);
}

.nav-logo {
  font-family: 'Oswald', sans-serif;
  font-size: 24px; font-weight: 700;
  letter-spacing: 3px;
  color: var(--red);
  text-shadow: 0 0 20px rgba(229,9,20,0.4);
  cursor: pointer; user-select: none;
}
.nav-logo span {
  color: var(--text-muted); font-size: 12px; letter-spacing: 4px;
  margin-left: 6px; font-family: 'DM Sans', sans-serif; font-weight: 300;
}

.nav-links { display: flex; gap: 6px; list-style: none; align-items: center; }
.nav-links li a, .nav-links li button {
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--text-muted); text-decoration: none;
  font-size: 13px; font-weight: 500; letter-spacing: 0.4px;
  padding: 7px 14px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links li a:hover, .nav-links li button:hover { color: var(--text); background: var(--glass); }
.nav-links li a.active, .nav-links li button.active { color: var(--red); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-search-wrap { position: relative; display: flex; align-items: center; }
.nav-search-icon { position: absolute; left: 12px; color: var(--text-dim); pointer-events: none; }
#nav-search {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 8px 14px 8px 34px; color: var(--text); font-size: 13px; font-family: inherit;
  width: 200px; outline: none; transition: all 0.3s;
}
#nav-search::placeholder { color: var(--text-dim); }
#nav-search:focus {
  border-color: rgba(229,9,20,0.4); background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.08); width: 250px;
}

/* ─── PAGES ─── */
.page { display: none; }
.page.active { display: block; }

/* ─── HERO ─── */
#hero {
  position: relative; height: 85vh; min-height: 500px; max-height: 860px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-bg-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  opacity: 0.28; transform: scale(1.0); filter: none;
  transition: opacity 0.7s ease, filter 0.7s ease, transform 0.7s ease;
}
.hero-bg-img.is-poster-fallback {
  opacity: 0.25; transform: scale(1.15); filter: blur(18px) saturate(1.2);
  object-position: center top;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.95) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0.1) 100%),
              linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 50%);
}
.hero-content {
  position: relative; z-index: 1; max-width: 560px;
  padding: 0 0 80px 60px;
  animation: heroFadeIn 0.8s ease both;
}
@keyframes heroFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.hero-eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--red); color: white;
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  padding: 4px 12px; border-radius: 4px; text-transform: uppercase;
}
.hero-phase-tag {
  font-size: 11px; color: var(--text-muted);
  border: 1px solid var(--glass-border); padding: 3px 10px; border-radius: 4px;
}
.hero-title {
  font-family: 'Oswald', sans-serif; font-size: clamp(40px, 6vw, 76px);
  line-height: 0.95; letter-spacing: 1.5px; margin-bottom: 14px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.8); font-weight: 600;
}
.hero-meta-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.hero-meta-row .dot { color: var(--text-dim); font-size: 4px; }
.hero-meta-row span { font-size: 13px; color: var(--text-muted); }
.hero-rating-badge { display: flex; align-items: center; gap: 5px; color: var(--gold) !important; font-weight: 600 !important; }
.hero-rating-badge svg { fill: var(--gold); }
.hero-genres { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.hero-genre-tag { font-size: 11px; color: var(--text-muted); background: var(--glass); border: 1px solid var(--glass-border); padding: 3px 10px; border-radius: 20px; }
.hero-plot { font-size: 14px; line-height: 1.65; color: var(--text-muted); margin-bottom: 24px; max-width: 460px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-hero-primary {
  background: var(--red); color: white; border: none; padding: 12px 28px; border-radius: 6px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.3px; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-hero-watchlist {
  background: var(--glass); color: var(--text); border: 1px solid var(--glass-border);
  padding: 12px 24px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-hero-watchlist:hover { background: rgba(255,255,255,0.08); }
.btn-hero-watchlist.in-list { color: var(--gold); border-color: rgba(245,197,24,0.35); background: rgba(245,197,24,0.08); }
.btn-hero-watchlist svg.check { display: none; }
.btn-hero-watchlist.in-list svg.plus { display: none; }
.btn-hero-watchlist.in-list svg.check { display: inline; }

.hero-scroll-hint {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-dim); font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  animation: scrollBounce 2s ease infinite; z-index: 2;
}
@keyframes scrollBounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(6px); } }

/* ─── CONTENT ROWS ─── */
#home-rows { padding-bottom: 40px; }
.content-section {
  padding: 32px 0 4px; opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  content-visibility: auto; contain-intrinsic-size: auto 320px;
}
.content-section.visible { opacity: 1; transform: translateY(0); }
.section-header { display: flex; align-items: center; padding: 0 24px; margin-bottom: 16px; gap: 12px; }
.section-title-wrap { display: flex; align-items: center; gap: 12px; }
.section-phase-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.section-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: 0.3px; }
.section-count { font-size: 11px; color: var(--text-dim); margin-left: 4px; }
.section-see-all {
  font-size: 12px; color: var(--text-dim); background: none; border: none; cursor: pointer;
  font-family: inherit; display: flex; align-items: center; gap: 4px; margin-left: auto;
  transition: color 0.2s; padding: 4px 8px;
}
.section-see-all:hover { color: var(--text-muted); }

.poster-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 8px 24px 20px;
  scroll-snap-type: x mandatory; scroll-padding-left: 24px; scrollbar-width: none;
}
.poster-row::-webkit-scrollbar { display: none; }

/* ─── CARD ─── */
.card { flex-shrink: 0; width: 150px; cursor: pointer; scroll-snap-align: start; transition: transform 0.3s cubic-bezier(.2,.8,.2,1); position: relative; }
.card:hover { transform: translateY(-6px) scale(1.03); z-index: 2; }
.card-poster-wrap {
  width: 100%; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden;
  position: relative; background: var(--bg3); box-shadow: var(--shadow);
  border: 1px solid var(--glass-border); transition: border-color 0.3s;
}
.card:hover .card-poster-wrap { border-color: rgba(229,9,20,0.4); }
.card-poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; position: relative; z-index: 1; }
.card:hover .card-poster-wrap img { transform: scale(1.06); }
.card-poster-wrap:has(img.loading)::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, var(--bg2) 30%, var(--bg3) 50%, var(--bg2) 70%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; z-index: 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.card-hover-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  opacity: 0; transition: opacity 0.3s; display: flex; align-items: flex-end; justify-content: center; padding: 12px; z-index: 2;
}
.card:hover .card-hover-overlay { opacity: 1; }
.card-hover-title { font-size: 12px; font-weight: 600; color: white; text-align: center; }

.card-type-tag, .card-type-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(0,0,0,0.7); color: var(--text-muted); font-size: 9px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase; padding: 3px 7px; border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
}

.card-wl-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.15); border-radius: 50%;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.2s, background 0.2s, transform 0.2s;
}
.card:hover .card-wl-btn { opacity: 1; }
.card-wl-btn:hover { background: rgba(229,9,20,0.85); transform: scale(1.1); }
.card-wl-btn.in-list { opacity: 1; background: rgba(0,0,00,0.1); }
.card-wl-btn svg { width: 13px; height: 13px; }

.card-info { padding: 8px 2px 0; }
.card-info-title, .card-title { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-info-year, .card-year { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.section-divider { height: 1px; background: linear-gradient(to right, transparent, var(--glass-border), transparent); margin: 8px 24px; }

/* ─── SEARCH PAGE ─── */
#search-page { padding: calc(var(--nav-h) + 20px) 24px 100px; min-height: 100vh; }
.search-page-title, .search-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.search-page-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }
.search-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-pill {
  background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-muted);
  font-size: 12px; font-weight: 500; padding: 6px 14px; border-radius: 20px; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.filter-pill:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.filter-pill.active { background: var(--red); border-color: var(--red); color: white; }
.search-results-grid, .search-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px;
}
.search-empty, .no-results { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.search-empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.search-empty-title, .no-results h3 { font-family: 'Syne', sans-serif; font-size: 20px; margin-bottom: 8px; color: var(--text); }
.search-empty-sub { font-size: 13px; color: var(--text-dim); }

/* ─── PHASES / XMEN PAGES ─── */
#phases-page, #xmen-page { padding: calc(var(--nav-h) + 20px) 24px 100px; min-height: 100vh; }
.phases-title, .phases-hero-title, .xmen-page-title {
  font-family: 'Oswald', sans-serif; font-size: 38px; font-weight: 600; letter-spacing: 1px; margin-bottom: 8px;
}
.phases-sub, .phases-hero-sub, .xmen-page-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.phase-divider { display: flex; align-items: center; gap: 14px; padding: 28px 24px 4px; }
.phase-divider-line { flex: 1; height: 1px; background: var(--glass-border); }
.phase-divider-label { font-family: 'Oswald', sans-serif; font-size: 18px; letter-spacing: 1.5px; }

.phase-block { margin-bottom: 40px; }
.phase-block-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--glass-border); }
.phase-block-number { font-family: 'Oswald', sans-serif; font-size: 48px; font-weight: 700; line-height: 1; opacity: 0.85; }
.phase-block-name { font-family: 'Oswald', sans-serif; font-size: 19px; font-weight: 600; letter-spacing: 0.5px; margin-bottom: 3px; }
.phase-block-count { font-size: 12px; color: var(--text-dim); }
.phase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }

/* ─── WATCHLIST PAGE ─── */
#watchlist-page { padding: calc(var(--nav-h) + 20px) 24px 100px; min-height: 100vh; }
.watchlist-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.watchlist-page-title { font-family: 'Oswald', sans-serif; font-size: 28px; font-weight: 600; letter-spacing: 0.5px; }
.clear-watchlist-btn {
  font-size: 12px; color: var(--text-dim); background: none; border: 1px solid var(--glass-border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.clear-watchlist-btn:hover { color: var(--red); border-color: var(--red); }
.watchlist-empty { text-align: center; padding: 80px 0; }
.watchlist-empty-icon { font-size: 48px; opacity: 0.4; margin-bottom: 14px; }
.watchlist-empty-title { font-family: 'Syne', sans-serif; font-size: 22px; color: var(--text-muted); margin-bottom: 6px; }
.watchlist-empty-sub { font-size: 13px; color: var(--text-dim); }

/* ─── MODAL ─── */
#modal-overlay {
  position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
#modal-overlay.open { opacity: 1; pointer-events: all; }
#modal {
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: 16px;
  width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; scrollbar-width: none;
  box-shadow: 0 32px 80px rgba(0,0,0,0.8); transform: translateY(24px) scale(0.98);
  transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
}
#modal-overlay.open #modal { transform: translateY(0) scale(1); }
#modal::-webkit-scrollbar { display: none; }

.modal-art, .modal-backdrop { width: 100%; aspect-ratio: 16/7; overflow: hidden; position: relative; border-radius: 16px 16px 0 0; background: var(--bg3); }
.modal-art-img, .modal-backdrop img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0.5; display: block;
  filter: none; transform: scale(1); transition: opacity 0.5s ease, filter 0.5s ease;
}
.modal-art-img.is-poster-fallback { opacity: 0.3; filter: blur(22px) saturate(1.1); transform: scale(1.15); }
.modal-art-gradient, .modal-backdrop-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--bg2) 100%); }
.modal-close-btn {
  position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.7); border: 1px solid var(--glass-border);
  color: white; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center; z-index: 10; transition: all 0.2s;
}
.modal-close-btn:hover { background: var(--red); }

.modal-body { padding: 0 24px 28px; margin-top: -40px; position: relative; }
.modal-top { display: flex; gap: 16px; align-items: flex-start; }
.modal-poster {
  flex-shrink: 0; width: 110px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--glass-border); box-shadow: var(--shadow); background: var(--bg3);
}
.modal-poster img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { flex: 1; padding-top: 16px; min-width: 0; }
.modal-type-tag, .modal-type-label { font-size: 10px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.modal-title { font-family: 'Oswald', sans-serif; font-size: 28px; letter-spacing: 1px; line-height: 1; margin-bottom: 10px; font-weight: 600; }
.modal-meta, .modal-meta-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.modal-tag, .meta-pill { font-size: 11px; color: var(--text-muted); background: var(--glass); border: 1px solid var(--glass-border); padding: 3px 10px; border-radius: 12px; }
.modal-rating, .meta-pill-rating { display: flex; align-items: center; gap: 5px; color: var(--gold); font-weight: 600; font-size: 13px; background: rgba(245,197,24,0.08); border-color: rgba(245,197,24,0.25); }
.modal-rating svg { fill: var(--gold); }
.genres-list, .modal-genres { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.genre-tag, .modal-genre-tag { font-size: 11px; background: rgba(229,9,20,0.1); color: var(--red); border: 1px solid rgba(229,9,20,0.2); padding: 3px 10px; border-radius: 12px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.modal-wl-btn {
  display: inline-flex; align-items: center; gap: 7px; background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text); padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
}
.modal-wl-btn:hover { background: rgba(255,255,255,0.08); }
.modal-wl-btn.in-list { color: var(--gold); border-color: rgba(245,197,24,0.35); background: rgba(245,197,24,0.08); }
.modal-wl-btn .check { display: none; }
.modal-wl-btn.in-list .plus { display: none; }
.modal-wl-btn.in-list .check { display: inline; }

.modal-plot, .modal-plot-text { font-size: 13px; line-height: 1.65; color: var(--text-muted); margin: 16px 0; }
.modal-section { margin-top: 20px; }
.modal-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 10px; }
.modal-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.modal-detail-item label, .modal-detail-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px; }
.modal-detail-item span, .modal-detail-value { font-size: 13px; color: var(--text); }

.download-section, .downloads-grid { margin-top: 12px; display: grid; gap: 8px; }
.download-title { font-size: 13px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.download-card, .download-item {
  background: var(--bg3); border: 1px solid var(--glass-border); border-radius: 8px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.download-card-info {}
.download-quality { font-size: 13px; font-weight: 600; color: var(--text); }
.download-audio { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }

.tg-btn, .tg-dl-btn {
  display: inline-flex; align-items: center; gap: 6px; background: #0088cc; color: white; border: none;
  padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; flex-shrink: 0; font-family: inherit; transition: all 0.2s;
}
.tg-btn:hover, .tg-dl-btn:hover { background: #0077b3; transform: translateY(-1px); }
.tg-btn-large, .tg-dl-btn-large {
  display: flex; align-items: center; justify-content: center; gap: 8px; background: #0088cc; color: white;
  border: none; padding: 14px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; font-family: inherit; transition: all 0.2s; width: 100%;
}
.tg-btn-large:hover, .tg-dl-btn-large:hover { background: #0077b3; }
.modal-divider { height: 1px; background: var(--glass-border); margin: 20px 0; }

/* ─── TOAST ─── */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg2); border: 1px solid var(--glass-border); color: var(--text);
  padding: 12px 20px; border-radius: 30px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px; z-index: 2500; opacity: 0; pointer-events: none;
  transition: all 0.3s ease; white-space: nowrap; box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── BOTTOM NAV ─── */
#bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: rgba(10,10,15,0.96); border-top: 1px solid var(--glass-border);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
}
.bnav-inner { display: flex; justify-content: space-around; }
.bnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 4px 8px; cursor: pointer; border: none; background: none;
  color: var(--text-dim); font-size: 10px; font-weight: 500; letter-spacing: 0.3px;
  font-family: inherit; transition: color 0.2s; position: relative;
}
.bnav-btn svg { width: 22px; height: 22px; }
.bnav-btn.active { color: var(--red); }
.bnav-btn .bnav-badge {
  position: absolute; top: 2px; right: calc(50% - 16px); background: var(--red); color: white;
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; min-width: 16px;
  text-align: center; display: none;
}
.bnav-btn .bnav-badge.visible { display: block; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  nav#topnav { padding: 0 16px; }
  .nav-links { display: none; }
  #nav-search { width: 150px; }
  #nav-search:focus { width: 180px; }
  .hero-content { padding: 0 20px 90px 20px; max-width: 100%; }
  .hero-title { font-size: clamp(32px, 10vw, 52px); }
  .hero-plot { font-size: 13px; -webkit-line-clamp: 4; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .section-header { padding: 0 16px; }
  .poster-row { padding: 8px 16px 20px; scroll-padding-left: 16px; }
  .card { width: 120px; }
  #bottom-nav { display: block; }
  #search-page, #phases-page, #xmen-page, #watchlist-page { padding: calc(var(--nav-h) + 16px) 16px 90px; }
  .search-results-grid, .search-grid, .phase-grid { grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 10px; }
  body { padding-bottom: 60px; }
  .modal-top { flex-direction: column; align-items: center; }
  .modal-poster { width: 100px; }
  .modal-details-grid { grid-template-columns: 1fr; }
  .modal-genres, .modal-meta-pills, .modal-actions { justify-content: center; }
  #modal { border-radius: 12px; }
  .modal-art, .modal-backdrop { aspect-ratio: 16/9; border-radius: 12px 12px 0 0; }
  .phase-divider { padding: 20px 16px 4px; }
  .phase-block-number { font-size: 36px; }
  .section-divider { margin: 0 16px; }
}
@media (min-width: 769px) { .nav-links { display: flex; } .card { width: 155px; } }
@media (min-width: 1024px) {
  .card { width: 170px; } .poster-row { padding: 8px 60px 20px; scroll-padding-left: 60px; }
  .section-header { padding: 0 60px; } nav#topnav { padding: 0 60px; }
  .hero-content { padding: 0 0 100px 60px; }
  #search-page, #phases-page, #xmen-page, #watchlist-page { padding: calc(var(--nav-h) + 20px) 60px 100px; }
  .phase-divider { padding: 28px 60px 4px; }
  .section-divider { margin: 0 60px; }
}

.fade-in { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.page-enter { animation: pageFade 0.35s ease both; }
@keyframes pageFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
