@charset "utf-8";
/* Chopin Adventure 公式サイト
   デザイントークンはゲーム本体の正本（仕様§6・設計図_フォント）から取る。
   ＝サイトとゲームが地続きに見えることが最大の説得力。 */

:root {
  --void: #070a1e;
  --navy: #141a44;
  --navy-2: #232b6b;
  --navy-3: #2f3a86;
  --gold: #ffd84a;
  --gold-hi: #fff8d8;
  --gold-deep: #e89a18;
  --brown: #3a2409;      /* 金文字の縁（ゲームと同じ焦げ茶） */
  --cyan: #5bd8ff;
  --magenta: #c66bff;
  --cream: #ede6f5;
  --cream-dim: #b9b3d4;
  --ink: #27497a;

  /* 町のグレーディング（JSで --town-* を差し替える） */
  --town-key: #ffb86b;
  --town-bg: #1a1c46;

  --page: var(--navy);
  --maxw: 1180px;
  --pad: clamp(18px, 5vw, 56px);
  --r: 18px;

  --f-display: "Cinzel Decorative", "Zen Kaku Gothic New", serif;
  --f-head: "Zen Kaku Gothic New", "M PLUS 1p", sans-serif;
  --f-body: "M PLUS 1p", "Zen Kaku Gothic New", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-weight: 500;
  color: var(--cream);
  background: var(--page);
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 1.2s ease;
}

/* 変身後＝ページが宇宙寄りに沈む（記名の仕掛けの到達点） */
body.transformed { --page: var(--void); }

img { max-width: 100%; height: auto; }

a { color: var(--gold); }

::selection { background: var(--gold); color: var(--brown); }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ───────── 背景の星と光 ───────── */

.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, #fff 50%, transparent 55%),
    radial-gradient(1.4px 1.4px at 68% 12%, var(--gold-hi) 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 82% 44%, var(--cyan) 50%, transparent 55%),
    radial-gradient(1.8px 1.8px at 34% 68%, #fff 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 54% 86%, var(--gold) 50%, transparent 55%),
    radial-gradient(1.4px 1.4px at 92% 74%, #fff 50%, transparent 55%),
    radial-gradient(1.2px 1.2px at 22% 92%, var(--magenta) 50%, transparent 55%);
  background-size: 620px 620px;
  opacity: .55;
  animation: twinkle 6s ease-in-out infinite;
}

@keyframes twinkle { 0%, 100% { opacity: .4; } 50% { opacity: .7; } }

.aurora {
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(91, 216, 255, .16), transparent 70%),
    radial-gradient(50% 45% at 78% 10%, rgba(198, 107, 255, .14), transparent 72%);
  filter: blur(10px);
}

/* ───────── HUD（読む＝集める） ───────── */

.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px clamp(12px, 4vw, 30px) 14px;
  pointer-events: none;
  /* ゲームのHUDと同じく「画面の上に乗った操作盤」に見せる＝下を本文が流れても読みが濁らない */
  background: linear-gradient(180deg, rgba(7, 10, 30, .96) 0%, rgba(7, 10, 30, .88) 58%, rgba(7, 10, 30, 0) 100%);
  backdrop-filter: blur(3px);
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity .5s ease, transform .5s ease;
}

.hud.on { opacity: 1; transform: none; }

.hud-label {
  font-family: var(--f-body);
  font-size: clamp(9px, 2.2vw, 11px);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--cream-dim);
  display: block;
  line-height: 1.4;
}

.hud-count {
  font-family: var(--f-display);
  font-weight: 900;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.hud-count b {
  font-size: clamp(20px, 5vw, 30px);
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 48%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 var(--brown)) drop-shadow(0 0 10px rgba(255, 216, 74, .5));
}

.hud-count i {
  font-style: normal;
  font-size: clamp(11px, 2.6vw, 14px);
  color: var(--cream-dim);
}

.hud-combo { min-width: min(38vw, 220px); }

.combo-bar {
  height: 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  overflow: hidden;
}

.combo-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  transition: width .25s ease;
}

