html,
body {
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (max-width: 720px) {
  .msg__header {
    height: 45px;
  }
  .msg__header .top_in {
    margin: 0 5%;
  }
  .msg__header .top_in .cc_logo {
    width: 52px;
    height: 26px;
    top: 10px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  .msg__header .top_in .btn_home {
    display: none;
  }
  .msg__header .top_in .btn_close {
    display: none;
  }
  .msg__header .top_in .msg-navigator__toggle {
    display: block;
    width: 30px;
    height: 30px;
    left: 0;
    top: 7px;
  }
  .msg__header .top_in .equalizer_toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 0px;
  }
  #msg-nav__container {
    font-size: 16px;
  }
  #msg-nav__container.msg__navigator {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(72vw, 260px);
    box-sizing: border-box;
    background-color: #1a1918;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 64px 16px calc(24px + env(safe-area-inset-bottom));
    transform: translate(-100%);
    transition: transform 0.3s ease;
    z-index: 9250;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
  }
  #msg-nav__container.msg__navigator.active {
    transform: translateX(0%);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.35);
  }
  #msg-nav__container.msg__navigator .msg__navigator--close {
    position: absolute;
    top: 12px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 10px;
    opacity: 0.6;
    background: none;
    border: 0;
    cursor: pointer;
  }
  #msg-nav__container.msg__navigator .msg__navigator--close svg {
    width: 100%;
    height: 100%;
  }
  #msg-nav__container.msg__navigator ul {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  #msg-nav__container.msg__navigator ul a {
    color: #8f8c85;
  }
  #msg-nav__container.msg__navigator ul a.active {
    color: #e6d6b2;
  }
  /* 그룹 라벨("용사의 장비 상자")은 JS(active 그룹 처리)용으로만 남기고 모바일에서는 숨김 */
  #msg-nav__container .msg__menu--item-03 {
    display: none;
  }
  #msg-nav__container.msg__navigator .main__menu {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 8px;
    font-size: 15px;
    letter-spacing: -0.3px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    -webkit-tap-highlight-color: transparent;
  }
  #msg-nav__container.msg__navigator .main__menu .title {
    margin: 0;
    font-size: inherit;
    line-height: 1.3;
  }
  #msg-nav__container .line {
    display: none;
  }
  #msg-nav__container .footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #a5a5a5;
  }
  #msg-nav__container .footer a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 4px;
    color: #8f8c85;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
  }
  #msg-nav__container .footer .homepage_link .nav__icon--home {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 6px;
  }
  #msg-nav__container .footer .hide_today_link {
    color: #6b6862;
    font-size: 11px;
  }
  .msg__navigator--aside {
    display: none;
    visibility: hidden;
  }
  #msg-main__container section {
    will-change: transform;
    overflow: hidden;
    max-width: 100vw;
  }
  /* 메인 배경: 캐릭터가 원본 가로 75% 지점에 있어서 모바일 세로 화면에서는 72% 로 맞춤
     + 글자 가독성을 위해 위는 옅고 아래로 갈수록 어두워지는 그라데이션을 덧씌움 */
  #msg-main__container #section-main {
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.35) 40%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.7) 100%),
      var(--section-main-bg) no-repeat 72% center / cover;
  }
  /* 모바일 메인 글씨(이미지) 가독성: 뒤에 그림자
     main_stage 가 scale(0.42) 이므로 값은 화면 기준 ÷0.42 (blur 24px ≒ 화면 10px) */
  #msg-main__container #section-main .container .title,
  #msg-main__container #section-main .container .contents,
  #msg-main__container #section-main .container .date {
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.95)) drop-shadow(0 4px 24px rgba(0, 0, 0, 0.85));
  }
  #msg-main__container #section-main .container .form__container .privacy label,
  #msg-main__container #section-main .container .form__container .privacy_terms {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.95), 0 2px 16px rgba(0, 0, 0, 0.85);
  }
  #msg-main__container #section-main .container .main_stage {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    height: auto;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.42);
  }
  #msg-main__container #section-1 {
    background: var(--section-1-bg) no-repeat center center / cover;
  }
  #msg-main__container #section-1 .container .main_stage {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    height: auto;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }
  #msg-main__container #section-2 {
    background: var(--section-2-bg) no-repeat center center / cover;
  }
  #msg-main__container #section-2 .container .main_stage {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    height: auto;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.28);
  }
  #msg-main__container #section-3 {
    background: var(--section-3-bg) no-repeat center center / cover;
  }
  #msg-main__container #section-3 .container .main_stage {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    height: auto;
    margin: 0;
    transform: translate(-50%, -50%) scale(0.36);
  }
  /* ── 모바일 사전예약 폼 ──
     main_stage 가 scale(0.42) 로 축소되므로 값은 "원하는 화면 크기 ÷ 0.42" 로 잡음
     (예: 화면 44px → 105px, 글자 14px → 34px). 글자 크기가 16px 이상이라 iOS 포커스 자동 확대도 안 생김 */
  #msg-main__container #section-main .container .form__container {
    /* 840px(화면 꽉 참) → 700px 로 줄이고 가운데 정렬해서 좌우 여백 확보 */
    width: 700px;
    align-self: center;
    margin-top: 14px;
  }
  #msg-main__container #section-main .container .form__container .input_number {
    flex-direction: column;
    align-items: stretch;
    gap: 22px;
  }
  #msg-main__container #section-main .container .form__container .input_number input[type="number"] {
    flex: none;
    width: 100%;
    height: 104px;
    box-sizing: border-box;
    padding: 0 16px;
    border: 2px solid rgba(176, 138, 84, 0.55);
    border-radius: 0;
    background: linear-gradient(180deg, rgba(36, 22, 15, 0.92) 0%, rgba(16, 9, 6, 0.92) 100%);
    box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.35), inset 0 0 0 8px rgba(176, 138, 84, 0.18), 0 0 18px rgba(0, 0, 0, 0.5);
    color: #efe0bf;
    font-family: "NEXON Lv2 Gothic", sans-serif;
    font-size: 30px;
    letter-spacing: -1.5px;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
  }
  #msg-main__container #section-main .container .form__container .input_number input[type="number"]:focus {
    border-color: rgba(222, 186, 122, 0.85);
    box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.35), inset 0 0 0 8px rgba(222, 186, 122, 0.25), 0 0 22px rgba(210, 160, 80, 0.25);
  }
  #msg-main__container #section-main .container .form__container .input_number input[type="number"]::placeholder {
    color: rgba(201, 176, 134, 0.7);
  }
  #msg-main__container #section-main .container .form__container .input_number button[type="submit"] {
    flex: none;
    align-self: center;
    width: 380px;
    height: 120px;
    -webkit-tap-highlight-color: transparent;
  }
  #msg-main__container #section-main .container .form__container .input_number button[type="submit"]:active {
    background-image: var(--section-main-preRegister-btn--hover);
    transform: scale(0.98);
  }
  #msg-main__container #section-main .container .form__container .privacy {
    justify-content: center;
    align-items: center;
    margin: 24px 0 0;
  }
  #msg-main__container #section-main .container .form__container .privacy input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin: 0 14px 0 0;
    border: 2px solid rgba(176, 138, 84, 0.7);
    border-radius: 0;
    background: rgba(16, 9, 6, 0.85) no-repeat center / 0 0;
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background-size 0.15s ease, border-color 0.15s ease;
  }
  #msg-main__container #section-main .container .form__container .privacy input[type="checkbox"]:checked {
    border-color: #d8b878;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23e9cf97' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 30px 30px;
  }
  #msg-main__container #section-main .container .form__container .privacy label {
    font-family: "NEXON Lv2 Gothic", sans-serif;
    font-size: 27px;
    line-height: 1;
    color: rgba(214, 198, 168, 0.85);
    letter-spacing: -1px;
    padding: 16px 0;
  }
  /* 자세히보기: 금색 글자 + 꺾쇠 */
  #msg-main__container #section-main .container .form__container .privacy_terms {
    display: inline-flex;
    align-items: center;
    margin-left: 16px;
    padding: 12px 4px;
    border: 0;
    background: none;
    font-family: "NEXON Lv2 Gothic", sans-serif;
    font-size: 23px;
    line-height: 1;
    letter-spacing: -0.5px;
    color: #c9a466;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  #msg-main__container #section-main .container .form__container .privacy_terms::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-left: 10px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
  }
  #msg-main__container #section-main .container .form__container .privacy_terms:active {
    color: #e2c48a;
  }
  #msg-modal__container {
    position: fixed;
    inset: 0;
    opacity: 0;
    height: 0;
    transition: opacity 0.5s ease, height 0s 0.5s ease;
  }
  /* 모바일 팝업 중앙 정렬
     - 데스크톱은 inset:0 + margin:auto 또는 left:50% + translate 를 섞어 쓰는데,
       화면보다 넓은 팝업에서는 둘 다 한쪽으로 치우침 (scale 속성은 transform 보다 먼저 적용됨)
     - 모바일에서는 left/top 50% + translate(-50%,-50%) scale() 하나로 통일 */
  #msg-modal__container .msg-modal__content {
    overflow: visible;
    --modal-scale: 0.6;
  }
  #msg-modal__container #privacy_terms.active,
  #msg-modal__container #pop_notice1.active,
  #msg-modal__container #pop_notice2.active,
  #msg-modal__container #preorder_complete.active,
  #msg-modal__container #sec2_pop_claim.active,
  #msg-modal__container #sec2_pop_option.active,
  #msg-modal__container #sec2_pop_notice1.active,
  #msg-modal__container #sec2_pop_notice2.active,
  #msg-modal__container #sec2_pop_notice3.active,
  #msg-modal__container #sec2_pop_notice4.active {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    margin: 0;
    width: max-content;
    scale: none;
    transform: translate(-50%, -50%) scale(var(--modal-scale));
  }
  #msg-modal__container #privacy_terms {
    --modal-scale: 0.4;
  }
  #msg-modal__container #pop_notice1 {
    --modal-scale: 0.62;
  }
  #msg-modal__container #pop_notice2 {
    --modal-scale: 0.62;
  }
  #msg-modal__container #preorder_complete {
    --modal-scale: 0.52;
  }
  #msg-modal__container #sec2_pop_claim {
    --modal-scale: 0.36;
  }
  #msg-modal__container #sec2_pop_option {
    --modal-scale: 0.34;
  }
  #msg-modal__container #sec2_pop_notice1 {
    --modal-scale: 0.62;
  }
  #msg-modal__container #sec2_pop_notice2 {
    --modal-scale: 0.62;
  }
  #msg-modal__container #sec2_pop_notice3 {
    --modal-scale: 0.62;
  }
  #msg-modal__container #sec2_pop_notice4 {
    --modal-scale: 0.62;
  }
  #msg-popup__container {
    position: fixed;
    top: -500vh;
    left: -500vw;
    z-index: 9200;
    opacity: 0;
    height: 0;
    transition: opacity 0.3s ease, height 0s 0.3s ease;
  }
  #msg-popup__container.active {
    opacity: 1;
    inset: 0;
    height: 100%;
    transition: opacity 0.3s ease;
  }
  #msg-popup__container .msg-popup__overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    z-index: 9200;
    transition: background-color 0.3s ease;
    pointer-events: none;
  }
  #msg-popup__container .msg-popup__overlay.active {
    background-color: rgba(0, 0, 0, 0.5);
  }
  #msg-popup__container .msg-popup__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9201;
    overflow: hidden;
    width: 280px;
    height: 148px;
    background: white;
    font-size: 20px;
    border: 1px solid;
    border-radius: 5px;
    font-family: "NEXON Lv2 Gothic";
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #msg-popup__container .msg-popup__content .message {
    margin-top: -74px;
    font-size: 14px;
    line-height: 14px;
    text-align: center;
  }
  #msg-popup__container .msg-popup__content .close {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    margin-left: -40px;
    margin-top: 0px;
    height: 30px;
    font-size: 12px;
    text-align: center;
    line-height: 30px;
    background: #272727;
    color: #fff;
    cursor: pointer;
    border-radius: 3px;
  }
  #msg-popup__container .msg-popup__content .confirm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 30px;
    margin-left: -90px;
    margin-top: 0px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 30px;
    background: #333;
    color: #fff;
    cursor: pointer;
  }
  #msg-popup__container .msg-popup__content .cancel {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: 10px;
    margin-top: 0px;
    width: 80px;
    height: 30px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 30px;
    background: #333;
    color: #fff;
    cursor: pointer;
  }
}
