@font-face {
  font-family: "FC Sound";
  src: url("./fonts/FC-Sound.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #090b12;
  --surface: #121722;
  --surface-soft: #10141e;
  --text: #f1f2f8;
  --muted: #929db3;
  --accent: #b9a1fa;
  --border: rgba(255, 255, 255, .085);
  --font: "FC Sound", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 65vh;
  min-width: 0;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  line-height: 1.4;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

/* Header */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 38px;
  min-height: 80px;
  padding: 15px 5%;
  background: rgba(9, 11, 18, .94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 35px;
  border: 1px solid #c5acff40;
  border-radius: 8px;
  background: linear-gradient(145deg, #c2a8ff, #8965d0);
  color: #201335;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 900;
  font-style: italic;
}

.logo-text,
.footer-logo {
  font-family: Arial, sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -.7px;
  white-space: nowrap;
}

.logo-text > span,
.footer-logo span {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 27px;
}

.main-nav a {
  padding: 8px 0;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
  transition: color .2s;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: #e4d7ff;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.account form {
  margin: 0;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  border: 1px solid #b9a1fa35;
  border-radius: 50%;
  background: #b9a1fa12;
  color: #d9c9ff;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #b9a1fa;
  color: #211536;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #c9b5ff;
}

.secondary {
  border-color: #ffffff20;
  background: #ffffff05;
  color: #d9dce8;
}

.secondary:hover:not(:disabled) {
  border-color: #b9a1fa55;
  background: #b9a1fa0c;
}

.small {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 13px;
}

.full {
  width: 100%;
  margin-top: 24px;
}

.danger {
  border-color: #e45c7440;
  background: #e45c7415;
  color: #ff9caf;
}

.danger:hover:not(:disabled) {
  background: #e45c7428;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

/* Shared layout */

.container {
  width: min(1320px, 90%);
  margin: 40px auto 75px;
}

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

.section-head h1,
.section-head h2 {
  margin: 0;
}

.section-head h1 {
  font-size: 34px;
}

.section-head h2 {
  font-size: 28px;
  font-weight: 500;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  color: #ad95d8;
  font-family: Arial, sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
}

.muted,
.notice,
.section-subtitle {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.notice {
  font-size: 13px;
}

.section-subtitle {
  margin: 10px 0 0;
}

.description {
  color: #abb5ca;
  white-space: pre-line;
  line-height: 1.9;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid #b9a1fa30;
  border-radius: 5px;
  background: #b9a1fa08;
  color: #cbb7f9;
  font-size: 13px;
}

/* Featured banner slider */

.home-hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: #10121d;
}

.home-hero::after {
  content: none;
}

.hero-slider {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  gap: 0;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hero-slider::-webkit-scrollbar {
  display: none;
}

.hero-slide {
  position: relative;
  isolation: isolate;
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  padding: 65px 5% 75px;
  overflow: hidden;
  scroll-snap-align: start;
}

.hero-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-background img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 35%;
  filter: blur(23px);
  opacity: .2;
  transform: scale(1.1);
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, #090b12ed, #090b1250),
    linear-gradient(0deg, #090b12, transparent 80%);
  pointer-events: none;
}

.hero-layout {
  position: relative;
  z-index: 2;
  width: min(1200px, 100%);
  min-width: 0;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 275px;
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
  min-height: 430px;
}

.hero-copy {
  min-width: 0;
  max-width: 700px;
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bca5f5;
}

.hero-copy h1 {
  margin: 20px 0 23px;
  font-size: clamp(34px, 4.4vw, 60px);
  line-height: 1.3;
  letter-spacing: -.5px;
  text-wrap: balance;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-meta > span:last-child:not(.anime-status) {
  color: #8e849f;
  font-family: Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 1.3px;
}

.hero-description {
  max-width: 540px;
  margin: 24px 0 28px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  white-space: pre-line;
  color: #a5afc2;
  font-size: 18px;
  line-height: 1.85;
}

.hero-poster {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid #ffffff25;
  border-radius: 14px;
  background: #151a27;
  box-shadow: 0 25px 70px #0007;
}

.hero-poster img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-controls {
  position: absolute;
  right: 5%;
  bottom: 18px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-arrow {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.hero-arrow:hover:not(:disabled) {
  border-color: #b9a1fa80;
  background: rgba(185, 161, 250, .18);
}

.hero-arrow:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Library */

.library {
  scroll-margin-top: 115px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(350px, 100%);
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 25px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: #717e96;
  font-size: 13px;
}

.library-count {
  color: #b8a5db;
}

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

.anime-item {
  min-width: 0;
}

.movie-card {
  display: block;
  min-width: 0;
}

.poster-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid #ffffff14;
  border-radius: 11px;
  background: #151b28;
  transition:
    border-color .2s,
    transform .2s,
    box-shadow .2s;
}

.poster-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.movie-card:hover .poster-frame {
  transform: translateY(-4px);
  border-color: #b9a1fa65;
  box-shadow: 0 15px 35px #0005;
}

.no-poster {
  color: #8c79a4;
  font-family: Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
}

.poster-action {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #080a10ad;
  color: white;
  font-size: 14px;
  opacity: 0;
  transition: opacity .2s;
}

.poster-action > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff70;
  border-radius: 50%;
  font-size: 14px;
}

.movie-card:hover .poster-action,
.movie-card:focus-visible .poster-action {
  opacity: 1;
}

.card-info {
  padding: 15px 1px 0;
}

.card-category {
  color: #8f7aa9;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 1.3px;
}

.card-info h3 {
  margin: 8px 0;
  min-height: 3em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #e3e3ed;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}

small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.card-info small {
  color: #7f8598;
}

/* Movie detail */

.detail {
  display: flex;
  align-items: center;
  gap: clamp(30px, 5vw, 70px);
  margin: 30px 0 50px;
  padding: 25px 0 45px;
  border-bottom: 1px solid var(--border);
}

.detail-poster {
  width: 235px;
  max-width: 100%;
  flex: 0 0 auto;
  align-self: flex-start;
}

.detail-poster .poster-frame {
  box-shadow: 0 20px 60px #0005;
}

.detail-info {
  min-width: 0;
  max-width: 740px;
}

.detail-info h1 {
  margin: 16px 0 22px;
  font-size: clamp(30px, 4vw, 47px);
  line-height: 1.4;
}

.detail-info .description {
  margin: 24px 0;
}

/* Episodes */

.episodes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 17px;
}

.episode-card {
  min-width: 0;
  overflow: hidden;
  background: #111722;
  border: 1px solid var(--border);
  border-radius: 11px;
  transition: border-color .2s, transform .2s;
}

.episode-card:hover {
  transform: translateY(-3px);
  border-color: #b9a1fa55;
}

.episode-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, #b9a1fa15, transparent),
    #182032;
}

.episode-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-preview img.episode-blurred {
  filter: blur(8px);
  transform: scale(1.08);
}

.episode-placeholder {
  padding-bottom: 12px;
  color: #64718b;
  font-family: Arial, sans-serif;
  font-size: 8px;
  letter-spacing: 1.5px;
}

.watched-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: .5px;
  pointer-events: none;
}

.episode-number {
  position: absolute;
  bottom: 9px;
  left: 13px;
  z-index: 2;
  color: #e1d9f5;
  font-family: Arial, sans-serif;
  font-size: 24px;
  font-weight: 700;
  text-shadow: 0 2px 10px #000a;
}

.episode-play {
  position: absolute;
  right: 13px;
  bottom: 13px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ffffff40;
  border-radius: 50%;
  background: #080a1055;
  color: #d0bfef;
  font-size: 12px;
}

.episode-info {
  padding: 13px 15px 16px;
}

.episode-info b {
  font-size: 16px;
  font-weight: 500;
}

.episode-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.continue-watching {
  margin: 25px 0;
}

/* Player */

.watch-heading {
  margin-top: 28px;
}

.watch-heading h2 {
  font-size: clamp(22px, 3vw, 29px);
}

video {
  display: block;
  width: 100%;
  max-height: 76vh;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
  object-fit: contain;
  background: black;
  border: 1px solid var(--border);
  border-radius: 12px;
}

video::cue {
  color: white;
  background: rgba(0, 0, 0, .75);
}

/* Forms and admin */

.panel {
  margin: 26px 0;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
}

.auth {
  width: min(440px, 90%);
  margin: 65px auto 90px;
}

.auth h1 {
  margin: 15px 0;
  font-size: 31px;
}

.auth .muted a,
.auth .notice a {
  color: #cab5ff;
}

.auth .notice {
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

label {
  display: block;
  margin: 23px 0 9px;
  color: #bdc6d9;
  font-size: 15px;
}

input:not([type="checkbox"]):not([type="hidden"]),
textarea,
select {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #ffffff18;
  border-radius: 8px;
  background: #0a0e17;
  color: #e4e7f2;
  transition: border-color .2s;
}

input:not([type="hidden"]):focus,
textarea:focus,
select:focus {
  border-color: #b9a1fa80;
}

input::placeholder,
textarea::placeholder {
  color: #65718a;
}

input[readonly] {
  color: #aa97d0;
  font-family: Arial, sans-serif;
  font-size: 13px;
}

input[type="file"] {
  font-size: 13px;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 11px;
  border: 1px solid #ffffff20;
  border-radius: 5px;
  background: #b9a1fa10;
  color: #d3bfff;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.8;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
}

.edit-poster-preview {
  margin-top: 18px;
  max-width: 180px;
}

.edit-poster-preview img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #10141e;
}

.admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
  padding: 20px 23px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
}

.admin-row > div {
  min-width: 0;
}

.admin-row b {
  font-size: 18px;
  font-weight: 500;
}

.delete-form {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid var(--border);
}

/* Empty states and notices */

.empty-state {
  grid-column: 1 / -1;
  padding: 50px 25px;
  text-align: center;
  border: 1px dashed #ffffff20;
  border-radius: 13px;
  background: #ffffff02;
}

.empty-symbol {
  color: #ac91df;
  font-size: 40px;
}

.empty-state h3 {
  margin: 12px 0;
  font-size: 25px;
}

.empty-state .muted {
  max-width: 470px;
  margin: 0 auto 25px;
}

.flash {
  width: min(1320px, 90%);
  margin: 20px auto;
  padding: 14px 20px;
  border: 1px solid #b9a1fa30;
  border-left: 3px solid #b9a1fa;
  border-radius: 8px;
  background: #b9a1fa0c;
  color: #d3c5ed;
}

/* Footer */

.site-footer {
  margin-top: 60px;
  padding: 35px 5%;
  border-top: 1px solid var(--border);
  background: #07090e;
}

.footer-inner {
  width: min(1320px, 100%);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 25px;
}

.footer-logo {
  font-size: 17px;
}

.footer-inner p {
  margin: 9px 0 0;
  color: #6f7a90;
  font-size: 12px;
}

.footer-legal {
  max-width: 350px;
}

/* Optional featured cards: retained for compatibility */

.featured-section {
  margin-bottom: 40px;
}

.featured-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}

.featured-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, border-color .2s;
}

.featured-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .3);
}

