html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  /* iPhone等の固定背景問題回避のため、背景指定を疑似要素へ移動 */
  /* background: linear-gradient(135deg, #181820cc 0%, #23232bcc 100%), url('img/ad.jpg') center center/cover no-repeat fixed; */
  background-color: #181820; /* fallback */
  color: #e6e6fa;
  font-family: Cambria, serif;
  margin: 0;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: 0; 
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    linear-gradient(135deg, #181820cc 0%, #23232bcc 100%),
    url('img/ad.jpg') center center/cover no-repeat;
  /* iOSでのちらつき対策 */
  will-change: transform;
}

header {
  text-align: center;
  padding: 40px 0 20px 0;
}

.main-copy {
  font-size: 1.5rem;
  color: #e6e6fa;
  font-weight: bold;
  letter-spacing: 0.08em;
  margin: 48px 0 32px 0;
  text-shadow: 0 0 12px #a020f0cc;
  opacity: 0;
  animation: fadeInCopy 1.2s 0.3s forwards;
  font-family: Cambria, serif;
}

@keyframes fadeInCopy {
  to { opacity: 1; }
}

.logo {
  width: 100%;
  max-width: 540px;
  height: auto;
  display: block;
  margin: 0 auto 18px auto;
  filter: drop-shadow(0 0 24px #a020f0);
  opacity: 0;
  animation: fadeInLogo 1.2s ease-out forwards;
}

@keyframes fadeInLogo {
  to { opacity: 1; transform: scale(1.08); }
}

.event-title {
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  color: #6a5a8a;
  text-shadow: 0 0 16px #23232b;
  margin: 0;
  opacity: 0;
  animation: fadeInTitle 1.2s 0.5s forwards;
}

@keyframes fadeInTitle {
  to { opacity: 1; }
}

.event-date, .hashtag {
  font-size: 1.2rem;
  margin: 8px 0;
  color: #e6e6fa;
  opacity: 0;
  animation: fadeInInfo 1s 1s forwards;
}

@keyframes fadeInInfo {
  to { opacity: 1; }
}

.cast-section {
  margin: 0 auto 0 auto;
  max-width: 900px;
  text-align: center;
}

.cast-section h2 {
  font-size: 2.2rem;
  color: #6a5a8a;
  margin-top: 0;
  margin-bottom: 24px;
  letter-spacing: 0.08em;
}

.cast-list {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 64px;
  align-items: center;
}
.cast-row {
  display: flex;
  flex-direction: row;
  gap: 32px;
  justify-content: center;
}

.cast-card {
  background: rgba(40, 0, 60, 0.85);
  border: 2px solid #6a5a8a;
  border-radius: 18px;
  width: 200px;
  padding: 24px 16px 16px 16px;
  box-shadow: 0 0 24px #23232b55;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.4s cubic-bezier(.68,-0.55,.27,1.55), box-shadow 0.4s;
  opacity: 0;
  animation: fadeInCard 1.2s forwards;
}

.cast-card:nth-child(1) { animation-delay: 0.2s; }
.cast-card:nth-child(2) { animation-delay: 0.4s; }
.cast-card:nth-child(3) { animation-delay: 0.6s; }
.cast-card:nth-child(4) { animation-delay: 0.8s; }

@keyframes fadeInCard {
  to { opacity: 1; transform: translateY(-12px) scale(1.04); }
}

.cast-card:hover {
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 32px #a020f0cc;
  border: 2px solid #bbaaff;
}

.cast-img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #6a5a8a;
  margin-bottom: 14px;
  box-shadow: 0 0 16px #23232baa;
}

.cast-info {
  text-align: center;
}

.cast-name {
  display: block;
  font-size: 1.3rem;
  font-weight: bold;
  color: #e6e6fa;
  margin-bottom: 6px;
  letter-spacing: 0.06em;
}

.cast-copy {
  display: block;
  font-size: 1.05rem;
  color: #bbaaff;
  font-style: italic;
  letter-spacing: 0.04em;
}

.ad-section {
  text-align: center;
  margin: 56px 0 32px 0;
}

.ad-banner {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 0 32px #a020f088;
  opacity: 0;
  animation: fadeInAd 1.2s 1.2s forwards;
}

@keyframes fadeInAd {
  to { opacity: 1; transform: scale(1.04); }
}

