@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Sora:wght@300;400;500;600&display=swap');

:root {
  --bg: #06070b;
  --bg-elevated: #0f121a;
  --bg-soft: #161a25;
  --text: #eef2ff;
  --text-muted: #a1adcb;
  --accent: #cf274f;
  --accent-strong: #f34d71;
  --accent-violet: #4f2fa3;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 55px rgba(0, 0, 0, 0.42);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --container: min(1320px, 92vw);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Sora", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgba(183, 33, 70, 0.19) 0%, rgba(7, 8, 13, 0) 28%),
    radial-gradient(circle at 85% 2%, rgba(91, 52, 177, 0.25) 0%, rgba(7, 8, 13, 0) 34%),
    linear-gradient(180deg, #040508 0%, #070911 45%, #090d16 100%);
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: "Space Grotesk", "Sora", sans-serif;
  letter-spacing: 0.01em;
  margin: 0;
}

p {
  margin: 0;
}

input,
select,
button {
  font: inherit;
}

.page-main {
  padding-top: 86px;
}

body[data-page="home"] .page-main,
body[data-page="auth"] .page-main,
body[data-page="profiles"] .page-main {
  padding-top: 0;
}

.content-shell {
  width: var(--container);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background 0.35s ease, border-color 0.35s ease, backdrop-filter 0.35s ease;
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  background: rgba(8, 10, 16, 0.84);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  letter-spacing: 0.015em;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.logo-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--accent-strong), var(--accent-violet));
  box-shadow: 0 0 24px rgba(207, 39, 79, 0.65);
}

.site-nav {
  margin-left: 26px;
}

.site-nav ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  color: var(--text-muted);
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
  font-size: 0.93rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-shell {
  position: relative;
}

.search-shell input {
  min-width: 200px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(9, 11, 17, 0.82);
  color: var(--text);
  padding: 0.62rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-shell input:focus {
  border-color: rgba(243, 77, 113, 0.75);
  box-shadow: 0 0 0 4px rgba(243, 77, 113, 0.16);
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.52rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
}

.source-pill {
  cursor: default;
  user-select: none;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem;
}

.hero {
  min-height: 96vh;
  padding-top: 120px;
  display: grid;
  align-items: center;
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 28%;
  background: linear-gradient(to top, var(--bg) 0%, rgba(6, 7, 11, 0) 100%);
}

.hero-content {
  width: var(--container);
  margin: 0 auto;
  max-width: 690px;
  position: relative;
  z-index: 1;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #f4b7c4;
  font-size: 0.74rem;
  margin-bottom: 0.9rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.8vw, 4.4rem);
  line-height: 1.02;
  margin-bottom: 1rem;
}

.hero-description {
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 62ch;
}

.hero-meta {
  margin-top: 1.1rem;
  color: #c5cfeb;
}

.hero-actions {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, background 0.24s ease;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #db1f4c 55%, #b7289b 110%);
  box-shadow: 0 15px 36px rgba(201, 40, 89, 0.42);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 40px rgba(201, 40, 89, 0.5);
}

.btn.ghost {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
}

.btn.ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.09);
}

.home-sections {
  margin-top: -44px;
  padding-bottom: 64px;
}

.content-row {
  margin-bottom: 1.55rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.78rem;
}

.section-head h2 {
  font-size: clamp(1.03rem, 2.2vw, 1.35rem);
}

.row-controls {
  display: inline-flex;
  gap: 0.55rem;
}

.row-btn {
  border: 1px solid var(--border);
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-size: 1.12rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.row-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.track-shell {
  position: relative;
}

.card-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(188px, 220px);
  gap: 0.95rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.38rem 0.18rem 0.88rem;
  scrollbar-width: thin;
}

.card-track::-webkit-scrollbar {
  height: 9px;
}

.card-track::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(197, 207, 235, 0.28);
}

.media-card {
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0a0e17;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.33);
  transition: transform 0.32s ease, box-shadow 0.32s ease;
  min-height: 318px;
}

.media-card:hover {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 25px 42px rgba(0, 0, 0, 0.55);
}

.media-link {
  display: block;
  position: relative;
  min-height: inherit;
}

.media-poster {
  width: 100%;
  height: 100%;
  min-height: 318px;
  object-fit: cover;
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6, 7, 11, 0.92) 10%, rgba(6, 7, 11, 0.1) 62%);
}

.media-meta {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.9rem;
  z-index: 1;
}

.media-meta h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.media-meta p {
  color: #bfc9e5;
  font-size: 0.78rem;
}

