:root {
  --bg-primary: #070913;
  --bg-card: rgba(18, 22, 41, 0.7);
  --bg-card-hover: rgba(28, 34, 62, 0.9);
  --border-glow: rgba(139, 92, 246, 0.3);
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-h-screen: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Header & Ecosystem Nav */
.ecosystem-bar {
  background: rgba(5, 7, 15, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ecosystem-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.eco-links {
  display: flex;
  gap: 16px;
}
.eco-link:hover {
  color: #fff;
}
.eco-active {
  color: var(--accent-pink);
  font-weight: 700;
}

/* Main Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 19, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glow);
}
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}
.logo-badge {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 1rem;
}
.search-box {
  flex: 1;
  max-width: 450px;
  position: relative;
}
.search-input {
  width: 100%;
  background: rgba(18, 22, 41, 0.8);
  border: 1px solid var(--border-glow);
  padding: 10px 16px 10px 40px;
  border-radius: 99px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s ease;
}
.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Category Filter Bar */
.filter-bar {
  max-width: 1280px;
  margin: 24px auto 0;
  padding: 0 16px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.filter-btn:hover, .filter-btn.active {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Hero Section */
.hero-banner {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px;
}
.hero-card {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  backdrop-filter: blur(10px);
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(to right, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Anime Grid */
.main-container {
  max-width: 1280px;
  margin: 32px auto;
  padding: 0 16px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.anime-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-col: column;
  position: relative;
}
.anime-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: var(--accent-purple);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.25);
}
.card-poster-wrap {
  width: 100%;
  height: 300px;
  position: relative;
  overflow: hidden;
}
.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.anime-card:hover .card-poster {
  transform: scale(1.08);
}
.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #fbbf24;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: auto;
}

/* Modal Player */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  color: #fff;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.footer {
  border-t: 1px solid rgba(255, 255, 255, 0.08);
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 60px;
}
