@charset "UTF-8";

/* リセット */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
ul,
ol,
dl,
dt,
dd,
figure {
  margin: 0;
  padding: 0;
  list-style: none;
}

* {
  box-sizing: border-box;
}

img {
  vertical-align: bottom;
}

a {
  text-decoration: none;
}

address {
  font-style: normal;
}

/* 全体記述 */

body {
  background-color: #1E1E1E;
  color: #fff;
  font-size: 16px;
  font-family: "M PLUS 2", sans-serif;
}

.flex {
  display: flex;
}

/* PCのみ改行 */
.br-pc {
  display: inline;
}

@media (max-width: 820px) {
  .br-pc {
    display: none;
  }
}

/* ナビ */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: 64px;
  background-color: #1E1E1E;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 内側ラッパー（ロゴ左・メニュー右） */
#site-header .inner {
  width: 100%;
  max-width: 1100px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#site-header .brand img {
  width: auto;
  display: block;
}

#site-header #global-nav ul {
  gap: 40px;
  align-items: center;
}

#global-nav a {
  color: #fff;
  font-family: "Baumans", system-ui;
  font-size: 24px;
  transition: color 0.25s ease, text-shadow 0.25s ease, transform 0.25s ease;
}

/* --- hover時の発光エフェクト --- */
#global-nav a:hover{
  color: #FF5E94;
  text-shadow:
    0 0 5px rgba(255, 94, 148, 0.7),
    0 0 10px rgba(255, 94, 148, 0.5),
    0 0 20px rgba(255, 94, 148, 0.3);
  transform: scale(1.03);
  /* 微細な拡大で“光の膨張”感 */
}

#global-nav a.is-glow {
  color: #FF5E94;
  text-shadow:
    0 0 5px rgba(255, 94, 148, 0.7),
    0 0 10px rgba(255, 94, 148, 0.5),
    0 0 20px rgba(255, 94, 148, 0.3);
}

/* ハンバーガー */
.nav-toggle {
  display: none;
  width: 42px;
  height: 34px;
  border: 1px solid #fff;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  padding: 7px 8px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.nav-toggle .bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  transition: transform .22s ease, opacity .16s ease;
}

/* オープニング */

#landing {
  font-size: clamp(32px, 5vw, 50px);
  font-family: "Baumans", system-ui;
  text-align: center;
  min-height: calc(100vh);
  min-height: calc(100svh);
  display: grid;
  place-items: center;
  padding: 28px 24px 18px;
  overflow: hidden; /* 星やロゴの溢れを防ぐ */
}

#landing .landing-overlay {
  text-align: center;
}

/* ボタンも中央に */

.landing-title br {
  display: block;
  line-height: 0;
  /* 改行時の余白をなくす */
  content: "";
}

/* --- タイトル行の星：右に寄り過ぎ → 内側へ --- */
.landing-title {
  position: relative;
  line-height: 1.1;
  /* ← 行間は本体に */
  max-width: min(94vw, 700px);
  margin: 0 auto;
  padding-right: clamp(16px, 5vw, 36px);
}

.landing-title::after {
  content: "";
  position: absolute;
  left: 92%;
  /* テキスト末尾より内側に寄せて “to” 付近に重ねる */
  top: -6px;
  width: clamp(26px, 6vw, 40px);
  height: clamp(26px, 6vw, 40px);
  background: url("../images/Star 2_40x40.png") center/contain no-repeat;
  animation: starTwinkle 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55));
  transform: translate(-80%, 0);
}

/* --- ENとSPARKを継ぎ目なく（参考：そのままなら変更不要） --- */
/* --- ENとSPARKをフォントサイズに合わせて調整 --- */
.logotype {
  display: inline-flex;
  align-items: center;
  /* ← baseline 揃え */
  gap: clamp(8px, 2vw, 14px);
  margin-top: 24px;
  position: relative;
  justify-content: center;
  width: auto;
  max-width: none;
}

/* ENロゴ */
.logotype .logo-en {
  height: 0.9em;
  /* フォントサイズの約90%の高さに */
  width: auto;
  display: block;
}

.logotype::after {
  content: "";
  position: absolute;
  width: clamp(26px, 6vw, 40px);
  height: clamp(26px, 6vw, 40px);
  background: url("../images/Star 2_40x40.png") center/contain no-repeat;
  animation: starTwinkle 2.2s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .55));
  left: 0%;
  /* ← ENの少し左下に見える位置（微調整可） */
  top: 110%;
  /* ← ロゴの真下あたり */
  transform: translate(-50%, 10%);
  pointer-events: none;
}

/* SPARKロゴ */
.logotype .logo-spark {
  height: 1em;
  /* フォントとほぼ同じ高さ */
  width: auto;
  display: block;
}

/* --- GAME START：中央寄せ & 左星の表示、ホバー光を削除 --- */
#btn-game-start {
  font-family: "Baumans", system-ui;
  font-size: 40px;
  letter-spacing: .08em;
  color: #FF5E94;
  background: transparent;
  border: 2px solid #FF5E94;
  border-radius: 12px;
  padding: .5em 1.6em;
  cursor: pointer;
  position: relative;
  display: inline-block;
  margin: 40px auto 0;
  /* 中央寄せ（親のtext-alignと併用で確実） */
  overflow: visible;
  /* ← ここがポイント：星をはみ出して見せる */
  transition: color .2s ease, background-color .2s ease;
}

/* ホバー時は“光を消して”、色変化のみ残す */
#btn-game-start:hover {
  color: #FFFFFF;
  background-color: rgba(255, 94, 148, .08);
  /* 以前の box-shadow / transform は削除 */
}

/* きらきら共通アニメーション */
@keyframes starTwinkle {

  0%,
  100% {
    opacity: .7;
    transform: scale(1) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.12) rotate(10deg);
  }
}

/* Landing Animation */
/* ===== ナビは初期非表示、完了時に表示 ===== */
#site-header {
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

body.show-header #site-header {
  opacity: 1;
  pointer-events: auto;
}

/* ===== Mainの先頭がナビに隠れないように（64px考慮） ===== */
body.show-header main {
  padding-top: 64px;
}

/* ===== クリック開始：EN以外は即退場、文字も消す ===== */
#landing.landing-seq .logo-spark,
#landing.landing-seq .landing-title::after,
/* タイトル右上の星 */
#landing.landing-seq .logotype::after,
/* EN下の星 */
#landing.landing-seq #btn-game-start {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}

/* 2つの星は強制非表示 */
#landing.landing-seq .landing-title::after,
#landing.landing-seq .logotype::after {
  display: none !important;
}

/* テキスト（Welcome / World of）は消す。EN画像は残す */
#landing.landing-seq .landing-title {
  color: transparent;
}

/* クリック中は Landing をレイアウトから切り離す（余白を残さない） */
#landing.landing-seq {
  position: fixed;
  inset: 0;
  z-index: 9998;
  /* オーバーレイ(#en-loader)より一段下 */
  background-color: inherit;
}

/* === EN：ジャンプ＆空中で手を振ってから退場（ピクサー風） === */
/* JSで .wave-out を付与 */
.logo-en {
  transition: opacity .3s ease, transform .3s ease;
  transform-origin: 50% 100%;
}

.logo-en.wave-out {
  animation: enJumpBye 1.2s ease-out forwards;
}

@keyframes enJumpBye {

  /* 助走 → 1段目ジャンプ */
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  15% {
    transform: translateY(-0.60em) scale(1.04) rotate(-6deg);
  }

  28% {
    transform: translateY(-0.20em) scale(1.01) rotate(6deg);
  }

  /* 2段目で高く！ */
  42% {
    transform: translateY(-1.50em) scale(1.02) rotate(-10deg);
  }

  /* 空中で“バイバイ”っぽい小刻み回転（左右に振る） */
  55% {
    transform: translateY(-1.65em) rotate(12deg);
  }

  68% {
    transform: translateY(-1.70em) rotate(-12deg);
  }

  81% {
    transform: translateY(-1.75em) rotate(12deg);
  }

  /* 退場（上方へフェード） */
  100% {
    transform: translateY(-2.10em) scale(0.96) rotate(-12deg);
    opacity: 0;
  }
}

/* ====== 全画面 Now Loading オーバーレイ（背景は #1E1E1E に統一） ====== */
#en-loader {
  position: fixed;
  inset: 0;
  /* 画面いっぱい */
  z-index: 9999;
  display: grid;
  place-items: center;
  /* 画面中央に */
  background: #1E1E1E;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}

#en-loader.show {
  opacity: 1;
  pointer-events: auto;
}

/* Landing と同じフォント・サイズで中央に */
#en-loader .wrap {
  text-align: center;
  font-family: "Baumans", system-ui;
  font-size: 64px;
  line-height: 1.1;
  color: #FFC93C;
  max-width: 90vw;
}

/* ラベル3行：Now Loading / ＆ / Charging...（確実に改行） */
#en-loader .label .t1,
#en-loader .label .amp,
#en-loader .label .t2 {
  display: block;
}

/* 2段目：バー＋稲妻（中央揃え、はみ出し防止） */
#en-loader .meter {
  margin-top: .4em;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  max-width: 90vw;
}

/* スクエアバー（角丸なし） */
#en-loader .bar {
  width: 5.5em;
  max-width: 70vw;
  height: .22em;
  border: 2px solid #FFC93C;
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}

/* ← ここが重要：transitionは一切使わない（JSで幅を1回だけ伸ばす） */
#en-loader .bar i {
  display: block;
  height: 100%;
  width: 0%;
  /* 初期0%固定 */
  background: #FFC93C;
}

/* 稲妻（バーの右側） */
#en-loader .bolt {
  display: inline-block;
  width: auto;
  height: .8em;
  transform-origin: 50% 50%;
  animation: boltNod 1.2s ease-in-out infinite;
}

@keyframes boltNod {

  0%,
  100% {
    transform: rotate(0deg)
  }

  50% {
    transform: rotate(10deg)
  }
}