.entry-section {
  text-align: center;
  margin-top: 64px;
  margin-bottom: 40px;
}

.entry-btn {
  display: inline-block;
  background: rgba(40, 0, 60, 0.85);
  color: #fff;
  font-size: 1.3rem;
  font-weight: bold;
  padding: 18px 48px;
  border-radius: 18px;
  border: 2px solid #6a5a8a;
  text-decoration: none;
  box-shadow: 0 0 24px #4b006e55;
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s, border 0.3s;
  opacity: 0;
  animation: fadeInBtn 1.2s 1.5s forwards;
}

@keyframes fadeInBtn {
  to { opacity: 1; transform: scale(1.05); }
}

.entry-btn:hover {
  background: rgba(60, 0, 90, 0.95);
  border: 2px solid #bbaaff;
  transform: scale(1.08) rotate(-2deg);
  box-shadow: 0 0 32px #a020f0cc;
}

/* モーダル画像拡大表示 */
.modal-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(30,0,40,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeInModal 0.3s;
}
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* modal内にカードラッパーを作り、キャプションを画像上に重ねる */
.modal-card {
  position: relative;
  display: inline-block;
  border-radius: 24px;
  overflow: hidden; /* キャプションが画像の下部に被るようにする */
  box-shadow: 0 0 64px #23232bcc;
  border: 4px solid #bbaaff;
  background: #1a0026;
  /* 大きめ表示を優先（横幅が狭い場合は高さ基準で縮小） */
  max-width: 92vw;
  max-height: 92vh;
}

/* 画像はカード内で表示（余白等はカード側で管理） */
.modal-img {
  display: block;
  max-width: 92vw;
  max-height: 84vh; /* キャプション領域を確保するため若干余裕を持たせる */
  width: auto;
  height: auto;
  border-radius: 0; /* カードでラウンドするので個別にしない */
  object-fit: cover;
}

/* 下部約1/3を覆うキャプション（グラデ＋ブラーで高級感） */
.modal-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 28px;
  /* 下から約1/3〜40%を覆うグラデーションを使用（大きめ表示でも被りが自然） */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(10,6,20,0.5) 30%, rgba(10,6,20,0.9) 100%);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-sizing: border-box;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

/* 名前とセリフの見た目調整（大きめ表示向けに拡大） */
.modal-name {
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff7ee;
  text-shadow: 0 4px 28px rgba(160,32,240,0.35);
  letter-spacing: 0.06em;
}

.modal-quote {
  font-style: italic;
  color: #e6e6fa;
  font-size: 1.15rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(10px);
  animation: slideUpCaption 0.36s 0.04s forwards cubic-bezier(.2,.9,.2,1);
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

/* キャプション出現アニメーション */
@keyframes slideUpCaption {
  to { opacity: 1; transform: translateY(0); }
}

/* クリックで閉じられる背景のカーソルはそのまま維持 */
.modal-bg {
  cursor: pointer;
}

/* モバイルではキャプションの余白とフォントを調整 */
@media (max-width: 700px) {
  .modal-card {
    max-width: 96vw;
    max-height: 96vh;
  }
  .modal-img {
    max-width: 96vw;
    max-height: 78vh;
  }
  .modal-caption {
    padding: 14px 16px;
    min-height: 90px;
  }
  .modal-name { font-size: 1.15rem; }
  .modal-quote { font-size: 1rem; }
}

.interior-section {
  max-width: 900px;
  margin: 64px auto 0 auto;
  text-align: center;
}
.interior-section h2 {
  font-size: 2.2rem;
  color: #6a5a8a;
  margin: 0 0 18px 0;
  letter-spacing: 0.08em;
}
.interior-copy {
  color: #e6e6fa;
  font-size: 1.1rem;
  margin-bottom: 32px;
  letter-spacing: 0.04em;
}
.interior-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  justify-items: center;
}
/* .interior-card {  上記で統合済み } */

.interior-card {
  cursor: pointer;
}
.interior-card:hover {
  transform: scale(1.04) rotate(-1deg);
  box-shadow: 0 0 32px #a020f0cc;
}
.interior-img {
  width: 360px;
  height: 240px;
  object-fit: cover;
  border-radius: 24px;
  border: 2px solid #bbaaff;
  background: #181820;
  transition: box-shadow 0.3s;
  box-shadow: 0 0 12px #23232baa;
  cursor: pointer;
  display: block;
}
@media (max-width: 700px) {
  .interior-img { width: 100%; height: auto; }
  .interior-grid { grid-template-columns: 1fr; }
}

