/* ベースのhtmlとbody */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  color: #ffffff;
  font-family: 'Zen Old Mincho', 'Hiragino Kaku Gothic ProN', Meiryo, serif;
  position: relative;
  z-index: 0;
}

/* 背景固定レイヤー（アドレスバーも縮む対応） */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;

  background: linear-gradient(
    to bottom,
    #0d0322 0%,
    #091130 30%,
    #352f63 65%,
    #6d5879 85%,
    #bfa4b0 100%
  );
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: scroll; /* Safariで安定する指定 */
}

/* 明朝体をすべての要素に */
body, html,
h1, h2, h3, h4, h5, h6,
p, span, div, label, input, textarea, button, a {
  font-family: 'Zen Old Mincho', 'Hiragino Mincho ProN', 'MS Mincho', serif;
}



.noctina-subtext {
  font-size: 1.1rem;
  color: #ffffff;
  margin-top: 0.4em;
  text-align: center;
  font-weight: normal;
  letter-spacing: 0.05em;
  filter: drop-shadow(0 0 1px #353041) drop-shadow(0 0 10px #9891b0);
}

.sky {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0;
  animation: twinkle 2s infinite ease-in-out;
}

@keyframes twinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.curved-star {
  position: absolute;
  width: 120px;
  height: 1px;
  background: linear-gradient(to left, white, transparent);
  opacity: 0.4;
  filter: blur(0.5px);
  transform-origin: right center;
  z-index: 0;
}

.bgm-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  opacity: 0.8;
  background: none;
}

.bgm-icon img {
  max-width: 80%;
  max-height: 80%;
  display: block;
}

.bgm-icon:hover { opacity: 1; }

.sub-title {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 1px #353041) drop-shadow(0 0 10px #9891b0);
}

/* グリッド */
.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* ← これ */
  justify-items: center;                            /* ← これ */
  gap: 24px;
  padding: 30px 10px;
  max-width: 780px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .character-grid {
    display: grid;
    grid-template-columns: repeat(2, 160px); /* カード幅固定！ */
    justify-content: center; /* 全体を中央寄せ！ */
    gap: 24px;
    padding: 30px 10px;
  }

  .character-card {
  width: 90%;
  margin: 0 auto;
}
}


