body {
  background-color: #686C89;
  margin: 0;
  padding: 0;
  text-align: center;
  color: #ffffff;
  font-family: "Kiwi Maru", serif;
}

.bazaar_title{
  margin: 50px auto 0px;
  color: #333;
  font-size: 64px;
  background-color: #4A6483;
  border: 8px solid #fff;
  width: 280px;
  height: 112px;
  border-radius: 15px;
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center;
}
h1 { 
  font-weight: 370;
  color: #fff;
  text-align: center;
  font-size: 64px;
  margin: auto;
}
.bazaar_attention{
  color: #fff;
  text-align: center;
  font-size: 24px;
  margin: 20px auto;
  
}

.category-links { 
  display: flex; 
  justify-content: center; 
  gap: 2em; 
  margin-bottom: 2em; 
}
.category { 
  cursor: pointer; 
}
.category-img { 
  width: 180px; 
  height: 180px; 
  object-fit: contain; 
}

.bazaar-list { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 2em; 
  margin-bottom: 3em; 
}
.bazaar-item { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  cursor: pointer; 
}

.frame { 
  position: relative; 
  width: 250px; 
  height: 250px; 
  padding: 5px; 
  box-sizing: border-box; 
}
.frame-img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
}

.item-img { 
  position: absolute; 
  top: 5%;       /* 上に余白5% */
  left: 5%;      /* 左に余白5% */
  width: 90%;    /* 額縁内で少し小さめ */
  height: auto;  /* 高さは自動で比率維持 */
  max-height: 90%;
  object-fit: contain;
}

.label-box { 
  background-color: #ffffff; 
  border-radius: 10px; 
  color: #000; 
  padding: 10px 20px; 
  margin-top: 10px; 
  max-width: 1000px; 
  max-height: 100px;

  display: flex;
  flex-direction: column; /* 縦に並べる */
  justify-content: center; /* 縦方向中央 */
  align-items: center;     /* 横方向中央 */
  text-align: center;      /* 複数行でも中央揃え */
  box-sizing: border-box;
}

.label-box p {
  margin: 2px 0; /* 上下の余白を少なめに */
}

/* ポップアップ */
.popup-overlay { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  background: rgba(0,0,0,0.6); 
  z-index: 100; 
}
.popup-content { 
  position: relative; 
  text-align: center; 
}

.popup-box { 
  background-color: #555867; 
  display: inline-block; 
  width: 300px;       /* 横幅をある程度固定 */
  max-height: 75vh; 
  position: relative; 
  padding: 60px 25px 25px 25px; 
  overflow: hidden;   /* 中身がはみ出さないように */
  overflow-y: auto;
}


.popup-frame { 
  position: relative; 
  width: 300px; 
  height: 300px; 
  margin: 15px auto 0; /* 上余白 */
}
.popup-frame-img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; 
}

.popup-img { 
  position: absolute; 
  top: 12%; 
  left: 5%; 
  width: 90%; 
  height: auto; 
  max-height: 77%;
  object-fit: contain;
}

.popup-text-box { 
  background-color: #ffffff; 
  border-radius: 10px; 
  padding: 10px 15px;  
  color: #000; 
  padding: 15px; 
  margin-top: 20px; 
  text-align: center; 
  max-height: 1000px;     
  font-size: clamp(0.8em, 2vw, 1em); /* 文字数に応じて自動調整 */
}
.popup-text-box p {
  margin: 5px 0;   /* ← デフォルトmarginを小さくする */
}

.popup-desc { 
  font-size: 1em; 
  margin: 0.5em 0; 
}

/* ×ボタン */
.close-btn {
  position: absolute;
  top: 0px;    
  right: 0px;  
  width: 85px;  
  height: 85px; 
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn img {
  width: 35px;      
  height: 35px;
  object-fit: contain;
  pointer-events: none; 
}

/* PC版で大きく表示 */

@media screen and (min-width: 481px) {
  .frame { 
    width: 450px;   /* 額縁幅 */
    height: 450px;  /* 額縁高さ */
    padding: 5px; 
    box-sizing: border-box; 
  }
  .item-img { 
    top: 60px;
    left: 74px;
    width: 300px;    /* 好きな小さめサイズ */
    height: 335px;   /* 好きな小さめサイズ */
    object-fit: contain; /* 枠内に収まるようにする */
  }
  .label-box { 
    padding: 15px 20px; /* ラベルボックス拡大 */
    font-size: 1.4em; 
    margin-top: 15px; 
  }

.popup-box {
  padding: 90px 0 30px; /* 上下左右とも1.5倍 */
}

.popup-frame {
  width: 300px;   /* 200 → 300 */
  height: 300px;  /* 200 → 300 */
  left: 0px;
}
.popup-frame-img {
  width: 100%;
  height: 100%;
  left: 0px;
  object-fit: contain;
}

.popup-img {
  width: 195px;   /* 130 → 195 */
  height: 240px;  /* 160 → 240 */
  top: 36px;      /* 24 → 36 */
  left: 52.5px;
}

  .popup-desc{font-size:0.9em;}
}


/* レスポンシブ */
@media screen and (max-width: 480px){
 .bazaar_title{
  width: 180px;
  height: 72px;
  }
  h1{
  font-size:32px;
  }
  .bazaar_attention{
  font-size:18px;
  }
  .category-img{
  width:120px;
  height:120px;
  }
  .frame{width:180px;height:180px;}
  .item-img{width:110px;height:130px;top:25px;left:34.5px;}
  .label-box{font-size:0.9em;}
  .popup-box{padding:60px 20px 20px 20px;}
  .popup-frame{width:200px;height:200px;}
  .popup-img{width:130px;height:160px;top:24px;left:34.5px;}
  .popup-desc{font-size:0.9em;}
  .close-btn{width:85px;height:85px;}
  .close-btn img{width:30px;height:30px;}
}