*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
:root {
  --color-primary-main: #FFD700;
  --color-primary-hover: #E6C200;
  --color-primary-active: #CCAD00;
  --color-accent-red: #E50914;
  --color-accent-green: #10B981;

  --color-primary: var(--color-primary-main);
  --color-primary-hover: var(--color-primary-hover);
  --color-primary-glow: rgba(255, 215, 0, 0.3);

  --color-bg-app: #0C0E12;
  --color-bg-surface-primary: #14171F;
  --color-bg-surface-secondary: #1E222D;
  --color-bg-overlay: rgba(12, 14, 18, 0.8);

  --color-bg: var(--color-bg-app);
  --color-surface: var(--color-bg-surface-primary);
  --color-surface-2: var(--color-bg-surface-secondary);
  --color-surface-3: #2A2E3A;

  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-hover: rgba(255, 255, 255, 0.15);

  --color-text-primary: #FFFFFF;
  --color-text-secondary: #9CA3AF;
  --color-text-muted: #6B7280;
  --color-text-inverse: #0C0E12;

  --color-text: var(--color-text-primary);
  --color-text-2: var(--color-text-secondary);
  --color-text-dim: #50506a;

  --color-gold: var(--color-primary-main);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Bebas Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display-fallback:
    Impact, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --text-xs: clamp(0.75rem, 1.5vw, 0.8125rem);
  --text-sm: clamp(0.75rem, 2vw, 0.875rem);
  --text-base: clamp(0.875rem, 2.5vw, 1rem);
  --text-lg: clamp(1rem, 3vw, 1.125rem);
  --text-h1: clamp(1.25rem, 5vw, 1.75rem);
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-md: 0 6px 8px rgba(0, 0, 0, 0.5);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --z-header: 100;
  --z-loader: 999;
  --z-toast: 1000;
}
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  user-select: none;
  -webkit-user-select: none;
}
img {
  max-width: 100%;
  height: auto;
}
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link {
  position: fixed;
  top: -100%;
  left: var(--space-4);
  padding: 12px 20px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 10000;
  font-weight: 700;
  font-size: 0.9rem;
  transition: top 0.2s;
  text-decoration: none;
}
.skip-link:focus {
  top: 0;
  outline: none;
  box-shadow: 0 4px 20px var(--color-primary-glow);
}

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  padding: 14px clamp(16px, 4vw, 24px);
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.header-logo {
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
}
.header-title {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.header-title span {
  color: #ff1a27;
}
.header-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-user-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary);
  padding: 1px;
  background: var(--color-bg);
}

.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  background: #000;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}
.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  z-index: 1;
}
.player-wrapper::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--color-bg), transparent);
  pointer-events: none;
  z-index: 2;
}

.content {
  padding: var(--space-6) clamp(16px, 4vw, 32px) 120px;
  max-width: 800px;
  margin: 0 auto;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}
.badge {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
}
.badge-quality {
  background: rgba(229, 9, 20, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(229, 9, 20, 0.3);
}
.badge-quality:hover {
  background: rgba(229, 9, 20, 0.25);
  border-color: rgba(229, 9, 20, 0.5);
}
.badge-duration {
  background: rgba(255, 255, 255, 0.06);
  color: #ccc;
  border: 1px solid var(--glass-border);
}

.movie-title {
  font-size: var(--text-h1);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-4);
  font-family: var(--font-display), var(--font-display-fallback);
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--color-gold), var(--color-primary));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease-in-out infinite;
}
.movie-description {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  line-height: 1.8;
  margin-bottom: var(--space-8, 32px);
  font-weight: 400;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--space-8, 32px);
}
.action-btn {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background: var(--glass);
  color: var(--color-text);
  position: relative;
  overflow: hidden;
}
.action-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform 0.5s ease;
}
.action-btn:hover::before {
  transform: translateX(100%) skewX(-15deg);
}
.action-btn:active {
  transform: scale(0.95);
}
.action-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.action-btn i {
  font-size: 1.2rem;
  pointer-events: none;
  transition: transform 0.25s ease;
}
.action-btn:hover i {
  transform: scale(1.15);
}
.btn-save.saved {
  background: rgba(229, 9, 20, 0.2);
  border-color: rgba(229, 9, 20, 0.5);
  color: var(--color-primary);
  box-shadow: 0 0 24px rgba(229, 9, 20, 0.2);
}
.btn-save:hover {
  border-color: rgba(229, 9, 20, 0.5);
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.25);
  transform: translateY(-2px);
}
.btn-save.saved:hover {
  background: rgba(229, 9, 20, 0.3);
  box-shadow: 0 8px 28px rgba(229, 9, 20, 0.35);
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  background: rgba(24, 24, 37, 0.92);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  color: var(--color-text);
  padding: 14px 24px;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: 700;
  border: 1px solid var(--glass-border);
  z-index: var(--z-toast);
  transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 90vw;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
}
.toast-icon {
  font-size: 1.1rem;
}
.toast-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.skeleton-loader {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: var(--z-loader);
  display: flex;
  flex-direction: column;
}
.skeleton-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.6s ease,
    visibility 0.6s ease;
}
.sk-anim {
  background: linear-gradient(
    90deg,
    var(--color-surface) 25%,
    var(--color-surface-2) 50%,
    var(--color-surface) 75%
  );
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 10px;
}
@keyframes shimmer {
  to {
    background-position: -400% 0;
  }
}
@keyframes gradient-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
.container {
  width: 100%;
}

