/* =========================================================
   common.css
   전 페이지 공통 리셋 / 변수 / 유틸리티
   ========================================================= */

/* Pretendard 폰트 - 외부 CDN 대신 /Content/Event/css/font 폴더에 내려받아 자체 호스팅 */
@font-face {
  font-family: "Pretendard";
  src: url("/Content/Event/css/font/Pretendard-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("/Content/Event/css/font/Pretendard-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("/Content/Event/css/font/Pretendard-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("/Content/Event/css/font/Pretendard-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Pretendard";
  src: url("/Content/Event/css/font/Pretendard-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-bg: #0a0a0f;
  --color-bg-alt: #14141c;
  --color-text: #ffffff;
  --color-text-inverse: #000000; /* 밝은 배경(버튼/입력창) 위에 올라가는 어두운 글자색 */
  --color-text-dim: #9a9aa5;
  --color-point: #ffd202; /* 포인트 컬러(골드/옐로) - 디자인 참고 반영 */
  --color-point-dark: #1a1a1a;
  --color-border: #2a2a35;
  --color-footer-bg: #1b1f27; /* 하단 바로가기(.quick-links) / 푸터 공용 배경 */

  --header-height: 96px;

  --font-base: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  word-break: keep-all;
  min-width: 360px;
  /* 고정 헤더 높이만큼 띄워서 본문이 헤더에 가리지 않도록 함
     (main 자체는 scale 되므로, scale 영향을 받지 않는 body 쪽에서 오프셋 처리) */
  padding-top: var(--header-height);
}

/* 모달이 열려있는 동안 배경 스크롤 차단 (js/common.js 에서 open/close 시 토글) */
body.modal-open {
  overflow: hidden;
}

/* ---------- 1920 고정 캔버스 ----------
   - 뷰포트 1920 이하: 1920 그대로 유지 (100%, 뷰포트가 좁으면 가로 스크롤바 발생)
   - 뷰포트 1920 초과: js/common.js 가 main 에 zoom 을 적용해 확대
   헤더는 main 밖에 있어 항상 원래 크기로 고정됩니다.

   transform:scale() 이 아니라 zoom 을 쓰는 이유: zoom 은 레이아웃 자체를
   확대하므로(문서가 차지하는 실제 높이/너비에 반영됨), main 뒤에 오는
   quick-links/footer 등의 형제 요소가 main 안에 들어있지 않아도
   확대된 만큼 자연스럽게 뒤따라옵니다. margin:0 인 이유는 main이
   항상 왼쪽 끝(x=0)에서부터 채워져야 zoom 배율과 맞물려 좌우 오차
   없이 정확히 들어맞기 때문입니다. */
main {
  width: 1920px;
  max-width: none;
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

.container {
  margin: 0 auto;
  padding: 0 40px;
}

/* 메인/영상(/이벤트) 클릭 이동 시, 고정 헤더 높이만큼 여백을 두고 멈추도록 함
   (scrollIntoView 가 이 값을 자동으로 계산해 헤더에 가리지 않게 스크롤함)
   index.html / en.html 공용 */
[data-section] {
  scroll-margin-top: var(--header-height);
}

/* ---------- 사이드 섹션 네비게이션 (index.html / en.html 공용) ---------- */
.side-nav {
  position: fixed;
  right: 0;
  top: 50%;
  width:110px;
  height:360px;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items:center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  border-top-left-radius: 30px;
  border-bottom-left-radius: 30px;
}

.side-nav button {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.side-nav button.is-active {
  color: var(--color-point);
  border-bottom-color: var(--color-point);
}

/* ---------- 영상 재생 버튼 / 유튜브 임베드 (index.html / en.html 공용) ---------- */
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 4px solid var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 66px;
  color: var(--color-text);
}

/* 유튜브 재생 버튼 클릭 시 placeholder 위에 덮어씌워지는 영상 iframe */
.video-frame-wrap {
  position: absolute;
  inset: 0;
}

.video-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 디자인 적용 전 콘텐츠 자리표시자 공통 스타일 */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    #1c1c26,
    #1c1c26 10px,
    #22222e 10px,
    #22222e 20px
  );
  border: 1px dashed var(--color-border);
  color: var(--color-text-dim);
  font-size: 14px;
  text-align: center;
  padding: 0;
}

.placeholder img {
  display: block;
  width: 100%;
  height: auto;
}

/* 실제 이미지가 들어오면 자리표시자 박스가 이미지 크기에 맞춰
   자동으로 커지거나 작아지도록 자리표시자 전용 스타일을 해제 */
.placeholder:has(img) {
  display: block;
  background: none;
  border: none;
  padding: 0;
  min-height: 0;
  height: auto;
}

/* 공통 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  transition: opacity 0.2s ease;
}

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

.modal-box .btn-primary {
  width:361px;
  height:67px;
  background:url('/Content/Event/images/btn_popup.png') 0 0 no-repeat;
  font-size: 36px;
  color: var(--color-text-inverse);
}
@media (min-width: 769px) {
  .modal-box .btn-primary:hover {
    background-image:url('/Content/Event/images/btn_popup_on.png');
    color:#4e2901;
  }
}

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

/* CTA 버튼 (회원가입/다운로드형 - 실제로는 배경 이미지 버튼이라 아래 속성 대부분은
   .btn-cta-join/.btn-cta-down 같은 하위 클래스에서 덮어씁니다) */
.btn-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 28px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 800;
  color: #1a1200;
  flex: 1;
}

.btn-cta-join {
  width:712px;
  height:132px;
  background:url('/Content/Event/images/btn_join.png') 0 0 no-repeat;
  flex: none;
  padding:0;
  color:transparent;
}
@media (min-width: 769px) {
  .btn-cta-join:hover {
    background-image:url('/Content/Event/images/btn_join_on.png');
  }
}

.btn-cta-down {
  width:712px;
  height:132px;
  background:url('/Content/Event/images/btn_down.png') 0 0 no-repeat;
  flex: none;
  padding:0;
  color:transparent;
}
@media (min-width: 769px) {
  .btn-cta-down:hover {
    background-image:url('/Content/Event/images/btn_down_on.png');
  }
}

/* 풀폭 블록형 탭 (영상탭 / 이벤트탭 공용) */
.tab-bar {
  display: flex;
  width: 100%;
  border-bottom: 2px solid var(--color-point);
}

.tab-bar button {
  flex: 1;
  height: 100px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101012;
  color: var(--color-text);
  font-size: 35px;
  font-weight: 700;
  text-align: center;
  border-right: 2px solid var(--color-point);
}

.tab-bar button:last-child {
  border-right: none;
}

.tab-bar button.is-active {
  background: var(--color-point);
  color: var(--color-point-dark);
}

/* 공통 헤더 (한국어 페이지 전용 - index.html / sub/event0X.html 공유) */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  z-index: 1000;
  background: #03060a;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.site-header .logo img {
  height: 50px;
}