.featured-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .05);
}

.featured-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.featured-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.featured-info small {
  opacity: .7;
}

/* Tablet */

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

  .header {
    gap: 25px;
  }

  .main-nav {
    gap: 20px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr) 235px;
    gap: 40px;
  }
}

/* Mobile */

@media (max-width: 750px) {
  .header {
    flex-wrap: wrap;
    gap: 13px;
    padding: 15px 5% 10px;
  }

  .logo-text {
    font-size: 18px;
  }

  .logo-mark {
    width: 26px;
    height: 30px;
    font-size: 20px;
  }

  .account-avatar {
    display: none;
  }

  .account .btn {
    font-size: 12px;
  }

  .main-nav {
    order: 3;
    justify-content: space-between;
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }

  .main-nav a {
    font-size: 14px;
  }

  .home-hero {
    padding: 0;
  }

  .hero-slide {
    padding: 32px 5% 65px;
  }

  .hero-layout {
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 25px;
  }

  .hero-poster {
    width: 145px;
    border-radius: 10px;
  }

  .hero-copy h1 {
    margin: 20px 0 23px;
    font-size: clamp(34px, 4.4vw, 60px);
    line-height: 1.3;
    letter-spacing: -.5px;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    text-wrap: wrap;
  }

  .hero-description {
    font-size: 16px;
    -webkit-line-clamp: 3;
  }

  .hero-copy .btn {
    padding: 11px 15px;
    font-size: 15px;
  }

  .hero-controls {
    bottom: 15px;
  }

  .hero-arrow {
    width: 38px;
    height: 38px;
    font-size: 25px;
  }

  .container {
    margin-top: 30px;
  }

  .section-head h2 {
    font-size: 25px;
  }

  .search-form {
    width: 100%;
  }

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

  .card-info h3 {
    font-size: 16px;
  }

  .card-category {
    font-size: 7px;
    letter-spacing: 1px;
  }

  .poster-action {
    display: none;
  }

  .detail {
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
  }

  .detail-poster {
    width: 175px;
  }

  .detail-info h1 {
    font-size: 31px;
  }

  .episode-placeholder {
    font-size: 7px;
    letter-spacing: 1px;
  }

  .admin-row {
    flex-wrap: wrap;
    padding: 17px;
  }

  .auth {
    margin-top: 35px;
  }

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

.featured-card .featured-poster {
  position: relative;
}

.featured-card .featured-poster img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

.hero-copy h1 {
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: normal;
  text-wrap: wrap;
}

.hero-copy h1 .title-word {
  display: inline-block;
  white-space: pre;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

/* ---------- Category Admin ---------- */

.category-create-card,
.category-group {
  background: #1c1c2e;
  border: 1px solid #2e2e4a;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.category-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.category-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(var(--category-rgb), 0.08);
  border: 1px solid rgba(var(--category-rgb), 0.25);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  background: rgb(var(--category-rgb));
  color: #ffffff;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
}

.category-edit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

.category-edit-form input[type="text"] {
  flex: 1;
  min-width: 140px;
}

.btn-small {
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.empty-note {
  color: #9ca3af;
}

/* ---------- Category Select (หน้าเพิ่ม/แก้เรื่อง) ---------- */

.category-select-section {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.category-select-section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.category-select-section > p {
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
}

.category-select-group {
  margin-bottom: 1.25rem;
}

.category-select-group:last-child {
  margin-bottom: 0;
}

.category-select-group h3 {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
}

.category-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.category-select-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  background: rgba(var(--category-rgb), 0.12);
  border: 1px solid rgba(var(--category-rgb), 0.4);
  color: rgb(var(--category-rgb));
  font-size: 0.85rem;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.category-select-item:hover {
  background: rgba(var(--category-rgb), 0.22);
}

.category-select-item input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: rgb(var(--category-rgb));
  cursor: pointer;
}

.category-select-item input:checked ~ .category-badge {
  box-shadow: 0 0 0 2px rgba(var(--category-rgb), 0.5);
}

.category-select-item .category-badge {
  pointer-events: none;
}

/* ---------- Category Filter (หน้าแรก) ---------- */

.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease, color 0.15s ease;
}

.category-filter-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.category-filter-chip.is-active {
  color: #ffffff;
  background: rgb(var(--category-rgb, 99, 102, 241));
  border-color: transparent;
  font-weight: 600;
}

.category-filter-chip:not(.is-active) {
  color: rgb(var(--category-rgb));
  border-color: rgba(var(--category-rgb), 0.4);
  background: rgba(var(--category-rgb), 0.1);
}

/* ---------- Movie Categories (หน้ารายละเอียด) ---------- */

.movie-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.movie-categories .category-badge {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.movie-categories .category-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--category-rgb), 0.35);
}