.hud.super .combo-fill {
  background: linear-gradient(90deg, #ff6b8f, var(--gold), #5be6a0, var(--cyan), var(--magenta));
  background-size: 300% 100%;
  animation: rainbow 1.6s linear infinite;
}

@keyframes rainbow { to { background-position: 300% 0; } }

/* ───────── 町の空を飛ぶマントショパンくん（記名） ───────── */
/* 走りのコマ送りは「スクロール中だけ動く」＝止めるたびに固まって点滅に見えたので飛行にした。
   飛行なら1枚の絵で成立し、スクロールに合わせて滑らかに横切る。 */

.town-flyer {
  position: absolute;
  z-index: 8;                      /* 建物より手前・veil(9)より奥＝町の空を飛ぶ */
  bottom: 52%;
  left: -12%;
  height: 15%;
  aspect-ratio: 619 / 239;
  background-image: url("cloak_fly.webp");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  transform: translate(-50%, 0);
  opacity: 0;
  transition: opacity .7s ease;
  will-change: left, transform;
}

.town-flyer.on { opacity: 1; }

/* ───────── ヘッダー ───────── */

header.site {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--pad) 0;
  max-width: var(--maxw);
  margin: 0 auto;
}

/* 下層ページはヘッダーが本文を覆わないよう通常フローに戻す */
body.doc-page header.site { position: relative; }

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  text-decoration: none;
  color: var(--cream);
}

.wordmark img { width: clamp(120px, 26vw, 168px); height: auto; }

.wordmark small {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--cream-dim);
  white-space: nowrap;
}

/* トップのヘッダー＝文字のワードマーク（ヒーローの大ロゴと二重にしない） */
.wordmark.text-only { flex-direction: column; align-items: flex-start; gap: 1px; }

.wm-name {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(13px, 3vw, 16px);
  letter-spacing: .12em;
  color: var(--gold);
  line-height: 1.2;
  white-space: nowrap;
}

nav.site { display: flex; gap: clamp(12px, 3vw, 26px); }

nav.site a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--cream);
  text-decoration: none;
  padding: 0 4px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}

nav.site a:hover { color: var(--gold); border-bottom-color: var(--gold); }

/* ───────── 見出し・文字 ───────── */

.kicker {
  font-family: var(--f-display);
  font-size: clamp(10px, 2.4vw, 12px);
  font-weight: 700;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 14px;
}

h1, h2, h3 {
  font-family: var(--f-head);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: .01em;
  margin: 0 0 18px;
}

/* 日本語を文節で折り返す（ゲーム本体のBudouXと同じ考え方のWeb標準機能）。
   対応していないブラウザでは通常の折り返しに戻るだけ＝安全。 */
h1, h2, h3, .tagline, .kana-sample, .boss h3, .town-copy h3, .tf-line {
  word-break: auto-phrase;
}

h2 {
  font-size: clamp(24px, 5.2vw, 42px);
  max-width: 22em;
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 52%, var(--gold-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 2px 0 var(--brown))
    drop-shadow(2px 0 0 var(--brown))
    drop-shadow(-2px 0 0 var(--brown))
    drop-shadow(0 -1px 0 var(--brown));
}

h3 { font-size: clamp(17px, 3.4vw, 22px); color: var(--cream); }

p { margin: 0 0 18px; }

.sub {
  font-size: clamp(14px, 2.6vw, 16.5px);
  color: var(--cream-dim);
  max-width: 36em;
  line-height: 1.95;
}

.sub.center { margin-left: auto; margin-right: auto; text-align: center; }

.ep {
  font-family: var(--f-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  color: var(--cyan);
  margin: 0 0 4px;
}

.fine-note {
  font-size: 12.5px;
  color: var(--cream-dim);
  text-align: center;
  margin-top: 18px;
}

/* ───────── ボタン ───────── */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 26px;
  border: 0;
  border-radius: 99px;
  font-family: var(--f-body);
  font-size: clamp(13.5px, 2.8vw, 15px);
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-deep));
  color: #2a1a05;
  box-shadow: 0 0 0 1px rgba(255, 248, 216, .6) inset, 0 10px 26px rgba(255, 216, 74, .26);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.cta:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 248, 216, .8) inset, 0 14px 34px rgba(255, 216, 74, .38); }
.cta:active { transform: translateY(0) scale(.97); }

.cta-static { cursor: default; }
.cta-static:hover { transform: none; box-shadow: 0 0 0 1px rgba(255, 248, 216, .6) inset, 0 10px 26px rgba(255, 216, 74, .26); }

.cta.ghost {
  background: rgba(35, 43, 107, .55);
  color: var(--cream);
  box-shadow: 0 0 0 1.5px rgba(255, 216, 74, .55) inset;
  backdrop-filter: blur(6px);
}