footer {
  background: #1a0026;
  color: #6a5a8a;
  text-align: center;
  padding: 24px 0 16px 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-top: 32px;
}

footer a {
  color: #e6e6fa;
  text-decoration: underline;
  transition: color 0.2s;
}

footer a:hover {
  color: #6a5a8a;
}
@media (max-width: 700px) {
  body {
    font-size: 15px;
    padding: 0;
  }
  header {
    padding: 24px 0 12px 0;
  }
  .logo {
    max-width: 80vw;
    height: auto;
  }
  .main-copy {
    font-size: 1.1rem;
    margin: 32px 0 8px 0;
    padding: 0 8px;
  }
  .event-date, .hashtag {
    font-size: 1rem;
  }
  .cast-section {
    max-width: 100vw;
    margin: 0 auto 0 auto;
    padding: 0 4vw;
  }
  .cast-section h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  .cast-list {
    gap: 32px;
    margin-top: 24px;
  }
  .cast-row {
    flex-direction: column;
    gap: 24px;
  }
  .cast-card {
    width: 90vw;
    min-width: 0;
    padding: 16px 8px 12px 8px;
  }
  .cast-img {
    width: 60vw;
    height: 60vw;
    max-width: 220px;
    max-height: 220px;
  }
  .ad-section {
    margin: 32px 0 16px 0;
  }
  .ad-banner {
    width: 90vw;
    height: 90vw;
    max-width: 220px;
    max-height: 220px;
  }
  .interior-section {
    max-width: 100vw;
    margin: 32px auto 0 auto;
    padding: 0 4vw;
  }
  .interior-section h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  .interior-copy {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }
  .interior-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .interior-card {
    padding: 6px;
  }
  .interior-img {
    width: 90vw;
    height: 67vw;
    max-width: 320px;
    max-height: 240px;
  }
  .entry-section {
    margin-top: 32px;
    margin-bottom: 24px;
  }
  .entry-btn {
    font-size: 1.05rem;
    padding: 14px 18vw;
    border-radius: 18px;
  }
  footer {
    font-size: 0.95rem;
    padding: 16px 0 10px 0;
  }
}
@media (max-width: 700px) {
  .cast-row {
    flex-direction: column !important;
    gap: 24px;
  }
}
.cast-section-alt {
  max-width: 900px;
  margin: 64px auto 0 auto;
  text-align: center;
}
.cast-section-alt h2 {
  font-size: 2.2rem;
  color: #6a5a8a;
  margin: 0 0 24px 0;
  letter-spacing: 0.08em;
}
.cast-list-alt {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}
.cast-card-alt {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: rgba(40, 0, 60, 0.85);
  border: 2px solid #6a5a8a;
  border-radius: 18px;
  box-shadow: 0 0 24px #23232b55;
  padding: 18px 32px;
  max-width: 600px;
  width: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
}
.cast-card-alt:hover {
  transform: scale(1.04) rotate(-1deg);
  box-shadow: 0 0 32px #a020f0cc;
}
.cast-img-alt {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #bbaaff;
  margin-right: 32px;
  box-shadow: 0 0 16px #23232baa;
  background: #181820;
}
.cast-info-alt {
  text-align: left;
}
.cast-name-alt {
  display: block;
  font-size: 1.4rem;
  font-weight: bold;
  color: #e6e6fa;
  margin-bottom: 10px;
  letter-spacing: 0.06em;
}
.cast-copy-alt {
  display: block;
  font-size: 1.1rem;
  color: #bbaaff;
  font-style: italic;
  letter-spacing: 0.04em;
}

