.kanpinpin-image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px auto;
  justify-content: center;
  max-width: 100%;
}

@media (max-width: 768px) {
  .kanpinpin-image-grid {
    padding-left: 20px; /* ← 左右に余白を追加 */
    justify-content: center; /* 念のため中央寄せ */
  }
}

.kanpinpin-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kanpinpin-image-box {
  width: 100px;
  height: 100px;
  border: 1px solid #000;
  position: relative;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kanpinpin-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-label {
  font-size: 20px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-label input {
  display: none;
}

.delete-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #f33;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  cursor: pointer;
}

.kanpinpin-image-box .nickname {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 10px;
  color: #666;
  background: rgba(255,255,255,0.7);
  padding: 2px 4px;
  border-radius: 3px;
}

.kanpinpin-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.kanpinpin-lightbox-modal {
  position: relative;
}

.kanpinpin-lightbox-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border: 4px solid white;
  box-shadow: 0 0 10px black;
}

.kanpinpin-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 24px;
  background: white;
  color: black;
  border-radius: 50%;
  padding: 5px 10px;
  cursor: pointer;
}

.upload-ranking {
  background: #fff;
  border: 6px solid #FFD700;
  border-radius: 16px;
  padding: 20px;
  font-family: 'PixelMplus10-Regular', sans-serif;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  text-align: center;
  width: 100%;
  max-width: 70%;
  margin: 0 auto 30px;
  box-sizing: border-box;
}

/* タイトル */
.upload-ranking h3 {
  font-size: 24px;
  font-weight: bold;
  color: #555;
  margin-bottom: 15px;
  position: relative;
}

.upload-ranking h3::before {
  content: "👑";
  display: block;
  font-size: 32px;
  margin-bottom: 4px;
}

/* ランキングリスト */
.upload-ranking ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.upload-ranking li {
  font-size: 18px;
  color: #333;
  margin: 16px 0;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* メダルアイコン */
.upload-ranking li:nth-child(1)::before,
.upload-ranking li:nth-child(2)::before,
.upload-ranking li:nth-child(3)::before {
  content: "";
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 50%;
  text-align: center;
  color: #fff;
  font-family: sans-serif;
  position: relative;
}

.upload-ranking li:nth-child(1)::before {
  content: "1";
  background: #FFD700;
  box-shadow: 0 0 3px #FFD700;
}

.upload-ranking li:nth-child(2)::before {
  content: "2";
  background: #C0C0C0;
  box-shadow: 0 0 3px #C0C0C0;
}

.upload-ranking li:nth-child(3)::before {
  content: "3";
  background: #CD7F32;
  box-shadow: 0 0 3px #CD7F32;
}

.upload-logs-box {
  max-width: 70%;
  margin: 0 auto;
  border: 1px solid #ccc;
  padding: 10px;
  box-sizing: border-box;
  background-color: #f9f9f9;
  border-radius: 10px;
}

@media screen and (max-width: 768px) {
  .upload-logs-box {
  font-size: 10px;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #ccc;
  padding: 10px;
  box-sizing: border-box;
  background-color: #f9f9f9;
  border-radius: 10px;
  }
}

@media screen and (max-width: 768px) {
  .upload-ranking {
  background: #fff;
  border: 6px solid #FFD700;
  border-radius: 12px;
  padding: 20px;
  font-family: 'PixelMplus10-Regular', sans-serif;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  text-align: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 30px;
  box-sizing: border-box;
  }
}

@media screen and (max-width: 768px) {
  .upload-ranking h3 {
  font-size: 20px;
  font-weight: bold;
  color: #555;
  margin-bottom: 15px;
  position: relative;
  }
}

.kanpinpin-gallery-header {
    margin-bottom: 1em;
    text-align: center;
}
.kanpinpin-gallery-header h3 {
    font-size: 1.7em;
    margin-bottom: 0.3em;
}
.kanpinpin-gallery-header p {
    color: #666;
    font-size: 0.90em;
    line-height: 1.5;
}

@media screen and (max-width: 768px) {
.kanpinpin-gallery-header h3 {
    font-size: 1.4em;
    margin-bottom: 0.3em;
  }
}