.cta.ghost:hover { background: rgba(47, 58, 134, .7); box-shadow: 0 0 0 1.5px var(--gold) inset; }

.cta.link {
  background: none;
  color: var(--cream);
  box-shadow: none;
  padding: 14px 10px;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-color: rgba(255, 216, 74, .5);
}

.cta.link:hover { color: var(--gold); box-shadow: none; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cta-row.center { justify-content: center; }

/* ───────── ヒーロー ───────── */

/* ヒーローは全幅の一枚絵（動画が"板"に見えないよう左右いっぱいに広げる） */
.hero {
  position: relative;
  z-index: 10;
  min-height: min(100vh, 860px);
  display: flex;
  align-items: flex-end;
  padding: clamp(96px, 16vh, 150px) 0 clamp(56px, 10vh, 96px);
  overflow: hidden;
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  /* ヒーローは丸ごと1枚の絵として置く（角丸で"板"に見せない） */
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  /* 映像の見せ場（中ほど）は明るいまま。下端だけ深く沈めて、
     MVに焼き込まれた歌詞のテロップと本文がぶつからないようにする。 */
  background:
    linear-gradient(180deg, rgba(7, 10, 30, .7) 0%, rgba(7, 10, 30, .08) 26%,
                    rgba(7, 10, 30, .38) 60%, rgba(7, 10, 30, .9) 84%, var(--page) 98%),
    linear-gradient(90deg, rgba(7, 10, 30, .86) 0%, rgba(7, 10, 30, .5) 34%, rgba(7, 10, 30, .06) 66%, transparent 100%);
}

.hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.hero h1 { margin: 0 0 10px; }

.hero h1 img {
  width: clamp(250px, 62vw, 430px);
  height: auto;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .6));
}

.tagline {
  font-family: var(--f-head);
  font-weight: 900;
  font-size: clamp(19px, 4.4vw, 30px);
  line-height: 1.45;
  margin: 0 0 14px;
  color: var(--cream);
  text-shadow: 0 2px 0 rgba(7, 10, 30, .8), 0 0 22px rgba(7, 10, 30, .9);
}

.hero .lede {
  font-size: clamp(14px, 2.7vw, 16.5px);
  max-width: 30em;
  color: var(--cream);
  text-shadow: 0 1px 8px rgba(7, 10, 30, .9);
  margin-bottom: 26px;
}

/* ───────── オープニングムービーのコーナー（劇場） ───────── */
/* ヒーローの映像は「背景」として割り切り、ムービーはここで正面から見せる。
   横長の映像はスマホの縦画面では何が写っているか分からないので、
   16:9の額に入れて大きな再生ボタンを置く＝一般的で、いちばん押される形。 */

.band.movie .inner { text-align: center; }
.band.movie h2, .band.movie .sub { margin-left: auto; margin-right: auto; }
.band.movie h2 { max-width: 20em; }
.band.movie .sub { text-align: left; max-width: 34em; }

.theater {
  position: relative;
  margin: clamp(26px, 5vw, 46px) auto 0;
  max-width: 980px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r);
  overflow: hidden;
  background: #05060f;
  box-shadow:
    0 0 0 1px rgba(255, 216, 74, .34),
    0 0 0 7px rgba(20, 26, 68, .55),
    0 26px 70px rgba(0, 0, 0, .55);
  transition: box-shadow .35s ease, transform .35s ease;
}

.theater:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(255, 216, 74, .7),
    0 0 0 7px rgba(35, 43, 107, .7),
    0 32px 84px rgba(0, 0, 0, .6);
}

.theater-video { display: block; width: 100%; height: 100%; object-fit: cover; }

/* 再生ボタン＝画面の中央に大きく。押したくなるように、常に静かに脈打つ */
.theater-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  border: 0;
  cursor: pointer;
  color: var(--cream);
  /* 下端は文字の下敷き（サムネイルに写り込んだ歌詞と重なっても読める） */
  background:
    linear-gradient(180deg, transparent 58%, rgba(7, 10, 30, .88) 100%),
    radial-gradient(62% 62% at 50% 46%, rgba(7, 10, 30, .42), rgba(7, 10, 30, .74));
  transition: opacity .4s ease, background .4s ease;
}

.theater-play.hidden { opacity: 0; pointer-events: none; }

