:root {
  --bg: #07070b;
  --bg-elevated: #12121a;
  --bg-card: #181824;
  --text: #f4f4f8;
  --text-muted: #9ca3b4;
  --red-dark: #6b0f0f;
  --red-darker: #4a0808;
  --red-hover: #851515;
  --accent: var(--red-dark);
  --accent-hover: var(--red-hover);
  --red-glow: rgba(107, 15, 15, 0.55);
  --red-glow-strong: rgba(139, 0, 0, 0.75);
  --glow-hover: 0 0 10px var(--red-glow), 0 0 22px var(--red-glow-strong), 0 0 36px rgba(107, 15, 15, 0.25);
  --gold: #f5c518;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.api-banner {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #3d1a00;
  border-bottom: 1px solid rgba(245, 197, 24, 0.35);
  color: #ffe8a3;
  font-size: 0.9rem;
}

.api-banner code {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: rgba(5, 5, 8, 0.92);
  border-bottom: 1px solid rgba(107, 15, 15, 0.25);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-item {
  border: none;
  background: transparent;
  color: #b8b8c0;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(107, 15, 15, 0.22);
}

.category-nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-link {
  border: 1px solid var(--red-darker);
  background: var(--red-dark);
  color: #f0d0d0;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.25s ease;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.88rem;
}

.category-link:hover,
.category-link.active {
  color: #fff;
  background: var(--red-hover);
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.logo {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.14em;
  color: var(--red-dark);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, text-shadow 0.25s ease;
}

.logo:hover {
  color: var(--red-hover);
  text-shadow: 0 0 10px var(--red-glow), 0 0 22px var(--red-glow-strong);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  border: 1px solid var(--red-darker);
  background: var(--red-dark);
  color: #f0d0d0;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.25s ease, border-color 0.2s;
  white-space: nowrap;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: var(--red-hover);
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.home-section {
  position: relative;
  z-index: 2;
  max-width: 1440px;
  margin: -5rem auto 0;
  padding: 0 1.5rem 2.5rem;
}

.home-loading {
  padding: 2rem 0;
  color: var(--text-muted);
}

.content-row {
  margin-bottom: 1.75rem;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.row-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.row-see-all {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}

.row-see-all:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.row-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--red-dark) transparent;
}

.row-track .movie-card,
.row-track .continue-card {
  flex: 0 0 155px;
  scroll-snap-align: start;
}

.row-track .poster-wrap {
  border-radius: 10px;
}

.row-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.header-sub {
  border-top: 1px solid var(--border);
  background: rgba(5, 5, 8, 0.96);
}

.header-sub .nav {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem 0.75rem;
}

.profile-btn {
  border: 2px solid var(--red-darker);
  background: transparent;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow 0.25s ease, border-color 0.2s, transform 0.15s;
  line-height: 0;
  flex-shrink: 0;
}

.profile-btn-header {
  margin-left: 0.25rem;
}

.profile-btn:hover {
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.avatar {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.avatar-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-md {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: 1.8rem;
}

.avatar-xl {
  width: 118px;
  height: 118px;
  font-size: 2.4rem;
}

.avatar-guest,
.avatar-add {
  background: var(--red-dark);
}

.avatar-add {
  background: #2a2a2a;
  color: #bdbdbd;
  font-size: 3rem;
  font-weight: 400;
}

.profile-edit-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  font-size: 1.6rem;
  color: #fff;
}

.login-screen {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 10%, rgba(107, 15, 15, 0.35), transparent 40%),
    radial-gradient(circle at 80% 20%, rgba(139, 0, 0, 0.18), transparent 35%),
    #0b0b0f;
  color: #fff;
  animation: loginFadeIn 0.5s ease;
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.login-screen.switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.82);
}

.login-header {
  padding: 1.25rem 3vw;
}

.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 90px);
  padding: 2rem 1.25rem 3rem;
}