.gnb {
  display: flex;
  align-items: center;
  gap: 32px;
}

.gnb a,
.gnb button {
  font-size: 15px;
  font-weight: 600;
  color:transparent;
}
.gnb .homepage {
  width:194px;
  height:53px;
  background:url('/Content/Event/images/btn_homepage.png') 0 0 no-repeat;
  background-size: contain;
}
.gnb .login {
  width:192px;
  height:51px;
  background:url('/Content/Event/images/btn_login.png') 0 0 no-repeat;
  background-size: contain;
}

@media (min-width: 769px) {
  .gnb .homepage:hover {
    background-image:url('/Content/Event/images/btn_homepage_on.png');
    background-size: contain;
  }
  .gnb .login:hover {
    background-image:url('/Content/Event/images/btn_login_on.png');
    background-size: contain;
  }
}

/* 공통 팝업/모달 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-overlay.is-open {
  display: flex;
}

.modal-box {
  background: var(--color-bg-alt);
  border: 2px solid var(--color-point);
  width: 90%;
  max-width: 1000px;
  padding: 60px 100px;
  text-align: center;
  position: relative;
}

#modal-invite-input .modal-box {
 max-width:1300px;
}

#modal-my-count .modal-box {
 max-width:1300px;
}

.modal-box .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 20px;
  line-height: 1;
}

/* 모달 상단에 딱 붙는 헤더 바 (모달 박스의 padding 밖으로 빼서 테두리에 붙임) */
.modal-box .modal-header {
  margin: -60px -100px 40px;
  padding: 12px 24px;
  background: #433f34;
  color: var(--color-text);
  font-size: 55px;
  font-weight: 600;
}
.modal-box .modal-header #my-invite-count {
  display:inline-block;
  background:#ff9400;
  border:solid 2px #ffdc36;
  padding:0 20px;
  color:#141b1f;
}

