:root {
  --bg-main: #ffffff;
  --c-purple: #4e3b5d;
  --c-lavender: #d4c3dd;
  --c-beige: #ebe9d6;
  --font-title: 'vdl-kuromincho', serif;
  --font-fashion: 'Shippori Mincho', 'Yu Mincho', serif;
  --sans: 'Zen Kaku Gothic New', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  width: 100%;
  overflow-x: hidden;
  background: var(--bg-main);
  color: var(--c-purple);
  font-family: var(--sans);
  font-weight: 500;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* ================= ローディング画面 ================= */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.loading-screen.is-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-text {
  font-family: var(--font-title) !important;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--c-purple);
  letter-spacing: 0.12em;
  display: flex;
}

.loading-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  animation: loadingLoop 4s infinite;
  animation-delay: calc(var(--i) * 0.08s);
}

@keyframes loadingLoop {
  0% { opacity: 0; transform: translateY(10px); }
  20%, 60% { opacity: 1; transform: translateY(0); }
  75%, 100% { opacity: 0; transform: translateY(-8px); }
}

/* ================= 固定ヘッダー基本（スマホ） ================= */
.fixed-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 76px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
  width: 100%;
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.35s ease;
}

.fixed-header.is-hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none !important;
}

.fixed-header.is-hidden .header-logo,
.fixed-header.is-hidden .menu-btn,
.fixed-header.is-hidden .header-nav {
  pointer-events: none !important;
}

.header-logo, .menu-btn, .header-nav { pointer-events: auto; }
.header-logo img { height: 68px; width: auto; object-fit: contain; }

.header-nav { display: none; }

.menu-btn {
  width: 46px; height: 46px;
  background: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  flex-shrink: 0;
}
.menu-btn span {
  width: 22px; height: 3px;
  background: var(--c-purple);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s, background-color 0.3s;
}

.menu-btn.is-active { background: var(--c-purple); }
.menu-btn.is-active span { background: #ffffff; }
.menu-btn.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-btn.is-active span:nth-child(2) { opacity: 0; }
.menu-btn.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.full-nav {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--c-beige);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-list { list-style: none; text-align: center; }
.nav-list li { margin: 1.5rem 0; }
.nav-link {
  font-family: var(--font-fashion);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--c-purple);
  letter-spacing: 0.15em;
  padding-bottom: 6px;
}

.section-title {
  font-family: var(--font-title) !important;
  font-size: 2rem;
  font-weight: 500;
  text-align: center;
  letter-spacing: 0.12em;
  color: #4e3b5d;
  margin: 0 0 1.8rem 0;
}

.section-title.title-in-box {
  margin-bottom: 1.2rem;
  font-size: 1.7rem;
}

/* ================= セクション共通余白 ================= */
.sec-intro, .sec-chara, .sec-endcard { 
  margin-top: 8rem;
}

/* ================= トップページ ================= */
.top-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.top-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.top-hero::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(
    to bottom, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.8) 80%, 
    #ffffff 100%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-logo-wrap {
  position: absolute;
  top: 65%;
  left: 50%;
  width: 90%;          
  max-width: 450px;    
  z-index: 10;         
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-logo-wrap.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.hero-logo {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(78, 59, 93, 0.25));
}

.top-body { max-width: 600px; margin: 0 auto; padding: 0 16px 60px; }

.intro-outer-box {
  border: 2px solid var(--c-purple);
  padding: 2rem 1.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}
.intro-text {
  font-family: var(--font-fashion);
  color: var(--c-purple);
  text-align: center;
  padding-top: 30px;
}