.login-title {
  margin: 0 0 0.65rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.login-subtitle {
  margin: 0 0 2.5rem;
  color: #9ca3b4;
  font-size: 1.05rem;
}

.profile-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2rem;
  max-width: 980px;
}

.profile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 132px;
}

.profile-tile {
  border: 3px solid transparent;
  background: transparent;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease;
}

.profile-tile:hover,
.profile-tile:focus-visible {
  transform: scale(1.06);
  border-color: #fff;
  box-shadow: 0 0 18px rgba(107, 15, 15, 0.55);
  outline: none;
}

.profile-tile-add:hover,
.profile-tile-add:focus-visible {
  border-color: #bdbdbd;
}

.profile-name {
  color: #808080;
  font-size: 1rem;
  text-align: center;
  word-break: break-word;
}

.profile-item:hover .profile-name,
.profile-item:focus-within .profile-name {
  color: #fff;
}

.profile-item-last .profile-tile {
  border-color: rgba(107, 15, 15, 0.65);
  box-shadow: 0 0 20px rgba(107, 15, 15, 0.35);
}

.profile-last-badge {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red-hover);
}

.profile-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 220px;
  background: rgba(12, 12, 18, 0.98);
  border: 1px solid rgba(107, 15, 15, 0.45);
  border-radius: 12px;
  padding: 0.45rem;
  box-shadow: var(--shadow), var(--glow-hover);
  z-index: 150;
}

.profile-menu-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.35rem;
}

.profile-menu-header span:first-child {
  font-weight: 700;
  font-size: 1rem;
}

.profile-menu-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.profile-menu-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
}

.profile-menu-item:hover {
  background: rgba(107, 15, 15, 0.25);
  color: #fff;
}

.profile-menu-danger {
  color: #ff9a9a;
}

.profile-menu-danger:hover {
  background: rgba(139, 0, 0, 0.35);
  color: #fff;
}

.login-manage-btn {
  margin-top: 2.5rem;
  border: 1px solid #808080;
  background: transparent;
  color: #808080;
  padding: 0.55rem 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.25s ease;
}

.login-manage-btn:hover {
  color: #fff;
  border-color: #fff;
  box-shadow: var(--glow-hover);
}

.profile-editor {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.profile-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}

.profile-editor-card {
  position: relative;
  width: min(460px, 100%);
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid rgba(107, 15, 15, 0.45);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  box-shadow: var(--glow-hover), var(--shadow);
}

.profile-editor-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
}

.editor-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.editor-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.editor-upload-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.editor-label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

#editor-username {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 0.75rem;
}

#editor-username:focus {
  border-color: var(--red-dark);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.editor-actions-right {
  display: flex;
  gap: 0.65rem;
  margin-left: auto;
}

.auth-error {
  margin: 0.35rem 0 0;
  color: #ff8a8a;
  font-size: 0.9rem;
}

body.login-open {
  overflow: hidden;
}

.app-shell.hidden {
  display: none;
}

.search-wrap {
  position: relative;
  margin-left: auto;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.search-clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}

.search-clear:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  background: rgba(12, 12, 18, 0.98);
  border: 1px solid rgba(107, 15, 15, 0.4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 120;
}

.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.search-suggest-item:hover {
  background: rgba(107, 15, 15, 0.22);
}

