:root {
  --bg: #09090f;
  --bg-soft: #0f1120;
  --panel: rgba(19, 19, 31, 0.84);
  --panel-2: #14162a;
  --text: #f5f7ff;
  --muted: #a6adcf;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #8b5cf6;
  --primary-2: #ec4899;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.18), transparent 26%),
    radial-gradient(circle at top right, rgba(236, 72, 153, 0.14), transparent 22%),
    linear-gradient(180deg, #09090f 0%, #0d1020 100%);
  min-height: 100vh;
}

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

img {
  display: block;
  width: 100%;
}

button,
input,
select {
  font: inherit;
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 15, 0.72);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.1;
}

.brand small,
.muted,
.anime-info p,
.section-kicker,
.footer-wrap p,
.favorites-list small,
.playlist-item small {
  color: var(--muted);
}

.nav-links,
.nav-actions,
.hero-meta,
.hero-actions,
.quick-filters,
.footer-links,
.detail-meta,
.server-bar,
.watch-actions,
.anime-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-links {
  flex: 1;
  justify-content: center;
}

.nav-links a,
.text-link,
.footer-links a,
.playlist-head a {
  color: #d6dbf4;
  transition: 0.2s ease;
}

.nav-links a:hover,
.text-link:hover,
.footer-links a:hover,
.playlist-head a:hover {
  color: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: min(320px, 44vw);
}

.search-box input {
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  width: 100%;
}

.btn,
.filter-chip,
.server-btn,
.episode-select {
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover,
.filter-chip:hover,
.server-btn:hover {
  transform: translateY(-1px);
}

.btn-primary,
.filter-chip.active,
.server-btn.active,
.favorite-toggle.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
}

.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 6, 10, 0.95) 12%, rgba(5, 6, 10, 0.55) 48%, rgba(5, 6, 10, 0.88) 100%),
    url('https://images.unsplash.com/photo-1578632767115-351597cf2477?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
}

.hero-overlay,
.anime-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}

.hero-content,
.anime-layout,
.player-layout,
.detail-columns,
.season-row,
.footer-wrap,
.anime-title-row,
.watch-head,
.playlist-head,
.section-head,
.list-head-row {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.hero-content,
.anime-layout,
.player-layout {
  align-items: center;
}

.hero-text {
  max-width: 650px;
}

.badge,
.pill,
.favorite-count,
.score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
}

.hero h1,
.anime-details h1,
.watch-head h1 {
  margin: 14px 0 12px;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 4.5rem);
}

.hero p,
.synopsis {
  max-width: 62ch;
  line-height: 1.7;
}

.hero-card,
.anime-details,
.top10,
.side-box,
.playlist-column,
.player-box,
.watch-info,
.season-banner,
.main-column {
  border-radius: var(--radius);
  padding: 24px;
}

.hero-card {
  width: min(360px, 100%);
}

.mini-list,
.related-list,
.footer-links,
.favorites-list {
  display: grid;
  gap: 12px;
}

.quick-filters {
  padding: 26px 0 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
}

.quick-filters::-webkit-scrollbar,
.nav-links::-webkit-scrollbar {
  display: none;
}

.section-block {
  padding: 28px 0 10px;
}

.section-head h2,
.side-box h3,
.top10 h3,
.playlist-head h2 {
  margin: 6px 0 0;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.anime-card {
  overflow: hidden;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.anime-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.18);
}

.anime-card img {
  aspect-ratio: 3 / 4.2;
  object-fit: cover;
}

.card-overlay,
.anime-info {
  padding: 14px 14px 0;
}

.card-overlay {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: -62px;
  position: relative;
  z-index: 1;
}

.anime-info {
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(9, 9, 15, 0) 0%, rgba(9, 9, 15, 0.95) 26%);
}

.anime-info h3 {
  margin: 20px 0 6px;
  font-size: 1rem;
}

.season-row,
.detail-columns,
.player-layout {
  align-items: start;
}

.season-row {
  grid-template-columns: 1.2fr 0.8fr;
}

.season-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 200px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(236, 72, 153, 0.12)),
    var(--panel);
}