/* フェードアウト用（消すときに使う） */
#en-loader.hide {
  opacity: 0;
  pointer-events: none;
}

/* Loading画面のレスポンシブフォントサイズ（Landingとの中間サイズ） */
@media (max-width: 900px) {
  #en-loader .wrap { font-size: 55px; }
}
@media (max-width: 770px) {
  #en-loader .wrap { font-size: 48px; }
}
@media (max-width: 600px) {
  #en-loader .wrap { font-size: 42px; }
}
@media (max-width: 440px) {
  #en-loader .wrap { font-size: 44px; }
}

/* ===== Main は初期は見せない（JSで body.app-started を付与して表示） ===== */
#main {
  visibility: hidden;
}

body.app-started #main {
  visibility: visible;
}

/* ===== Opening/Ending 基本 ===== */
#opening,
#ending {
  font-family: "Shippori Mincho B1", serif;
  font-size: 20px;
  /* 画面高（ナビ64px差引）- フォールバック付き */
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px 24px;
}

#ending{
  /* 画面高（ナビ64px差引）を最低保証 - vhフォールバック付き */
  min-height: calc(100vh - 64px) !important;  /* フォールバック */
  min-height: calc(100svh - 64px) !important; /* svhでモバイルUI高さ揺れ対策 */
  height: auto !important;                    /* 固定高は持たない */
  display: grid;
  align-content: center;                      /* 中身を中央寄せ */
  padding-top: 24px !important;               /* 既存より小さめでもOK */
  padding-bottom: 72px !important;            /* CTA突き出し分を確保 */
  position: relative !important;
  overflow: visible !important;               /* CTAを切らない */
  z-index: 1 !important;

  /* 背景はそのまま（下基準） */
  background: #020A54 url("../images/nightcity_1280x720.png")
              center bottom / cover no-repeat;
  background-attachment: scroll;
  background-size: cover;
}

#opening .opening-copy,
#ending .ending-copy {
  max-width: 980px;
  margin: 0 auto;
  line-height: 1.9;
}

/* ハイライト（共通） */
#opening .opening-copy span,
#ending .ending-copy span {
  font-size: 36px;
  color: #FF5E94;
  font-weight: 500;
}

/* 「光」だけ個別ID。あなたのCSSはセレクタが間違っていたので修正 */
#opening .opening-copy #light {
  font-size: 36px;
  color: #fff;
  font-weight: 500;
}

/* ENSPARK の行だけ少し大きく */
#opening .opening-copy #enspark {
  font-size: 24px;
  line-height: 1.8;
  /* 均一な高さ */
  margin: 32px 0;
  /* 上下に一定余白 */
}

/* 改行調整 */
#ending .ending-copy .extra-space {
line-height: 1.8;
  /* 均一な高さ */
  margin: 32px 0;
  /* 上下に一定余白 */
}

/* タグラインはゴールド */
#opening .opening-copy .tagline,
#ending .ending-copy .tagline {
  color: #FFC93C;
  font-size: 36px;
  font-weight: 500;
  line-height: 1.35;
  /* 本文よりは詰め気味 */
  margin: 0;
  /* 外側の余白はゼロに */
  display: block;
  position: relative;
  animation: taglineGlow 6s ease-in-out infinite alternate;
  /* ← ここに付与 */
}

@keyframes taglineGlow {
  0% {
    text-shadow: 0 0 10px rgba(255, 200, 80, .22), 0 0 20px rgba(255, 200, 80, .06);
  }

  100% {
    text-shadow: 0 0 25px rgba(255, 200, 80, .60), 0 0 45px rgba(255, 200, 80, .28);
  }
}

/* 直後の1行だけ近づけて“行間っぽく”見せる */
#opening .tagline+.line,
#ending .tagline+.line {
  margin: 0;
  line-height: 1.45;
  /* 外側余白は使わず、位置で寄せる（= 段落間ではなく行間のニュアンス） */
  transform: translateY(-0.28em);
  /* 近づけ量のツマミ。-0.22em〜-0.34emで調整 */
}

#ending .thanks{
  font-family: "Baumans", system-ui;
  font-size: 36px;
}

/* ===== 段落フェード：初期は隠す → body.opening-play で順次表示 ===== */
#opening .line,
#ending .line {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .6s ease, transform .6s ease;
}

/* 開始クラスが付いたら順次フェード（等間隔でディレイ） */
body.opening-play #opening .line:nth-of-type(1){
  transition-delay: 0.20s;
  opacity: 1;
  transform: none;
}

body.opening-play #opening .line:nth-of-type(2){
  transition-delay: 0.40s;
  opacity: 1;
  transform: none;
}

body.opening-play #opening .line:nth-of-type(3){
  transition-delay: 0.60s;
  opacity: 1;
  transform: none;
}

body.opening-play #opening .line:nth-of-type(4){
  transition-delay: 0.80s;
  opacity: 1;
  transform: none;
}

body.opening-play #opening .line:nth-of-type(5){
  transition-delay: 1.00s;
  opacity: 1;
  transform: none;
}

body.opening-play #opening .line:nth-of-type(6){
  transition-delay: 1.20s;
  opacity: 1;
  transform: none;
}

/* #Ending：画面に入ったら順次フェードイン（1回でOK） */
#ending.is-inview .line:nth-of-type(1) { transition-delay: 0.20s; opacity:1; transform:none; }
#ending.is-inview .line:nth-of-type(2) { transition-delay: 0.40s; opacity:1; transform:none; }
#ending.is-inview .line:nth-of-type(3) { transition-delay: 0.60s; opacity:1; transform:none; }
#ending.is-inview .line:nth-of-type(4) { transition-delay: 0.80s; opacity:1; transform:none; }
#ending.is-inview .line:nth-of-type(5) { transition-delay: 1.00s; opacity:1; transform:none; }
#ending.is-inview .line:nth-of-type(6) { transition-delay: 1.20s; opacity:1; transform:none; }

/* タグライン本体：glowはそのまま。重ね順だけ明示 */
#opening .tagline,
#ending .tagline {
  position: relative;
  isolation: isolate;
  /* 疑似要素の積層を閉じ込める */
  z-index: 0;
  animation: taglineGlow 6s ease-in-out infinite alternate;
}

/* 既存：花火画像（発生源の視覚記号） */
#opening .tagline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -80%;
  transform: translate(-50%, -80%);
  width: min(497px, 70vw);
  aspect-ratio: 497/378;
  background: url("../images/firework_497x378.png") center/contain no-repeat;
  opacity: .3;
  pointer-events: none;
  z-index: -1;
  /* テキストの後ろ */
}

/* ===== Ending: per-letter bounce & fireworks layer ===== */

/* 花火キャンバスは背景とテキストの間に置く */
#ending { position: relative; }
#ending .ending-copy { position: relative; z-index: 2; }
#ending .fw-canvas {
  position: absolute; inset: 0;
  z-index: 1; pointer-events: none; display: block;
}

/* “Thank you for Playing!” を1文字ずつ装飾 */
#ending .thanks {
  display: inline-block;
  font-weight: 800;
  letter-spacing: .02em;
  will-change: transform;
}
#ending .thanks .tletter {
  display: inline-block;
  animation: snesBounce 1.2s ease-in-out infinite;
  transform-origin: 50% 80%;
}

/* 遅延を段階付け（最大30文字分）*/
#ending .thanks .tletter:nth-child(1)  { animation-delay: 0.00s }
#ending .thanks .tletter:nth-child(2)  { animation-delay: 0.03s }
#ending .thanks .tletter:nth-child(3)  { animation-delay: 0.06s }
#ending .thanks .tletter:nth-child(4)  { animation-delay: 0.09s }
#ending .thanks .tletter:nth-child(5)  { animation-delay: 0.12s }
#ending .thanks .tletter:nth-child(6)  { animation-delay: 0.15s }
#ending .thanks .tletter:nth-child(7)  { animation-delay: 0.18s }
#ending .thanks .tletter:nth-child(8)  { animation-delay: 0.21s }
#ending .thanks .tletter:nth-child(9)  { animation-delay: 0.24s }
#ending .thanks .tletter:nth-child(10) { animation-delay: 0.27s }
#ending .thanks .tletter:nth-child(11) { animation-delay: 0.30s }
#ending .thanks .tletter:nth-child(12) { animation-delay: 0.33s }
#ending .thanks .tletter:nth-child(13) { animation-delay: 0.36s }
#ending .thanks .tletter:nth-child(14) { animation-delay: 0.39s }
#ending .thanks .tletter:nth-child(15) { animation-delay: 0.42s }
#ending .thanks .tletter:nth-child(16) { animation-delay: 0.45s }
#ending .thanks .tletter:nth-child(17) { animation-delay: 0.48s }
#ending .thanks .tletter:nth-child(18) { animation-delay: 0.51s }
#ending .thanks .tletter:nth-child(19) { animation-delay: 0.54s }
#ending .thanks .tletter:nth-child(20) { animation-delay: 0.57s }
#ending .thanks .tletter:nth-child(21) { animation-delay: 0.60s }
#ending .thanks .tletter:nth-child(22) { animation-delay: 0.63s }
#ending .thanks .tletter:nth-child(23) { animation-delay: 0.66s }
#ending .thanks .tletter:nth-child(24) { animation-delay: 0.69s }
#ending .thanks .tletter:nth-child(25) { animation-delay: 0.72s }
#ending .thanks .tletter:nth-child(26) { animation-delay: 0.75s }
#ending .thanks .tletter:nth-child(27) { animation-delay: 0.78s }
#ending .thanks .tletter:nth-child(28) { animation-delay: 0.81s }
#ending .thanks .tletter:nth-child(29) { animation-delay: 0.84s }
#ending .thanks .tletter:nth-child(30) { animation-delay: 0.87s }