.search-suggest-item img {
  width: 42px;
  height: 63px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.search-suggest-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.search-suggest-info strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-info span {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
}

.search-filter {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.search-filter:hover,
.search-filter.active {
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-darker);
  box-shadow: var(--glow-hover);
}

.btn-danger {
  background: transparent;
  color: #ff8a8a;
  border-color: rgba(255, 100, 100, 0.35);
  padding: 0.65rem 1rem;
}

.btn-danger:hover {
  background: rgba(139, 0, 0, 0.45);
  border-color: #a02020;
  color: #fff;
}

.search-form input {
  width: min(280px, 42vw);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  outline: none;
}

.search-form input:focus {
  border-color: var(--red-dark);
  box-shadow: 0 0 0 3px var(--red-glow), var(--glow-hover);
}

.search-form button {
  border: 1px solid var(--red-darker);
  background: var(--red-dark);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.25s ease, border-color 0.2s;
}

.search-form button:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.hero {
  position: relative;
  min-height: 72vh;
  display: flex;
  align-items: end;
  overflow: hidden;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1028, #0b0b12);
  background-size: cover;
  background-position: center top;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 8%, rgba(7, 7, 11, 0.35) 45%, rgba(7, 7, 11, 0.85) 100%),
    linear-gradient(to right, rgba(7, 7, 11, 0.95) 0%, rgba(7, 7, 11, 0.2) 55%, rgba(7, 7, 11, 0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 4rem 1.5rem 5.5rem;
}

.hero-label {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
}

.hero-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 0.95;
  margin: 0 0 1rem;
  max-width: 12ch;
}

.hero-overview {
  max-width: 560px;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text);
}

.chip.gold {
  color: #111;
  background: var(--gold);
  border-color: transparent;
  font-weight: 700;
}

.btn {
  border: 1px solid var(--red-darker);
  cursor: pointer;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s, box-shadow 0.25s ease, border-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--red-dark);
  color: #fff;
  padding: 0.85rem 1.4rem;
}

.btn-primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.btn-text {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  transition: color 0.2s, box-shadow 0.25s ease, border-color 0.2s, background 0.2s;
}

.btn-text:hover {
  color: #fff;
  background: var(--red-dark);
  border-color: var(--red-darker);
  box-shadow: var(--glow-hover);
}

.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-header > div {
  flex: 1;
}

.airing-clock {
  color: var(--red-hover) !important;
  font-weight: 600;
}

.airing-group {
  margin-bottom: 1.25rem;
}

.airing-group-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #f0d0d0;
}

.airing-row {
  margin-bottom: 0.5rem;
}

.airing-badge {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

.airing-badge.live {
  background: var(--red-dark);
  color: #fff;
  animation: livePulse 1.4s ease-in-out infinite;
}

.airing-badge.just-aired {
  background: #1f6feb;
  color: #fff;
}

.airing-badge.up-next {
  background: #b8860b;
  color: #fff;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(107, 15, 15, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(107, 15, 15, 0); }
}

.section-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.movie-row,
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.browse-content {
  display: block;
}

.movie-card {
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-wrap .rating {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  background: rgba(0, 0, 0, 0.72);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.25rem 0.45rem;
  border-radius: 8px;
}

.poster-wrap .type-badge {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  background: var(--red-dark);
  color: white;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
  border-radius: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--red-darker);
}

.section-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn-secondary {
  background: var(--red-dark);
  color: #fff;
  border: 1px solid var(--red-darker);
  padding: 0.8rem 1.35rem;
}

.btn-secondary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.movie-card h3 {
  margin: 0.65rem 0 0.15rem;
  font-size: 0.95rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.skeleton {
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #15151f 0%, #222232 50%, #15151f 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(92vh, 960px);
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.modal-backdrop-img {
  height: 220px;
  background: #111 center / cover no-repeat;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 1px solid var(--red-darker);
  border-radius: 50%;
  background: var(--red-dark);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.25s ease;
}

.modal-close:hover {
  background: var(--red-hover);
  box-shadow: var(--glow-hover);
}

.modal-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem 1.5rem;
  padding: 0 1.5rem 1.75rem;
  margin-top: -3rem;
}

.modal-poster-wrap img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: block;
}

.modal-info h2 {
  margin: 0 0 0.35rem;
  font-size: 1.8rem;
}

.modal-release {
  margin: 0 0 0.75rem;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-section {
  margin-bottom: 1rem;
}

.modal-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.modal-tagline {
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 0.75rem;
}

.modal-overview {
  margin: 0;
  color: #d5d8e0;
  line-height: 1.7;
  white-space: normal;
  overflow: visible;
  max-height: none;
}

.modal-cast-block {
  grid-column: 1 / -1;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.modal-cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 1.15rem 0.9rem;
}

.cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.cast-photo {
  width: 100%;
  max-width: 108px;
}

.cast-photo img,
.cast-placeholder {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: var(--bg-card);
  border: 2px solid rgba(107, 15, 15, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cast-placeholder {
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-muted);
}

.cast-name {
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
}

.cast-role {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.modal-watch-btn {
  margin-top: 0.25rem;
}

.watch-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 0;
}

.watch-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
}

.watch-modal-panel {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  overflow: hidden;
  background: #0a0a0e;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.watch-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10;
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: 100vh;
  overflow: hidden;
}

.watch-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

.watch-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-right: 3rem;
}

.watch-modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.watch-subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.watch-subtitle a {
  color: #e91e63;
  text-decoration: none;
  font-weight: 600;
}

.watch-subtitle a:hover {
  text-decoration: underline;
}

.watch-episode-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.watch-ep-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.watch-ep-select {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
  max-width: 220px;
}

.watch-ep-select:focus {
  border-color: #e91e63;
  box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.25);
}