.intro-line {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

.intro-catch {
  white-space: nowrap;
  -webkit-text-stroke: 0.5px var(--c-purple);
  text-align: center;
  font-family: var(--font-fashion);
  font-weight: 900;
  color: var(--c-purple);
  line-height: 1.6;
  letter-spacing: 0.08em;
  margin-top: 3rem;
  margin-bottom: 0.5rem;
}

.spoiler-note {
  font-family: var(--font-fashion);
  font-size: 1.05rem; /* 文字サイズを拡大 */
  font-weight: 800;   /* 太さを強化 */
  color: var(--c-purple);
  text-align: center;
  margin-bottom: 5rem;
  letter-spacing: 0.08em;
}

.diamond-decor {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 3.2rem auto 1.5rem;
  padding: 0 20px;
}


.d-item {
  width: 12px; height: 12px;
  transform: rotate(45deg);
  flex-shrink: 0;
  margin: 0 2.5px;
  animation: flashSeq 2.8s infinite ease-in-out;
}
.d-purple { background: var(--c-purple); }
.d-beige { background: var(--c-lavender); }

.p1 { animation-delay: 0s; }
.p2 { animation-delay: 0.2s; }
.p3 { animation-delay: 0.4s; }
.p4 { animation-delay: 0.6s; }

@keyframes flashSeq {
  0%, 100% { opacity: 1; transform: rotate(45deg) scale(1); }
  20% { opacity: 0.15; transform: rotate(45deg) scale(0.5); }
  40% { opacity: 1; transform: rotate(45deg) scale(1); }
}

.icon-wrap {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 12px;
  flex-shrink: 0;
}
.icon-wrap img { width: 100%; height: 100%; object-fit: contain; }

.chara-grid-2col {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px 16px;
}
.chara-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.chara-thumb-oval {
  width: 100%;
  aspect-ratio: 1.25 / 1;
  border-radius: 999px;
  border: none;
  overflow: hidden;
  background: var(--c-beige);
  box-shadow: 0 4px 12px rgba(78, 59, 93, 0.15);
  position: relative;
}

.chara-thumb-oval img {
  position: absolute;
  max-width: none;
  height: auto;
  display: block;
}

.chara-name {
  margin-top: 14px;
  font-family: var(--font-fashion);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-purple);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ================= END CARD セクション ================= */
.endcard-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.endcard-item {
  border: 2px solid var(--c-purple);
  padding: 1.1rem 1.4rem;
  border-radius: 8px;
  background: var(--c-beige);
  font-family: var(--font-fashion);
  font-weight: 700;
  font-size: clamp(0.9rem, 3.8vw, 1.1rem);
  white-space: nowrap;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 8px;
}
.endcard-item::after { content: "›"; font-size: 1.4rem; flex-shrink: 0; }

/* ================= キャラ詳細ページ ================= */
.detail-page {
  min-height: 100svh;
  padding-top: 96px;
  padding-bottom: 60px;
  width: 100%;
  overflow-x: hidden;
  background-color: #ffffff;
  color: var(--c-purple);
}
.detail-container { max-width: 500px; margin: 0 auto; padding: 0 12px; }

.stage {
  position: relative;
  height: calc(100svh - 170px);
  max-height: 620px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-bottom: 1.8rem;
  width: 100%;
}

/* ================= キャラ詳細 ＆ エンドカード詳細 共通矢印 ================= */
.nav-arrow {
  position: fixed; /* 画面に完全固定 */
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: transparent;
  border: none;
  color: #4e3b5d; /* キャラ詳細用の文字色 */
  font-size: 3.2rem;
  font-weight: 300;
  cursor: pointer;
  padding: 10px 6px;
  line-height: 1;
  user-select: none;
}

/* ★ エンドカード詳細ページ内では矢印の色をベージュにする */
.end-detail-page .nav-arrow {
  color: var(--c-beige);
}

.nav-arrow.prev { left: 8px; }
.nav-arrow.next { right: 8px; }

.art-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.art {
  position: relative;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chara-bg-icon {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 280px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
  -webkit-mask-image: url("images/icon-fff.webp");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("images/icon-fff.webp");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.chara-main-img {
  position: relative;
  z-index: 2;
  max-height: 100%;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
}

.chara-main-img.float-anim {
  animation: charaFloatUp 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes charaFloatUp {
  from { opacity: 0.8; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

.vertical-quote {
  position: absolute;
  top: 16px;
  right: 36px;
  writing-mode: vertical-rl;
  font-family: var(--font-fashion);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.12em;
  line-height: 1.6;
  z-index: 10;
  max-height: 85%;
  white-space: nowrap;
  display: flex;
  gap: 12px;
}

.quote-line {
  padding: 16px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* 立ち絵左下の悪魔姿切り替えダイヤマーク */
.demon-toggle-btn {
  position: absolute;
  bottom: 24px;
  left: 54px;
  z-index: 15;
  background: none;
  border: none;
  outline: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}

.demon-diamond-icon {
  width: 42px;
  height: 42px;
  fill: var(--c-purple);
  stroke: transparent;
  stroke-width: 0;
  transition: fill 0.25s ease, stroke 0.25s ease, transform 0.3s ease;
}

.demon-toggle-label {
  font-family: var(--font-fashion);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c-purple) !important;
  -webkit-text-fill-color: var(--c-purple);
  letter-spacing: 0.12em;
  line-height: 1;
}

.demon-toggle-btn.is-active .demon-diamond-icon {
  fill: #ffffff;
  stroke: var(--c-purple);
  stroke-width: 1px;
  transform: rotate(180deg);
}

.chara-info { margin-top: 1.8rem; padding: 0 8px; }

.detail-chara-name {
  font-family: var(--font-fashion);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--c-purple);
  margin-bottom: 0.2rem;
  letter-spacing: 0.08em;
}

.detail-chara-kana {
  display: block;
  font-family: var(--font-fashion);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-purple);
  opacity: 0.75;
  margin-bottom: 1.2rem;
  letter-spacing: 0.12em;
}

.detail-chara-desc {
  font-family: var(--font-fashion);
  line-height: 2.1;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--c-purple);
  text-align: justify;
}

.diamond-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 2.5rem auto 1rem;
}

.curved-diamond {
  width: 20px;
  height: 20px;
  fill: var(--c-purple);
  filter: none;
}

.others-sec {
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: none;
}

.others-sec .chara-name { color: var(--c-purple); }

/* ================= エンドカード詳細 ================= */
.end-detail-page {
  min-height: 100svh;
  background: var(--c-purple);
  color: var(--c-beige);
  padding: 80px 16px 60px;
  width: 100%;
  overflow-x: hidden;
}
.end-detail-container {
  max-width: 560px;
  margin: 0 auto;
}

.end-card-stage {
  position: relative;
  width: 100%;
}

.end-nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  background: transparent;
  border: none;
  color: var(--c-beige);
  font-size: 3.2rem;
  font-weight: 300;
  cursor: pointer;
  padding: 10px 6px;
  line-height: 1;
  user-select: none;
}
.end-nav-arrow.prev { left: 4px; }
.end-nav-arrow.next { right: 4px; }

.end-detail-content { padding: 0 32px; }

.end-title {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 4.2vw, 1.5rem);
  font-weight: 500;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--c-beige);
  letter-spacing: 0.08em;
  line-height: 1.4;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.end-title {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 4.2vw, 1.5rem);
  font-weight: 500;
  text-align: center;
  margin-bottom: 1rem; /* 入国者表示との間隔調整 */
  color: var(--c-beige);
  letter-spacing: 0.08em;
  line-height: 1.4;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.end-condition {
  font-family: var(--font-fashion);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  color: var(--c-beige);
  margin-bottom: 2.5rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.end-text {
  font-family: var(--font-fashion);
  line-height: 2.1;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: justify;
  margin-bottom: 2.5rem;
  color: var(--c-beige);
  white-space: pre-wrap;
  letter-spacing: 0.04em;
}

.end-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--c-lavender);
  display: block;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.others-end-sec {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1.5px solid rgba(212, 195, 221, 0.3);
}