.sk-video-placeholder {
  width: 100%;
  padding-bottom: 56.25%;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-2) 100%);
  position: relative;
  overflow: hidden;
}
.sk-video-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite linear;
}
.sk-content {
  padding: 24px clamp(16px, 4vw, 32px);
  max-width: 800px;
  margin: 0 auto;
}
.sk-title {
  width: 140px;
  height: 28px;
  margin-bottom: 20px;
  border-radius: 8px;
}
.sk-subtitle {
  width: 85%;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 8px;
}
.sk-subtitle-2 {
  width: 60%;
  height: 36px;
  margin-bottom: 24px;
  border-radius: 8px;
}
.sk-desc {
  width: 100%;
  height: 120px;
  border-radius: 16px;
}

.frame-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 3;
  color: var(--color-text-muted);
  gap: 12px;
  padding: 20px;
  text-align: center;
  font-size: var(--text-base);
}
.frame-error i {
  font-size: 3rem;
  color: var(--color-primary);
  animation: shake 0.5s ease;
}
@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
.icon-muted {
  font-size: 1.5rem;
  color: var(--color-text-muted);
}

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  padding: 40px 20px;
}
.error-page i {
  font-size: 5rem;
  color: var(--color-surface-3);
  margin-bottom: 24px;
}
.error-page h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  font-weight: 800;
}
.error-page p {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  font-size: var(--text-base);
}
.error-page .e-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin: 4px;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.3);
}
.error-page .e-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.4);
}
.error-page .e-btn-sec {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.error-page .e-btn-sec:hover {
  background: var(--color-surface-2);
  border-color: var(--color-border-hover);
  transform: translateY(-2px);
}
.rating-section {
  margin-bottom: var(--space-8, 32px);
}
.rating-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 10px;
  font-weight: 600;
}
.stars {
  display: flex;
  gap: 6px;
}
.star-btn {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--color-surface-3, #222235);
  transition:
    color 0.15s,
    transform 0.15s;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}