.tp-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(78px, 13vw, 116px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 46%, var(--gold-deep));
  box-shadow: 0 0 0 1px rgba(255, 248, 216, .8) inset, 0 12px 40px rgba(255, 216, 74, .45);
  animation: playpulse 2.6s ease-in-out infinite;
}

@keyframes playpulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 248, 216, .8) inset, 0 12px 40px rgba(255, 216, 74, .4); }
  50% { box-shadow: 0 0 0 1px rgba(255, 248, 216, 1) inset, 0 14px 58px rgba(255, 216, 74, .72); }
}

.theater:hover .tp-ring { transform: translate(-50%, -50%) scale(1.06); }

.tp-icon {
  position: relative;
  width: clamp(30px, 5vw, 44px);
  margin-left: 5px;              /* 三角の重心ぶんだけ右へ＝目で見て中央に来る */
  fill: #2a1a05;
  filter: drop-shadow(0 1px 0 rgba(255, 248, 216, .5));
}

.tp-text {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(16px, 4vw, 30px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--f-body);
  font-size: clamp(13px, 2.6vw, 15px);
  font-weight: 900;
  letter-spacing: .05em;
  text-shadow: 0 2px 10px rgba(7, 10, 30, .95);
}

.tp-text i {
  font-family: var(--f-display);
  font-style: normal;
  font-weight: 700;
  font-size: .92em;
  color: var(--gold);
}

.scrollcue {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 11px;
  letter-spacing: .2em;
  color: var(--cream-dim);
  white-space: nowrap;
}

.scrollcue::after {
  content: "";
  display: block;
  width: 1px;
  height: 26px;
  margin: 8px auto 0;
  background: linear-gradient(180deg, var(--gold), transparent);
  animation: cue 2.2s ease-in-out infinite;
}

@keyframes cue { 0%, 100% { opacity: .3; transform: scaleY(.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* ───────── 帯（共通セクション） ───────── */

.band {
  position: relative;
  z-index: 10;
  padding: clamp(64px, 12vh, 128px) 0;
  /* 目次リンクで飛んだ時に見出しがHUDの下へ潜らないように */
  scroll-margin-top: 78px;
}

.band .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.inner.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

/* ───────── 物語（紙芝居の絵巻） ───────── */

.plates {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 26px);
  margin: clamp(28px, 5vw, 48px) 0;
}

.plate {
  margin: 0;
  border-radius: var(--r);
  overflow: hidden;
  background: rgba(35, 43, 107, .3);
  box-shadow: 0 0 0 1px rgba(255, 216, 74, .18), 0 18px 40px rgba(0, 0, 0, .4);
}

.plate img { display: block; width: 100%; }

.plate figcaption {
  padding: 14px 18px 16px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--cream-dim);
}

/* ───────── 4つの町（7層パララックス＝山場） ───────── */

.towns { margin-top: clamp(28px, 5vw, 48px); }

.town {
  position: relative;
  margin-bottom: clamp(26px, 5vw, 54px);
}

/* ゲームの論理画面（2123×977）と同じ画角にする＝層の高さ比（hFrac）がゲームどおりに効く。
   ⚠️ min-height は使わない（aspect-ratio と併用すると幅の方が押し広げられて横にはみ出す）。 */
.town-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 2123 / 977;
  max-height: 74vh;
  overflow: hidden;
  background: var(--town-bg);
}

/* 各層の height（＝hFrac）と bottom（＝地面ライン＋depthLift）は、
   ゲームのデータ（CHOPIN_CHAPTERS.json）から build_site.py が inline style で書き込む。
   ここでは共通の敷き方だけを持つ：横は繰り返して敷き、パララックスは背景位置で流す。 */
.pl {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  background-position: 0 bottom;
  background-size: auto 100%;
  will-change: background-position;
}

/* 空だけは画面全体を覆う（ゲームの MakeFullSky ＝ cover と同じ） */
.pl-sky { z-index: 1; top: 0; bottom: 0; background-size: cover; background-position: 50% 45%; }

/* 天体（月と星・夜の町だけ）＝黒地の加算素材。上そろえで月を上部に残す（ゲームの MakeCelestial と同じ） */
.pl-moonstars {
  z-index: 2;
  top: 0;
  height: 90%;
  background-size: cover;
  background-position: 50% top;
  background-repeat: no-repeat;
  mix-blend-mode: screen;
}

