  @font-face {
    font-family: 'MapoBackpacking';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/MapoBackpackingA.woff')
      format('woff');
    font-weight: normal;
    font-style: normal;
  }


  html {
    scroll-behavior: smooth;
    font-size: 18px; /* 모바일 기준 */
  }

  body {
    font-size: 1.1rem;
    background-color: #fff7f7 !important;
    /* font-family: 'Arial', sans-serif; */
    margin: 0;
    padding: 0;
  }

  b, strong {
      font-size: 19px;
      font-weight: bolder;
      color: #0081ff;
  }

  /* 공통 요소 (모바일 기준) */
  .site-header,
  .mbtiz-title,
  .mbtiz-subtitle,
  .upload-area h3,
  .result-title,
  .result-text,
  .sns-button,
  .retry-button {
    font-size: 1.0rem;
  }

  .site-header {
    display: block;
    font-weight: bold;
    color: #c4465c;
    padding: 20px 20px 10px;
    text-align: left;
    text-decoration: none;
    max-width: 600px;
    margin: 0 auto;
  }

  .site-header:hover {
    color: #f3818b;
  }

  .mbtiz-title-wrap {
    text-align: center;
    padding: 10px 20px 0px;
  }

  .mbtiz-title {
    margin: 10px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #c4465c;
    cursor: pointer;
  }

  .mbtiz-title .highlight-mbti {
    font-size: 1.8rem;
    font-weight: 800;
  }

  .mbtiz-subtitle {
    background-color: #ffe1e4;
    display: inline-block;
    padding: 5px 24px 10px;
    border-radius: 30px;
    font-weight: 600;
    color: #c4465c;
    margin-top: 15px;
    line-height: 1.5;
  }

  .start-button {
    font-size: 1.3rem;
    margin-top: 20px;
    padding: 11px 55px;
    font-weight: bold;
    color: #fff;
    background-color: #C4374E;
    border: none; /* ✅ 테두리 완전 제거 */
    border-radius: 30px;
    box-shadow: none; /* ✅ 그림자 제거 */
    outline: none; /* ✅ 포커스 효과 제거 */
    cursor: pointer;
    transition: background-color 0.3s ease;
  }

  .start-button:hover {
    background-color: #c4465c; /* 더 진한 핑크 */
    transform: scale(1.02);    /* 살짝 확대 */
  }

  .start-button.retry-mode {
    background-color: #e6e6e6 !important;
    color: #fff; /* 회색 배경이면 글씨색은 진회색 추천 */
  }

  .spinner-border {
    margin-bottom: 20px;
  }

  .upload-area {
    text-align: center;
    padding: 20px 20px 0px;
    background-color: #fff7f7;
    transition: box-shadow 0.5s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .upload-area h3 {
    margin-bottom: 20px;
    font-weight: bold;
  }

  .upload-input {
    width: 230px;
    height: 180px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #dc5e6d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    transition: border-color 0.3s ease, background-color 0.3s ease;
  }

  .upload-input:hover {
    border-color: #c4465c;
    background-color: #fdf8f8;
    transform: scale(1.02);    /* 살짝 확대 */
  }

  .upload-input.dragover {
    border-color: #ff3366;
    background-color: #fdf8f8;
  }

  .upload-input label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
  }

  .upload-input input[type="file"] {
    display: none;
  }

  .preview-img {
    display: block;
    margin: 0 auto 0;
    max-width: 200px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
  }

  .sns-wrap {
    display: flex;
    flex-direction: row;      /* 가로 배치 */
    justify-content: center;  /* 가운데 정렬 */
    align-items: center;
    /* gap: 10px; */
    flex-wrap: nowrap;        /* ❗ 줄바꿈 방지 */
    padding-top: 5px;
  }

  .link-icon {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* width: 80px; */
    padding: 0 15px 0 0;
    border: none;
    background: none;
    cursor: pointer;
  }

  .link-icon img {
    width: 47px;
    height: 47px;
    object-fit: contain;
    display: block;
  }

  .link-icon .label {
    font-size: 0.7rem;
    color: #850808;
    margin-top: 5px;
    text-align: center;
  }
    
  button.link-icon {
    border: none;
    outline: none;
    box-shadow: none;
    background-color: transparent; /* 필요 시 */
  }

  .result-box {
    overflow: hidden;
    margin-top: 20px;
    /* margin-bottom: 20px; */
    padding: 15px 15px 25px 15px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    display: none;
  }

  /* ✅ result-box 안에 있는 모든 요소가 밖으로 안나가도록 */
  .result-box img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  /* ✅ 광고 배너 폭 제한 */
  .ad-wrapper {
    max-width: 100%;
    /* overflow: hidden; */
    /* background-color: #000; */
    /* border-radius: 16px; */
    /* box-shadow: 0 0 12px rgba(220, 75, 90, 0.5); */
  }

  .ad-wrapper img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 8px auto 0 auto;
    border-radius: 8px;
    /* box-shadow: 0 7px 10px #C4374E; */
    box-shadow: 0 7px 10px #2f3f78;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .result-box.shrink {
    margin-top: 20px;
    padding-top: 10px;
    /* 
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center; */
  }
  
  #resultBox:focus {
    /* outline: 2px solid #90b9e3;  */
    outline: none;
    box-shadow: 0 0 10px #5297dccf; 
    /* box-shadow: 0 0 10px rgba(0,0,0,0.1); */
    border-radius: 20px; /* 기존 둥글기 유지 */
  }

  .result-title {
    font-weight: bold;
    color: #c4465c;
    margin-bottom: 10px;
  }

  .result-text {
    font-size: 0.9rem;
    color: #333;
  }

  #compatibility {
    font-size: 0.9rem;
    font-weight: bold;
  }

  .action-button {
    width: 200px;  /* 다른 사진으로 재시도 버튼 기준 */
    display: block;
    margin: 10px auto;
    padding: 12px 0;
    text-align: center;
    border-radius: 30px;
    background-color: #d85b6e;
    color: white;
  }

  .ad-button-wrapper {
    display: flex;
    justify-content: center; /* 수평 중앙 정렬 */
  }

  .ad-button {
    font-size: 1.0rem;
    /* padding: 9px 40px; */
    padding: 9px 40px 9px 30px;
    color: #fff;
    background-color: #dc3853;
    border: none; /* ✅ 테두리 완전 제거 */
    border-radius: 30px;
    outline: none; /* ✅ 포커스 효과 제거 */
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 5px #777;
    display: inline-block; /* 버튼 자체는 inline-block */
  }


  .share-button, .sns-button {
    margin-top: 20px;
    background: #dc5e6d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    margin-right: 10px;
  }

  .share-title {
    color: #c4465c;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    margin-top: 10px;
  }

  .retry-button {
    /* background-color: #dc5e6d; */
    background-color: #ddd;
    /* margin: 15px auto 18px; */
    margin: 30px auto 18px;
    display: block;
  }

  body.page-mbti .retry-button {
    background-color: #dc5e6d !important;
  }

  .retry-button:hover {
    background-color: #d95766;
  }

  .save-button {
    background-color: #dc5e6d;
    margin: 15px auto 17px;
    display: block;
  }

  .save-button:hover {
    background-color: #d95766;
  }

  .kakao-button {
    background-color: #dc5e6d;
    margin: 15px auto 17px;
    display: block;
    text-align: center;
    color: #fff;
    font-size: 1.0rem;
    padding: 6px 0 6px 0;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
  }

  .kakao-button:hover {
    background-color: #d95766;
  }

  .kakao-button .kakao-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
  }

  .blink-red {
    color: #d51128 !important;
    transition: color 0.3s ease;
    font-weight: bold;
  }

  input[type="file"] {
    font-size: 1rem;
  }

  #loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
  }







  /* 📱 모바일 전용 */
  @media (max-width: 768px) {
    .site-header {
      padding-top: 10px;
      padding-left: 16px;
      padding-right: 16px;
    }
  }

  /* 💻 PC 전용 */
  @media (min-width: 769px) {
    html {
      font-size: 18px;
    }

    body {
      font-size: 1.2rem;
    }

    .site-header {
      max-width: 600px; /* ✅ 더 넓게 */
    }

    .mbtiz-title-wrap {
      padding: 10px 20px 10px; /* ✅ 상단 여백 축소 */
    }

    .upload-area {
      padding: 10px 20px 0px; /* ✅ 아래도 살짝 축소 */
    }

    .site-header,
    .mbtiz-title,
    .mbtiz-subtitle,
    .start-button,
    .upload-area h3,
    .result-title,
    .sns-button {
      font-size: 1.3rem;
    }

    .result-text {
      font-size: 1.0rem;
    }

    .result-box {
      max-width: 520px; /* ✅ 기존 400px → 520px */
    }

    .action-button {
      width: 230px; /* ✅ 버튼도 약간 더 넓게 */
    }

    .sns-wrap {
      flex-wrap: wrap; /* ✅ SNS 버튼도 너비 좁으면 줄바꿈 허용 */
      gap: 16px;        /* ✅ 버튼 사이 여유 */
    }

    #compatibility {
      font-size: 1.0rem;
    }

    .mbtiz-title {
      margin: 10px;
      font-size: 2.4rem;         /* ✅ 더 크고 균형 있게 */
      font-weight: 700;
    }

    .mbtiz-title .highlight-mbti {
      font-size: 2.8rem;         /* ✅ MBTI 강조 */
      font-weight: 800;
      color: #C4374E;
    }

    .mbtiz-subtitle {
      margin: 15px;
      font-size: 1.2rem;
    }

    .start-button {
      font-size: 1.4rem;
      padding: 14px 65px;        /* ✅ 버튼 크기 조정 */
    }

    .retry-button {
      font-size: 1.2rem;
    }

    .link-icon span {
      display: block;
      text-align: center;
      font-size: 0.65rem;
      margin-top: 2px;
      color: #333;
    }
  }

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: #606060;
  padding: 40px 0 20px 0;
  position: relative;
  bottom: 0;
  width: 100%;
}