@keyframes snesBounce {
  0%   { transform: translateY(0) scale(1); }
  18%  { transform: translateY(-11px) scale(1.06); }
  36%  { transform: translateY(0) scale(1); }
  54%  { transform: translateY(-6px) scale(1.03); }
  72%  { transform: translateY(0) scale(1); }
  84%  { transform: translateY(-3px) scale(1.015); }
  100% { transform: translateY(0) scale(1); }
}
/* 動きの滑らかさ */
#ending .thanks .tletter { animation-timing-function: cubic-bezier(.22,.61,.36,1); }

/* ===== Next Stage（各セクション境目に半分見切れる配置） ===== */
/* トップレベル & CTA付きセクションだけを基準にする（ナビ64px考慮） */
main > section.has-cta{
  position: relative;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  overflow: visible;               /* CTAを次セクション側へ半分だけ出す */
}

/* CTAは最前面に固定 */
main > section.has-cta .scroll-cta{
  z-index: 400;
}

/* CTAの見切れ強化（History→Works、Works→Ending 用にわずかに上げる） */
#history.has-cta .scroll-cta,
#works.has-cta .scroll-cta {
  bottom: -60px;
}

/* CTA本体：半分見切れ配置（-44pxは“半分見せ”量。微調整可） */
main > section.has-cta .scroll-cta{
  position: absolute;
  left: 50%;
  bottom: -44px;                   /* ← 半分だけ見せる */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 200;
  pointer-events: auto;
}

/* ラベルだけ “ぴょんぴょん”・縦書き・ボーダー無し */
.has-cta .scroll-cta .label {
  writing-mode: vertical-rl;
  font-family: "Baumans", system-ui;
  font-size: 26px;
  letter-spacing: .08em;
  color: #fff;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  animation: hop 2.6s ease-in-out infinite;
}

.has-cta .scroll-cta .label span {
  display: block;
  /* ← これで Next / Stage を確実に改行 */
  line-height: 1;
  /* お好みで 0.9〜1.1 */
}

@keyframes hop {

  0%,
  100% {
    transform: translateY(0);
  }

  45% {
    transform: translateY(-8px);
  }
}

/* 星画像（普段は静止・縦にリピートしておく） */
.scroll-cta .star {
  width: 18px;
  height: 81px;
  background-image: url("../images/Scroll%20Star_18x81.png");
  /* CSSから見て ../images */
  background-position: 50% 0;
  /* 上端から開始 */
  background-size: 18px 81px;
  /* 1タイル＝ちょうど画像サイズ */
  background-repeat: repeat-y;
  /* 縦に繰り返す（ここがポイント） */
  display: block;
}

/* ホバー時：背景の Y 位置だけ下へ流す（1タイル分 = 81px） */
.scroll-cta:hover .star,
.scroll-cta .label:hover~.star {
  animation: starFlowDown 1.2s linear both;
}

@keyframes starFlowDown {
  from {
    background-position: 50% 0;
  }

  to {
    background-position: 50% 81px;
  }

  /* 81px進めると“下に流れた”見え方 */
}

/* 共通：CTAのフェード制御（全セクション使い回し） */
.scroll-cta {
  opacity: 1;
  transition: opacity .28s ease, transform .28s ease;
}

.scroll-cta.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  /* ほんの少しだけ沈む */
}

/* ===============================
   Profiles (RPG UI) — 最終調整
================================= */

#profile {
  background: linear-gradient(180deg, #1E1E1E 0%, #06237B 50%, #17BEEB 80%);
  background-repeat: no-repeat;
  background-size: cover;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "M PLUS 2", sans-serif;
  padding-bottom: 120px;
  /* CTAと被らない外側下余白 */
  overflow-x: hidden;
  /* はみ出し防止（横スクロール抑止） */
  --pink: #FF5E94;
  --gold: #FFC93C;
  --blue: #00BFFF;
  --box: #06237B;
  --br: #FFFFFF;
}

#profile .block-head,
#profile .profile-layout {
  width: min(1100px, 92vw);
}

/* 見出し＋星ボーダー（さらに微調整：-12px） */
#profile .block-head {
  position: relative;
  margin-bottom: 12px;
}

#profile .block-head h2 {
  font-family: "Baumans", system-ui;
  font-size: 36px;
  color: var(--gold);
  display: inline-block;
  position: relative;
  margin-bottom: 10px;
}

#profile .block-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% - 12px);
  /* ← ご指定の下げ量 */
  width: 265px;
  height: 18px;
  background: url("../images/CreatorHistoryProfileborder_265x18.png") center/contain no-repeat;
  pointer-events: none;
}

/* タブ（既出のまま） */
#profile .subtabs {
  background-color: var(--box);
  border: 4px solid var(--br);
  border-radius: 8px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#profile .subtabs .tab {
  appearance: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font: 800 clamp(14px, 1.8vw, 22px)/1 "M PLUS 2", sans-serif;
  padding: 8px clamp(6px, 2vw, 10px);
  flex: 1;
  text-align: center;
  transition: color .15s ease, text-shadow .15s ease;
}

#profile .subtabs .tab+.tab {
  border-left: 2px solid var(--br);
}

#profile .subtabs .tab:hover,
#profile .subtabs .tab:focus,
#profile .subtabs .tab.is-active {
  color: var(--pink);
  text-shadow: 0 0 6px rgba(255, 94, 148, .55), 0 0 12px rgba(255, 94, 148, .35);
}

/* レイアウト：左カラムを縮小 → 右本文を広げる */
#profile .profile-layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 240px 1fr;
  /* ← 320→240 に縮小 */
  gap: 24px;
  align-items: stretch;
}

/* 箱共通 */
#profile .panel-box,
#profile .profile-card,
#profile .subtabs {
  background-color: var(--box);
  border: 4px solid var(--br);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .28), inset 0 0 8px rgba(255, 255, 255, .06);
}

/* 左プロフィール：画像を少し下げ、全体小型化＆中央揃え */
#profile .profile-card {
  padding: 14px;
  display: grid;
  place-items: center;
  text-align: center;
}

#profile .profile-card .dot {
  width: 160px; /* min() をやめ固定に */
  height: 160px; /* aspect-ratioも削除して整数ピクセル指定 */
  border: none;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: transparent;
  margin: -8px 0 10px;

  /* ここからが画質対策 */
  image-rendering: -webkit-optimize-contrast; /* Chrome */
  image-rendering: crisp-edges;               /* Firefox */
  transform: translateZ(0);                   /* GPUレイヤー化で滲み軽減 */
  backface-visibility: hidden;
}
#profile .profile-card .dot img,
#profile .profile-card .dot svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
}

/* 画像下の文章をさらに小さくして一行に収まるように */
#profile .bio-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  font: 600 16px/1.4 "M PLUS 2", sans-serif;
  margin-inline: auto;
  text-align: center;
  justify-items: center;
}

#profile .bio-dl dt {
  color: var(--blue);
  font-weight: 800;
}

#profile .bio-dl dd {
  color: #fff;
  font-weight: 700;
  text-align: left;
  justify-self: start;
}
#profile .bio-dl dd span { display: block; }
#profile .bio-dl .jp {
  font-size: 14px;
  line-height: 1.2;
  opacity: .9;
}

/* Profile CardとPanel Boxのレスポンシブは後方のProfile統一定義で管理 */

/* 右本文（箱は固定・中身切替） */
#profile .profile-body .panel-box {
  --pane-h: 420px;
  height: var(--pane-h);
  overflow: auto;
  padding: 20px 24px;
  scrollbar-color: var(--pink) rgba(255, 255, 255, .18);
  background-color: var(--box);
}

@media (max-width:820px) {
  #profile .profile-body .panel-box {
    --pane-h: 480px;
  }
}

#profile .panel {
  display: none;
}

#profile .panel.is-active {
  display: block;
}

/* 見出し色＝青、本文20px（既定） */
#profile .panel>h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
  margin: -1px;
  padding: 0;
}

#profile .panel h4 {
  font: 800 22px/1.4 "M PLUS 2", sans-serif;
  color: var(--blue);
  margin: 0 0 10px;
}

#profile .panel h5 {
  font: 700 19px/1.4 "M PLUS 2", sans-serif;
  color: var(--blue);
  margin: 12px 0 8px;
}

#profile .panel p,
#profile .panel dd,
#profile .panel li {
  font: 400 18px/1.8 "M PLUS 2", sans-serif;
  color: #fff;
}

/* Biography：最後の一文は太字。中の「確かなかたち」は .neo-pink で色付け（JSでwrap済み） */
#profile #bio p:last-of-type {
  font-weight: 800;
  margin-top: 10px;
}

/* Traits / Equipment：項目の箱線なし。左位置を本文に合わせ、縦間隔をやや詰める */
#profile .trait-card,
#profile .gear-card {
  padding: 3px 0;
  border: none;
  background: transparent;
}

#profile #traits h5,
#profile #equipment h5 {
  color: var(--gold);
  margin: 4px 0 2px;
}

#profile .trait-card p {
  margin: 0;
  line-height: 1.4;
}

/* Titles：各セクション見出しはゴールド */
#profile #titles h5 {
  color: var(--gold);
}

/* 切替アニメ（フェード） */
@keyframes pfadeOut {
  from {
    opacity: 1;
    transform: scale(.995);
  }

  to {
    opacity: 0;
    transform: scale(.992);
  }
}

@keyframes pfadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

#profile .panel.is-anim-out {
  animation: pfadeOut .22s ease-in both;
}

#profile .panel.is-anim-in {
  animation: pfadeIn .28s ease-out both;
}

/* ==== Profiles: 次セクションの“食い込み”防止（CTAは半分見切れのまま） ==== */

/* セクションは通常フロー。見切れ演出は overflow ではなく CTA の transform で実現 */
#profile {
  position: relative !important;
  z-index: 1;
  /* 次セクションより前面にして透け防止 */
  overflow: visible !important;
  /* 切らない＝CTAを外に描画させる */
  padding-bottom: 120px !important;
  /* CTAの突き出し分 + 余白 */
  margin-bottom: 0 !important;
  /* ネガティブマージンは不使用に戻す */
}