.card-hover {
  position: absolute;
  inset: auto 0 0;
  background: linear-gradient(to top, rgba(5, 7, 10, 0.96) 0%, rgba(6, 8, 12, 0.9) 70%, rgba(6, 8, 12, 0) 100%);
  padding: 0.9rem;
  transform: translateY(100%);
  transition: transform 0.32s ease;
}

.media-card:hover .card-hover {
  transform: translateY(0);
}

.card-tags {
  color: #d8dff7;
  font-size: 0.73rem;
}

.card-synopsis {
  color: #9fabcc;
  font-size: 0.74rem;
  line-height: 1.45;
  margin-top: 0.45rem;
  min-height: 2.95em;
}

.card-actions {
  margin-top: 0.72rem;
  display: flex;
  gap: 0.52rem;
}

.mini-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.74rem;
  cursor: pointer;
}

.mini-btn.primary {
  background: linear-gradient(120deg, #c9254f, #8a2cb4);
}

.mini-btn.ghost {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #e8ebfb;
}

.mini-btn.ghost.in-list {
  border-color: rgba(243, 77, 113, 0.65);
  color: #ffbfd0;
}

.progress-track {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 3.65rem;
  z-index: 2;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  height: 0.2rem;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f84f70, #b23cf8);
}

.progress-context {
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 4rem;
  z-index: 2;
  color: #e7ecff;
  font-size: 0.67rem;
}

.catalog-hero,
.detail-body,
.episode-panel,
.player-layout,
.auth-shell,
.profiles-shell {
  width: var(--container);
  margin: 0 auto;
}

.catalog-hero {
  padding-top: 120px;
  padding-bottom: 22px;
}

.catalog-hero h1 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
}

.catalog-hero p {
  margin-top: 0.65rem;
  color: var(--text-muted);
}

.catalog-controls {
  margin-top: 1.25rem;
  background: rgba(16, 20, 31, 0.86);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.05rem;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 0.65rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  color: #b8c3e3;
  font-size: 0.78rem;
}

.control-group input,
.control-group select,
.auth-form input {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(4, 6, 10, 0.66);
  color: var(--text);
  border-radius: 0.78rem;
  padding: 0.64rem 0.82rem;
  outline: none;
}

.control-group input:focus,
.control-group select:focus,
.auth-form input:focus {
  border-color: rgba(207, 39, 79, 0.7);
  box-shadow: 0 0 0 3px rgba(207, 39, 79, 0.18);
}

.catalog-summary {
  margin-top: 0.95rem;
  color: #c0cae8;
  font-size: 0.93rem;
}

.catalog-grid {
  width: var(--container);
  margin: 1rem auto 1.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 1rem;
}

.catalog-grid .media-card {
  min-height: 350px;
}

.catalog-grid .media-poster {
  min-height: 350px;
}

.catalog-pagination {
  width: var(--container);
  margin: 0 auto 3.2rem;
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
}

.page-btn.active {
  border-color: rgba(243, 77, 113, 0.78);
  background: rgba(243, 77, 113, 0.14);
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  color: #bdc8e7;
}

.detail-hero {
  min-height: 70vh;
  padding-top: 120px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
}

.detail-content {
  width: var(--container);
  margin: 0 auto;
  max-width: 720px;
}

.detail-summary {
  margin-top: 0.9rem;
  color: #bcc8e8;
  line-height: 1.6;
}