.mbti-INFP { color: #ff6f91; background-color: #ffe6ec; }
.mbti-INFJ { color: #ab47bc; background-color: #f4e4fa; }
.mbti-INTJ { color: #1976d2; background-color: #e0f0ff; }
.mbti-INTP { color: #00acc1; background-color: #d2f3f7; }
.mbti-ENFP { color: #ff7043; background-color: #ffe3db; }
.mbti-ENFJ { color: #fbc02d; background-color: #fff8dc; }
.mbti-ENTJ { color: #1976d2; background-color: #e0f0ff; }
.mbti-ENTP { color: #00acc1; background-color: #d2f3f7; }
.mbti-ISFP { color: #ec407a; background-color: #ffe2ed; }
.mbti-ISFJ { color: #e53935; background-color: #ffe2e2; }
.mbti-ISTP { color: #3949ab; background-color: #e6e9fd; }
.mbti-ISTJ { color: #455a64; background-color: #e0e6ea; }
.mbti-ESFP { color: #e53935; background-color: #ffe2e2; }
.mbti-ESFJ { color: #6d4c41; background-color: #f0e5e0; }
.mbti-ESTP { color: #5e35b1; background-color: #eee6fa; }
.mbti-ESTJ { color: #3e2723; background-color: #e9e0dc; }

[class^="mbti-"], [class*=" mbti-"] {
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: bold;
}

.c-banner-wrap {
  border-radius: 7px; /* 둥근 정도 */
  overflow: hidden;
  display: inline-block; /* 필요 시 블록 조정 */
  box-shadow: 0 4px 12px rgba(16, 20, 231, 0.15);
  /* box-shadow: 0 8px 5px #C4374E; */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}








/* 카드 전체에 그림자 주고, 이미지↔버튼 사이 공백 제거 */
/* 공통 */
.ad-card {
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ad-link img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.ad-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 14px;
  color: #fff;
  font-weight: 500;
  line-height: 1;
}

/* 남자 */
body.male .ad-card {
  box-shadow: 0 4px 7px #2f3f78;
  /* box-shadow: 0 0px 4px #C4374E; */
}

body.male .ad-cta {
  background: #1d86f8;
  /* background: #b83b4f; */
}

/* 여자 */
body.female .ad-card {
  box-shadow: 0 4px 7px #2f3f78;
  /* box-shadow: 0 0px 4px #C4374E; */
}

body.female .ad-cta {
  background: #1d86f8;
  /* background: #b83b4f; */
}


/* 좌우 텍스트 크기 조절(선택) */
.ad-cta-left{ font-size: .87rem; }
.ad-cta-right{ font-size: 1.5rem; }