/* ==============================
   creature-detail.css
   生物個別ページ専用CSS
============================== */

/* ==============================
   ページ全体
============================== */

.page-wrap {
  padding-top: 18px;
}

/* ==============================
   生物名ヘッダー
============================== */

.creature-detail-head {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 14px 34px 16px;
  text-align: center;
  border: 1px solid rgba(128, 235, 255, 0.58);
  border-radius: 14px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 74, 105, 0.42),
      rgba(0, 145, 175, 0.18),
      rgba(0, 29, 48, 0.5)
    );
  box-shadow:
    0 0 18px rgba(0, 210, 255, 0.2),
    inset 0 0 18px rgba(148, 239, 255, 0.08);
  backdrop-filter: blur(4px);
}

.creature-detail-title {
  margin: 0;
  color: #35f4ff;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow:
    0 0 10px rgba(53, 244, 255, 0.9),
    0 3px 8px rgba(0, 0, 0, 0.75);
}

.creature-detail-subtitle {
  margin-top: 3px;
  color: #bff8ff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

/* ==============================
   メインビジュアル
============================== */

.creature-hero {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  border: 1px solid rgba(128, 235, 255, 0.58);
  background: rgba(0, 18, 28, 0.78);
  box-shadow:
    0 0 24px rgba(0, 220, 255, 0.22),
    inset 0 0 22px rgba(255, 255, 255, 0.05);
}

.creature-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) brightness(0.9);
}

.creature-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0, 12, 20, 0.24), transparent 42%),
    radial-gradient(circle at 20% 80%, rgba(0, 220, 255, 0.12), transparent 34%);
}

/* 左下キャプション欄 */
.creature-info-box {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 2;
  width: min(300px, calc(100% - 48px));
  padding: 18px 18px 16px;
  border: 1px solid rgba(128, 235, 255, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 36, 52, 0.88),
      rgba(0, 78, 98, 0.68)
    );
  box-shadow:
    0 0 18px rgba(0, 220, 255, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(4px);
}

.creature-info-note {
  margin: 0 0 12px;
  color: #a9f4ff;
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
}

.creature-info-box dl {
  margin: 0;
}

.creature-info-box div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  padding: 5px 0;
}

.creature-info-box dt {
  color: #f4fdff;
  font-size: 1.05rem;
  font-weight: 500;
}

.creature-info-box dd {
  margin: 0;
  color: #dffcff;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
}

/* メイン画像内：印象的な説明文 */
.creature-flavor-text {
  margin: 0 0 16px;
  padding-bottom: 12px;
  color: #bff8ff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.8;
  font-style: italic;
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(128, 235, 255, 0.28);
  text-shadow:
    0 0 7px rgba(0, 220, 255, 0.55),
    0 2px 5px rgba(0, 0, 0, 0.82);
}

/* ==============================
   脅威度カラー
============================== */

.threat-level {
  font-weight: 600;
}

.threat-separator {
  margin: 0 0.35em;
  color: inherit;
}

.threat-en {
  display: inline;
  margin-left: 0;
}

.threat-harmless {
  color: #8fffd7 !important;
}

.threat-minor {
  color: #ffd700 !important;
}

.threat-threat {
  color: #ff8c00 !important;
}

.threat-extreme {
  color: #ff0000 !important;
}

.threat-lethal {
  color: #dc143c !important;
}

/* ==============================
   共通パネルセクション
============================== */

.creature-section {
  margin-top: 34px;
  padding: 26px 28px;
}

.creature-section-title {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
  padding-bottom: 10px;
  color: #35f4ff;
  font-size: 1.25rem;
  border-bottom: 1px solid rgba(79, 232, 255, 0.55);
  text-shadow: 0 0 8px rgba(53, 244, 255, 0.8);
}

.creature-section p {
  position: relative;
  z-index: 1;
  font-weight: 500;
  color: #dffcff;
  line-height: 1.9;
  font-size: 1rem;
  font-weight: 500;
}



/* ==============================
   PDAデータバンク
============================== */

.pda-image-wrap {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  margin: 8px auto 24px;
}

.pda-image-wrap img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(82, 234, 255, 0.55);
  box-shadow:
    0 0 18px rgba(0, 220, 255, 0.24),
    0 4px 12px rgba(0, 0, 0, 0.45);
}

.source-note {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(79, 232, 255, 0.35);
  color: #a9f4ff !important;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-style: italic;
}

/* ==============================
   テキストセクション
============================== */

