@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --green: #58CC02;
  --green-dark: #46a800;
  --green-shadow: #3a8c00;
  --blue: #1CB0F6;
  --blue-dark: #0a96de;
  --blue-shadow: #0077b5;
  --yellow: #FFD900;
  --yellow-dark: #e6c500;
  --red: #FF4B4B;
  --purple: #CE82FF;
  --bg: #111827;
  --bg2: #1a2332;
  --bg3: #222d3d;
  --card: #1e2b3c;
  --card-hover: #243347;
  --border: #2d3f55;
  --text: #ffffff;
  --text-muted: #7a8fa8;
  --text-dim: #3a5068;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; }
button { font-family: 'Nunito', sans-serif; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

.navbar {
  position: fixed;
  top: 12px; left: 16px; right: 16px;
  z-index: 200;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 16px;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
}

.navbar.floating {
  background: rgba(13, 19, 33, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(88, 204, 2, 0.1);
  border-color: rgba(45, 63, 85, 0.45);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo .x { color: var(--green); }

.nav-center {
  flex: 1;
  max-width: 480px;
  margin: 0 16px;
  position: relative;
}
.nav-center input {
  width: 100%;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px 10px 42px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  outline: none;
  transition: border-color .2s, background .2s;
}
.nav-center input::placeholder { color: var(--text-muted); }
.nav-center input:focus { border-color: var(--blue); background: var(--bg3); }
.nav-center .si {
  position: absolute; left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-links a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--bg3); }
.nav-links a.active { color: var(--green); }

.nav-label { font-size: inherit; }

.nav-search-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: color .2s, background .2s;
}
.nav-search-btn:hover { color: var(--text); background: var(--bg3); }
.nav-search-btn .icon-close { display: none; }
.nav-search-btn .nav-label { display: none; }

.navbar.search-open .nav-logo { display: none; }
.navbar.search-open .nav-center { display: flex !important; flex: 1; }
.navbar.search-open .nav-links { display: none; }
.navbar.search-open .nav-search-btn .icon-search { display: none; }
.navbar.search-open .nav-search-btn .icon-close { display: block; }
.navbar.search-open .nav-search-btn { color: var(--text); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  border: none;
  border-bottom: 4px solid transparent;
  transition: transform .1s, border-bottom-width .1s, background .15s;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.btn svg { flex-shrink: 0; }

.btn-green { background: var(--green); color: #fff; border-bottom-color: var(--green-shadow); }
.btn-green:hover { background: var(--green-dark); }

.btn-blue { background: var(--blue); color: #fff; border-bottom-color: var(--blue-shadow); }
.btn-blue:hover { background: var(--blue-dark); }

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
  border-bottom: 4px solid var(--blue-shadow);
  padding: 10px 22px;
}
.btn-ghost:hover { background: rgba(28,176,246,0.1); }

.btn-dark {
  background: var(--card);
  color: var(--text);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  padding: 10px 20px;
}
.btn-dark:hover { border-color: var(--blue); color: var(--blue); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-bottom-width: 3px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.page { padding-top: calc(var(--nav-h) + 20px); min-height: 100vh; width: 100%; max-width: 100vw; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; }

.hero {
  position: relative;
  height: 520px;
  overflow: hidden;
  background: var(--bg2);
}

.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.hero-slide.active { opacity: 1; pointer-events: all; }

.hero-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right,
    rgba(17,24,39,0.96) 30%,
    rgba(17,24,39,0.55) 60%,
    rgba(17,24,39,0.1) 100%
  );
}

.hero-content {
  position: absolute; left: 0; bottom: 0; top: 0;
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 60px;
  max-width: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 5px 12px;
  border-radius: 99px;
  border-bottom: 3px solid var(--green-shadow);
  margin-bottom: 16px;
  width: fit-content;
}

.hero-title {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 6px;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
}

.hero-titlejp {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
}

.hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-dots {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
  z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background .2s, width .25s;
  border: none;
}
.hero-dot.active { background: var(--green); width: 26px; }

.hero-arrows {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex; justify-content: space-between;
  padding: 0 16px;
  z-index: 10;
  pointer-events: none;
}
.hero-arrow {
  pointer-events: all;
  width: 44px; height: 44px;
  background: rgba(30,43,60,0.88);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.hero-arrow:hover { background: var(--blue); border-color: var(--blue-shadow); }

.section { padding: 44px 0 8px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-title {
  font-size: 17px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title .title-icon {
  width: 32px; height: 32px;
  background: var(--bg3);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  flex-shrink: 0;
}

.live-dot {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(88,204,2,0.15);
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(88,204,2,0.4);
}
.live-dot::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.section-link {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: gap .2s;
  white-space: nowrap;
}
.section-link:hover { gap: 9px; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.cards-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.cards-row::-webkit-scrollbar { height: 4px; }
.cards-row::-webkit-scrollbar-track { background: transparent; }
.cards-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.anime-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  flex-shrink: 0;
  width: 170px;
}
.cards-grid .anime-card { width: auto; }

.anime-card:hover { transform: translateY(-4px); border-color: var(--blue); background: var(--card-hover); }
.anime-card:active { transform: translateY(0); border-bottom-width: 2px; }

.anime-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  background: var(--bg2);
}

.anime-card-img-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
}

.anime-card-body { padding: 12px; }

.anime-card-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 7px;
}

.anime-card-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
}
.pill svg { flex-shrink: 0; }
.pill-green { background: rgba(88,204,2,0.12); color: var(--green); }
.pill-blue { background: rgba(28,176,246,0.12); color: var(--blue); }
.pill-yellow { background: rgba(255,217,0,0.12); color: var(--yellow); }
.pill-muted { background: var(--bg3); color: var(--text-muted); }

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.schedule-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.schedule-card:hover { transform: translateY(-3px); border-color: var(--green); background: var(--card-hover); }
.schedule-card:active { transform: translateY(0); border-bottom-width: 2px; }

.schedule-card-thumb {
  width: 68px;
  height: 88px;
  border-radius: 10px;
  background: var(--bg3);
  border: 2px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border);
}
.schedule-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.schedule-card-placeholder {
  width: 68px; height: 88px;
  border-radius: 10px;
  background: var(--bg3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--border);
}