.detail-meta {
  margin-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-meta span,
.detail-genres {
  color: #d2dbf2;
  font-size: 0.9rem;
}

.detail-meta span {
  padding: 0.33rem 0.68rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.detail-genres {
  margin-top: 0.88rem;
}

.detail-body {
  margin-top: -58px;
  position: relative;
  z-index: 2;
}

.detail-info-card,
.player-info-card,
.episode-panel,
.player-sidebar,
.auth-card,
.profiles-panel {
  border: 1px solid var(--border);
  background: linear-gradient(170deg, rgba(15, 19, 28, 0.96), rgba(11, 14, 22, 0.95));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.detail-info-card {
  padding: 1.4rem;
}

.detail-info-card h2 {
  margin-bottom: 0.7rem;
}

.detail-info-card h3 {
  margin-top: 1.1rem;
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.detail-info-card p {
  color: #b9c5e6;
  line-height: 1.64;
}

.episode-panel {
  margin-top: 1.15rem;
  padding: 1.3rem;
}

.season-block + .season-block {
  margin-top: 1.15rem;
}

.season-block h3 {
  margin-bottom: 0.66rem;
  font-size: 1rem;
}

.episode-list {
  display: grid;
  gap: 0.58rem;
}

.episode-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 0.72rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.24rem;
  transition: border-color 0.24s ease, transform 0.24s ease;
}

.episode-item:hover,
.episode-item.active {
  border-color: rgba(243, 77, 113, 0.65);
  transform: translateY(-1px);
}

.episode-item strong {
  font-size: 0.9rem;
}

.episode-item span,
.episode-item p {
  color: #adbcde;
  font-size: 0.8rem;
}

.player-layout {
  padding-top: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1rem;
}

.video-stage {
  border-radius: var(--radius-lg);
  min-height: 60vh;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-end;
}

.video-chip {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.74rem;
  color: #f5f6ff;
  background: rgba(8, 10, 16, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.video-overlay-content {
  width: 100%;
  padding: 1.3rem;
  background: linear-gradient(to top, rgba(4, 5, 9, 0.95) 10%, rgba(4, 5, 9, 0.38) 67%, rgba(4, 5, 9, 0) 100%);
}

.player-info-card {
  margin-top: 0.9rem;
  padding: 1.1rem;
}

.player-info-card p {
  color: #b9c5e3;
  margin-top: 0.6rem;
  line-height: 1.62;
}

.player-meta {
  font-size: 0.9rem;
}

.player-sidebar {
  height: fit-content;
  padding: 1rem;
}

.player-sidebar h3 {
  margin-bottom: 0.7rem;
}

.episode-list.compact .episode-item {
  padding: 0.65rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.2rem 0;
}

.auth-card {
  width: min(980px, 92vw);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.auth-showcase {
  padding: 2.2rem;
  background:
    radial-gradient(circle at 22% 15%, rgba(244, 82, 122, 0.36), rgba(32, 16, 54, 0) 56%),
    radial-gradient(circle at 88% 84%, rgba(78, 45, 163, 0.52), rgba(8, 9, 14, 0) 48%),
    linear-gradient(170deg, #11172a, #0a0d17);
}

.auth-showcase h1 {
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  margin-bottom: 1rem;
}

.auth-showcase p {
  color: #c6d1ee;
  line-height: 1.66;
  max-width: 38ch;
}

.auth-content {
  padding: 1.3rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.42rem;
}

.auth-tab {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  padding: 0.62rem;
  cursor: pointer;
}

.auth-tab.active {
  color: #fff;
  border-color: rgba(243, 77, 113, 0.68);
  background: rgba(243, 77, 113, 0.15);
}

.auth-panel {
  margin-top: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 0.65rem;
}

.auth-form button {
  margin-top: 0.2rem;
}

.auth-message {
  margin-top: 0.7rem;
  min-height: 1.2em;
  color: #f8bfd0;
  font-size: 0.9rem;
}

.profiles-shell {
  min-height: 100vh;
  padding: 130px 0 36px;
}

.profiles-panel {
  padding: 1.4rem;
}

.profiles-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profiles-actions {
  display: flex;
  gap: 0.58rem;
}

.profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.profile-card {
  position: relative;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.profile-card:hover,
.profile-card.active {
  transform: translateY(-2px);
  border-color: rgba(243, 77, 113, 0.65);
}

.profile-card img {
  width: min(100%, 118px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin: 0 auto 0.66rem;
}

.profile-card h3 {
  font-size: 0.96rem;
}

.profile-delete {
  margin-top: 0.55rem;
  border: 1px solid rgba(248, 107, 138, 0.5);
  background: rgba(243, 77, 113, 0.12);
  color: #ffc4d2;
  border-radius: 999px;
  padding: 0.3rem 0.58rem;
  font-size: 0.73rem;
}

.site-footer {
  margin-top: 1.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(8, 10, 16, 0.66);
}

.footer-inner {
  width: var(--container);
  margin: 0 auto;
  padding: 2.1rem 0 1.2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  gap: 1rem;
}

.footer-grid h4 {
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}

.footer-grid p,
.footer-grid a {
  color: #a8b4d7;
  line-height: 1.64;
  font-size: 0.86rem;
}

.footer-bottom {
  margin-top: 1.25rem;
  color: #7f8cad;
  font-size: 0.78rem;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .catalog-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .player-sidebar {
    order: 2;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 4vw;
    right: 4vw;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    border-radius: 16px;
    background: rgba(8, 10, 17, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem;
  }

  .site-nav.open {
    max-height: 350px;
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .search-shell input {
    min-width: 132px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .header-tools {
    gap: 0.45rem;
  }

  .search-shell input {
    min-width: 0;
    width: 108px;
  }

  .profile-pill {
    display: none;
  }

  .hero {
    min-height: 88vh;
  }

  .hero-actions,
  .profiles-actions {
    width: 100%;
  }

  .btn {
    flex: 1;
  }

  .catalog-controls {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

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

  .hero h1,
  .catalog-hero h1 {
    font-size: 1.85rem;
  }

  .video-stage {
    min-height: 48vh;
  }
}