.character-card {
  width: 100%;        /* ← 修正 */
  max-width: 160px;   /* ← 限界を決める */
  height: auto;
  perspective: 1000px;
  position: relative;
  text-align: center;
  border-radius: 16px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-inner {
  width: 100%;
  height: 300px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s linear;
  transform-origin: center center;
}

/* PC: ホバー中回転 */
@media (hover: hover) {
  .character-card:hover .card-inner {
    animation: rotateCard 4s linear infinite;
  }
}

/* スマホ用: タップで回転 */
.character-card.active .card-inner {
  animation: rotateCard 4s linear infinite;
}

@keyframes rotateCard {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  background: #f2eceb;
  border-radius: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
  transform: rotateY(0deg); /* ← 追加（表も明示） */
}

.card-back {
  transform: rotateY(180deg);
}

.card-front img,
.card-back img {
  width: auto;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 追加 */
.character-name + .detail-button {
  margin-top: 2px;
  padding-top: 2px;
}



/* キャラ名 */
.character-name {
  margin: 8px 0 4px;
  font-size: 1rem;
  font-weight: bold;
  color: #ffffff;
  text-align: center;
  border-bottom: 1px dashed #aaa;
  filter: drop-shadow(0 0 1px #353041) drop-shadow(0 0 10px #9891b0);
}

/* ボタン */
.detail-button {
  margin-top: 6px;
  padding: 6px 12px;
  background: #ffffff00;
  border: none;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
  filter: drop-shadow(0 0 1px #ffffff);
  box-shadow: 0 0 5px rgba(94, 93, 107, 0.2);
}

/* hover時に一緒に動く感を出す */
.character-card:hover .character-name,
.character-card:hover .detail-button {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}


/* モーダル */
.character-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS対応 */
  touch-action: pan-y; /* 縦スクロールだけ許可 */
}




body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}


.character-modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(to bottom, #281fa252, #543d8366, #fff0fb4e);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(188, 173, 192, 0.668);
  color: #fff;
  padding: 20px 20px 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  position: relative;
  box-sizing: border-box;
  max-height: 90vh;
  overflow-y: auto;
}

@media screen and (max-width: 768px) {
  .modal-content {
    max-height: 80vh;      /* 枠だけ制限 */
    height: auto;          /* 中身の自然な高さ維持 */
    overflow-y: auto;      /* スクロール許可 */
    box-sizing: border-box;
  }
}
.modal-content {
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.modal-content::-webkit-scrollbar {
  width: 2px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}






.modal-content .character-image-wrapper {
  width: 100%;
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  margin-bottom: 12px;
}

.modal-content .character-image-wrapper img {
  max-height: 100%;
  object-fit: contain;
}

.modal-description {
  color: #ffffff;
  margin: 0 auto 12px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.modal-toggle-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-toggle-buttons button {
  position: relative;
  padding: 8px 20px;
  background: transparent;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: box-shadow 0.4s ease;
}

.modal-toggle-buttons button:hover {
  box-shadow: 0 0 10px 2px #fff;
}


.close-button {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
}

.close-modal-btn {
  margin-top: 6px;
  padding: 6px 12px;
  background: #ffffff00;
  border: none;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
  filter: drop-shadow(0 0 1px #ffffff);
  box-shadow: 0 0 5px rgba(94, 93, 107, 0.2);
}

.close-modal-btn:hover {
transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

.section-title {
  position: relative;
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  filter: drop-shadow(0 0 1px #353041) drop-shadow(0 0 10px #9891b0);
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 220vw; /* ← ここを25vw→28vwくらいに拡大（様子見て調整OK） */
  max-width: 300px; /* ← 最大幅も少しアップしてもいいかも */
  height: 2px;
  background: linear-gradient(to right, transparent, #fff, transparent);
  transform: translateX(-50%);
  opacity: 0.7;
}

.noctina-subtext-inline {
  font-size: 1.1rem;
  color: #ffffff;
  margin-top: 0.4em;
  text-align: center;
  font-weight: normal;
  letter-spacing: 0.05em;
  filter: drop-shadow(0 0 1px #353041) drop-shadow(0 0 1px #9891b0);
}

.youtube-link {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(144, 140, 170, 0.3);
  transition: all 0.3s ease;
}



.youtube-link:hover {
  box-shadow: 0 0 14px rgba(144, 140, 170, 0.6);
}

.youtube-link-wrapper {
  text-align: center;
  margin: 20px auto; /* ← 上下余白も調整可 */
}

/* フッター */

.noctina-footer {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
  padding: 16px 6px 4px; /* ← ここだけ少し減らして高さを抑える */
  margin-top: 40px;
  backdrop-filter: blur(8px);
  width: 100%;
  box-sizing: border-box;
}

.noctina-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 2px; /* ← 線の太さはそのまま */
  width: 50%;
  background: linear-gradient(to right, transparent, #ffffffaa, transparent);
  opacity: 0.8;
}




.footer-content {
  max-width: 1024px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px 40px;
  margin-bottom: 14px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.05em;
  border-bottom: 1px dashed transparent;
  transition: border-bottom 0.3s ease;
}

.footer-links a:hover {
  border-bottom: 1px dashed #ffffff;
}

.sns-icons {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.sns-icons img {
  width: 28px;
  height: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.sns-icons img:hover {
  transform: scale(1.2);
  opacity: 0.85;
}

@media (max-width: 600px) {
  .footer-links {
    gap: 16px 24px;
    font-size: 0.95rem;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sns-icons {
    gap: 16px;
  }
}


/* SNSアイコン */
.sns-icons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}

.sns-icons img {
  width: 28px;
  height: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.sns-icons img:hover {
  transform: scale(1.2);
  opacity: 0.85;
}

/* モバイル調整 */
@media (max-width: 600px) {
  .footer-links {
    gap: 16px 20px;
    font-size: 0.95rem;
  }

  .sns-icons {
    gap: 16px;
  }
}

.sns-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2vh;
  margin-bottom: 1.5vh; /* 下にほんの少し空ける（調整しやすい単位） */
}

.sns-links a {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.95rem;
  color: white;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.sns-links a:hover {
  opacity: 1;
  transform: scale(1.05);
}

.sns-links a img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.sns-links a:hover img {
  transform: scale(1.1);
}

@media screen and (max-width: 600px) {
  .sns-links {
    gap: 0.8rem; /* さらに詰める */
    flex-wrap: wrap;
  }

  .sns-links a {
    font-size: 0.75rem;     /* テキストを少し小さく */
    gap: 0.3em;              /* 画像とテキストの隙間を狭く */
  }

  .sns-links a img {
    width: 18px;
    height: 18px;
  }
}

img {
    -webkit-user-drag: none;         /* Safariでのドラッグ防止 */
    -webkit-touch-callout: none;     /* iOS長押しメニュー防止 */
    user-select: none;               /* テキスト選択禁止 */
    pointer-events: auto;            /* hoverイベントを許可するなら必要 */
  }


  