.pl-far_a { z-index: 3; }
.pl-far_b { z-index: 4; }
.pl-mid { z-index: 5; }
.pl-near { z-index: 6; }
.pl-ground { z-index: 7; }

/* 絵の四辺をページの闇へ溶かす（額縁を作らず、世界がページに続いて見えるように）。
   下端は最後まで絵を見せてから急に沈める＝石畳（地面層）が暗く潰れない。 */
.town-veil {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--page) 0%, rgba(20, 26, 68, .3) 10%, transparent 30%,
                    transparent 74%, rgba(7, 10, 30, .5) 93%, var(--page) 100%),
    linear-gradient(90deg, var(--page) 0%, transparent 16%, transparent 84%, var(--page) 100%);
}

.town-copy {
  position: relative;
  z-index: 10;
  max-width: var(--maxw);
  margin: -46px auto 0;
  padding: 0 var(--pad);
}

.town-copy h3 {
  font-size: clamp(22px, 5vw, 34px);
  margin-bottom: 10px;
  background: linear-gradient(180deg, #fff, var(--town-key));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(7, 10, 30, .95)) drop-shadow(0 0 14px rgba(7, 10, 30, .9));
}

.town-copy .ep { text-shadow: 0 1px 6px rgba(7, 10, 30, .95); }

.town-copy p:not(.ep) {
  max-width: 30em;
  font-size: clamp(13.5px, 2.6vw, 15.5px);
  color: var(--cream);
  text-shadow: 0 1px 8px rgba(7, 10, 30, .95), 0 0 20px rgba(7, 10, 30, .8);
}

/* 町ごとのキーカラー */
.town[data-town="morning"] { --town-key: #ffb86b; --town-bg: #2a1e3a; }
.town[data-town="night"]   { --town-key: #7f9dff; --town-bg: #0e1236; }
.town[data-town="snow"]    { --town-key: #bfe4ff; --town-bg: #1b2550; }
.town[data-town="sea"]     { --town-key: #4fd6c0; --town-bg: #102a44; }

/* ───────── 変身 ───────── */

.band.transform { text-align: center; }
.band.transform h2, .band.transform .sub { margin-left: auto; margin-right: auto; }
.band.transform h2 { max-width: 18em; }
/* 本文は左そろえ（中央そろえの長文は読みにくい）。ブロックだけ中央に置く。 */
.band.transform .sub { text-align: left; max-width: 34em; }

.transform-stage {
  position: relative;
  margin: clamp(40px, 8vw, 78px) auto clamp(28px, 5vw, 44px);
  max-width: 640px;
  min-height: clamp(190px, 38vw, 290px);
  display: grid;
  place-items: center;
  /* 光線は回るので、回転で広がった分が画面外へはみ出さないよう枠内で切る */
  overflow: hidden;
}

.tf-rays {
  position: absolute;
  width: min(96%, 560px);
  max-width: none;
  opacity: .85;
  mix-blend-mode: screen;
  filter: saturate(1.15);
  animation: rays 14s linear infinite;
}

@keyframes rays { to { transform: rotate(360deg); } }

.tf-cat {
  position: relative;
  width: min(72%, 400px);
  filter: drop-shadow(0 0 26px rgba(255, 216, 74, .55)) drop-shadow(0 10px 20px rgba(0, 0, 0, .5));
}

.tf-line {
  position: relative;
  margin: 14px 0 0;
  font-family: var(--f-head);
  font-weight: 900;
  font-size: clamp(17px, 4.2vw, 27px);
  letter-spacing: .02em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 50%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 var(--brown)) drop-shadow(0 0 18px rgba(255, 216, 74, .55));
}

/* 変身の発火（全画面フラッシュ） */
.flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 52%, #fff 0%, var(--gold) 26%, rgba(255, 216, 74, 0) 62%);
}

.flash.fire { animation: fire 1.05s ease-out forwards; }

@keyframes fire {
  0% { opacity: 0; transform: scale(.7); }
  18% { opacity: .95; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ───────── 立ちはだかる者たち（集合シルエット） ───────── */
/* 誰が待っているかは見せない。影だけが闇に浮かび、遊んで確かめてもらう。 */

.crowd {
  position: relative;
  margin: clamp(30px, 6vw, 56px) 0 clamp(24px, 4vw, 40px);
  padding: 0;
}

.crowd img {
  display: block;
  width: 100%;
  height: auto;
  /* 影の集団を闇へなじませる（左右と下をページに溶かす） */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%),
    linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%),
    linear-gradient(180deg, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.crowd figcaption {
  margin-top: clamp(6px, 1.6vw, 14px);
  text-align: center;
  font-size: clamp(12.5px, 2.5vw, 14px);
  color: var(--cream-dim);
  letter-spacing: .04em;
}

/* ───────── 手ざわり（3枚） ───────── */

.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 3vw, 24px);
  margin-top: clamp(26px, 5vw, 44px);
}

.feature {
  padding: clamp(20px, 4vw, 28px);
  border-radius: var(--r);
  background: rgba(35, 43, 107, .35);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

.feature h3 { margin-bottom: 10px; color: var(--gold); }

.feature p { font-size: 13.5px; color: var(--cream-dim); margin: 0; }

/* ───────── ひらがなモード ───────── */

.kana-demo {
  padding: clamp(22px, 4vw, 32px);
  border-radius: var(--r);
  background: linear-gradient(180deg, rgba(35, 43, 107, .6), rgba(20, 26, 68, .6));
  box-shadow: 0 0 0 1px rgba(255, 216, 74, .22);
}

.kana-tabs { display: flex; gap: 8px; margin-bottom: 18px; }

.kana-tab {
  flex: 1;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 99px;
  font-family: var(--f-body);
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  color: var(--cream);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .14) inset;
  transition: background .2s, color .2s, box-shadow .2s;
}

.kana-tab.is-on {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 45%, var(--gold-deep));
  color: #2a1a05;
  box-shadow: 0 0 0 1px rgba(255, 248, 216, .7) inset;
}

.kana-sample {
  margin: 0;
  font-family: var(--f-head);
  font-weight: 900;
  font-size: clamp(16px, 3.6vw, 22px);
  line-height: 1.9;
  color: var(--cream);
  min-height: 3.8em;
}

/* ───────── 最終CTA ───────── */

.band.promise { text-align: center; }

.band.promise h2.big {
  font-size: clamp(24px, 5.6vw, 44px);
  max-width: 20em;
  margin-left: auto;
  margin-right: auto;
}

/* ───────── フッター ───────── */

footer.site {
  position: relative;
  z-index: 10;
  padding: clamp(40px, 7vw, 70px) var(--pad) clamp(70px, 10vw, 96px);
  max-width: var(--maxw);
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

footer .cols {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

/* フッター＝作品のロゴと、開発元 PanMarie Studio のロゴを並べる */
footer .brand { display: flex; align-items: center; gap: clamp(14px, 3vw, 26px); }
footer .brand .studio-logo { width: clamp(84px, 11vw, 112px); height: auto; }
footer .brand .game-logo { width: clamp(100px, 13vw, 126px); height: auto; opacity: .88; }

footer .brand small {
  font-family: var(--f-display);
  font-size: 9px;
  letter-spacing: .2em;
  color: var(--cream-dim);
}

footer nav { display: flex; flex-wrap: wrap; gap: 18px; }

footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font-size: 13px;
  color: var(--cream-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

footer nav a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.fine { font-size: 11.5px; color: var(--cream-dim); margin: 0; }

/* ───────── ダイアログ（待機リスト・MV） ───────── */

dialog {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--cream);
  max-width: min(92vw, 520px);
  width: 100%;
}

dialog::backdrop { background: rgba(4, 6, 20, .82); backdrop-filter: blur(4px); }

#wl-form {
  position: relative;
  padding: clamp(26px, 5vw, 38px);
  border-radius: var(--r);
  background: linear-gradient(180deg, #232b6b, #141a44);
  box-shadow: 0 0 0 1px rgba(255, 216, 74, .4), 0 30px 60px rgba(0, 0, 0, .6);
}

#wl-form h2 { font-size: clamp(19px, 4vw, 25px); }

.wl-lede { font-size: 13.5px; color: var(--cream-dim); }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--cream-dim);
}

.field input, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(7, 10, 30, .5);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: 15px;
}

.field textarea { resize: vertical; }

.hp-field { position: absolute; top: -9999px; left: 0; }

.wl-close, .mv-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: var(--cream);
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.wl-close:hover, .mv-close:hover { background: rgba(255, 255, 255, .2); }

#wl-status { min-height: 1.6em; font-size: 13px; color: var(--gold); margin: 12px 0 0; }

.wl-privacy { font-size: 11.5px; color: var(--cream-dim); margin: 10px 0 0; }

/* ───────── 再生中の知らせ（音楽は画面外でも鳴り続ける） ───────── */

.now-playing {
  position: fixed;
  right: clamp(12px, 3vw, 26px);
  bottom: clamp(12px, 3vw, 26px);
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--f-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--cream);
  background: rgba(20, 26, 68, .88);
  box-shadow: 0 0 0 1.5px rgba(255, 216, 74, .55) inset, 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
  transition: transform .2s ease, box-shadow .2s ease;
}