@media (max-width: 820px) {
  #profile { padding-bottom: 72px !important; }
}

/* CTA は高さ計算に入れず、見た目だけ下へ。半分見切れを維持 */
#profile.has-cta .scroll-cta {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translate(-50%, 44px) !important;
  /* 従来の -44px 相当の突き出し */
  pointer-events: auto;
  z-index: 50;
}

/* 念のため：次セクションは通常の前面順位 */
#history {
  position: relative;
  z-index: 0;
}

/* セクション自身にスクロールを出す指定を他所でされていた場合の保険 */
#profile.stage.has-cta {
  overflow-y: visible !important;
}

/* 右本文パネルだけは内部スクロールのまま（要件維持） */
#profile .profile-body .panel-box {
  overflow: auto !important;
}

/* ===============================
   Creator History（完全統合版／修正版2025-10-30）
   吹き出し▽・ドット絵・前CTA修正込み
================================= */

#history{
  position: relative !important;
  --field-h: 240px;
  --balloon-top: 24%;
  --balloon-gap: 22px;
  --tail-size: 28px;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
  background-color: #17BEEB;
  background-image: url("../images/dotback_back_1280x617.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover; /* 画面が高いときも下端にビルが届くよう全面フィット */
  overflow: visible !important;
  padding-bottom: 0 !important;     /* ← ここを0に（高さを盛らない） */
}


/* 草 */
#history::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100vw;
  height: var(--field-h);
  background: url("../images/dotback_front_1280x267.png") left bottom / auto 100% repeat-x;
  animation: groundScroll 90s linear infinite;
  z-index: 0;
}

@keyframes groundScroll {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: -1280px;
  }
}

/* 見出し */
#history .block-head {
  position: absolute;
  top: clamp(80px, 12vh, 140px);
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 92vw);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 3;
}

@media (max-width: 820px) {
  #history {
    background-size: cover;
    --field-h: 240px;
  }
  #history .block-head {
    top: clamp(64px, 10vh, 110px);
    align-items: center;
    gap: 12px;
  }
}

#history .block-head h2 {
  font-family: "Baumans", system-ui;
  font-size: 36px;
  color: #FFC93C;
  margin: 0;
  position: relative;
}

#history .block-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(100% - 6px);
  width: 265px;
  height: 18px;
  background: url("../images/CreatorHistoryProfileborder_265x18.png") center/contain no-repeat;
  pointer-events: none;
}

/* ライフゲージ */
#history .lives {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Pixelify Sans", sans-serif;
  font-size: 36px;
  color: #fff;
}

#history .lives img {
  width: 32px;
  height: 32px;
  display: block;
}

/* ----- キャンバス ----- */
#history .history-canvas {
  position: static !important;
  min-height: calc(100vh - 64px) !important;
  min-height: calc(100svh - 64px) !important;
  z-index: 1;
  overflow: visible !important;
}

/* ----- 吹き出し本体（1定義に統一） ----- */
#history .balloon {
  position: absolute;
  left: 50%;
  top: var(--balloon-top);
  transform: translateX(-50%);
  width: min(860px, 90vw);
  background: #fff;
  border-radius: 14px;
  padding: 22px 26px;
  display: none;
  overflow: visible;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .25);
  z-index: 3;
}

#history .balloon.is-active {
  display: block;
}

#history .balloon h3 {
  font: 700 24px/1.6 "M PLUS 2", sans-serif;
  color: #00BFFF;
  margin: 0 0 8px;
}

#history .balloon p {
  font: 400 20px/1.8 "M PLUS 2", sans-serif;
  color: #111;
}

@media (max-width: 820px) {
  #history .balloon h3 { font-size: 22px; line-height: 1.45; }
  #history .balloon p { font-size: 18px; line-height: 1.65; }
}

@media (max-width: 720px) {
  #history .balloon h3 { font-size: 20px; line-height: 1.4; }
  #history .balloon p { font-size: 17px; line-height: 1.6; }
  #history .rail-text { font-size: 20px; top: calc(50% - 26px); }
}

@media (max-width: 560px) {
  #history .rail-text { font-size: 18px; top: calc(50% - 22px); left: 50%; transform: translateX(-50%); }
  #history .rail-text.r1 { left: 42%; }
  #history .rail-text.r2 { left: 58%; }
}

#history .balloon .pink {
  color: #FF5E94;
}

/* 吹き出し口（選択中ボタンの真下に追従） */
/* 差し替え：常時見せる。left は px が無ければ % を使う両対応 */
#history .balloon::after{
  content:"";
  position:absolute;
  left: var(--tail-x-px, var(--tail-x, 50%));
  bottom: calc(var(--tail-size) * -1 + 5px);
  transform: translateX(-50%);
  width:0; height:0;
  border-left:  var(--tail-size) solid transparent;
  border-right: var(--tail-size) solid transparent;
  border-top:   var(--tail-size) solid #fff;
  pointer-events: none;
  opacity: 1 !important;   /* ← ここで常時可視 */
}

/* （削除してOK）
#history .balloon::after{ opacity: 0; }
#history.hist-ready .balloon::after{ opacity: 1; }
*/

/* ----- ステップ（1/2/3）レールと丸 ----- */
#history .history-steps {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 90vw);
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  top: 26%;
}

#history .history-steps::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 50%;
  width: 100vw;
  /* 画面幅いっぱい */
  height: 4px;
  background: #FF5E94;
  border-radius: 2px;
  z-index: 0;
}

#history .rail-text {
  position: absolute;
  top: calc(50% - clamp(42px, 6vw, 48px));
  /* 線の少し上に */
  transform: translateX(-50%);
  font-family: "Pixelify Sans", sans-serif;
  font-size: clamp(20px, 3.4vw, 30px);
  color: #FFC93C;
  /* ゴールド */
  user-select: none;
  white-space: nowrap;
  z-index: 1;
  text-shadow: 0 0 6px rgba(255, 201, 60, .35);
}

#history .rail-text.r1 {
  left: 28%;
}

#history .rail-text.r2 {
  left: 72%;
}

#history .step {
  appearance: none;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  background: #FF5E94;
  color: #fff;
  font-family: "Baumans", system-ui, sans-serif;
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .15s ease, background .25s ease;
  z-index: 2;
}

#history .step:hover {
  transform: translateY(-4px);
}

#history .step.is-active {
  background: #FFC93C;
  color: #111;
}

/* キャンバスの基準（親にrelativeが必要） */
#history .history-canvas{ position: relative; z-index: 2; }

/* 俳優（ドット絵） */
#history .actor{
  position: absolute !important;
  left: 50%;
  bottom: calc(var(--field-h) - clamp(130px, var(--field-h) * 0.62, 210px)) !important;
  top:auto !important;
  transform: translateX(-50%) !important;
  width: 72px;
  height: 72px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  z-index: 4;                 /* 草(0)より前、吹き出し(3)より後ろでもOKなら2〜3で調整 */
  pointer-events: none;
  display: block !important;  /* どこかでdisplay:noneされても強制表示 */
}

/* 俳優の移動は left をトランジション */
#history .actor{
  transition: left var(--walk-dur, 320ms) linear;
}

/* 初期同期だけは一瞬で置く用（JSが一時的に付与） */
#history .actor.no-trans{
  transition: none !important;
}

/* スプライト */
#history .actor.pose-right{ background-image:url("../images/dot_right.svg"); }
#history .actor.pose-stand{ background-image:url("../images/dot_stand.svg"); }
#history .actor.pose-left { background-image:url("../images/dot_left.svg"); }

/* ----- CTAボタン（半分見切れ維持） ----- */
#history.has-cta .scroll-cta {
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translate(-50%, 44px) !important;
  z-index: 50 !important;
  /* CTA最前面 */
  pointer-events: auto;
}

/* ENDINGのCTAボタン */

/* CTAは bottom:0 から translate で半分出す（現状維持） */
#ending.has-cta .scroll-cta{
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translate(-50%, 44px) !important;
  z-index: 50 !important;
  pointer-events: auto;
}

/* SERVICESのCTAボタン（スマホで見切れ防止） */
#services.has-cta .scroll-cta{
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translate(-50%, 44px) !important;
  z-index: 50 !important;
  pointer-events: auto;
}

/* ===============================
   Past Works (site)
================================== */
#works {
  --work-accent: #FF5E94;
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background:
    linear-gradient(180deg,
      rgba(249, 210, 122, 0.55) 0%,
      rgba(252, 165, 126, 0.42) 32%,
      rgba(185, 106, 182, 0.32) 64%,
      rgba(26, 18, 63, 0.55) 100%),
    url("../images/sunsetcity_1280x720.png") center bottom / cover no-repeat;
  color: #fff;
  overflow: visible;
  padding: 32px 0 22px;
  min-height: calc(100vh - 64px);
  min-height: calc(100svh - 64px);
}

#works::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.0) 0%, rgba(0, 0, 0, 0.14) 48%, rgba(0, 0, 0, 0.32) 100%);
  pointer-events: none;
  z-index: 0;
}

#works .block-head {
  width: min(980px, 96vw);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  text-align: left;
}

#works .block-head h2 {
  font-family: "Baumans", system-ui;
  font-size: 36px;
  color: #FFC93C;
  letter-spacing: .05em;
  position: relative;
  display: inline-block;
}

#works .block-head h2::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -12px;
  width: 203px;
  height: 18px;
  background: url("../images/PastWorksborder_203x18.png") center/contain no-repeat;
}

#works .block-head .pc-notice {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 24px;
  text-align: center;
}

#works .works-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(230px, 1fr);
  gap: 16px;
  align-items: stretch;
  width: min(1000px, 96vw);
  margin: 0 auto;
  padding: 26px 12px 34px;
  z-index: 1;
}

#works .works-rail { display: none; }