@media (max-width: 700px) {
  .logo {
    max-width: 80vw;
    height: auto;
  }
  .cast-section-alt {
    margin: 32px auto 0 auto;
    padding: 0 4vw;
  }
  .cast-section-alt h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  .cast-card-alt {
    flex-direction: column;
    align-items: center;
    padding: 14px 4vw;
    max-width: 98vw;
  }
  .cast-img-alt {
    margin-right: 0;
    margin-bottom: 12px;
    width: 60vw;
    height: 60vw;
    max-width: 220px;
    max-height: 220px;
  }
  .cast-info-alt {
    text-align: center;
  }
  .cast-name-alt {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  .cast-copy-alt {
    font-size: 0.95rem;
  }
}
.cast-section-portrait {
  max-width: 900px;
  margin: 16px auto 0 auto;
  text-align: center;
}
.cast-section-portrait h2 {
  font-size: 2.2rem;
  color: #6a5a8a;
  margin: 0 0 24px 0;
  letter-spacing: 0.08em;
}
.cast-list-portrait {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  justify-items: center;
}
.cast-card-portrait {
  background: rgba(40, 0, 60, 0.85); /* 念のため残すが画像で覆う */
  border: 4px solid #bbaaff; /* 枠線を強調 */
  border-radius: 20px;
  box-shadow: 0 0 24px #23232b55;
  padding: 0; /* Paddingなしで画像を全面に */
  width: 100%;
  max-width: 300px; /* カルーセルのカード幅 */
  height: 420px; /* 高さを固定して写真を大きく見せる */
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden; /* 画像のはみ出しをカット */
  position: relative; /* キャプションの絶対配置基準 */
  transition: transform 0.3s, box-shadow 0.3s;
}

.interior-card {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
}
.cast-card-portrait:hover {
  /* scaleはカルーセルJSと競合する可能性あるが、一旦border強化のみ */
  box-shadow: 0 0 32px #a020f0cc;
  border-color: #e6e6fa;
}

.cast-img-portrait {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 0; /* カード側でRadius */
  border: none;
  margin: 0;
  box-shadow: none;
  background: #181820;
}

.cast-info-portrait {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px 16px 16px 16px; /* 上を開けてグラデーションを見せる */
  text-align: left;
  /* 下から暗くなるグラデーション（文字を読みやすく） */
  background: linear-gradient(to top, rgba(16,0,32,0.95) 0%, rgba(16,0,32,0.6) 60%, rgba(0,0,0,0) 100%);
  box-sizing: border-box;
}

.cast-name-portrait {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  text-shadow: 0 2px 10px rgba(160,32,240,0.5);
  letter-spacing: 0.08em;
}

.cast-copy-portrait {
  display: block;
  font-size: 0.95rem;
  color: #e6e6fa;
  font-style: italic;
  opacity: 0.9;
  letter-spacing: 0.04em;
}

@media (max-width: 700px) {
  .cast-section-portrait {
    margin: 16px auto 0 auto;
    padding: 0 4vw;
  }
  .cast-section-portrait h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  .cast-list-portrait {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* スマホ版もカルーセル設定で上書きされるので最低限のスタイル維持 */
  .cast-card-portrait {
    max-width: 100%;
    /* margin等はカルーセル設定に任せる */
  }
  .cast-img-portrait {
    /* 画像サイズは親divに従う */
    width: 100%;
    height: 100%;
  }
  .cast-name-portrait {
    font-size: 1.4rem;
  }
  .cast-copy-portrait {
    font-size: 0.9rem;
  }
}

/* --- 3D Carousel Styles --- */
.cast-list-portrait {
  display: block; /* Grid解除 */
  position: relative;
  width: 300px; 
  height: 400px; /* カード高さ確保 */
  margin: 80px auto 120px auto; /* 上下に回転余地を持たせる */
  perspective: 1000px;
  overflow: visible;
  padding: 0;
}

.carousel-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.1, 0, 0.2, 1);
  /* ドラッグ中はtransitionを0sにするJS制御を入れる予定 */
}

.cast-card-portrait {
  /* 絶対配置に変更 */
  position: absolute !important;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 380px; 
  /* 裏側でも表示はさせるが、暗くするなどの処理はJSまたはCSSで */
  backface-visibility: hidden; 
  opacity: 0.95;
  user-select: none;
  /* 既存Hoverエフェクトの上書き・無効化 */
  transition: opacity 0.3s;
  animation: none;
}

/* スマホ表示の上書き */
@media (max-width: 700px) {
  .cast-list-portrait {
    width: 240px; /* 少し狭める */
    height: 340px; /* 高さを抑える */
    margin: 50px auto 90px auto;
    perspective: 800px;
    display: block; /* Grid上書き */
    grid-template-columns: none;
    gap: 0;
  }
  .cast-card-portrait {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    height: 100%;      /* 親の高さに合わせる */
    min-height: 100%;
  }
  .cast-img-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}