.modal-box p {
  /* margin-bottom: 60px; */
  font-size: 45px;
}

.modal-box p.txt1 {
  font-size:34px;
  color:#e5d0b9;
  margin-bottom:0;
}

.modal-box p.txt2 {
  font-size:28px;
  color:#cc802a;
}

.modal-box p.txt3 {
  color:#ffc000;
  border-bottom:solid 2px #584208;
  margin-bottom:10px;
  font-weight:600;
}

.modal-box .modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top:50px;
}

.modal-box input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
}

/* "아이디 + 입력창" 한 줄 배치 (친구 아이디 입력 모달 등) */
.modal-field {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  text-align: left;
}

.modal-field label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  width:250px;
  height:65px;
  background: #584938;
  color: var(--color-text);
  font-size: 28px;
  font-weight: 700;
}

.modal-field input[type="text"] {
  margin-bottom: 0;
  background: #fff;
  color: var(--color-text-inverse);
  height:65px;
  border-radius:0;
  font-size:28px;
}

/* 공통 푸터 */
/* main 밖에 있어도 1920 캔버스와 같은 폭/zoom 대상이 되도록 width 고정
   (js/common.js 가 main 과 함께 이 요소에도 동일한 zoom 을 적용함) */
.site-footer {
  width: 1920px;
  margin: 0;
  padding: 32px 0;
  text-align: center;
  font-size: 25px;
  font-weight:300;
  color: var(--color-text-dim);
  background: var(--color-footer-bg);
}

/* 공식카페 / 공식유튜브 링크 아이콘 (홈페이지 이미지 버튼 제외) */
.quick-links a:not(.homepage) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size:25px;
}

.quick-links a img {
  width: 56px;
  height: 56px;
  margin-right:10px;
}

/* /sub/event0X.html 단독 페이지 전용 푸터 링크 (index.html 은 .quick-links 사용)
   main 밖의 .site-footer 안에 있지만 site-footer 자체가 zoom 대상 캔버스이므로
   여기 값도 다른 캔버스 요소와 동일하게 PC는 1920 기준, 모바일은 750 기준입니다. */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding-bottom: 24px;
}

.footer-links .homepage {
  width: 194px;
  height: 53px;
  background: url('/Content/Event/images/btn_homepage.png') 0 0 no-repeat;
  background-size: contain;
  color: transparent;
}

.footer-links a:not(.homepage) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
}

.footer-links a img {
  width: 32px;
  height: 32px;
}

/* 반응형 - 헤더는 실제 뷰포트 기준으로 계속 반응형 대응
   (main 은 고정 캔버스이므로 여기서 제외 - .site-header 안의 .container 만 대상) */
@media (max-width: 1024px) {
  .site-header .container {
    padding: 0 24px;
  }
}

/* ---------- 768px 이하: 모바일 레이아웃 ----------
   main / .quick-links / .site-footer 는 PC(1920)와 동일한 방식으로
   375 고정 캔버스로 전환되고, js/common.js 가 실제 뷰포트 폭에 맞춰
   zoom 비율(renderableWidth / 375)을 적용합니다. 모바일 이미지는 2배수(750
   기준)로 작업되므로, 이 캔버스 안에 들어가는 값은 전부 "실측 픽셀 / 2" 로
   넣습니다 (즉 375 기준 실제 크기 그대로).
   헤더/모달/side-nav 는 PC와 마찬가지로 캔버스 밖에 있어 zoom 대상이 아니므로,
   여기서는 실제 px 값을 그대로(절반 계산 없이) 직접 지정합니다. */