#works .works-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
  padding-right: 0;
  margin-right: -4px;
  height: 100%;
  overflow: visible;
}

#works .works-playfield {
  width: clamp(340px, 38vw, 450px);
  height: clamp(460px, 60vh, 600px);
  background: #000;
  border: 7px solid #fff;
  box-shadow: 0 28px 66px rgba(0, 0, 0, .55);
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  display: grid;
  place-items: center;
  z-index: 0;
}

#works .works-playfield::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(255, 255, 255, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: .22;
  pointer-events: none;
  z-index: 0;
}

#works .works-playfield.is-dropping .work.is-active figure {
  animation: dropIn .78s cubic-bezier(.25,.9,.28,1);
}

@keyframes dropIn {
  0%   { transform: translateY(-120%) scale(0.98); opacity: 0; }
  52%  { transform: translateY(-10%) scale(1.01); opacity: 1; }
  70%  { transform: translateY(6%) scale(1); }
  84%  { transform: translateY(-5%) scale(.995); }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

#works .works-stack {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 12px 10px;
}

#works .work {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

#works .work.is-active {
  opacity: 1;
  pointer-events: auto;
}

#works .work figure {
  width: min(340px, 84%);
  max-width: 380px;
  height: auto;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 14px 44px;
  gap: 10px;
  background: var(--work-accent, #FF5E94);
  border-radius: 10px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .42);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

/* 展開アイコン（タップで詳細表示を示す） */
#works .work figure::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 22px;
  height: 22px;
  background-image: url("../images/icon-expand.svg");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.85;
}

#works .work figure:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .5);
}

#works .work a { display: block; width: 100%; height: auto; }

#works .thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  border-radius: 12px;
  border: 3px solid #fff;
  background-size: cover;
  background-position: center center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .45);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

#works .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 10px 18px rgba(255, 255, 255, .18);
  pointer-events: none;
}

#works figcaption {
  position: static;
  transform: none;
  width: 100%;
  background: transparent;
  color: #fff;
  padding: 0;
  border-radius: 0;
  font-family: "Montserrat", sans-serif;
  letter-spacing: .05em;
  font-size: 20px;
  font-weight: 800;
  box-shadow: none;
  text-align: center;
  margin: 0 0 6px;
}

#works .works-tip {
  display: none;
}

#works .works-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: "Pixelify Sans", sans-serif;
  z-index: 2;
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
}

#works .ctrl {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: rgba(255, 255, 255, .8);
  color: #111;
  font-size: 0;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
}

#works .ctrl:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .35);
}

#works .ctrl::before {
  content: "\25B2";
  font-size: 18px;
  line-height: 1;
  display: block;
}
#works .ctrl.next::before { content: "\25BC"; }

#works .dotnav {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}

#works .dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  min-height: 12px;
  padding: 0;
  flex-shrink: 0;
  aspect-ratio: 1;
  box-sizing: content-box;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--accent, #FF5E94);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease, opacity .2s ease;
  opacity: .35;
}

#works .dot.is-active {
  background: var(--accent, #FF5E94);
  border-color: var(--accent, #FF5E94);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(0, 158, 255, .6);
  opacity: 1;
}

#works .works-ui {
  --ui-font-size: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  justify-content: space-between;
  position: relative;
  z-index: 2;
  margin-left: 0;
  margin-right: 0;
  transform: none;
  min-height: 340px;
  height: 100%;
  pointer-events: none;
}

#works .works-ui .score,
#works .works-ui .next-block {
  width: 210px;
  background: #05060e;
  color: #fff;
  border: 4px solid #fff;
  border-radius: 10px;
  padding: 14px 16px 16px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .35);
  text-align: center;
  font-family: "Baumans", system-ui;
  font-size: var(--ui-font-size);
  letter-spacing: .05em;
}

#works .next-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  width: 180px;
}

#works .next-block span {
  display: block;
  font-size: 0.8em;
  margin-bottom: 8px;
  letter-spacing: .08em;
}

#works .block-preview {
  width: 110px;
  height: 110px;
  margin: 4px auto 0;
  background: #f2c84d;
  border-radius: 4px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, .35);
  position: relative;
  overflow: hidden;
}

#works .block-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, transparent calc(50% - 1.5px), #c58d1f calc(50% - 1.5px), #c58d1f calc(50% + 1.5px), transparent calc(50% + 1.5px)),
    linear-gradient(to bottom, transparent calc(50% - 1.5px), #c58d1f calc(50% - 1.5px), #c58d1f calc(50% + 1.5px), transparent calc(50% + 1.5px));
  opacity: .9;
}

#works .block-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14), inset 0 10px 16px rgba(255, 255, 255, .18);
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  pointer-events: none;
}

#works .score-line {
  margin: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 6px;
  justify-content: center;
  align-items: center;
}
#works .score-line .label:nth-of-type(1) { grid-row: 1; grid-column: 1; }
#works .score-value { grid-row: 1; grid-column: 2; }
#works .score-line .label:nth-of-type(2) { grid-row: 2; grid-column: 1; }
#works .time-value { grid-row: 2; grid-column: 2; }

#works .score-line .label {
  font-size: 1em;
  letter-spacing: .08em;
}

#works .score-value,
#works .time-value {
  font-size: 1em;
  letter-spacing: .08em;
}

#works .works-ui .score { align-self: flex-start; margin-top: 0; position: absolute; right: 0; top: 0; }
#works .works-ui .next-block { align-self: flex-start; margin-top: auto; margin-bottom: 0; position: absolute; right: 0; bottom: 0; }

#works.has-cta .scroll-cta{
  position: absolute !important;
  left: 50% !important;
  bottom: 0 !important;
  transform: translate(-50%, 44px) !important;
  z-index: 50 !important;
  pointer-events: auto;
}

/* セクションの前面順を固定して、CTAが次セクション上にも覗くようにする */
#opening { position: relative; z-index: 6; }
#profile { position: relative; z-index: 5; }
#history { position: relative; z-index: 4; }
#works { position: relative; z-index: 3; }
#services { position: relative; z-index: 2; }
#ending { position: relative; z-index: 1; }

#works .thumb--asobulo { background-image: url("../images/asobulo_238x160.png"); }
#works .thumb--fasting { background-image: url("../images/fasting_238x160.png"); }
#works .thumb--food { background-image: url("../images/food_238x160.png"); }
#works .thumb--3decsite { background-image: url("../images/3dec_238x160.png"); }
#works .thumb--horrorecsite { background-image: url("../images/horrorec_238x160.png"); }
#works .thumb--ace-banner {
  background-image: url("../images/ace_banner1.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #f5f5f5;
}

@media (max-width: 770px) {
  #works { padding: 44px 0 52px; }
  #works .works-grid {
    gap: 22px;
    padding: 52px 14px 52px;
    width: 100%;
    align-items: stretch;
    grid-template-columns: 1fr; /* 右カラムを畳んで余白を消す */
    justify-items: center;
  }
  #works .works-view { width: 100%; }
  #works .works-controls {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 12px;
    margin-top: 6px;
    right: auto;
    top: auto;
  }
  #works .dotnav { flex-direction: row; gap: 12px; }
  #works .ctrl { width: 40px; height: 40px; }
  #works .ctrl::before { content: "\25C0"; }
  #works .ctrl.next::before { content: "\25B6"; }
  #works .works-ui {
    --ui-font-size: clamp(18px, 3vw, 22px);
    position: absolute;
    top: clamp(8px, 2.6vw, 14px);
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: auto;
    pointer-events: none;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: clamp(8px, 2vw, 12px);
    width: clamp(340px, 44vw, 480px);
    min-height: 0;
    height: auto;
  }
  #works .works-ui .score,
  #works .works-ui .next-block {
    position: static;
    width: clamp(160px, 40vw, 210px);
    min-width: 0;
    font-size: var(--ui-font-size);
    padding: clamp(10px, 3vw, 14px);
    margin: 0;
  }
  #works .works-ui .score {
    align-self: flex-start;
  }
  #works .works-ui .next-block {
    width: clamp(120px, 28vw, 150px);
    align-self: stretch;
    padding: clamp(8px, 2.6vw, 12px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  #works .block-preview { width: clamp(26px, 7vw, 34px); height: clamp(26px, 7vw, 34px); }

  /* 縦積み時のみ矢印を左右に変更し、コントロールを横並びに */
  #works .works-controls {
    position: static;
    transform: none;
    flex-direction: row;
    gap: 12px;
    margin-top: 6px;
    right: auto;
    top: auto;
  }
  #works .dotnav { flex-direction: row; gap: 12px; }
  #works .ctrl::before { content: "\25C0"; }
  #works .ctrl.next::before { content: "\25B6"; }
}

/* ===============================
   Contact（圧縮版）
================================== */
#contact {
  position: relative;
  background-color: #1E1E1E; /* Openingと同じトーンに */
  overflow: hidden;
  padding: 48px 0 60px; /* 下余白をさらに圧縮 */
  z-index: 0;
}

#contact::before {
  content:"";
  position:absolute;
  left:50%;
  transform:translate(-50%, 0);
  bottom: auto;
  top: 38%;
  width:min(520px, 68vw);
  display: block;
  aspect-ratio: 497 / 378;
  height:auto;
  max-height:min(340px, 60vh);
  background:url("../images/firework_497x378.png") center center / contain no-repeat;
  opacity:.22;
  mix-blend-mode:screen;
  pointer-events:none;
  z-index:0;
}

#contact .block-head,
#contact form {
  position:relative;
  z-index:1;
}

#contact form {
  width: min(780px, 94vw);
  margin: 0 auto;
  padding: 0 12px;
}

/* タイトル */
#contact .block-head h2 {
  font-family:"Baumans", system-ui;
  font-size:32px; /* 小さく */
  color:#FFC93C;
  text-align:center;
  margin-bottom:24px;
  position:relative;
}
#contact .block-head h2::after {
  content:"";
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  bottom:-10px;
  width:200px;
  height:14px;
  background:url("../images/CreatorHistoryProfileborder_265x18.png") center/contain no-repeat;
}

