/* 모던 디자인 변수 호환 */
/* common-modern.css의 변수를 사용하여 다크모드 및 테마 호환성 확보 */

body {
  background-color: #f9f9f9;
  font-family: 'Noto Sans KR', sans-serif;
}

/* 길드 버프 설정 구역 */

.buff-select-container {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  margin-bottom: 30px;
}

.guild-select, .building-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.guild-buttons, .building-buttons {
  display: flex;
  gap: 10px;
}

.guild-button, .building-button {
  width: 60px;
  height: 60px;
  background: url('/static/images/CollectionGame/postcard/guild/building/building_container.webp') no-repeat center/contain;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

.guild-button img, .building-button img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.selected {
  border: 2px solid red;
  border-radius: 8px;
}


/* 구매 단위 버튼 */
.purchase-amounts {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.purchase-amounts button {
  width: 120px;
  height: 40px;
  background: url('/static/images/CollectionGame/postcard/button_default.webp') no-repeat center/contain;
  background-size: 100% 100%;
  color: black;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0;
}

/* 상점 구역 */
.store-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.store-item {
  width: 150px;
  height: 150px; /* 정사각형 */
  background: url('/static/images/CollectionGame/postcard/slot_background.webp') no-repeat center/contain;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.store-item .postcard-image {
  width: 60%;
}

.store-item .postcard-name {
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.price-field {
  background: url('/static/images/CollectionGame/postcard/button_default.webp') no-repeat center/contain;
  background-size: 100% 100%;
  width: 100px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.price-field img {
  width: 18px;
  height: 18px;
}

/* 우체통 */
#mailbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.mailbox-card {
  width: 100px;
  height: 100px;
  background: url('/static/images/CollectionGame/postcard/slot_background.webp') no-repeat center/contain;
  background-size: 100% 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mailbox-card img {
  width: 50px;
}

.fame-duration {
  display: flex;
  justify-content: space-between;
  width: 80%;
  margin-top: 5px;
  color: white;
  font-size: 14px;
}

/* 우체통 관리 입력 */
.mailbox-management {
  margin-top: 20px;
}

.mailbox-management input {
  width: 100%;
  margin-bottom: 10px;
  padding: 5px;
  border: 1px solid #aaa;
  border-radius: 5px;
}

.mailbox-management button {
  width: 120px;
  height: 40px;
  background: url('/static/images/CollectionGame/postcard/button_default.webp') no-repeat center/contain;
  background-size: 100% 100%;
  color: black;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0;
}

/* 공통 */
h2 {
  font-weight: bold;
  margin-bottom: 10px;
}

.currency-input-box {
  width: 180px;
  height: 42px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  position: relative;
  margin-bottom: 10px;
}

.luna-box {
  background-image: url('/static/images/CollectionGame/money/luna_field.webp');
}

.rubble-box {
  background-image: url('/static/images/CollectionGame/money/rubble_field.webp');
}

.currency-input-box input {
  position: absolute;
  width: 100%;
  height: 100%;
  padding-left: 45px;
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.toggle-section {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
  background-color: #333;
  border-radius: 8px;
  overflow: hidden;
}

.section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.toggle-section.active .section-content {
  max-height: 1000px;
}

.section-body {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.toggle-section h2 {
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  margin-bottom: 10px;
  padding: 15px;
  background-color: #444;
  color: white;
  border-radius: 6px;
  font-size: 20px;
}

.toggle-section h3 {
  width: fit-content;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  margin-bottom: 10px;
  padding: 5px;
  background-color: #333;
  color: white;
  border-radius: 6px;
  font-size: 16px;
}

.toggle-section h2:hover {
  background-color: #555;
}


.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:checked + .slider::before {
  transform: translateX(24px);
}

#mailbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  max-height: 300px; /* 스크롤뷰 높이 */
  overflow-y: auto; /* 세로 스크롤 */
  padding-right: 10px;
}

.purchase-amounts button.selected,
.guild-button.selected,
.building-button.selected {
  border: 2px solid red;
  border-radius: 8px;
}