:root {
  --bg: #0b1020;
  --panel: #10182d;
  --panel-2: #18233f;
  --text: #eef3ff;
  --muted: #b7c5e8;
  --line: rgba(255, 255, 255, 0.1);
  --brand: #7aa2ff;
  --brand-soft: rgba(122, 162, 255, 0.14);
  --warning: #f7c66b;
  --danger: #ff8e8e;
  --success: #7be0a6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(122, 162, 255, 0.12), transparent 30%),
    linear-gradient(180deg, #08101e 0%, #0b1020 100%);
}

a {
  color: var(--brand);
  text-decoration: none;
}

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

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  background: rgba(16, 24, 45, 0.88);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.08;
}

.hero-text,
.panel-copy,
.muted,
.small-note {
  color: var(--muted);
}

.hero-text {
  margin-top: 16px;
  max-width: 66ch;
  line-height: 1.75;
}

.search-bar {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

.search-bar button,
.secondary-button,
.card-button,
.episode-button,
.close-button {
  font: inherit;
}

.search-bar button,
.secondary-button {
  border: 1px solid rgba(122, 162, 255, 0.35);
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.28), rgba(122, 162, 255, 0.16));
  color: var(--text);
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

.secondary-button:hover,
.search-bar button:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.36), rgba(122, 162, 255, 0.22));
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hero-card,
.player-card,
.meta-card,
.episode-list {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 22px;
}

.hero-card {
  padding: 20px;
}

.hero-card h2 {
  margin-top: 0;
}

.hero-card ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-top: 28px;
  margin-bottom: 18px;
}

.toolbar h2 {
  margin: 0;
  font-size: 1.45rem;
}

.toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
}

.status-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.status-chip.warning {
  color: var(--warning);
}

.status-chip.error {
  color: var(--danger);
}

.message-box {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.message-box.warning {
  color: var(--warning);
}

.message-box.error {
  color: var(--danger);
}

.message-box.success {
  color: var(--success);
}

.hidden {
  display: none !important;
}

.anime-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.anime-card {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.card-button {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.card-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.04);
}

.card-body {
  display: block;
  padding: 16px;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-type,
.card-score {
  color: #b7c5e8;
  font-size: 0.82rem;
}

.card-title {
  display: block;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 8px;
}

.card-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.card-synopsis {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

.detail-poster {
  width: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.detail-main h2 {
  margin: 6px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.detail-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.detail-badge {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.meta-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 18px;
}

.meta-card {
  padding: 16px;
}

.meta-card strong {
  display: block;
  margin-bottom: 8px;
}

.section-stack {
  display: grid;
  gap: 20px;
}

.player-card,
.episode-list {
  padding: 18px;
}

.player-shell {
  margin-top: 12px;
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.player-shell iframe,
.player-shell video {
  width: 100%;
  min-height: 420px;
  border: 0;
  display: block;
  background: #000;
}

.player-placeholder {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}

.player-actions {
  margin-top: 12px;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.episode-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.episode-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.episode-button {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
}

.active-resolution,
.active-provider {
  outline: 2px solid #7aa2ff;
  background: rgba(122, 162, 255, 0.14);
}

@media (max-width: 920px) {
  .hero,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: start;
    flex-direction: column;
  }
}

.responsive-ad-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  min-height: 0;
}

.responsive-ad-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.responsive-ad-mobile {
  width: 320px;
  max-width: 100%;
  min-height: 50px;
}

.responsive-ad-tablet {
  width: 300px;
  max-width: 100%;
  min-height: 250px;
}

.responsive-ad-desktop {
  width: 728px;
  max-width: 100%;
  min-height: 90px;
}

@media (max-width: 480px) {
  .responsive-ad-slot {
    margin: 12px 0;
  }
}