/* =========================================
   기본 변수 및 초기화
   ========================================= */
:root {
  --bg: #111;
  --card: #1c1c22;
  --accent: #e50914;
  --text: #eee;
  --muted: #8b8b96;
  --border: #2a2a33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Malgun Gothic", sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* =========================================
   헤더 (로고, 검색, 카테고리 탭)
   ========================================= */
.hd {
  background: #000;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
}

.hd-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.logo {
  font-weight: 800;
  color: var(--accent);
  font-size: 22px;
  white-space: nowrap;
}

/* =========================================
   한줄공지 (주마등 효과)
   ========================================= */
.header-notice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(229, 9, 20, 0.1);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #ff5b63;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  margin-right: auto;
  margin-left: 10px;
  max-width: 600px; /* PC에서 공지사항 최대 넓이 */
  overflow: hidden; /* 영역을 벗어나는 텍스트 숨김 */
}

.header-notice .notice-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.notice-scroll {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  display: flex;
}

.notice-scroll span {
  display: inline-block;
  padding-left: 100%; /* 시작점을 화면 오른쪽 밖으로 밀어냄 */
  animation: marquee 15s linear infinite; /* 15초 동안 무한 반복 */
}

/* 마우스 올리면 멈춤 */
.header-notice:hover .notice-scroll span {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* =========================================
   검색창
   ========================================= */
.search {
  flex: 1;
  display: flex;
  max-width: 500px;
  margin-left: auto;
}

.search input {
  flex: 1;
  background: #1c1c22;
  border: 1px solid #333;
  color: #eee;
  padding: 9px 14px;
  border-radius: 7px 0 0 7px;
  font-size: 14px;
}

.search button {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0 24px; 
  border-radius: 0 7px 7px 0;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
}

.cat-tabs {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  max-width: 1400px;
  margin: 0 auto;
  overflow-x: auto;
  border-top: 1px solid #1a1a1a;
}

.cat-tabs a {
  color: #bbb;
  padding: 12px 18px;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.cat-tabs a:hover { color: #fff; }
.cat-tabs a.active { color: #fff; border-bottom-color: var(--accent); font-weight: 600; }

/* =========================================
   배너 영역 (PC 3개, 모바일 1개 격자 배치)
   ========================================= */
.banners {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr); /* PC에서 한 줄에 3개 */
  padding: 16px 32px;
  max-width: 1400px;
  margin: 0 auto;
}

.banner {
  border-radius: 8px;
  overflow: hidden;
  display: block;
  width: 100%;
  transition: transform 0.2s;
}

.banner:hover {
  transform: translateY(-3px);
}

/* 배너 이미지: 89px 강제 찌그러짐 */
.banner img {
  display: block;
  width: 100%;
  height: 89px;
  object-fit: fill; 
  border-radius: 8px;
}

/* =========================================
   메인 콘텐츠 영역
   ========================================= */
main {
  padding: 30px 32px 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.page-title { font-size: 22px; margin: 0 0 20px; }
.page-title .cnt { color: var(--muted); font-size: 16px; font-weight: 400; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.result-info { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* =========================================
   필터 바
   ========================================= */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--card);
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group.grow { flex: 1; min-width: 180px; }
.filter-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

.filter-bar select, 
.filter-bar input[type=search] {
  background: #222;
  border: 1px solid #333;
  color: #eee;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  min-width: 110px;
}

.filter-bar input[type=search] { width: 100%; }

.filter-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 22px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
}

.filter-btn:hover { background: #ff1f2b; }
.filter-reset { color: var(--muted); font-size: 13px; align-self: center; }

/* =========================================
   섹션 헤더
   ========================================= */
.sec, .hero { margin-bottom: 40px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sec-head h1, .sec-head h2 { font-size: 18px; margin: 0; }
.sec-head .more { color: var(--muted); font-size: 13px; }
.sec-head .more:hover { color: var(--accent); }
.muted { color: var(--muted); font-size: 13px; }

/* =========================================
   [핵심] 그리드 및 카드 디자인
   ========================================= */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, 1fr);
  align-items: start;
}

.card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ★ 콘텐츠 카드 이미지: 높이 300px 강제 고정 */
.card img {
  width: 100%;
  height: 300px; 
  object-fit: cover; 
  object-position: center;
  display: block;
  background: linear-gradient(135deg, #1c1c22, #2a2a33);
}

.card .info {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 카드 제목 */
.card .t {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .t:hover { color: var(--accent); }

/* 주연 배우 */
.cast-line {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cast-line .cast-label { color: var(--accent); font-weight: 600; margin-right: 4px; }
.cast-line a { color: #bbb; }
.cast-line a:hover { color: #fff; text-decoration: underline; }

/* 연도 / 카테고리 / 조회수 */
.card .y {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

/* 맛보기 버튼 영역 */
.card-links {
  margin-top: auto;
  display: flex;
  gap: 6px;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ddd;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
  transition: all 0.2s;
}

.mini-btn.play {
  background: rgba(229, 9, 20, 0.15);
  color: #ff5b63;
  border: 1px solid rgba(229, 9, 20, 0.3);
}
.mini-btn.play:hover {
  background: var(--accent);
  color: #fff;
}

/* =========================================
   [추가] 24시간 이내 NEW 배지
   ========================================= */
.badge-new {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: rgba(229, 9, 20, 0.7);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 10;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* =========================================
   상세 및 재생 페이지
   ========================================= */
.play-page { padding: 24px 32px 60px; max-width: 1000px; margin: 0 auto; }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: #bbb; }
.breadcrumb a:hover { color: var(--accent); }

.play-head { display: flex; gap: 24px; margin-bottom: 24px; align-items: flex-start; }
.play-head img { width: 140px; border-radius: 8px; flex-shrink: 0; aspect-ratio: auto; height: auto; }
.play-head h1 { margin: 0 0 8px; font-size: 22px; }
.play-head .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.play-head .cast { font-size: 13px; color: #ccc; margin-bottom: 10px; }
.play-head .cast a { color: #7cc7ff; }
.play-head .synopsis { font-size: 13.5px; color: #bbb; line-height: 1.6; margin-bottom: 12px; }
.play-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.player-wrap iframe, .player-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.play-note { margin-top: 16px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* =========================================
   페이지네이션
   ========================================= */
.pager { display: flex; gap: 5px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager a, .pager .cur {
  padding: 7px 13px;
  border-radius: 5px;
  background: var(--card);
  font-size: 13px;
  border: 1px solid var(--border);
}
.pager a:hover { background: #2a2a33; color: #fff; }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* =========================================
   푸터
   ========================================= */
footer {
  padding: 32px;
  text-align: center;
  color: #666;
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
footer .small { color: #444; margin-top: 6px; }
footer a { color: #888; }
footer a:hover { color: var(--accent); }

/* =========================================
   반응형 (화면 크기에 따른 레이아웃 조정)
   ========================================= */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .hd-top { 
    padding: 12px 16px; 
    gap: 8px 10px; 
    flex-wrap: wrap; 
  }
  .logo {
    width: auto;
    flex: 0 0 auto;
    margin-bottom: 0;
    font-size: 20px;
  }
  .logo img { max-height: 26px; }
  
  /* 모바일 한줄공지: 로고 오른쪽에 나란히 */
  .header-notice {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    margin: 0;
    max-width: none;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
    border-radius: 999px;
  }
  .header-notice .notice-icon { font-size: 12px; }

  .search { 
    order: 3;
    flex: 1 1 100%;
    max-width: 100%; 
    width: 100%; 
    margin-left: 0;
    margin-top: 8px;
    display: flex;
    align-items: center;
    background: #1c1c22;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
  }
  .search input {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px;
    font-size: 14px;
  }
  .search button {
    border-radius: 0;
    padding: 0 20px;
    font-size: 14px;
    height: 100%;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
  }

  /* 모바일 배너: 한 줄에 1개씩 */
  .banners {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }
  
  .cat-tabs { padding: 0 16px; }
  main { padding: 20px 16px; }
  .play-page { padding: 16px; }
  .play-head { flex-direction: column; gap: 14px; }
  .play-head img { width: 110px; }
  .filter-bar { padding: 14px; }
}

@media (max-width: 768px) {
  .grid { 
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .card img { height: 200px; } /* 모바일에서는 이미지 높이 200px로 축소 */
  .card .info { padding: 10px; }
  .card .t { font-size: 13px; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card img { height: 160px; } /* 작은 모바일 화면에서는 160px로 축소 */
}