:root {
  --bg-primary: #0a0b0e;
  --bg-secondary: #12151b;
  --bg-card: #161a22;
  --bg-card-hover: #1e2430;
  --bg-glass: rgba(18, 21, 27, 0.75);
  --accent-gold: #f5c518;
  --accent-gold-glow: rgba(245, 197, 24, 0.35);
  --accent-red: #e50914;
  --accent-red-glow: rgba(229, 9, 20, 0.4);
  --text-main: #f0f2f5;
  --text-muted: #9ba1ad;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(245, 197, 24, 0.3);
  --font-title: 'Cinzel', serif;
  --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Distinct Category Palettes */
  --badge-rose-color: #c084fc;
  --badge-rose-bg: rgba(192, 132, 252, 0.16);
  --badge-rose-border: rgba(192, 132, 252, 0.45);

  --badge-horror-color: #f87171;
  --badge-horror-bg: rgba(248, 113, 113, 0.16);
  --badge-horror-border: rgba(248, 113, 113, 0.45);

  --badge-music-color: #38bdf8;
  --badge-music-bg: rgba(56, 189, 248, 0.16);
  --badge-music-border: rgba(56, 189, 248, 0.45);

  --badge-fantasy-color: #34d399;
  --badge-fantasy-bg: rgba(52, 211, 153, 0.16);
  --badge-fantasy-border: rgba(52, 211, 153, 0.45);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 네비게이션 바 */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 11, 14, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  color: var(--accent-gold);
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px rgba(245, 197, 24, 0.6));
}

.brand-text {
  font-family: var(--font-title);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.brand-text em {
  color: var(--accent-gold);
  font-style: normal;
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.2rem 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: #000;
  background: var(--accent-gold);
  font-weight: 700;
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.4);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  padding: 0.55rem 2rem 0.55rem 2.4rem;
  border-radius: 20px;
  outline: none;
  width: 220px;
  transition: var(--transition);
}