.creature-text-section {
  margin-top: 36px;
}

.creature-text-title {
  margin: 0 0 16px;
  padding-bottom: 8px;
  color: #35f4ff;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(79, 232, 255, 0.55);
  text-shadow:
    0 0 8px rgba(53, 244, 255, 0.78),
    0 2px 5px rgba(0, 0, 0, 0.7);
}

.creature-text-section p,
.creature-text-section li {
  color: #e7fbff;
  line-height: 1.9;
  font-weight: 500;
  font-size: 1.05rem;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.75);
}

.creature-text-section ul {
  margin: 0;
  padding-left: 1.4em;
}

.creature-text-section a {
  color: #82f3ff;
  border-bottom: 1px dotted rgba(130, 243, 255, 0.7);
}

.creature-text-section a:hover {
  color: #ffcf62;
  border-bottom-color: rgba(255, 207, 98, 0.9);
}

.threat-section .creature-text-title {
  color: #ff5f9a;
  border-bottom-color: rgba(255, 95, 154, 0.65);
  text-shadow:
    0 0 8px rgba(255, 95, 154, 0.72),
    0 2px 5px rgba(0, 0, 0, 0.7);
}

.trivia-section .creature-text-title {
  color: #ffcf62;
  border-bottom-color: rgba(255, 207, 98, 0.58);
  text-shadow:
    0 0 8px rgba(255, 184, 35, 0.65),
    0 2px 5px rgba(0, 0, 0, 0.7);
}

/* 余談リストの項目間隔 */
.trivia-section li {
  margin-bottom: 1.1em;
}

.trivia-section li:last-child {
  margin-bottom: 0;
}


.related-section .creature-text-title {
  color: #7cf8ff;
}


/* ==============================
   ギャラリー
============================== */

.creature-gallery-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.creature-gallery-item {
  margin: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(82, 234, 255, 0.58);
  background: rgba(0, 24, 36, 0.82);
  box-shadow:
    0 0 14px rgba(0, 220, 255, 0.16),
    inset 0 0 14px rgba(255, 255, 255, 0.04);
}

.creature-gallery-button {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: inherit;
}

.creature-gallery-button img,
.creature-gallery-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.creature-gallery-button img {
  display: block;
  object-fit: cover;
  filter: saturate(1.05) brightness(0.9);
  transition:
    transform 0.28s ease,
    filter 0.28s ease;
}

.creature-gallery-item:hover .creature-gallery-button img {
  transform: scale(1.04);
  filter: saturate(1.18) brightness(1);
}

.creature-gallery-item figcaption {
  padding: 10px 12px;
  color: #dffcff;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  background: rgba(0, 28, 40, 0.9);
  text-shadow:
    0 0 6px rgba(0, 220, 255, 0.6),
    0 2px 4px rgba(0, 0, 0, 0.7);
}

/* 画像未設定用 */
.creature-gallery-item.no-data {
  display: flex;
  flex-direction: column;
}

.creature-gallery-placeholder {
  display: grid;
  place-items: center;
  color: rgba(120, 235, 255, 0.62);
  font-size: 1rem;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.12em;
  background:
    radial-gradient(circle at center, rgba(0, 180, 220, 0.12), transparent 45%),
    linear-gradient(135deg, rgba(0, 14, 22, 0.94), rgba(0, 34, 48, 0.88));
  text-shadow: 0 0 8px rgba(0, 220, 255, 0.5);
}

/* ==============================
   ギャラリーモーダル
============================== */

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.gallery-modal.is-open {
  display: flex;
}

.gallery-modal-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0, 180, 220, 0.16), transparent 46%),
    rgba(0, 8, 14, 0.88);
  backdrop-filter: blur(4px);
}

.gallery-modal-content {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(128, 235, 255, 0.72);
  background: rgba(0, 18, 28, 0.92);
  box-shadow:
    0 0 28px rgba(0, 220, 255, 0.28),
    0 0 44px rgba(0, 0, 0, 0.65),
    inset 0 0 22px rgba(255, 255, 255, 0.05);
}

.gallery-modal-image {
  width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  background: rgba(0, 8, 14, 0.9);
}

.gallery-modal-caption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: min(620px, calc(100% - 36px));
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(128, 235, 255, 0.55);
  background:
    linear-gradient(
      135deg,
      rgba(0, 30, 44, 0.9),
      rgba(0, 80, 104, 0.74)
    );
  color: #f4fdff;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.5;
  text-shadow:
    0 0 8px rgba(0, 220, 255, 0.75),
    0 2px 5px rgba(0, 0, 0, 0.78);
  box-shadow:
    0 0 16px rgba(0, 220, 255, 0.22),
    inset 0 0 14px rgba(255, 255, 255, 0.06);
}

