/* dev4-66675: bigbet 시안 이식 (BIGBET / bigb111.com 참고)
 * body[data-yt-theme="1"] 하에 taegeuk 오버레이 위에 덮어씀 */

:root {
  --bb-bg-dark: #0f1319;
  --bb-bg-mid: #161b1f;
  --bb-bg-card: #1e242b;
  --bb-bg-header: #10151b;
  --bb-yellow: #f5c342;
  --bb-yellow-hi: #ffd45f;
  --bb-red: #d24747;
  --bb-red-hi: #e53e3e;
  --bb-text: #ffffff;
  --bb-text-mid: #b8bcc4;
  --bb-border: rgba(255, 255, 255, 0.08);
}

/* ============ 전체 배경 ============ */
body[data-yt-theme="1"] {
  background: var(--bb-bg-dark) !important;
  color: var(--bb-text) !important;
}
body[data-yt-theme="1"] .wrapper { background: transparent !important; }
body[data-yt-theme="1"] .wrapper::before { display: none !important; }

/* ============ 헤더 ============ */
body[data-yt-theme="1"] .yt-header {
  background: var(--bb-bg-header) !important;
  border-bottom: 1px solid var(--bb-border) !important;
  height: 72px !important;
}
body[data-yt-theme="1"] .yt-header-logo img {
  width: 130px !important;
  max-height: 48px !important;
  filter: none !important;
}
body[data-yt-theme="1"] .yt-header-search {
  display: none !important;
}
body[data-yt-theme="1"] .yt-btn-login {
  background: var(--bb-red) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 6px !important;
  height: 40px !important;
  padding: 0 20px !important;
  font-weight: 700 !important;
}
body[data-yt-theme="1"] .yt-btn-login:hover { background: var(--bb-red-hi) !important; }
body[data-yt-theme="1"] .yt-btn-outline {
  background: transparent !important;
  border: 1px solid var(--bb-yellow) !important;
  color: var(--bb-yellow) !important;
  border-radius: 6px !important;
  height: 40px !important;
  padding: 0 20px !important;
}

/* ============ 사이드바 감춤 (bigbet은 상단 네비 방식) ============ */
body[data-yt-theme="1"] .yt-sidebar { display: none !important; }
body[data-yt-theme="1"] .wrapper { padding-left: 0 !important; padding-top: 72px !important; }

/* ============ 상단 네비바 (header 아래) ============ */
body[data-yt-theme="1"] .bb-topnav {
  position: fixed;
  top: 72px; left: 0; right: 0;
  height: 44px;
  background: var(--bb-bg-header);
  border-bottom: 1px solid var(--bb-border);
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 32px;
}
body[data-yt-theme="1"] .bb-topnav a {
  color: var(--bb-text-mid);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  padding: 0 8px;
  transition: color 0.15s;
}
body[data-yt-theme="1"] .bb-topnav a:hover,
body[data-yt-theme="1"] .bb-topnav a.active { color: var(--bb-text); }
body[data-yt-theme="1"] .bb-topnav a .bb-new {
  position: absolute; top: -8px; right: -10px;
  background: var(--bb-red); color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 2px;
}

/* #85491 - 모바일 뷰포트에서 상단 카테고리 네비(bb-topnav)가 항목 개수만큼 넓어져
   페이지 전체가 가로 스크롤되던 문제 수정: 네비 자체만 가로 스크롤되도록 격리 */
@media (max-width: 768px) {
  body[data-yt-theme="1"] .bb-topnav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px;
    gap: 20px;
    scrollbar-width: none;
  }
  body[data-yt-theme="1"] .bb-topnav::-webkit-scrollbar { display: none; }
  body[data-yt-theme="1"] .bb-topnav a { flex-shrink: 0; }
}
body[data-yt-theme="1"] .wrapper { padding-top: 116px !important; }

/* ============ 히어로 배너 ============ */
body[data-yt-theme="1"] .bb-hero {
  max-width: 1400px;
  margin: 24px auto 32px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 3.6/1;
  background: var(--bb-bg-card);
}
body[data-yt-theme="1"] .bb-hero img { width: 100%; height: 100%; object-fit: cover; }
body[data-yt-theme="1"] .bb-hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none;
}
body[data-yt-theme="1"] .bb-hero-nav.prev { left: 16px; }
body[data-yt-theme="1"] .bb-hero-nav.next { right: 16px; }

/* ============ 카테고리 카드 그리드 ============ */
body[data-yt-theme="1"] .bb-cats {
  max-width: 1400px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 0 32px;
}
body[data-yt-theme="1"] .bb-cat {
  background: var(--bb-bg-card);
  border-radius: 12px;
  padding: 28px 20px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--bb-text); text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 120px;
}
body[data-yt-theme="1"] .bb-cat:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245, 195, 66, 0.15);
}
body[data-yt-theme="1"] .bb-cat .bb-cat-label { font-size: 17px; font-weight: 700; line-height: 1.3; white-space: pre-line; }
body[data-yt-theme="1"] .bb-cat .bb-cat-icon { width: 76px; height: 76px; object-fit: contain; }

/* #85491 - 모바일에서 5열 카테고리 그리드가 아이콘+라벨 최소 너비 때문에
   컨테이너 밖으로 넘쳐 페이지 가로 스크롤을 유발하던 문제 수정 */