.search-box input:focus {
  width: 270px;
  border-color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 10px rgba(245, 197, 24, 0.25);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.btn-yt {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  border-radius: 20px;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-yt:hover {
  background: #f40612;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

/* 히어로 스포트라이트 */
.hero-spotlight {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  padding: 4.5rem 2rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.6) contrast(1.15);
  transform: scale(1.02);
  transition: transform 3s ease-out, background-image 0.5s ease-in-out;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(10, 11, 14, 0.2) 0%, rgba(10, 11, 14, 0.75) 60%, var(--bg-primary) 100%),
              linear-gradient(90deg, rgba(10, 11, 14, 0.92) 0%, rgba(10, 11, 14, 0.5) 60%, transparent 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.badge-accent {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(245, 197, 24, 0.3);
}

.hero-title {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  text-shadow: 0 4px 25px rgba(0, 0, 0, 0.85);
}

.hero-quote {
  font-size: 1.15rem;
  color: #e0e4ec;
  font-weight: 400;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hero-synopsis {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 680px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  gap: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: #000;
}

.btn-primary:hover {
  background: #ffdb4d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 197, 24, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

/* 컨텐츠 영역 */
.content-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.result-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
}

.result-count span {
  color: var(--accent-gold);
  font-weight: 700;
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.sort-controls select {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.sort-controls select:focus {
  border-color: var(--accent-gold);
}

/* =========================================================================
   카테고리 뱃지 시스템 (Category Badge Classes)
   ========================================================================= */
.category-badge,
.card-category {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  border-radius: 6px;
  letter-spacing: 0.4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  transition: var(--transition);
}

.badge-rose {
  color: var(--badge-rose-color);
  background: var(--badge-rose-bg);
  border: 1px solid var(--badge-rose-border);
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.25);
}

.badge-horror {
  color: var(--badge-horror-color);
  background: var(--badge-horror-bg);
  border: 1px solid var(--badge-horror-border);
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.25);
}

.badge-music,
.badge-mv {
  color: var(--badge-music-color);
  background: var(--badge-music-bg);
  border: 1px solid var(--badge-music-border);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.badge-fantasy {
  color: var(--badge-fantasy-color);
  background: var(--badge-fantasy-bg);
  border: 1px solid var(--badge-fantasy-border);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

/* =========================================================================
   가로 카테고리 레일 슬라이더 (Horizontal Rails)
   ========================================================================= */
.rails-container {
  display: flex;
  flex-direction: column;
  gap: 3.2rem;
}

.rail-section {
  position: relative;
  margin-bottom: 1rem;
}

.rail-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.2rem;
  padding: 0 0.5rem;
}

.rail-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rail-title {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.rail-count-badge {
  font-size: 0.8rem;
  color: var(--accent-gold);
  background: rgba(245, 197, 24, 0.12);
  border: 1px solid rgba(245, 197, 24, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 700;
}

.rail-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.rail-track {
  display: flex;
  gap: 1.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1rem 0.5rem 1.6rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.rail-track::-webkit-scrollbar {
  display: none;
}

.rail-track .video-card {
  flex: 0 0 295px;
  scroll-snap-align: start;
}

/* 레일 네비게이션 버튼 (Chevrons) */
.rail-btn,
.rail-btn-prev,
.rail-btn-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 84px;
  background: rgba(10, 11, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  border-radius: 6px;
  transition: var(--transition);
  opacity: 0;
  line-height: 1;
  user-select: none;
}

.rail-wrapper:hover .rail-btn-prev,
.rail-wrapper:hover .rail-btn-next {
  opacity: 1;
}

.rail-btn-prev {
  left: 0;
}

.rail-btn-next {
  right: 0;
}

.rail-btn-prev:hover,
.rail-btn-next:hover {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.5);
}

/* =========================================================================
   비디오 카드 및 OTT 호버 애니메이션
   ========================================================================= */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.8rem;
}

.video-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease;
  position: relative;
  will-change: transform;
  outline: none;
}

.video-card:hover,
.video-card:focus-visible {
  transform: scale(1.06) translateY(-4px);
  z-index: 8;
  border-color: var(--border-glow);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85),
              0 0 20px rgba(245, 197, 24, 0.18);
  background: var(--bg-card-hover);
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.thumb-wrap img,
.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.video-card:hover .thumb-wrap img,
.video-card:hover .card-thumbnail {
  transform: scale(1.08);
}

.thumb-overlay,
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.video-card:hover .thumb-overlay,
.video-card:hover .card-overlay {
  opacity: 1;
}

.play-icon-badge {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent-gold);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.6);
  transform: scale(0.85);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-card:hover .play-icon-badge {
  transform: scale(1);
}

.card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.card-body {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =========================================================================
   시네마 극장 모달 플레이어 (High-Fidelity Cinema Modal)
   ========================================================================= */
.theater-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.theater-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.theater-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.theater-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(245, 197, 24, 0.2);
  overflow: hidden;
  animation: modalUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalUp {
  from { transform: scale(0.95) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.theater-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  transition: var(--transition);
}

.theater-close:hover {
  background: var(--accent-red);
  transform: rotate(90deg);
}

/* 모달 좌우 플레이리스트 이동 버튼 */
.theater-nav-btn {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  width: 44px;
  height: 64px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  border-radius: 6px;
  transition: var(--transition);
  line-height: 1;
  user-select: none;
}

.theater-prev-btn {
  left: 12px;
}

.theater-next-btn {
  right: 12px;
}

.theater-nav-btn:hover {
  background: var(--accent-gold);
  color: #000;
  border-color: var(--accent-gold);
  box-shadow: 0 0 18px rgba(245, 197, 24, 0.5);
}

.video-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-responsive iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.theater-info {
  padding: 1.5rem 2rem 2rem;
}

.theater-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
}

.theater-cat {
  display: inline-block;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.theater-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.btn-yt-small {
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 20px;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-yt-small:hover {
  background: #f40612;
}

.theater-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 푸터 */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  max-width: 1440px;
  margin: 1.5rem auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================================================
   반응형 미디어 쿼리 (Responsive Styles)
   ========================================================================= */
@media (max-width: 900px) {
  .nav-menu {
    max-width: 100%;
    padding: 0.4rem 0;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .hero-spotlight {
    min-height: 420px;
    padding: 2.5rem 1.5rem;
  }
  .rail-btn-prev,
  .rail-btn-next {
    opacity: 0.85;
    width: 36px;
    height: 64px;
    font-size: 1.6rem;
  }
}

@media (max-width: 600px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  .rail-track .video-card {
    flex: 0 0 260px;
  }
  .search-box input {
    width: 140px;
  }
  .search-box input:focus {
    width: 180px;
  }
  .hero-buttons {
    flex-direction: column;
  }
  .theater-info {
    padding: 1.2rem;
  }
  .theater-title {
    font-size: 1.1rem;
  }
  .theater-nav-btn {
    width: 36px;
    height: 48px;
    font-size: 1.6rem;
  }
}