.gallery-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(128, 235, 255, 0.72);
  background: rgba(0, 24, 36, 0.86);
  color: #f4fdff;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    0 0 14px rgba(0, 220, 255, 0.25),
    inset 0 0 12px rgba(255, 255, 255, 0.06);
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-modal-close:hover {
  transform: scale(1.08);
  color: #ffcf62;
  border-color: rgba(255, 184, 35, 0.9);
  box-shadow:
    0 0 18px rgba(255, 184, 35, 0.25),
    0 0 22px rgba(0, 220, 255, 0.22);
}

/* ==============================
   ギャラリーモーダル：前後ボタン
============================== */

.gallery-modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 46px;
  height: 64px;
  transform: translateY(-50%);
  border: 1px solid rgba(128, 235, 255, 0.68);
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      rgba(0, 24, 36, 0.82),
      rgba(0, 78, 98, 0.58)
    );
  color: #f4fdff;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-shadow:
    0 0 8px rgba(0, 220, 255, 0.8),
    0 2px 5px rgba(0, 0, 0, 0.85);
  box-shadow:
    0 0 16px rgba(0, 220, 255, 0.22),
    inset 0 0 14px rgba(255, 255, 255, 0.06);
  transition:
    transform 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.gallery-modal-prev {
  left: 14px;
}

.gallery-modal-next {
  right: 14px;
}

.gallery-modal-nav:hover {
  transform: translateY(-50%) scale(1.05);
  color: #ffcf62;
  border-color: rgba(255, 184, 35, 0.9);
  box-shadow:
    0 0 18px rgba(255, 184, 35, 0.25),
    0 0 24px rgba(0, 220, 255, 0.22);
}

@media screen and (max-width: 760px) {
  .gallery-modal-nav {
    width: 38px;
    height: 54px;
    font-size: 2.2rem;
    border-radius: 10px;
  }

  .gallery-modal-prev {
    left: 8px;
  }

  .gallery-modal-next {
    right: 8px;
  }
}

/* ==============================
   戻るボタン
============================== */

.creature-back-links {
  margin-top: 52px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

.creature-back-button {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  border: 1px solid rgba(120, 220, 255, 0.72);
  background:
    linear-gradient(135deg, rgba(0, 126, 156, 0.82), rgba(0, 58, 86, 0.92));
  color: #f4fdff;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow:
    0 0 8px rgba(0, 220, 255, 0.7),
    0 2px 5px rgba(0, 0, 0, 0.75);
  box-shadow:
    0 0 16px rgba(0, 220, 255, 0.24),
    inset 0 0 16px rgba(255, 255, 255, 0.08);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease;
}

.creature-back-button:hover {
  transform: translateY(-2px);
  color: #ffcf62;
  border-color: rgba(255, 184, 35, 0.9);
  box-shadow:
    0 0 20px rgba(255, 184, 35, 0.26),
    0 0 28px rgba(0, 220, 255, 0.22),
    inset 0 0 18px rgba(255, 255, 255, 0.08);
}

/* ==============================
   スマホ表示
============================== */

@media screen and (max-width: 760px) {
  .creature-detail-head {
    width: 100%;
    margin-bottom: 18px;
    padding: 12px 18px 14px;
  }

  .creature-detail-title {
    font-size: 1.2rem;
  }

  .creature-detail-subtitle {
    font-size: 0.82rem;
  }

  .creature-hero {
    min-height: auto;
  }

  .creature-info-box {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    padding: 14px;
  }

  .creature-info-box div {
    grid-template-columns: 64px 1fr;
  }

  .creature-section {
    padding: 22px 18px;
  }

  .creature-text-section {
    margin-top: 32px;
  }

  .creature-gallery-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .gallery-modal {
    padding: 14px;
  }

  .gallery-modal-content {
    max-height: calc(100vh - 28px);
  }

  .gallery-modal-image {
    max-height: calc(100vh - 80px);
  }

  .gallery-modal-caption {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
  }

  .gallery-modal-close {
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
  }

  .creature-back-links {
    flex-direction: column;
    align-items: center;
  }

  .creature-back-button {
    width: min(100%, 300px);
    text-align: center;
  }
}