@media (max-width: 768px) {
  body[data-yt-theme="1"] .bb-cats {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
    gap: 12px;
  }
  body[data-yt-theme="1"] .bb-cat {
    min-width: 0;
    padding: 16px 14px;
    min-height: auto;
  }
  body[data-yt-theme="1"] .bb-cat .bb-cat-label { font-size: 14px; min-width: 0; }
  body[data-yt-theme="1"] .bb-cat .bb-cat-icon { width: 48px; height: 48px; flex-shrink: 0; }
}

/* #85491 - 모바일에서 5열(About/Help/Statistics/Regulation/LANGUAGE) 푸터 링크 그리드가
   inline style(grid-template-columns:repeat(4,1fr) auto)로 인해 넘치던 문제 수정 */
@media (max-width: 768px) {
  body[data-yt-theme="1"] footer.bb-shown > div[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px 16px !important;
  }
}

/* ============ 프리미어리그 매치 카드 (프리매치) ============ */
body[data-yt-theme="1"] .bb-matches {
  max-width: 1400px;
  margin: 0 auto 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  padding: 0 32px;
}
body[data-yt-theme="1"] .bb-match {
  background: var(--bb-bg-card);
  border-radius: 8px;
  padding: 16px;
}
body[data-yt-theme="1"] .bb-match-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--bb-text-mid); margin-bottom: 8px; }
body[data-yt-theme="1"] .bb-match-teams { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
body[data-yt-theme="1"] .bb-match-vs { color: var(--bb-text-mid); font-weight: 700; }
body[data-yt-theme="1"] .bb-match-odds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
body[data-yt-theme="1"] .bb-odd {
  background: var(--bb-bg-mid);
  border-radius: 4px; padding: 10px 0;
  text-align: center; color: var(--bb-yellow); font-weight: 700; font-size: 15px;
  border: 1px solid transparent;
}
body[data-yt-theme="1"] .bb-odd:hover { border-color: var(--bb-yellow); }

/* ============ 섹션 헤더 ============ */
body[data-yt-theme="1"] .bb-section {
  max-width: 1400px;
  margin: 0 auto 40px;
  padding: 32px 32px 24px;
  background: var(--bb-bg-mid);
  border-radius: 12px;
}
body[data-yt-theme="1"] .bb-section-head {
  text-align: center;
  margin-bottom: 24px;
}
body[data-yt-theme="1"] .bb-section-cat {
  color: var(--bb-yellow); font-size: 13px; font-weight: 600; letter-spacing: 3px;
}
body[data-yt-theme="1"] .bb-section-title { color: var(--bb-text); font-size: 22px; font-weight: 700; margin-top: 4px; }
body[data-yt-theme="1"] .bb-section-more {
  position: absolute; right: 32px; top: 32px;
  color: var(--bb-text-mid); font-size: 13px; text-decoration: none;
}

/* ============ 라이브카지노 로비 (2열) ============ */
body[data-yt-theme="1"] .bb-lobby-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
body[data-yt-theme="1"] .bb-lobby-card {
  aspect-ratio: 3.3/1; border-radius: 8px; overflow: hidden; background: #0d1013;
}
body[data-yt-theme="1"] .bb-lobby-card img { width: 100%; height: 100%; object-fit: cover; }

/* ============ 슬롯 그리드 (5열) ============ */
body[data-yt-theme="1"] .bb-slot-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
body[data-yt-theme="1"] .bb-slot-card {
  aspect-ratio: 3/2; border-radius: 8px; overflow: hidden; background: #0d1013; position: relative;
}
body[data-yt-theme="1"] .bb-slot-card img { width: 100%; height: 100%; object-fit: cover; }
body[data-yt-theme="1"] .bb-slot-tag {
  position: absolute; top: 6px; right: 6px;
  background: var(--bb-red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px;
}

/* ============ 폰트 ============ */
body[data-yt-theme="1"] * { font-family: "Noto Sans KR", "Noto Sans JP", -apple-system, sans-serif !important; }

/* 원 taegeuk 요소 감춤 (홈에서 bigbet 재구성) */
body[data-yt-theme="1"] .visual-section,
body[data-yt-theme="1"] .toggle-section,
body[data-yt-theme="1"] .realtime-section,
body[data-yt-theme="1"] .board-section,
body[data-yt-theme="1"] .jackpot-section,
body[data-yt-theme="1"] .footer-section,
body[data-yt-theme="1"] .header-section,
body[data-yt-theme="1"] .header-main,
body[data-yt-theme="1"] .header-menu,
body[data-yt-theme="1"] .popup-wrapper,
body[data-yt-theme="1"] .modal-wrapper,
body[data-yt-theme="1"] .mobile-menu,
body[data-yt-theme="1"] .sn-overlay,
body[data-yt-theme="1"] .submit-overlay,
body[data-yt-theme="1"] .content-section,
body[data-yt-theme="1"] main.page-content > *:not(.bb-shown),
body[data-yt-theme="1"] section:not([class*="bb-"]):not(.bb-shown) { display: none !important; }
body[data-yt-theme="1"] .bb-shown { display: block !important; }
body[data-yt-theme="1"] nav.bb-topnav.bb-shown { display: flex !important; }
body[data-yt-theme="1"] .bb-cats.bb-shown { display: grid !important; }
body[data-yt-theme="1"] .garden-theme-wrapper { background: var(--bb-bg-dark) !important; min-height: 100vh; }