.watch-player-host {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: min(56vw, calc(100vh - 220px));
  max-height: calc(100vh - 180px);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.watch-player-host iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.watch-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.watch-loading {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-muted);
}

/* ── Playback Servers Sidebar ── */

.playback-sidebar {
  display: flex;
  flex-direction: column;
  background: #111116;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.playback-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.15rem 0.85rem;
  flex-shrink: 0;
}

.playback-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.playback-icon {
  display: inline-block;
  width: 18px;
  height: 14px;
  position: relative;
}

.playback-icon::before,
.playback-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #e91e63;
}

.playback-icon::before {
  top: 2px;
}

.playback-icon::after {
  bottom: 2px;
}

.playback-header h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

.playback-hd {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e91e63;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0 0.85rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(233, 30, 99, 0.4) transparent;
}

.server-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.25s;
}

.server-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(233, 30, 99, 0.25);
}

.server-btn.active {
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.18) 0%, rgba(156, 39, 176, 0.12) 100%);
  border-color: rgba(233, 30, 99, 0.45);
  box-shadow: 0 0 20px rgba(233, 30, 99, 0.12);
}

.server-btn-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.server-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
}

.server-btn.active .server-label {
  color: #b0b8c4;
}

.server-indicator {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a3a44;
  transition: background 0.2s, box-shadow 0.25s;
}

.server-btn.active .server-indicator {
  background: #e91e63;
  box-shadow: 0 0 10px rgba(233, 30, 99, 0.85), 0 0 20px rgba(233, 30, 99, 0.4);
}

.continue-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(107, 15, 15, 0.92);
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.continue-card:hover .continue-play,
.movie-card:hover .continue-play {
  opacity: 1;
}

.continue-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.45);
}

.continue-progress span {
  display: block;
  height: 100%;
  background: var(--red-hover);
}

body.watch-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .watch-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: 100vh;
    height: 100dvh;
  }

  .watch-main {
    padding: 1rem;
    flex: 1;
    min-height: 0;
  }

  .playback-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-height: 42vh;
  }

  .server-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 1rem;
    gap: 0.55rem;
  }

  .server-btn {
    flex: 0 0 240px;
  }
}

@media (max-width: 860px) {
  .search-wrap {
    margin-left: 0;
    width: 100%;
    order: 3;
  }

  .profile-menu-wrap,
  .profile-wrap,
  .profile-btn-header {
    order: 4;
    margin-left: auto;
  }

  .main-nav {
    order: 2;
    width: 100%;
  }

  .header-inner {
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .search-form input {
    flex: 1;
    width: auto;
  }

  .hero {
    min-height: 62vh;
  }

  .modal-body {
    grid-template-columns: 1fr;
    margin-top: -1rem;
  }

  .modal-poster-wrap {
    max-width: 220px;
  }
}

@media (max-width: 520px) {
  .search-form button {
    padding-inline: 0.85rem;
  }

  .movie-row,
  .movie-grid,
  .loading-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
