.maintext {
  font-size: xx-large;
  font-weight: bolder;
  text-align: center;
  margin-top: 20px;
  font-size: 1.4rem;
}

#subtext {
  text-align: center;
}

/* =====================
   グリッドレイアウト
   スマホ: 1列、タブレット: 2列、PC: 5列以上
   ===================== */
.originality-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 16px 10px;
  margin: 5px;
}

@media (min-width: 540px) {
  .originality-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

@media (min-width: 900px) {
  .originality-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =====================
   カード
   --team-color は JS から inline style で注入される
   ===================== */
.originality-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-top: 5px solid var(--team-color, #bf0000);
  transition: box-shadow 0.2s, transform 0.2s;
}

.originality-card:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* =====================
   画像コンテナ
   画像の実際のアスペクト比に合わせて高さが変わる
   ===================== */
.card-image-container {
  width: 100%;
  /* 固定高なし：画像の縦横比をそのまま反映 */
  overflow: hidden;
  background: #f0f0f0;
}

.card-img {
  width: 100%;
  height: auto;          /* 画像本来の縦横比を維持 */
  display: block;
  object-fit: contain;   /* 余白が出るが画像が切れない */
  cursor: zoom-in;
  transition: transform 0.3s;
}

.card-img:hover {
  transform: scale(1.03);
}

/* =====================
   カード本文
   ===================== */
.card-body {
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.dan-badge {
  display: inline-block;
  background-color: var(--team-color, #bf0000);
  color: #fff;
  /* 背景色が明るい場合に文字を読みやすくする */
  mix-blend-mode: normal;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: bold;
  margin-bottom: 8px;
  width: fit-content;
  /* 薄い色でも文字が読めるよう影を付ける */
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.group-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-family: 'Zen Antique', serif;
  line-height: 1.4;
  color: #1a1a1a;
}

.group-description {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.6;
  margin: 0;
  white-space: pre-wrap; /* 改行を反映 */
}

/* =====================
   ローディング・メッセージ
   ===================== */
.loading, .message, .message-error {
  text-align: center;
  grid-column: 1 / -1;
  padding: 40px;
  color: #666;
}
.message-error { color: #d9534f; }

/* =====================
   画像拡大モーダル
   notification-banner.js と同じ classList.add("show") 方式
   ===================== */
#imgModal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

#imgModal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: origModalFadeIn 0.18s ease;
}

@keyframes origModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* モーダル内の拡大画像 */
#imgModal .modal-content {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  cursor: default;
  display: block;
}

/* キャプション */
#caption {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  white-space: nowrap;
  max-width: 88vw;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* 閉じるボタン */
#imgModal .close {
  position: fixed;
  top: 14px;
  right: 20px;
  color: #fff;
  font-size: 2.2rem;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  opacity: 0.85;
  transition: opacity 0.2s;
  z-index: 1001;
}

#imgModal .close:hover {
  opacity: 1;
}