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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
  /* 최소 너비 설정으로 너무 작은 화면에서도 콘텐츠가 제대로 표시되도록 함 */
  min-width: 320px;
}

.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  background-size: cover;
  align-items: center;
  z-index: -1;
}

/* 9:16 비율 유지 (모바일 세로 화면용) */
@media (max-width: 500px), (orientation: portrait) {
  .background {
    /* 9:16 비율에 맞게 배경 조정 */
    aspect-ratio: 9/16;
    width: 100%;
    height: auto;
    /* 화면 중앙에 위치하도록 설정 */
    top: 50%;
    transform: translateY(-50%);
  }
}

.loading-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  min-height: 450px;
  z-index: 10;
  transform: translateZ(0); /* 하드웨어 가속 사용 */
  opacity: 1;
  transition: opacity 0.5s ease; /* 부드러운 페이드 아웃 효과 */
  background: url('buldak-background.jpg') no-repeat center;
}

.logo-container {
  position: absolute;
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  z-index: 11;
}

.logo {
  width: 50%;
  max-width: 200px;
  min-width: 120px; /* 로고의 최소 크기 설정 */
}

.middle-image-container {
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.middle-image {
  width: 60%;
  max-width: 300px;
  min-width: 150px;
  height: auto;
  display: block;
}

.prize-banner {
  position: relative;
  margin-top: -30px;
  background-color: #000;
  border-radius: 50px;
  padding: 12px 20px;
  display: inline-block;

}

.prize-text {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  text-align: center;
  display: block;
  white-space: nowrap;
  text-shadow: 
    /* 아웃사이드 스트로크 효과 */
    -1.18px -1.18px 0 #000,
    1.18px -1.18px 0 #000,
    -1.18px 1.18px 0 #000,
    1.18px 1.18px 0 #000,
    0px -1.18px 0 #000,
    0px 1.18px 0 #000,
    -1.18px 0px 0 #000,
    1.18px 0px 0 #000,
    /* 드롭쉐도우 */
    0px 2px 0px rgba(156, 27, 98), 
    0px 2px 8px rgb(156, 27, 98);
}

.progress-container {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 400px;
  min-height: 100px;
  text-align: center;
  z-index: 11;
}

.progress-bar {
  position: relative;
  width: 80%;              /* 컨테이너의 80% */
  min-width: 250px;        /* 최소 너비 설정으로 너무 작아지지 않도록 함 */
  height: 40px;            /* 높이 복원 */
  background: url('progress-bar-bg.png') no-repeat center;
  background-size: 100% 100%; /* 프레임을 영역에 맞게 설정 */
  border-radius: 20px;
  overflow: visible;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  border: none;
  padding: 0;              /* 패딩 제거 */
  display: flex;           /* 내부 요소 정렬을 위한 flexbox 설정 */
  align-items: center;
  transform: translateZ(0); /* 하드웨어 가속 사용 */
}

/* fill 영역을 명확하게 정의하기 위한 내부 컨테이너 */
.progress-inner {
  position: absolute;
  top: 10px;
  left: 2.5%;              /* 왼쪽 여백 증가 */
  right: 2.5%;             /* 오른쪽 여백 증가 */
  height: calc(100% - 20px); /* 상하 여백 증가 */
  border-radius: 30px;
  overflow: visible;       /* 캐릭터가 바깥으로 나갈 수 있도록 변경 */
}

#progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;               /* 초기 너비는 0 */
  background: url('fill-pattern.png') no-repeat;
  background-size: 100% 100%;
  border-radius: 15px;
  transition: width 0.2s ease-out;
  transform: translateZ(0); /* 하드웨어 가속 사용 */
  transform-origin: left center;
}

#progress-character {
  position: absolute;
  width: 60px;
  height: 60px;
  bottom: -15px;
  right: -30px;            /* fill의 오른쪽 끝에서 약간 튀어나오게 위치 */
  background: url('buldak-character.png') no-repeat center;
  background-size: contain;
  z-index: 11;
  pointer-events: none;
}

.loading-text {
  margin-top: 20px;
  display: block;
  text-align: center;
  color: #ffffff;
  font-size: 25.57px;
  font-weight: 500;
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", sans-serif;
  /* Outside Stroke 효과 (모바일 호환성) + Drop Shadow */
  text-shadow: 
    /* Outside Stroke (8방향, 0.6px) */
    -0.6px -0.6px 0 #070909,
    0.6px -0.6px 0 #070909,
    -0.6px 0.6px 0 #070909,
    0.6px 0.6px 0 #070909,
    0px -0.6px 0 #070909,
    0px 0.6px 0 #070909,
    -0.6px 0px 0 #070909,
    0.6px 0px 0 #070909,
    /* Drop Shadow */
    1.28px 1.28px 0px #070909;
}



/* 화면 높이가 낮은 경우를 위한 미디어 쿼리 */
@media (max-height: 650px) {
  .logo-container {
    top: 3%;
  }
  
  .progress-container {
    bottom: 2%;
    width: 100%;
  min-height: 50px;
  }
  
  .logo {
    max-width: 150px;
  }
  
  .middle-image {
    max-width: 200px;
  }
  
  .prize-banner {
    margin-top: -15px;
    padding: 8px 12px;
  }
  
  .prize-text {
    font-size: 13px;
  }
}