.star-btn svg {
  width: 28px;
  height: 28px;
  display: block;
  fill: var(--color-surface-3, #222235);
  transition: fill 0.15s;
}
.star-btn:hover svg,
.star-btn.filled svg {
  fill: var(--color-gold, #fbbf24);
}
.star-btn:hover,
.star-btn.filled {
  color: var(--color-gold, #fbbf24);
}
.star-btn:active {
  transform: scale(0.85);
}
.rating-info {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 8px;
}
.related-section {
  padding: 0 clamp(16px, 4vw, 32px) 32px;
}
.related-title {
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.related-title i {
  color: var(--color-primary);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.related-card {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  border-color: rgba(229, 9, 20, 0.2);
}
.related-thumb {
  position: relative;
  padding-bottom: 150%;
  background: var(--color-surface-2);
  overflow: hidden;
}
.related-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.related-card:hover .related-thumb img {
  transform: scale(1.08);
}
.related-no-img {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 28px;
}
.related-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}
.related-info {
  padding: 8px 10px;
}
.related-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-year {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

@media (max-width: 480px) {
  .player-wrapper {
    border-radius: 0;
    box-shadow: none;
  }
  .player-container {
    border-radius: 0;
  }
  .content {
    padding: var(--space-4) clamp(10px, 3vw, 20px) 100px;
  }
  .movie-title {
    font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  }
  .movie-description {
    font-size: var(--text-sm);
    line-height: 1.7;
  }
  .badges {
    gap: 6px;
  }
  .badge {
    padding: 4px 10px;
    font-size: 10px;
  }
  .actions {
    flex-direction: column;
    gap: 10px;
  }
  .action-btn {
    min-width: 100%;
    padding: 14px;
    font-size: var(--text-sm);
  }
  .action-btn i {
    font-size: 1.1rem;
  }
  .rating-section {
    margin-bottom: 28px;
  }
  .star-btn svg {
    width: 24px;
    height: 24px;
  }
  .star-btn {
    font-size: 1.3rem;
  }
  .related-section {
    padding: 0 clamp(10px, 3vw, 20px) 24px;
  }
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .related-name {
    font-size: 11px;
  }
  .related-year {
    font-size: 9px;
  }
  .header {
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .header-logo {
    height: 24px;
  }
  .header-title {
    font-size: var(--text-base);
  }
  .error-page {
    padding: 30px 16px;
  }
  .error-page i {
    font-size: 3.5rem;
  }
  .error-page h2 {
    font-size: 1.2rem;
  }
}

@media (min-width: 481px) and (max-width: 767px) {
  .content {
    max-width: 600px;
    margin: 0 auto;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .player-wrapper {
    border-radius: var(--radius-md);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .content {
    max-width: 700px;
    margin: 0 auto;
  }
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .movie-title {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
  }
}

@media (min-width: 1200px) {
  .content {
    max-width: 800px;
  }
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .player-wrapper {
    border-radius: var(--radius-lg);
  }
}

@media (min-width: 1600px) {
  .content {
    max-width: 900px;
  }
  .related-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (hover: hover) {
  .related-card:hover {
    transform: translateY(-4px);
  }
}

@media (hover: none) {
  .related-card:active {
    transform: scale(0.97);
    border-color: rgba(229, 9, 20, 0.2);
  }
  .action-btn:active {
    transform: scale(0.96);
  }
  .star-btn:active {
    transform: scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .movie-title {
    animation: none;
  }
  .related-thumb img {
    transition: none;
  }
  .action-btn {
    transition: none;
  }
}

@media (max-width: 380px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .badge {
    padding: 3px 8px;
    font-size: 9px;
  }
}

/* Comments Section */
.comments-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.comments-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.comment-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.comment-form {
  margin-bottom: 1.5rem;
}

.comment-input-wrap {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: border-color 0.3s ease;
}

.comment-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-glow);
}

#commentInput {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  resize: vertical;
  min-height: 60px;
  outline: none;
}

#commentInput::placeholder {
  color: var(--color-text-muted);
}

.comment-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--glass-border);
}

.spoiler-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.char-counter {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  flex-grow: 1;
  text-align: right;
  margin-right: 12px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.comment-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #800020);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.comment-body {
  flex-grow: 1;
  min-width: 0;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.comment-content-wrap {
  position: relative;
  margin-bottom: 8px;
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  word-wrap: break-word;
  white-space: pre-wrap;
  transition: filter 0.3s ease;
}

.spoiler-blur {
  filter: blur(6px);
  cursor: pointer;
  user-select: none;
}

.spoiler-reveal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--color-border);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(4px);
}

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

.like-btn, .delete-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
}

.like-btn:hover {
  color: #ff4b4b;
  background: rgba(255, 75, 75, 0.1);
}

.like-btn.liked {
  color: #ff4b4b;
}

.like-btn.liked i {
  animation: pulse 0.3s ease-in-out;
}

.delete-btn:hover {
  color: #ff4b4b;
  background: rgba(255, 75, 75, 0.1);
}

.serial-track-form {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  animation: slideDown 0.3s ease;
}

.serial-track-form h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--color-text);
}

.serial-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.serial-inputs label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.s-input {
  width: 60px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  outline: none;
}

.s-input:focus {
  border-color: var(--color-primary);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .comments-section {
    padding: 1rem;
    margin-top: 1.5rem;
  }
  .comment-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .comment-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
}

/* ==================== QR LOGIN ==================== */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.qr-modal[hidden] {
  display: none;
}
.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 8, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: qrFadeIn 0.25s var(--ease-out, ease-out) both;
}
.qr-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #15151f 0%, #0d0d15 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow: 0 8px 8px rgba(0, 0, 0, 0.5);
  padding: 32px 28px 26px;
  text-align: center;
  animation: qrPop 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
.qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-muted);
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.qr-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text);
  transform: rotate(90deg);
}
.qr-view {
  animation: qrFadeIn 0.25s ease-out both;
}
.qr-icon-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 1.7rem;
}
.qr-lock {
  background: linear-gradient(135deg, #e50914, #7a050b);
  color: #fff;
  box-shadow: 0 10px 30px rgba(229, 9, 20, 0.35);
}
.qr-error {
  background: rgba(255, 152, 0, 0.12);
  color: #ff9800;
  box-shadow: 0 10px 30px rgba(255, 152, 0, 0.15);
}
.qr-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.qr-sub {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: 18px;
  line-height: 1.5;
}
.qr-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qr-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
}
.qr-features i {
  color: var(--color-primary);
  font-size: 0.95rem;
  flex-shrink: 0;
}
.qr-cta {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.35);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.qr-cta:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(229, 9, 20, 0.45);
}
.qr-cta:active {
  transform: scale(0.97);
}
.qr-hint {
  margin-top: 14px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.qr-scan-wrap {
  position: relative;
  width: 224px;
  height: 224px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-scan-ring {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  background: conic-gradient(from 0deg, rgba(229, 9, 20, 0), rgba(229, 9, 20, 0.55), rgba(229, 9, 20, 0));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: qrSpin 3.2s linear infinite;
}
.qr-image {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  object-fit: contain;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  animation: qrPop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
.qr-scan-line {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(229, 9, 20, 0.8);
  animation: qrScan 2s ease-in-out infinite;
}
.qr-steps {
  margin: 14px 0 18px;
  display: grid;
  gap: 10px;
  text-align: left;
}
.qr-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-sm);
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
}
.qr-step-num {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.qr-step b {
  color: #ff1a27;
}
.qr-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: 14px;
}
.qr-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: qrSpin 0.8s linear infinite;
}
.qr-link-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.qr-link-btn:hover {
  color: var(--color-text);
}
.qr-success-check {
  width: 72px;
  height: 72px;
  margin: 6px auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  font-size: 2.2rem;
  box-shadow: 0 12px 36px rgba(34, 197, 94, 0.4);
  animation: qrSuccess 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) both;
}
.qr-modal-open {
  overflow: hidden;
}

/* Guest strip */
.guest-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 4px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(229, 9, 20, 0.12), rgba(229, 9, 20, 0.04));
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: 16px;
  animation: slideDown 0.3s ease-out both;
}
.guest-strip-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(229, 9, 20, 0.15);
  color: var(--color-primary);
  font-size: 1.2rem;
}
.guest-strip-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.guest-strip-text b {
  font-size: var(--text-sm);
}
.guest-strip-text span {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.guest-strip-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(229, 9, 20, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.guest-strip-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}
.guest-strip-btn:active {
  transform: scale(0.96);
}

@keyframes qrFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes qrPop {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes qrSpin {
  to { transform: rotate(360deg); }
}
@keyframes qrScan {
  0% { top: 8px; }
  50% { top: 210px; }
  100% { top: 8px; }
}
@keyframes qrSuccess {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
  .qr-card {
    max-width: 340px;
    padding: 26px 20px 22px;
  }
  .qr-scan-wrap {
    width: 200px;
    height: 200px;
  }
  .qr-image {
    width: 178px;
    height: 178px;
  }
  @keyframes qrScan {
    0% { top: 8px; }
    50% { top: 186px; }
    100% { top: 8px; }
  }
  .qr-features {
    grid-template-columns: 1fr;
  }
}

.watch-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 24px) 40px;
}

.watch-primary {
  min-width: 0;
}

.watch-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.player-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.quality-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.quality-tab {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.quality-tab:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

.quality-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}

.player-container {
  position: absolute;
  inset: 0;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.related-section {
  margin-top: 16px;
}

.related-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.related-card:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-1px);
}

.related-thumb {
  position: relative;
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
  font-size: 24px;
}

.related-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.related-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.related-name {
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-year {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.empty-related {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

@media (max-width: 960px) {
  .watch-layout {
    grid-template-columns: 1fr;
  }

  .watch-sidebar {
    position: static;
    max-height: none;
  }

  .related-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .related-list {
    grid-template-columns: 1fr;
  }

  .related-thumb {
    width: 100px;
    min-width: 100px;
  }
}