.now-playing:hover { transform: translateY(-2px); box-shadow: 0 0 0 1.5px var(--gold) inset, 0 14px 36px rgba(0, 0, 0, .5); }
.now-playing[hidden] { display: none; }

/* 音が鳴っていることを示す3本のバー */
.np-eq { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.np-eq i { width: 3px; height: 100%; border-radius: 2px; background: var(--gold); transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.np-eq i:nth-child(2) { animation-delay: .18s; }
.np-eq i:nth-child(3) { animation-delay: .36s; }

@keyframes eq {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1); }
}

/* ───────── 下層ページ ───────── */

body.doc-page { --page: var(--navy); }

.doc {
  position: relative;
  z-index: 10;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 76px) var(--pad) clamp(60px, 10vw, 100px);
}

.doc h1 { font-size: clamp(24px, 5vw, 36px); font-family: var(--f-head); }

.doc h2 {
  font-size: clamp(17px, 3.4vw, 21px);
  margin-top: 34px;
  -webkit-text-fill-color: initial;
  background: none;
  filter: none;
  color: var(--gold);
}

.doc .updated { color: var(--cream-dim); font-size: 14px; }

.doc p { font-size: 14.5px; color: var(--cream); }

.faq-q { color: var(--gold); }

.hint { font-size: 12px; color: var(--cream-dim); margin-top: 6px; }