.end-sec-title {
  color: var(--c-beige) !important;
  -webkit-text-stroke: none !important;
  text-shadow: none !important;
}

.others-end-sec .endcard-item {
  background: rgba(255, 255, 255, 0.1);
  color: var(--c-beige);
  border-color: var(--c-lavender);
}

.top-body, .detail-page, .end-detail-page { padding-bottom: 4rem; }

/* ================= フッター ================= */
.site-footer {
  text-align: center;
  padding: 40px 16px;
  margin-top: 0;
  border-top: 1.5px solid var(--c-lavender);
  background-color: #ffffff;
}

.credit { 
  font-family: var(--font-fashion); 
  font-size: 0.9rem; 
  font-weight: 900; 
  color: var(--c-purple); 
  margin-bottom: 12px; 
}

.twitter-btn { display: inline-block; width: 36px; height: 36px; }
.twitter-btn img { width: 100%; height: 100%; object-fit: contain; }

/* ================= PC用 レスポンシブ表示設定 ================= */
@media (min-width: 768px) {
  .fixed-header {
    height: 88px;
    padding: 0 40px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(212, 195, 221, 0.6);
    box-shadow: 0 4px 20px rgba(78, 59, 93, 0.06);
  }

  .header-logo img { height: 76px; }
  .menu-btn { display: none !important; }
  .header-nav { display: block; }

  .header-nav-list {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
  }

  .header-nav-link {
    font-family: var(--font-fashion);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--c-purple);
    letter-spacing: 0.08em;
    padding: 6px 4px;
    position: relative;
    transition: color 0.25s ease;
  }

  .header-nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--c-purple);
    transition: width 0.25s ease, left 0.25s ease;
  }

  .header-nav-link:hover::after {
    width: 100%;
    left: 0;
  }

  /* キービジュアル（ご提示コードと全く同じ設定） */
  .top-hero {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
  }

  .top-hero > img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
  }

  .top-hero::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 25%;
    background: linear-gradient(
      to bottom, 
      rgba(255, 255, 255, 0) 0%, 
      rgba(255, 255, 255, 0.8) 75%, 
      #ffffff 100%
    );
    pointer-events: none;
    z-index: 1;
  }

  .hero-logo-wrap {
    position: absolute;
    top: auto;
    bottom: 8%;
    left: 50%;
    width: 90%;
    max-width: 480px;
    z-index: 10;
    transform: translate(-50%, 20px);
  }

  .hero-logo-wrap.is-visible {
    transform: translate(-50%, 0);
  }

  
    .detail-page { padding-top: 110px; }

    .end-detail-page {
      padding-top: 120px;
    }
  
    .stage {
      height: calc(100vh - 200px);
      max-height: 680px;
    }
  
    /* ★ PC表示時も absolute にせず fixed で画面中央に完全固定 */
    .nav-arrow {
      position: fixed;
      top: 50%;
      transform: translateY(-50%);
      font-size: 3.8rem;
      opacity: 0.7;
      transition: opacity 0.2s ease, transform 0.2s ease;
    }
  
    .nav-arrow:hover {
      opacity: 1;
      transform: translateY(-50%) scale(1.1);
    }
  
    /* 中央コンテンツ横の固定位置計算 */
    .detail-page .nav-arrow.prev { left: calc(50% - 320px); }
    .detail-page .nav-arrow.next { right: calc(50% - 320px); }
  
    .end-detail-page .nav-arrow.prev { left: calc(50% - 350px); }
    .end-detail-page .nav-arrow.next { right: calc(50% - 350px); }
  }