.favorites-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
}

.favorites-list li a,
.favorites-list li button {
  width: 100%;
}

.favorite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.favorite-item strong {
  display: block;
  margin-bottom: 2px;
}

.remove-favorite {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.anime-page {
  padding-bottom: 32px;
}

.anime-hero {
  position: relative;
  padding: 34px 0;
  overflow: hidden;
}

.poster-box {
  width: min(320px, 100%);
  flex: 0 0 min(320px, 100%);
}

.poster-box img {
  border-radius: 26px;
  aspect-ratio: 3 / 4.2;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.anime-layout {
  align-items: stretch;
}

.anime-details {
  width: 100%;
}

.detail-meta {
  margin: 8px 0 18px;
}

.detail-columns {
  padding-top: 12px;
}

.main-column {
  flex: 1.4;
}

.side-panel {
  flex: 0.9;
  display: grid;
  gap: 18px;
}

.episode-list,
.playlist-list {
  display: grid;
  gap: 14px;
}

.episode-item,
.playlist-item {
  display: grid;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.episode-item {
  grid-template-columns: 120px 1fr auto;
}

.episode-item img {
  height: 74px;
  object-fit: cover;
  border-radius: 14px;
}

.playlist-item {
  grid-template-columns: 48px 1fr;
}

.playlist-item strong {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.playlist-item.active,
.episode-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.watch-page {
  padding: 26px 0 36px;
}

.player-column {
  flex: 1.5;
}

.playlist-column {
  flex: 0.85;
}

.player-box {
  padding: 14px;
}

.fake-video {
  min-height: 500px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 14px;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.1)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.25));
  border: 1px solid var(--border);
}

.play-core {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.watch-info {
  margin-top: 18px;
}

.watch-nav {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.block-btn {
  text-align: center;
}

.site-footer {
  padding: 34px 0 46px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .anime-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-layout,
  .detail-columns,
  .season-row,
  .anime-layout,
  .hero-content,
  .watch-head {
    flex-direction: column;
  }

  .hero-card,
  .poster-box,
  .playlist-column,
  .player-column,
  .main-column,
  .side-panel {
    width: 100%;
  }

  .fake-video {
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 18px, 100%);
  }

  .nav {
    flex-wrap: wrap;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    width: 100%;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .nav-actions,
  .search-box {
    width: 100%;
  }

  .search-box {
    min-width: 0;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 28px;
    background-position: center right;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-card,
  .anime-details,
  .top10,
  .side-box,
  .playlist-column,
  .player-box,
  .watch-info,
  .season-banner,
  .main-column {
    padding: 18px;
    border-radius: 20px;
  }

  .quick-filters {
    padding-top: 18px;
  }

  .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-overlay,
  .anime-info {
    padding-left: 10px;
    padding-right: 10px;
  }

  .anime-info h3 {
    font-size: 0.95rem;
    margin-top: 16px;
  }

  .section-head,
  .playlist-head,
  .anime-title-row,
  .watch-head,
  .footer-wrap,
  .list-head-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .anime-title-row .btn,
  .watch-actions,
  .anime-actions-row,
  .hero-actions {
    width: 100%;
  }

  .watch-actions .btn,
  .anime-actions-row .btn,
  .hero-actions .btn,
  .season-banner .btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .episode-item {
    grid-template-columns: 88px 1fr;
  }

  .episode-item span {
    display: none;
  }

  .episode-item img {
    height: 64px;
  }

  .fake-video {
    min-height: 220px;
    padding: 22px 16px;
  }

  .play-core {
    width: 72px;
    height: 72px;
    font-size: 1.6rem;
  }

  .server-bar {
    align-items: stretch;
  }

  .server-bar span {
    width: 100%;
  }

  .favorite-item {
    flex-direction: column;
    align-items: stretch;
  }

  .remove-favorite {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .anime-grid {
    grid-template-columns: 1fr 1fr;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .badge,
  .pill,
  .favorite-count,
  .score,
  .btn,
  .filter-chip,
  .server-btn,
  .episode-select {
    font-size: 0.92rem;
  }
}