/* 行間や余白を詰める */
#contact .form-row {
  max-width:640px; /* 幅も詰め */
  margin:0 auto 10px;
}
#contact label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#eee;
  font-size:18px; /* 少し小さく */
  margin-bottom:4px;
}
#contact .req,
#contact .opt {
  font-size:14px;
  padding:2px 8px;
  border-radius:5px;
  line-height:1.1;
}
#contact .req { background:#FF3C5F; }
#contact .opt { background:#00BFFF; }

#contact input,
#contact textarea {
  width:100%;
  background:#fff;
  border:1.5px solid #b9c0c9;
  border-radius:5px;
  padding:8px 10px;
  font-size:16px;
  line-height:1.4;
  outline:none;
  transition:border-color .2s, box-shadow .2s;
}
#contact input:focus,
#contact textarea:focus {
  border-color:#7aa2ff;
  box-shadow:0 0 0 2px rgba(122,162,255,.15);
}

#contact .form-actions {
  text-align:center;
  margin-top:16px;
}
#contact .btn.btn-primary {
  background:#ff0048;
  color:#fff;
  border:none;
  padding:10px 18px;
  border-radius:8px;
  font-size:18px;
  box-shadow:0 4px 0 rgba(0,0,0,.25);
  min-width:180px;
  cursor:pointer;
  transition:transform .05s, background .2s;
}
#contact .btn.btn-primary:active {
  transform:translateY(1px);
  box-shadow:0 3px 0 rgba(0,0,0,.25);
}
#contact .btn.btn-primary[disabled] {
  background:#999;
  box-shadow:none;
  filter:grayscale(.3);
  cursor:not-allowed;
}

@media (max-width:560px){
  #contact .block-head h2 { font-size:26px; }
  #contact label { font-size:16px; flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ===== Contact: エラー時の最終調整（デザイン保持版） ===== */

/* エラー発生時でも高さが揺れないように下余白を少し確保 */
#contact .form-row {
  padding-bottom: 6px;
}

/* エラーメッセージ：より強い赤、行の高さ固定 */
#contact .error {
  margin: 4px 2px 0;
  color: #ff0048;                /* よりエラーらしい鮮やかな赤 */
  font-size: 14px;
  line-height: 1.4;
  min-height: 1.6em;             /* 揺れ防止（常時1行分確保） */
  display: block;
}

/* 入力欄：エラー時の赤枠 */
#contact .is-invalid input,
#contact .is-invalid textarea {
  border-color: #ff0048 !important;
  box-shadow: 0 0 0 2px rgba(255, 29, 29, 0.25) !important;
}

/* ラベルや必須/任意の色は変えない（既存を維持） */
#contact .is-invalid > label,
#contact .req,
#contact .opt {
  color: inherit !important;
}

/* 送信ボタン下の余白をやや増やす */
#contact .form-actions {
  margin-bottom: 28px;
}

/* 送信完了/エラーメッセージ */
.contact-message {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  font-family: "M PLUS 2", sans-serif;
  line-height: 1.8;
}
.contact-message.success {
  background: rgba(255, 201, 60, 0.15);
  border: 2px solid #FFC93C;
}
.contact-message.success p:first-child {
  font-size: 20px;
  color: #FFC93C;
  margin-bottom: 8px;
}
.contact-message.error {
  background: rgba(255, 60, 95, 0.15);
  border: 2px solid #FF3C5F;
  color: #FF3C5F;
}

/* 送信完了後のフォームグレーアウト */
#contact form.is-submitted {
  pointer-events: none;
}

#contact form.is-submitted .form-group {
  opacity: 0.4;
}

/* 成功メッセージは明るく表示 */
#contact form.is-submitted .form-actions {
  opacity: 1;
}

/* reCAPTCHAバッジを非表示（フォーム内に帰属表示あり） */
.grecaptcha-badge {
  visibility: hidden !important;
}

/* reCAPTCHA帰属表示 */
.recaptcha-notice {
  font-size: 12px;
  color: #888;
  margin-top: 16px;
  line-height: 1.5;
  text-align: center;
}

.recaptcha-notice a {
  color: #aaa;
  text-decoration: underline;
}

/* ===============================
   Responsive layout (global)
================================== */
@media (max-width: 1024px) {
  #site-header .inner { padding: 0 16px; }
  #site-header #global-nav ul { gap: 24px; }
  #global-nav a { font-size: 20px; }
  #landing { font-size: 46px; padding: 32px 12px 18px; }
  #btn-game-start { font-size: 34px; margin-top: 28px; }
  #opening, #ending { padding: 24px 16px; font-size: 18px; }
  #opening .opening-copy span,
  #ending .ending-copy span,
  #opening .opening-copy #light { font-size: 30px; }
  #opening .tagline, #ending .tagline { font-size: 32px; }
  #profile .block-head h2 { font-size: 32px; }
  #profile .profile-layout { gap: 18px; }
  #history .block-head h2 { font-size: 32px; }
  #history .balloon { width: min(780px, 94vw); padding: 18px 20px; }
  #history .balloon h3 { font-size: 22px; }
  #history .balloon p { font-size: 18px; }
  #contact { padding: 48px 0 60px; }
}

@media (max-width: 768px) {
  #site-header #global-nav ul { gap: 16px; }
  #global-nav a { font-size: 18px; }
  #landing { font-size: 38px; padding: 28px 12px 12px; }
  #btn-game-start { font-size: 30px; padding: .45em 1.2em; }
  #opening, #ending { font-size: 17px; padding: 20px 12px; }
  #opening .tagline, #ending .tagline { font-size: 30px; }
  /* Profile dotサイズは後方のProfile統一定義で管理 */
  #history .block-head { top: clamp(78px, 12vh, 118px); }
  #history .balloon { width: min(94vw, 720px); padding: 16px 18px; }
  #history .balloon h3 { font-size: 20px; }
  #history .balloon p { font-size: 17px; }
  #works .works-playfield { height: 440px; }
  #works .work figure { max-width: 340px; }
  #works .works-ui { gap: 18px; }
  #works .dot { width: 16px; height: 16px; min-width: 16px; min-height: 16px; aspect-ratio: 1; }
  #contact .block-head h2 { font-size: 28px; }
}

@media (max-width: 640px) {
  #site-header #global-nav ul { gap: 12px; }
}

@media (max-width: 560px) {
  #site-header { height: 58px; }
  #site-header .inner { padding: 0 12px; }
  #global-nav a { font-size: 16px; }
  #landing { font-size: 32px; padding: 22px 16px 8px; }
  #btn-game-start { font-size: 26px; margin-top: 18px; }
  /* ヘッダー58px用にmin-height再計算 */
  #opening, #ending {
    font-size: 16px;
    padding: 18px 10px;
    min-height: calc(100vh - 58px);
    min-height: calc(100svh - 58px);
  }
  #opening .opening-copy span,
  #ending .ending-copy span,
  #opening .opening-copy #light { font-size: 24px; }
  #opening .tagline, #ending .tagline { font-size: 26px; }
  #profile .profile-card .dot { width: 96px; height: 96px; }
  #history .block-head h2 { font-size: 30px; }
  #history .balloon h3 { font-size: 18px; }
  #history .balloon p { font-size: 16px; }
  #contact { padding: 36px 0 44px; }
  #contact label { font-size: 15px; }
}

@media (max-width: 480px) {
  #site-header #global-nav ul { gap: 10px; }
  #global-nav a { font-size: 15px; }
}

@media (max-width: 420px) {
  #landing { font-size: 28px; }
  #btn-game-start { font-size: 24px; padding: .4em 1em; }
  #opening { padding: 14px 10px; }
  #contact .btn.btn-primary { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  #site-header .inner { padding: 0 10px; }
  #global-nav ul { gap: 12px; }
  #global-nav a { font-size: 16px; }
  #global-nav {
    position: fixed;
    top: 58px; /* ヘッダーが560px以下で58pxに縮むため合わせる */
    left: 0;
    right: 0;
    background: rgba(30,30,30,0.95);
    padding: 10px 16px 20px;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s ease, opacity .22s ease;
    margin-top: 0;
    z-index: 150;
  }
  #global-nav ul {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-toggle { display: flex; }
  body.nav-open #global-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-toggle.is-active { background: rgba(255,255,255,0.14); border-color: #fff; }
  body.nav-open .nav-toggle .bar:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  body.nav-open .nav-toggle .bar:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle .bar:nth-child(3) { transform: translateY(-4px) rotate(-45deg); }
  #landing {
    font-size: 34px;
    padding-inline: clamp(30px, 9vw, 56px);
  }
  .landing-title {
    max-width: min(90vw, 500px);
    padding-right: clamp(18px, 6vw, 38px);
  }
  .logotype {
    width: min(86vw, 300px);
    gap: clamp(6px, 2vw, 10px);
  }
  .logotype .logo-en { height: clamp(28px, 8vw, 40px); }
  .logotype .logo-spark { height: clamp(28px, 8vw, 42px); }
}

@media (max-width: 520px) {
  #landing {
    font-size: clamp(30px, 6.8vw, 40px);
    padding-inline: clamp(26px, 7vw, 46px);
  }
  .landing-title {
    max-width: min(90vw, 500px);
    padding-right: clamp(12px, 5vw, 30px);
  }
  .logotype {
    width: min(88vw, 320px);
    gap: clamp(6px, 2vw, 12px);
  }
  .logotype .logo-en { height: clamp(32px, 8vw, 44px); }
  .logotype .logo-spark { height: clamp(32px, 8vw, 46px); }
  .logotype::after { width: clamp(26px, 6vw, 40px); height: clamp(26px, 6vw, 40px); }
  .landing-title::after { width: clamp(26px, 6vw, 40px); height: clamp(26px, 6vw, 40px); }
}