.schedule-info { flex: 1; min-width: 0; }
.schedule-title {
  font-size: 13px; font-weight: 800;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.schedule-ep { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.schedule-timer {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800;
  color: var(--yellow);
  background: rgba(255,217,0,0.1);
  padding: 3px 9px;
  border-radius: 99px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hero-skeleton {
  position: absolute; inset: 0;
  display: flex;
  align-items: stretch;
}
.hero-skeleton-img {
  position: absolute; inset: 0;
  border-radius: 0;
}
.hero-skeleton-content {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 60px;
  gap: 16px;
  width: 480px;
  max-width: 90%;
}
.hero-skeleton-badge {
  width: 110px;
  height: 26px;
  border-radius: 99px;
}
.hero-skeleton-title {
  width: 90%;
  height: 36px;
  border-radius: 10px;
}
.hero-skeleton-title-sm {
  width: 65%;
  height: 36px;
}
.hero-skeleton-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.hero-skeleton-btn {
  width: 130px;
  height: 44px;
  border-radius: var(--radius-sm);
}

.search-hero {
  background: var(--bg2);
  padding: 56px 0 40px;
  border-bottom: 3px solid var(--border);
}
.search-hero h1 {
  font-size: 32px; font-weight: 900;
  margin-bottom: 24px; text-align: center;
}
.search-hero h1 span { color: var(--green); }
.season-hero-label {
  text-align: center;
  font-size: 12px; font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}
#heroSeason h1 { margin-bottom: 0; }

.search-box {
  max-width: 580px; margin: 0 auto;
  position: relative;
}
.search-box input {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 70px 17px 22px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 17px; font-weight: 700;
  outline: none;
  transition: border-color .2s;
}
.search-box input:focus { border-color: var(--blue); }
.search-box input::placeholder { color: var(--text-dim); }
.search-box .search-btn {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
}

.filter-row {
  display: flex; gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.season-picker-wrap {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease, opacity 0.3s ease, margin-bottom 0.3s ease;
  margin-bottom: 0;
  overflow: hidden;
}
.season-picker-wrap.open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-bottom: 24px;
}
.season-picker-wrap > .season-list-row {
  min-height: 0;
}
.season-list-row {
  display: flex;
  gap: 8px;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.season-list-row::-webkit-scrollbar { height: 4px; }
.season-list-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.season-list-btn {
  flex-shrink: 0;
  padding: 9px 18px;
  border-radius: 99px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  cursor: pointer;
  background: var(--card);
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  transition: all .15s;
  white-space: nowrap;
}
.season-list-btn:hover:not(.active) { border-color: var(--green); color: var(--green); }
.season-list-btn.active {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
  border-bottom-color: var(--green-shadow);
}
.filter-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: 99px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer;
  background: var(--card);
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  transition: all .15s;
}
.filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.filter-btn.active { background: var(--green); color: #fff; border-color: var(--green-shadow); }

.anime-hero {
  position: relative;
  min-height: 400px;
  overflow: hidden;
  background: var(--bg2);
}
.anime-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  filter: blur(4px) brightness(0.35);
  transform: scale(1.06);
}
.anime-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    var(--bg) 0%,
    rgba(17,24,39,0.55) 55%,
    transparent 100%
  );
}
.anime-hero-content {
  position: relative; z-index: 2;
  height: 100%;
  display: flex; align-items: flex-end;
  padding-bottom: 32px;
}
.anime-hero-inner {
  display: flex; align-items: flex-end; gap: 28px;
  width: 100%; max-width: 1280px;
  margin: 0 auto; padding: 0 24px;
}
.anime-poster {
  width: 160px; height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 3px solid var(--border);
  border-bottom: 5px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.anime-poster-placeholder {
  width: 160px; height: 220px;
  border-radius: var(--radius);
  border: 3px solid var(--border);
  background: var(--bg3);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--border);
}
.anime-hero-info { flex: 1; min-width: 0; }
.anime-hero-title {
  font-size: 30px; font-weight: 900; line-height: 1.15;
  margin-bottom: 8px;
}
.anime-hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.anime-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.tabs {
  display: flex; gap: 2px;
  border-bottom: 3px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tabs::-webkit-scrollbar { height: 0; }
.tab-btn {
  padding: 13px 20px;
  background: none; border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  color: var(--text-muted);
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.5px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.ep-btn {
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 12px;
  padding: 11px 6px;
  text-align: center;
  font-family: 'Nunito', sans-serif;
  font-size: 14px; font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.ep-btn:hover { border-color: var(--blue); color: var(--blue); transform: translateY(-2px); background: var(--card-hover); }
.ep-btn.active { background: var(--green); border-color: var(--green-shadow); color: #fff; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.info-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}
.info-card .label {
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.info-card .value {
  font-size: 22px; font-weight: 900;
}

.genres-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.genre-tag {
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
}
.genre-tag:hover { border-color: var(--purple); color: var(--purple); }

.player-wrapper {
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.player-wrapper video { width: 100%; height: 100%; outline: none; }

.player-no-stream {
  display: flex; flex-direction: column;
  align-items: center; gap: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 48px 24px;
}
.player-no-stream .ns-icon { color: var(--border); }

.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 18px;
  flex-wrap: wrap;
  gap: 10px;
}
.player-nav { display: flex; gap: 8px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { transition: color .15s; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { color: var(--text-dim); }

.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-state .es-icon { color: var(--border); margin: 0 auto 16px; }
.empty-state h2 { font-size: 22px; font-weight: 900; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); font-weight: 600; margin-bottom: 24px; }

.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: none;
  border-bottom: 4px solid var(--green-shadow);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover { background: var(--green-dark); }
.back-to-top:active { transform: translateY(2px); border-bottom-width: 2px; }
@media (max-width: 768px) {
  .back-to-top { bottom: calc(var(--nav-h) + 12px); right: 16px; width: 40px; height: 40px; }
}

.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--card);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border);
  border-radius: 14px;
  padding: 13px 18px;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn .3s ease;
  min-width: 240px; max-width: 340px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.info { border-color: var(--blue); color: var(--blue); }
.toast span.toast-msg { color: var(--text); }
@keyframes toastIn {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.section-desc {
  font-size: 15px; font-weight: 600;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
}
.section-label {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.footer {
  background: var(--bg2);
  border-top: 3px solid var(--border);
  padding: 40px 24px;
  margin-top: 60px;
  text-align: center;
}
.footer-logo { font-size: 26px; font-weight: 900; margin-bottom: 6px; }
.footer-logo span { color: var(--green); }
.footer-links {
  display: flex; justify-content: center; gap: 20px;
  margin: 14px 0; flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: color .2s;
}
.footer-links a:hover { color: var(--blue); }
.footer p { color: var(--text-muted); font-size: 12px; font-weight: 600; }

.nav-center { position: relative; }
.nav-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 600;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}
.nav-search-dropdown.open { display: block; }
.nsd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.nsd-item:last-child { border-bottom: none; }
.nsd-item:hover { background: var(--bg3); }
.nsd-img {
  width: 36px; height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg3);
}
.nsd-img-placeholder {
  width: 36px; height: 50px;
  border-radius: 6px;
  background: var(--bg3);
  flex-shrink: 0;
}
.nsd-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nsd-loading, .nsd-empty {
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}
.nsd-empty strong { color: var(--text); }
.mobile-nsd {
  top: calc(100% + 4px);
  left: 0; right: 0;
  max-height: 280px;
}

@media (max-width: 1024px) {
  .nav-center { max-width: 320px; }
  .hero-content { padding: 40px 40px; max-width: 460px; }
  .hero-title { font-size: 30px; }
  .schedule-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

.mobile-top-bar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 210;
  height: 54px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(45, 63, 85, 0.5);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  padding: 0 14px;
  align-items: center;
  gap: 12px;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.mobile-top-bar.floating {
  background: rgba(17, 24, 39, 0.98);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(88, 204, 2, 0.12);
  border-bottom-color: rgba(88, 204, 2, 0.15);
}
.mobile-top-bar .mtb-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.3px;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
}
.mobile-top-bar .mtb-logo .x { color: var(--green); }
.mobile-top-bar .mtb-logo .logo-icon {
  width: 30px; height: 30px;
  background: var(--green);
  border-radius: 8px;
  border-bottom: 3px solid var(--green-shadow);
  display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.mobile-top-bar .mtb-search {
  flex: 1;
  position: relative;
}
.mobile-top-bar .mtb-search input {
  width: 100%;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px 8px 36px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  transition: border-color .2s, background .2s;
}
.mobile-top-bar .mtb-search input::placeholder { color: var(--text-muted); }
.mobile-top-bar .mtb-search input:focus { border-color: var(--blue); background: var(--bg3); }
.mtb-dev-wrap {
  position: relative;
  flex-shrink: 0;
  display: none;
}
.mtb-dev {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--green-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  user-select: none;
}
.mtb-dev:active { transform: scale(0.92); }
.mtb-dev-card {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg2);
  border: 2px solid var(--border);
  border-bottom: 3px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-width: 210px;
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.mtb-dev-card.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.mtb-dev-card::before {
  content: '';
  position: absolute;
  top: -8px; right: 10px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid var(--border);
}
.mobile-top-bar .mtb-search .mtb-si {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

@media (max-width: 768px) {
  :root { --nav-h: 58px; }

  .mobile-top-bar { display: flex; }

  .navbar {
    top: auto; bottom: 0; left: 0; right: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(45,63,85,0.5);
    background: rgba(13, 19, 33, 0.95);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
    padding: 0;
    justify-content: stretch;
    gap: 0;
    height: var(--nav-h);
    width: 100%;
  }
  .nav-logo { display: none; }
  .nav-center { display: none !important; }

  .nav-links {
    display: contents;
  }

  .nav-links a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    border-radius: 0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    min-width: 0;
    background: none !important;
    color: var(--text-muted);
    height: 100%;
  }
  .nav-links a.active,
  .nav-links a:hover { color: var(--green); background: none !important; }
  .nav-links a svg { width: 22px; height: 22px; flex-shrink: 0; }
  .nav-links a .nav-label { font-size: 9px; display: block; }

  .page { padding-top: 54px; padding-bottom: var(--nav-h); }

  .hero { height: 55vw; min-height: 300px; max-height: 460px; }
  .hero-overlay {
    background: linear-gradient(
      to top,
      rgba(17,24,39,0.98) 0%,
      rgba(17,24,39,0.72) 42%,
      rgba(17,24,39,0.1) 85%,
      rgba(17,24,39,0) 100%
    );
  }
  .hero-content {
    position: absolute;
    top: auto; bottom: 0; left: 0; right: 0;
    justify-content: flex-end;
    padding: 20px 20px 48px;
    max-width: 100%;
    width: 100%;
  }
  .hero-title { font-size: 22px; margin-bottom: 10px; }
  .hero-badge { font-size: 10px; padding: 4px 10px; margin-bottom: 10px; }
  .hero-desc { display: none; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { padding: 10px 18px; font-size: 13px; }
  .hero-arrows { display: none; }
  .hero-dots { bottom: 28px; }

  .hero-skeleton-content {
    top: auto; bottom: 0; justify-content: flex-end;
    padding: 20px 20px 48px; width: 100%; max-width: 100%;
  }

  .container { padding: 0 16px; width: 100%; }
  .section { padding: 28px 0 8px; }
  .section-title { font-size: 15px; }

  .cards-row { -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .anime-card { width: 150px; }
  .cards-grid .anime-card { width: auto; }

  .schedule-grid { grid-template-columns: 1fr; gap: 10px; }
  .schedule-card { padding: 12px 14px; gap: 12px; }
  .schedule-card-thumb { width: 64px; height: 84px; }

  .anime-hero { min-height: 300px; height: auto; }
  .anime-hero-inner { padding: 0 16px; }
  .anime-hero-title { font-size: 20px; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  .player-wrapper { max-height: 56vw; border-radius: 0; }
  .player-bar { flex-direction: column; align-items: flex-start; }

  .search-hero { padding: 40px 0 28px; }
  .search-hero h1 { font-size: 24px; }

  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
  .tabs { gap: 0; }
  .tab-btn { padding: 12px 14px; font-size: 13px; }

  .toast-container { right: 16px; bottom: calc(var(--nav-h) + 12px); }
  .toast { min-width: unset; max-width: calc(100vw - 32px); }

  .footer { margin-top: 40px; padding: 32px 20px; }
}

@media (max-width: 600px) {

  .hero { height: 62vw; min-height: 260px; max-height: 340px; }
  .hero-content { padding: 14px 16px 46px; }
  .hero-title { font-size: 19px; margin-bottom: 10px; }
  .hero-badge { font-size: 9px; padding: 3px 9px; margin-bottom: 8px; }
  .hero-desc { display: none; }
  .hero-actions { gap: 8px; flex-wrap: nowrap; }
  .hero-actions .btn { padding: 9px 14px; font-size: 12px; flex: 1; justify-content: center; max-width: 160px; }
  .hero-dots { bottom: 26px; gap: 6px; }
  .hero-dot { width: 6px; height: 6px; }
  .hero-dot.active { width: 20px; }

  .hero-skeleton-content { padding: 14px 16px 46px; }
  .hero-skeleton-title { height: 19px; width: 70%; }
  .hero-skeleton-title-sm { height: 19px; width: 50%; }
  .hero-skeleton-btn { width: 90px; height: 36px; }

  .container { padding: 0 14px; }
  .section { padding: 20px 0 4px; }
  .section-header { margin-bottom: 14px; }
  .section-title { font-size: 13px; letter-spacing: 0.3px; }
  .section-title .title-icon { width: 26px; height: 26px; }
  .section-link { font-size: 11px; }

  .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cards-grid .anime-card { width: auto; }
  .anime-card { width: 130px; }
  .cards-row { gap: 10px; -webkit-overflow-scrolling: touch; }
  .anime-card-body { padding: 8px 10px; }
  .anime-card-title { font-size: 12px; }
  .anime-card-meta { font-size: 10px; gap: 4px; }

  .schedule-grid { grid-template-columns: 1fr; gap: 8px; }
  .schedule-card { padding: 10px 12px; gap: 10px; }
  .schedule-card-thumb,
  .schedule-card-placeholder { width: 58px; height: 78px; border-radius: 8px; }
  .schedule-title { font-size: 13px; }

  .filter-btn { padding: 7px 12px; font-size: 11px; }
  .filters-bar { gap: 6px; }

  .anime-hero { min-height: 220px; height: auto; }
  .anime-poster { width: 80px; height: 110px; }
  .anime-poster-placeholder { width: 80px; height: 110px; }
  .anime-hero-inner { gap: 12px; padding: 0 12px; }
  .anime-hero-title { font-size: 15px; }
  .anime-hero-meta { font-size: 12px; }
  .anime-hero-actions { gap: 8px; }
  .anime-hero-actions .btn { padding: 8px 12px; font-size: 11px; }

  .info-grid { gap: 8px; }
  .info-card { padding: 12px 10px; }
  .info-card .label { font-size: 10px; }
  .info-card .value { font-size: 16px; }

  .tabs { gap: 0; border-bottom-width: 2px; }
  .tab-btn { padding: 10px 10px; font-size: 12px; flex: 1; text-align: center; justify-content: center; }

  .synopsis-text { font-size: 13px; line-height: 1.6; }

  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 5px; }
  .ep-btn { padding: 7px 2px; font-size: 12px; }

  .breadcrumb { font-size: 11px; }

  .player-wrapper { max-height: 57vw; }
  .player-bar { padding: 10px 12px; gap: 8px; }

  .search-hero { padding: 24px 0 20px; }
  .search-hero h1 { font-size: 20px; }
  .search-box input { font-size: 14px; padding: 12px 50px 12px 14px; }
  .search-box-btn { width: 40px; }

  .toast-container { right: 10px; bottom: calc(var(--nav-h) + 10px); }
  .toast { font-size: 13px; padding: 10px 14px; gap: 8px; }

  .footer { padding: 24px 12px; font-size: 12px; }
}

@media (max-width: 390px) {
  .hero { height: 60vw; min-height: 220px; }
  .hero-content { padding: 12px 12px 44px; }
  .hero-title { font-size: 18px; }

  .container { padding: 0 10px; }
  .section { padding: 16px 0 4px; }

  .cards-grid { gap: 8px; }
  .anime-card { width: 110px; }

  .anime-hero { min-height: 200px; height: auto; }
  .anime-poster { width: 72px; height: 100px; }
  .anime-poster-placeholder { width: 72px; height: 100px; }
  .anime-hero-title { font-size: 14px; }
  .anime-hero-actions .btn { padding: 7px 10px; font-size: 11px; }

  .tab-btn { padding: 9px 8px; font-size: 11px; }
  .ep-btn { font-size: 11px; }
}