.backlink {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 32px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 216, 74, .5);
}

#form-status { min-height: 1.6em; font-size: 13.5px; color: var(--gold); }

/* ───────── 出現アニメ ───────── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .8s cubic-bezier(.2, .7, .3, 1), transform .8s cubic-bezier(.2, .7, .3, 1);
}

.reveal.in { opacity: 1; transform: none; }

.reveal.d1 { transition-delay: .1s; }
.reveal.d2 { transition-delay: .22s; }
.reveal.d3 { transition-delay: .34s; }

/* ───────── レスポンシブ ───────── */

@media (min-width: 700px) {
  .plates { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 960px) {
  .inner.split { grid-template-columns: 1fr 1fr; }
  .town-copy { margin-top: -70px; }
}

@media (max-width: 700px) {
  /* 縦画面では横がトリミングされるので、主役（ショパンくん）が画面に残る位置で切る */
  .hero-video { object-position: 33% center; }

  /* 縦画面は横方向の陰を薄く（画面が狭いぶん、左の濃い陰が映像全体を暗くしてしまうため） */
  .hero-shade {
    background:
      linear-gradient(180deg, rgba(7, 10, 30, .72) 0%, rgba(7, 10, 30, .1) 22%,
                      rgba(7, 10, 30, .5) 52%, rgba(7, 10, 30, .92) 80%, var(--page) 97%);
  }


  /* 横画面のゲーム比のままだと絵が細い帯になるので、縦を確保して"寄って"見せる
     （層の高さ比はそのまま＝重なりはゲームどおり。横の見える範囲だけが狭くなる） */
  .town-scene { aspect-ratio: 16 / 11; }
}

@media (max-width: 560px) {
  /* nav.site a より詳細度を高くする（低いと display:inline-flex に負けて隠れない） */
  nav.site a.hide-sp, .hide-sp { display: none; }
  .hero { align-items: flex-end; min-height: 88vh; }
}

/* ───────── 動きを減らす設定を尊重 ───────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .starfield, .scrollcue::after, .tf-rays, .hud.super .combo-fill { animation: none; }
  .town-flyer { transition: none; }
  .np-eq i { animation: none; transform: scaleY(.7); }
  .flash.fire { animation: none; opacity: 0; }
  .pl { background-position-x: 0 !important; }
  .cta { transition: none; }
}