/* =====================================================
   Profile レスポンシブ統一定義
   ブレークポイント: 1000px / 820px / 640px / 440px / 400px
   ===================================================== */

/* ----- 1000px以下: テキストサイズ調整 ----- */
@media (max-width: 1000px) {
  #profile .panel p,
  #profile .panel dd,
  #profile .panel li { font-size: 17px; line-height: 1.7; }
  #profile .panel h4 { font-size: 21px; }
  #profile .panel h5 { font-size: 18px; }
}

/* ----- 820px以下: 1カラムレイアウト ----- */
@media (max-width: 820px) {
  #profile .profile-layout { grid-template-columns: 1fr; }
  /* 画像+テキストを中央寄せ */
  #profile .profile-card {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px;
  }
  #profile .profile-card .dot {
    width: 100px !important;
    height: 100px !important;
    flex-shrink: 0;
  }
  #profile .bio-dl {
    text-align: left;
    margin-inline: 0;
  }
  #profile .panel p,
  #profile .panel dd,
  #profile .panel li { font-size: 17px; line-height: 1.65; }
  #profile .panel h4 { font-size: 21px; }
  #profile .panel h5 { font-size: 18px; }
  #profile .profile-body .panel-box { --pane-h: auto; height: auto; min-height: 380px; }
}

/* ----- 640px以下: 画像+テキスト横並び（中央寄せグループ、テキスト左揃え） ----- */
@media (max-width: 640px) {
  #profile .profile-layout { grid-template-columns: 1fr; gap: 12px; }
  #profile .profile-card {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 16px;
    text-align: center;
  }
  #profile .profile-card .dot {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
  }
  #profile .bio-dl {
    width: auto;
    display: grid;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
    text-align: left !important;
    font-size: clamp(14px, 3.8vw, 16px);
    line-height: 1.35;
    column-gap: 10px;
    row-gap: 4px;
    margin-inline: 0;
  }
  #profile .bio-dl dt,
  #profile .bio-dl dd {
    text-align: left !important;
    white-space: nowrap;
  }
  #profile .profile-body .panel-box { padding: 16px; }
  #profile .panel p,
  #profile .panel dd,
  #profile .panel li { font-size: 15px; line-height: 1.55; }
  /* Titlesの行間を広げる */
  #profile #titles li { line-height: 1.75; }
  #profile .panel h4 { font-size: 18px; }
  #profile .panel h5 { font-size: 16px; }
}

/* ----- 440px以下: コンパクト表示 ----- */
@media (max-width: 440px) {
  #profile .profile-layout,
  #profile .block-head {
    width: 100%;
    padding: 0 4px;
    box-sizing: border-box;
    gap: 6px;
  }
  #profile .profile-card {
    justify-content: center !important;
  }
  #profile .profile-card .dot { width: 64px; height: 64px; }
  #profile .profile-body .panel-box {
    padding: 6px 8px 10px;
    width: 100%;
    box-sizing: border-box;
    min-height: 320px;
  }
  #profile .subtabs { padding: 6px; gap: 4px; }
  #profile .panel p,
  #profile .panel dd,
  #profile .panel li { font-size: clamp(11px, 3.2vw, 13px); line-height: 1.5; }
  #profile #titles li { line-height: 1.7; }
  #profile .panel h4 { font-size: clamp(13px, 3.4vw, 16px); }
  #profile .panel h5 { font-size: clamp(12px, 3.2vw, 15px); }
  #profile #bio p { line-height: 1.6; }
  #profile .bio-dl {
    font-size: clamp(12px, 3.6vw, 14px);
    line-height: 1.4;
  }
  #history .rail-text { font-size: clamp(14px, 4vw, 20px); }
}

/* ----- 400px以下: 極小画面対応 ----- */
@media (max-width: 400px) {
  #profile .profile-layout,
  #profile .block-head {
    padding: 0 2px;
    gap: 2px;
  }
  #profile .profile-card { gap: 8px; justify-content: center !important; }
  #profile .profile-card .dot { width: 56px; height: 56px; }
  #profile .bio-dl { gap: 2px 6px; }
  #profile .profile-body .panel-box { padding: 4px 4px 6px; min-height: 300px; }
}

/* ===============================
   Footer（最終調整版）
================================== */
.site-footer {
  background-color: #1E1E1E;
  color: #fff;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  padding: 32px 75px 8px;     /* 下 20px -> 8px に再圧縮 */
  position: relative;
  z-index: 2;
}

.site-footer .footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* 左：屋号 */
.footer-brand {
  font-family: "Shippori Mincho B1", serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
  line-height: 1.6;
}

.footer-tagline {
  font-family: "Shippori Mincho B1", serif;
  font-size: 14px;
  margin: 4px 0 0;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

/* 右：SNSアイコン */
.footer-right {
  text-align: right;
}
.sns-list {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 0;
  margin: 0;
}
.sns-list img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}
.sns-list a:hover img {
  transform: scale(1.1);
}

/* コピーライト */
.copy {
  display: block;
  text-align: center;
  margin-top: 40px;           /* 16px -> 12px */
  margin-bottom: 0;           /* 末尾の余白ゼロでページエンドをタイトに */
  font-size: 12px;
  opacity: 0.7;
}

/* 横幅が狭いとき（スマホ対応） */
@media (max-width: 768px) {
  .site-footer {
    padding: 32px 24px 16px;
  }
  .site-footer .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
  }
  .footer-right {
    text-align: center;
  }
}

/* 固定ナビぶんだけアンカー停止位置を上にずらす */
main > section { scroll-margin-top: 64px; }

/* ===============================
   Global: 横スクロール防止
================================== */
html, body {
  width: 100%;
  overflow-x: hidden; /* 横スクロール禁止 */
}

/* 横ブレしやすい要素のリセット */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

/* フッター内のコピーライト間延びを解消 */
.site-footer .copy {
  margin-top: 12px !important;  /* 40px → 12px */
  margin-bottom: 0 !important;
}

/* ======================================
   Works モーダル
   ====================================== */
body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  /* iOSでのスクロール防止を強化 */
  touch-action: none;
  -webkit-overflow-scrolling: none;
}

.work-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.work-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* フェードアウト時のアニメーション強化 */
.work-modal.is-closing {
  opacity: 0;
  visibility: hidden;
}

.work-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.work-modal-content {
  position: relative;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(6, 35, 123, 0.95);
  border: 4px solid var(--br, #fff);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  z-index: 1;
}

.work-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 1px;
  line-height: 1;
}

.work-modal-close:hover {
  background: rgba(255, 94, 148, 0.3);
  border-color: var(--pink, #FF5E94);
}

/* モーダル左右ナビゲーション */
.work-modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.work-modal.is-open .work-modal-nav {
  opacity: 1;
  pointer-events: auto;
}

.work-modal-nav:hover {
  background: rgba(255, 94, 148, 0.9);
  border-color: var(--pink, #FF5E94);
  transform: translateY(-50%) scale(1.1);
}

/* モーダルコンテンツのすぐ外側に配置 */
.work-modal-prev {
  left: calc(50% - min(400px, 45%) - 60px);
}

.work-modal-next {
  right: calc(50% - min(400px, 45%) - 60px);
}

@media (max-width: 1000px) {
  .work-modal-prev { left: 8px; }
  .work-modal-next { right: 8px; }
}

@media (max-width: 600px) {
  .work-modal-nav {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
}

.work-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.work-modal-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  overflow: hidden;
  background: #0a1530 no-repeat center / cover;
  border: 2px solid rgba(255,255,255,0.2);
}

.work-modal-thumb.thumb--asobulo { background-image: url("../images/asobulo_238x160.png"); }
.work-modal-thumb.thumb--fasting { background-image: url("../images/fasting_238x160.png"); }
.work-modal-thumb.thumb--food { background-image: url("../images/food_238x160.png"); }
.work-modal-thumb.thumb--3decsite { background-image: url("../images/3dec_238x160.png"); }
.work-modal-thumb.thumb--horrorecsite { background-image: url("../images/horrorec_238x160.png"); }
.work-modal-thumb.thumb--ace-banner {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #f5f5f5;
}

.work-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* バナー切り替えナビゲーション */
.banner-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.banner-nav-prev,
.banner-nav-next {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.banner-nav-prev:hover,
.banner-nav-next:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.banner-nav-indicator {
  font-family: "M PLUS 2", sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
  min-width: 100px;
  text-align: center;
}

.banner-nav-hint {
  width: 100%;
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.work-modal-title {
  font-family: "Baumans", system-ui;
  font-size: 24px;
  color: var(--gold, #FFC93C);
  margin: 0 0 16px;
}

.work-modal-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 12px;
  margin: 0 0 16px;
  font-size: 14px;
}

.work-modal-meta dt {
  color: rgba(255,255,255,0.6);
}

.work-modal-meta dd {
  margin: 0;
  color: #fff;
}

.work-modal-desc {
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  margin-bottom: 20px;
}

.work-modal-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 12px 24px;
  background: var(--pink, #FF5E94);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background .2s, transform .2s;
}

.work-modal-link:hover {
  background: #ff7aa8;
  transform: translateY(-2px);
}

/* PC想定注釈（モーダル内） */
.work-modal-info .pc-notice {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 12px;
  text-align: center;
}

@media (max-width: 768px) {
  .work-modal-body {
    grid-template-columns: 1fr;
  }
  .work-modal-content {
    padding: 20px;
  }
  /* 1カラム時はリンクボタンを中央寄せ */
  .work-modal-info {
    text-align: center;
  }
  .work-modal-link {
    margin: 0 auto;
  }
}

/* ======================================
   Services セクション - RPGアイテムショップ風
   ====================================== */
#services {
  background:
    /* 暗くするオーバーレイ */
    linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)),
    url("../images/shopbackground.png") center center / cover no-repeat;
  background-color: #1a1208;
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 100px;
  /* ドット絵のシャープな拡大 */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* 背景のランプの揺らぎアニメーション */
#services::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 160, 60, 0.15) 0%, transparent 50%);
  animation: lampFlicker 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

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

@keyframes magicCircle {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 見出し - 他セクションと統一（左揃え） */
#services .block-head {
  width: min(980px, 96vw);
  margin: 0 auto 40px;
  padding: 0 24px;
  position: relative;
  z-index: 2;
  text-align: left;
  box-sizing: border-box;
}

#services .block-head h2 {
  font-family: "Baumans", system-ui;
  font-size: 36px;
  color: var(--gold, #FFC93C);
  letter-spacing: .05em;
  position: relative;
  display: inline-block;
}

#services .block-head h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -14px;
  width: 203px;
  height: 18px;
  background: url("../images/PastWorksborder_203x18.png") left center/contain no-repeat;
  pointer-events: none;
}

/* ショップダイアログ */
.shop-dialogue {
  max-width: 400px;
  margin: 0 auto 32px;
  background: rgba(6, 35, 123, 0.95);
  border: 3px solid var(--gold, #FFC93C);
  border-radius: 12px;
  padding: 16px 24px;
  position: relative;
  box-shadow:
    0 0 20px rgba(255, 201, 60, 0.3),
    inset 0 0 30px rgba(255, 201, 60, 0.05);
  animation: dialoguePulse 3s ease-in-out infinite;
}

@keyframes dialoguePulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 201, 60, 0.3), inset 0 0 30px rgba(255, 201, 60, 0.05); }
  50% { box-shadow: 0 0 30px rgba(255, 201, 60, 0.5), inset 0 0 40px rgba(255, 201, 60, 0.1); }
}