@media (max-width: 768px) {
  :root {
    --header-height: 35px;
  }

  .site-header .container {
    padding: 0 8px;
  }

  /* 로고는 모바일 전용 이미지 없이 PC와 같은 logo.png 를 그대로 쓰고,
     렌더링 높이만 PC(50px)의 절반으로 줄입니다 */
  .site-header .logo img {
    height: 25px;
  }

  .gnb {
    gap: 8px;
  }

  /* 실측: btn_homepage_mo.png 175x48 / btn_login_mo.png 173x46
     -> 헤더는 main 처럼 zoom 되는 캔버스가 아니라 실제 px 그대로 화면에 박히는
     영역이라, 모바일 이미지가 2배수로 작업된 만큼 여기서는 절반 크기로 넣어야
     실제 기기(375 기준)에서 의도한 크기로 보입니다. */
  .gnb .homepage {
    width: 88px;
    height: 24px;
    background-image: url('/Content/Event/images/btn_homepage_mo.png');
  }
  .gnb .homepage:active {
    background-image: url('/Content/Event/images/btn_homepage_mo_on.png');
  }

  .gnb .login {
    width: 87px;
    height: 23px;
    background-image: url('/Content/Event/images/btn_login_mo.png');
  }
  .gnb .login:active {
    background-image: url('/Content/Event/images/btn_login_mo_on.png');
  }

  /* 375 고정 캔버스 전환 (PC의 1920px 대응) */
  main {
    width: 375px;
  }

  .site-footer {
    width: 375px;
    padding: 20px 0;
    font-size: 11px;
  }

  /* /sub/event0X.html 전용 푸터 링크 - 375 캔버스 기준 추정치 */
  .footer-links {
    gap: 8px;
    padding-bottom: 6px;
  }

  .footer-links .homepage {
    width: 50px;
    height: 14px;
  }

  .footer-links a:not(.homepage) {
    font-size: 7px;
  }

  .footer-links a img {
    width: 10px;
    height: 10px;
  }

  /* 풀폭 블록형 탭 (영상탭 / 이벤트탭 공용) - 375 캔버스 기준 추정치
     (border 도 PC 2px 그대로 물려받으면 배율이 어긋나 1px 로 같이 줄임) */
  .tab-bar {
    border-bottom-width: 1px;
  }

  .tab-bar button {
    height: 30px;
    font-size: 11px;
    border-right-width: 1px;
  }

  /* 팝업/모달 - main 밖에 있어 zoom 대상이 아니므로 실제 px 로 축소
     TODO: 모바일 팝업 시안 확정되면 정확한 값으로 다시 맞춰주세요 (현재는 추정치) */
  .modal-box {
    padding: 20px 20px;
    border-width: 1px;
  }

  .modal-box .modal-header {
    margin: -20px -20px 20px;
    padding: 10px 16px;
    font-size: 17px;
  }

  .modal-box .modal-header #my-invite-count {
    padding: 0 8px;
  }

  .modal-box p {
    font-size: 16px;
  }

  .modal-box p.txt1 {
    font-size: 10px;
  }

  .modal-box p.txt2 {
    font-size: 10px;
  }

  .modal-field {
    gap: 8px;
    margin-top: 20px;
  }

  .modal-field label {
    width: 100px;
    height: 36px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .modal-field input[type="text"] {
    height: 36px;
    font-size: 14px;
  }

  .modal-box .modal-actions {
    margin-top: 25px;
  }

  /* 팝업 확인 버튼 - btn_popup_mo.png(+_on) 준비되면 크기 맞춰주세요 (현재는 추정치).
     모달도 헤더와 마찬가지로 zoom 캔버스 밖 실제 px 영역이므로, 이미지가 2배수로
     오면 실측값의 절반으로 넣어야 합니다. */
  .modal-box .btn-primary {
    width: 135px;
    height: 25px;
    background-image: url('/Content/Event/images/btn_popup_mo.png');
    font-size: 14px;
  }
  .modal-box .btn-primary:active {
    background-image: url('/Content/Event/images/btn_popup_mo_on.png');
  }
}


  /* ---------------- 커스텀 스크롤바 ---------------- */
  .custom-scrollbar::-webkit-scrollbar {
    width: 16px; /* 썸이 실제로 차지할 전체 너비 */
  }
  .custom-scrollbar::-webkit-scrollbar-track {
    background-color: #1b1738;
    background-clip: padding-box; /* 아래 border(투명) 영역엔 배경이 안 깔리게 */
    border: 6px solid transparent; /* 이 두께만큼 트랙이 얇게 보임(가운데 4px만 색이 남음) */
    border-radius: 20px;
  }
  .custom-scrollbar::-webkit-scrollbar-thumb {
    background: #ffc000;
    border-radius: 20px;
    border:solid 4px #1b1738;
    /* 트랙과 달리 테두리를 안 줘서 스크롤바 전체 너비(16px)를 꽉 채움
       → 얇은 트랙 위에 더 넓은 막대가 떠 있는 것처럼 보임 */
  }
  .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #b39ddb;
  }
  .custom-scrollbar::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
  }