/* 메인 페이지 (Gate) 스타일 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700;900&display=swap');

/* 메인 페이지 */
#main-page {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background-image: url('bg_gate.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  /* Safe area 대응 */
  padding-bottom: env(safe-area-inset-bottom);
}

/* 체크무늬 패턴 배경 - 이미지 배경 사용으로 비활성화 */
.checker-bg {
  display: none;
}

/* 그라디언트 오버레이 - 이미지 배경 사용으로 비활성화 */
.gradient-overlay {
  display: none;
}

/* 틴더 로고 */
.tinder-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 70px;
  height: auto;
  z-index: 10;
}

/* 타이틀 영역 */
.title-container {
  position: absolute;
  top: max(8%, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
  width: 90%;
  max-width: 343px;
}

.title-image {
  width: 100%;
  max-width: 311px;
  height: auto;
}

/* 작은 화면 대응 */
@media screen and (max-height: 700px) {
  .title-container {
    top: max(5%, env(safe-area-inset-top));
  }
  
  .title-image {
    max-width: 280px;
  }
}

@media screen and (max-height: 600px) {
  .title-container {
    top: max(3%, env(safe-area-inset-top));
  }
  
  .title-image {
    max-width: 250px;
  }
}

.sub-text-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.sub-text-img {
  height: 20px;
  width: auto;
}

.sub-text-heart {
  height: 30px;
  width: auto;
}

/* 텍스트 기반 타이틀 */
.title-text {
  font-size: 64px;
  font-weight: 900;
  color: #FD267D;
  text-shadow: 
    -2px -2px 0 #000,  
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 4px 0 #000;
  letter-spacing: -2px;
  font-family: 'Noto Sans KR', sans-serif;
}

.sub-text {
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.sub-text-highlight {
  font-size: 18px;
  font-weight: 800;
  color: white;
  background: #FF0062;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid white;
}

/* 개인정보 동의 체크박스 */
.consent-container {
  position: absolute;
  bottom: max(5%, calc(5% + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

/* 작은 화면 대응 */
@media screen and (max-height: 700px) {
  .consent-container {
    bottom: max(3%, calc(3% + env(safe-area-inset-bottom)));
    font-size: 12px;
  }
  
  .consent-text {
    font-size: 12px;
  }
}

.consent-checkbox {
  width: 24px;
  height: 24px;
  cursor: pointer;
}

.consent-text {
  font-size: 14px;
  color: white;
  font-weight: 700;
  letter-spacing: -0.32px;
  margin: 0;
}

.consent-text span {
  text-decoration: underline;
}

/* START 버튼 */
.start-btn-container {
  position: absolute;
  bottom: max(10%, calc(10% + env(safe-area-inset-bottom)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.start-btn-container.visible {
  opacity: 1;
  pointer-events: auto;
}

.start-btn {
  width: 168px;
  height: 168px;
  background: url('btn_start.svg') no-repeat center;
  background-size: contain;
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
}

.start-btn:hover {
  filter: brightness(1.1);
}

.start-btn:active {
  transform: scale(0.95);
}

/* 작은 화면 대응 */
@media screen and (max-height: 700px) {
  .start-btn-container {
    bottom: max(12%, calc(12% + env(safe-area-inset-bottom)));
  }
  
  .start-btn {
    width: 140px;
    height: 140px;
  }
}

@media screen and (max-height: 600px) {
  .start-btn-container {
    bottom: max(15%, calc(15% + env(safe-area-inset-bottom)));
  }
  
  .start-btn {
    width: 120px;
    height: 120px;
  }
}

/* 장식 카드 요소들 */
.deco-card-1 {
  position: absolute;
  bottom: -10%;
  left: -20%;
  width: 340px;
  height: 509px;
  background: black;
  border-radius: 40px;
  transform: rotate(12deg);
  z-index: 2;
}

.deco-card-2 {
  position: absolute;
  bottom: -15%;
  left: -45%;
  width: 340px;
  height: 509px;
  background: linear-gradient(177deg, #fd267d 2%, #e448ff 57%);
  border: 2px solid black;
  border-radius: 40px;
  transform: rotate(-12deg);
  z-index: 1;
}

/* ========================================
   개인정보 동의 팝업
   ======================================== */
#privacy-popup {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#privacy-popup.visible {
  display: flex;
  opacity: 1;
}

/* 검은색 dim 배경 */
.privacy-dim-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1;
}

/* 가운데 모달 박스 */
.privacy-modal-box {
  position: relative;
  width: min(343px, 87vw);
  padding: 16px;
  background: linear-gradient(180deg, #ff7854 0%, #fd267d 100%);
  border-radius: 10px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 닫기 버튼 */
.privacy-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.privacy-close-btn:hover {
  opacity: 0.8;
}

.privacy-close-btn:active {
  transform: scale(0.95);
}

/* 모달 타이틀 */
.privacy-modal-title {
  color: #f3f3f3;
  text-align: center;
  font-family: Pretendard, 'Noto Sans KR', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 140%;
  letter-spacing: -0.48px;
  margin: 0;
  padding-top: 24px;
}

/* 모달 콘텐츠 박스 */
.privacy-modal-content {
  background: #000;
  border-radius: 10px;
  padding: 16px;
  color: white;
  font-family: Pretendard, 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.28px;
}

.privacy-modal-content strong {
  font-weight: 700;
}

/* ========================================
   결과 페이지 스타일
   ======================================== */

#result-page {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  padding-bottom: 25vh;
  box-sizing: border-box;
  /* 배경 이미지 */
  background-image: url('bg.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

/* ========================================
   Share 페이지 스타일
   ======================================== */
#share-page {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 210;
  overflow-y: auto;
  overflow-x: hidden;
  background-image: url('bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* Safe area 대응 */
  padding-top: max(48px, env(safe-area-inset-top) + 32px);
  padding-bottom: max(40px, env(safe-area-inset-bottom) + 24px);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

#share-page.visible {
  display: flex;
}

.share-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 70px;
  height: auto;
  z-index: 2;
}

.share-title {
  margin-top: 0;
  margin-bottom: max(20px, 2.5vh);
  width: min(343px, 88vw);
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.share-title img {
  width: 100%;
  height: auto;
  display: block;
}

.share-card {
  margin-top: 0;
  margin-bottom: max(24px, 3vh);
  z-index: 2;
  border-radius: 20px;
  border: none;
  box-shadow: 0 0 20px 0 #FFF;
  overflow: hidden;
  padding: 0;
  line-height: 0;
  height: auto;
  max-height: 50vh;
  width: auto;
  max-width: 85vw;
  aspect-ratio: 1000 / 1500;
  flex-shrink: 1;
}

.share-card img {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
  object-fit: contain;
}

.share-cta-btn {
  margin-top: 0;
  margin-bottom: 0;
  width: min(343px, 88vw);
  height: 62px;
  min-height: 54px;
  background: url('btn_main.svg') no-repeat center;
  background-size: contain;
  border: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-cta-btn span {
  color: #fff;
  text-align: center;
  font-family: Pretendard, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.32px;
}

/* 작은 화면 대응 */
@media screen and (max-height: 750px) {
  #share-page {
    padding-top: max(32px, env(safe-area-inset-top) + 20px);
    padding-bottom: max(32px, env(safe-area-inset-bottom) + 16px);
  }
  
  .share-title {
    margin-bottom: 16px;
  }
  
  .share-title img {
    max-width: 280px;
  }
  
  .share-card {
    max-height: 50vh;
    margin-bottom: 20px;
  }
  
  .share-cta-btn {
    height: 56px;
  }
}

@media screen and (max-height: 700px) {
  #share-page {
    padding-top: max(48px, env(safe-area-inset-top) + 12px);
    padding-bottom: max(24px, env(safe-area-inset-bottom) + 12px);
  }
  
  .share-title {
    margin-bottom: 14px;
  }
  
  .share-title img {
    max-width: 260px;
  }
  
  .share-card {
    max-height: 50vh;
    margin-bottom: 16px;
  }
  
  .share-cta-btn {
    height: 52px;
  }
}

@media screen and (max-height: 650px) {
  #share-page {
    padding-top: max(50px, env(safe-area-inset-top) + 8px);
    padding-bottom: max(20px, env(safe-area-inset-bottom) + 10px);
  }
  
  .share-title {
    margin-bottom: 12px;
  }
  
  .share-title img {
    max-width: 240px;
  }
  
  .share-card {
    max-height: 40vh;
    margin-bottom: 14px;
  }
  
  .share-cta-btn {
    height: 48px;
  }
  
  .share-cta-btn span {
    font-size: 14px;
  }
}

/* Retry 버튼 */
.retry-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #000;
  text-align: center;
  font-family: Pretendard, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 100%;
  letter-spacing: -0.32px;
  cursor: pointer;
  z-index: 10;
  padding: 8px 12px;
}

.retry-btn:hover {
  opacity: 0.8;
}

.retry-btn span {
  display: flex;
  align-items: center;
  align-self: center;
  transform: translateY(2px);
  color: #000;
  text-align: center;
  font-family: Pretendard, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.32px;
}

/* 결과 로고 컨테이너 */
.result-logo-container {
  margin-top: 60px;
  z-index: 10;
}

.result-title-image {
  width: 65vw;
  height: auto;
}

/* 비디오 컨테이너 */
.result-video-container {
  margin-top: 20px;
  z-index: 10;
  
}

.result-video-frame {
  position: relative;
  width: auto;
  height: 35vh;
  /* 비디오 비율에 맞게 높이 자동 조정 (9:16 세로 비율 기준) */
  aspect-ratio: 8 / 16;
  background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 0 20px 0 #FFF;
}

.result-card-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.result-video-title {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  z-index: 5;
}

#result-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.rec-indicator {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  z-index: 5;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: #ff0000;
  border-radius: 50%;
  animation: rec-blink 1s infinite;
}

@keyframes rec-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* 액션 버튼들 */
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  z-index: 10;
  width: 344px;
}

.result-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  width: 136px;
  padding: 0 25px;
  background: #111111;
  background-size: contain;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: white;
  padding: 0 10px;
  transition: transform 0.1s, filter 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



.result-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: #111111;
  border: none;
  border-radius: 100px;
  padding: 0;
  cursor: pointer;
}

/* 틴더 CTA 버튼 */
.tinder-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 95vw;
  height: 62px;
  padding: 6vw 0px;
  margin-top: 40px;
  background: url('btn_main.svg') no-repeat center center;
  background-size: 100% 100%;
  font-size: 15px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  z-index: 10;
  transition: transform 0.1s;
  cursor: pointer;
}

/* 그라디언트 텍스트 */
.gradient-text {
  background: linear-gradient(90deg, var(--tinder_pink, #FD267D) 0.11%, var(--tinder_orange, #FF7854) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: Pretendard, 'Noto Sans KR', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.4px;
  text-align: center;
}

/* 해시태그 섹션 */
.hashtag-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32px;
  z-index: 10;
}

.hashtag-desc {
  font-size: 14px;
  font-weight: 500;
  color: white;
  text-align: center;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.hashtag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.hashtag-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  gap: 10px;
  border-radius: 100px;
  border: 1px solid #F3F3F3;
  background: #ffffff00;
  color: #F3F3F3;
  text-align: center;
  font-family: Pretendard, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  letter-spacing: -0.32px;
}

.copy-hashtag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 24px;
  background: #111111;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.copy-hashtag-btn:hover {
  filter: brightness(1.1);
}

.copy-hashtag-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 0 black;
}

/* 결과 페이지 하단 배경 이미지 */
.result-bg-bottom-container {
  position: relative;
  width: 100%;
  height: 30vh;
  z-index: 1;
  pointer-events: none;
  flex-shrink: 0;
}

.result-bg-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