.dialogue-arrow {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--gold, #FFC93C);
}

.dialogue-arrow::after {
  content: "";
  position: absolute;
  top: -14px;
  left: -9px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 9px solid rgba(6, 35, 123, 0.95);
}

.dialogue-text {
  font-family: "M PLUS 2", sans-serif;
  font-size: 16px;
  color: #fff;
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

/* サービスカードグリッド */
.shop-frame {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

.shop-inventory {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 20px;
  position: relative;
}

.shop-inventory .service-card {
  flex: 0 0 calc(33.333% - 14px);
  max-width: calc(33.333% - 14px);
  display: flex;
  flex-direction: column;
}

/* SHOP看板 */
.shop-sign {
  position: absolute;
  top: -60px;
  right: -30px;
  width: 120px;
  height: auto;
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  animation: signSwing 3s ease-in-out infinite;
  transform-origin: top center;
}

@keyframes signSwing {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

/* モバイル用看板（デフォルトは非表示） */
.shop-sign-mobile {
  display: none;
}

/* サービスカード */
.service-card {
  position: relative;
  border-radius: 16px;
  padding: 3px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  --card-color: #FF5E94;
  height: 100%;
}

/* カードの枠色を順番に変える：ピンク→青→黄色 */
.service-card:nth-child(3n+1) {
  --card-color: #FF5E94; /* ピンク */
}
.service-card:nth-child(3n+2) {
  --card-color: #00BFFF; /* 青 */
}
.service-card:nth-child(3n+3) {
  --card-color: #FFC93C; /* 黄色 */
}

/* カードのグロー効果 */
.card-glow {
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--card-color), transparent 40%, transparent 60%, var(--card-color));
  opacity: 0.5;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(135deg, var(--card-color) 0%, rgba(255,255,255,0.3) 50%, var(--card-color) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.card-inner {
  background: linear-gradient(180deg, rgba(15, 25, 60, 0.98) 0%, rgba(6, 20, 50, 0.98) 100%);
  border-radius: 14px;
  padding: 24px 16px;
  height: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  justify-items: center;
  text-align: center;
}

/* ホバー効果 */
.service-card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.service-card:hover .card-glow {
  opacity: 1;
  animation: glowPulse 1.5s ease-in-out infinite;
}

/* タッチデバイスでhover sticky問題を回避 */
@media (hover: none) {
  .service-card:hover {
    transform: none;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  }
  .service-card:hover .card-glow {
    opacity: 0.5;
    animation: none;
  }
}

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

/* サービスアイコン */
.service-icon {
  font-size: 44px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.15);
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: scale(1.15); }
  50% { transform: scale(1.25); }
}

/* サービス名 */
.service-name {
  font-family: "Baumans", system-ui;
  font-size: 18px;
  color: #fff;
  margin: 0 0 8px;
}

/* サービス説明 */
.service-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.5;
  align-self: start;
  min-height: 78px;
}

/* 価格 */
.service-price {
  font-family: "Montserrat", "M PLUS 2", sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--gold, #FFC93C);
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  text-shadow: 0 0 8px rgba(255, 201, 60, 0.5);
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

/* 価格帯リスト（規模別） */
.service-tiers {
  list-style: none;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: end;
  min-height: 120px;
}

.service-tiers li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}

.service-tiers a {
  color: #00BFFF;
  text-decoration: underline;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  cursor: pointer;
}

.service-tiers a:hover {
  color: #FFC93C;
}

.tier-label {
  font-family: "M PLUS 2", sans-serif;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
}

.tier-price {
  font-family: "Montserrat", "M PLUS 2", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold, #FFC93C);
  text-shadow: 0 0 8px rgba(255, 201, 60, 0.5);
}

/* レスポンシブ */
@media (max-width: 1024px) {
  #services {
    padding-top: 100px;
  }

  #services .block-head h2 {
    font-size: 36px;
  }

  .shop-sign {
    width: 100px;
    top: -50px;
    right: -10px;
  }
}

@media (max-width: 900px) {
  .shop-inventory {
    gap: 16px;
  }

  .shop-inventory .service-card {
    flex: 0 0 calc(50% - 8px);
    max-width: calc(50% - 8px);
  }

  .shop-sign {
    width: 90px;
    top: -45px;
    right: 0;
  }
}

@media (max-width: 768px) {
  #services {
    padding-top: 80px;
    padding-bottom: 80px;
    /* 768px～600pxは元のショップ背景画像を維持 */
  }

  #services .block-head {
    padding: 0 20px;
    margin-bottom: 30px;
  }

  #services .block-head h2 {
    font-size: 34px;
  }

  /* 吹き出しを中央揃え */
  .shop-dialogue {
    margin: 0 auto 24px;
    padding: 14px 18px;
    width: calc(100% - 32px);
    max-width: 400px;
  }

  .shop-frame {
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .shop-sign {
    width: 80px;
    top: -40px;
    right: 10px;
  }
}

@media (max-width: 600px) {
  #services {
    padding-top: 70px;
    padding-bottom: 100px;
    /* iOS対応: #000から#020A54へのグラデーション */
    background: linear-gradient(to bottom, #000000 0%, #020A54 100%);
    background-color: #000000;
  }

  #services .block-head {
    padding: 0 16px;
  }

  #services .block-head h2 {
    font-size: 32px;
  }

  #services .block-head h2::after {
    width: 180px;
    bottom: -12px;
  }

  /* 1カラム時は中央揃え */
  .shop-frame {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .shop-dialogue {
    width: 100%;
    max-width: 100%;
    margin: 0 0 20px;
    padding: 12px 14px;
    position: relative;
    box-sizing: border-box;
  }

  .dialogue-text {
    font-size: 14px;
  }

  .shop-inventory {
    gap: 14px;
  }

  .shop-inventory .service-card {
    flex: 0 0 100%;
    max-width: 100%;
    cursor: pointer;
    height: auto;
    /* paintのみでアコーディオン高さ変化に対応 */
    contain: paint;
    box-sizing: border-box;
    overflow-anchor: none;
  }

  /* アコーディオン：ヘッダー部分（常に表示） */
  .service-card .card-inner {
    position: relative;
    height: auto;
    box-sizing: border-box;
    /* 開閉時のサイズ変動を防ぐ */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* 開閉インジケーター */
  .service-card .service-name::after {
    content: "▼";
    font-size: 10px;
    margin-left: 8px;
    transition: transform 0.3s ease;
    display: inline-block;
  }

  .service-card.is-open .service-name::after {
    transform: rotate(180deg);
  }

  /* アコーディオン：折りたたみ部分（初期非表示） */
  .service-card .service-desc,
  .service-card .service-price,
  .service-card .service-tiers {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease-out, opacity 0.25s ease-out, padding 0.35s ease-out;
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }

  /* 開いた状態 */
  .service-card.is-open .service-desc {
    max-height: 200px;
    opacity: 1;
    padding-top: 10px;
  }

  .service-card.is-open .service-price {
    max-height: 50px;
    opacity: 1;
    padding-top: 10px;
  }

  .service-card.is-open .service-tiers {
    max-height: 150px;
    opacity: 1;
    padding-top: 10px;
  }

  /* デスクトップ用看板を非表示 */
  .shop-frame > .shop-sign {
    display: none;
  }

  /* モバイル用看板を表示してダイアログの右上に配置 */
  .shop-sign-mobile {
    display: block;
    position: absolute;
    width: 60px;
    top: -25px;
    right: -10px;
    z-index: 10;
    animation: signSwing 3s ease-in-out infinite;
  }

  .card-inner {
    padding: 14px 12px;
  }

  .service-icon {
    font-size: 30px;
  }

  .service-name {
    font-size: 14px;
  }

  .service-desc {
    font-size: 12px;
    min-height: auto;
  }

  .service-price {
    font-size: 14px;
    min-height: auto;
  }

  .service-tiers {
    min-height: auto;
    gap: 4px;
  }

  .tier-label {
    font-size: 11px;
  }

  .tier-price {
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  #services .block-head {
    padding: 0 12px;
  }

  #services .block-head h2 {
    font-size: 28px;
  }

  #services .block-head h2::after {
    width: 160px;
  }

  .shop-frame {
    padding: 0 12px;
  }

  .shop-sign-mobile {
    width: 50px;
    top: -20px;
    right: -5px;
  }

  .dialogue-text {
    font-size: 13px;
  }
}