/* ---------- Hero Description Clamp ---------- */

.hero-description-wrapper {
  position: relative;
  max-width: 640px;
}

.hero-description.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-description-wrapper.is-open .hero-description {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.hero-description-toggle {
  margin-top: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-description-toggle:hover {
  color: #fff;
}

.hero-description-toggle.is-hidden {
  display: none;
}

/* ---------- Category Dropdown (หน้าแรก) ---------- */

.category-dropdown {
  position: relative;
  display: inline-block;
}

.category-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.dropdown-arrow {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.category-dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.category-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  max-height: 340px;
  overflow-y: auto;
  background: #1c1c2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.category-dropdown.is-open .category-dropdown-menu {
  display: block;
}

.category-dropdown-item {
  display: block;
  padding: 9px 16px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.category-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.category-dropdown-item.is-active {
  background: rgba(var(--category-rgb, 99, 102, 241), 0.25);
  color: #fff;
  font-weight: 600;
}

/* ---------- Movie Categories: outline style ---------- */

.movie-categories .category-badge {
  background: rgba(var(--category-rgb), 0.08);
  color: rgb(var(--category-rgb));
  border: 1px solid rgba(var(--category-rgb), 0.45);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.movie-categories .category-badge:hover {
  background: rgba(var(--category-rgb), 0.16);
  border-color: rgba(var(--category-rgb), 0.7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--category-rgb), 0.25);
}

/* ---------- Force FC Sound on like count & comment heading ---------- */

.episode-like,
.episode-like span,
.like-total,
.comment-shortcut,
.comment-heading-count,
.section-head h2,
.section-head .eyebrow {
  font-family: "FC Sound", Tahoma, Arial, sans-serif;
}

.next-episode-bar {
  display: flex;
  justify-content: flex-end;
  margin: -10px 0 18px;
}

.btn-watched {
  background-color: #ffffff;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.btn-watched:hover {
  background-color: #f0f0f0;
}

.notification-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 14px;
  border: 1px solid #eee;
  border-radius: 10px;
  margin-bottom: 12px;
}

.notification-poster {
  flex: 0 0 260px;
}

.notification-poster img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.notification-content {
  flex: 1 !important;
  min-width: 0;
}

.notification-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.notification-actions form {
  margin: 0;
}

.logo-text {
  background: linear-gradient(
    90deg,
    #38bdf8,
    #a78bfa,
    #f472b6,
    #38bdf8
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: logo-flow 5s linear infinite;
}

.logo-text span {
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@keyframes logo-flow {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 300% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-text {
    animation: none;
    -webkit-text-fill-color: currentColor;
    color: inherit;
    background: none;
  }
}

/* ---------- Profile ---------- */

.profile-avatar-preview {
  display: block;
  width: 96px;
  height: 96px;
  margin-bottom: 1rem;
  border-radius: 50%;
  object-fit: cover;
}

.account-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  text-decoration: none;
  transition: background 0.2s ease;
}

.account-profile:hover {
  background: rgba(255, 255, 255, 0.12);
}

.account-profile .account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .account-name {
    display: none;
  }
}

.profile-page {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

.profile-card {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.profile-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
}

.profile-title {
  margin: 0;
  font-size: 1.3rem;
}

.profile-email {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
}

.profile-field input[type="text"] {
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  font-size: 0.95rem;
}

.profile-field input[type="file"] {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.profile-hint {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.profile-form .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

/* ---------- Comments ---------- */

img.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 6px;
}

.comment-action-button {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    padding: 3px 0;
    margin: 0;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.65;
    color: #929db3;
    cursor: pointer;
}

.comment-action-button:hover {
    color: #d9dce8;
}

.comment-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    max-width: 100%;
}

.comment-edit-form textarea {
    width: 100%;
    min-height: 60px;
    max-height: 200px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #ffffff18;
    background: #0a0e17;
    color: #e4e7f2;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
}

.comment-edit-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.comment-edit-form .btn {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 12px;
}

.comment-edit-form[hidden] {
    display: none !important;
}

.comment-body[hidden] {
    display: none !important;
}

.comment-actions .comment-action-button,
.comment-actions .comment-delete-button {
    line-height: 1;

    padding: 3px 0;

    display: inline-flex;

    align-items: center;
}

/* ── Fix: ปุ่มใน form ไม่ให้เบนกับปุ่มอื่น ── */
.actions form,
.detail-member-actions form,
.notification-actions form,
.episode-community-bar form,
.comment-actions form {
  margin: 0;
}