/* =========================================================
   Monsters Abyss 特設サイト
   レイアウトの考え方：
   - 各ブロックは「ステージ」。デザイン上の大きさ（--w × --h）を持ち、
     中の画像は「デザイン上の座標（--x, --y）と幅（--pw）」で置く。
   - 座標はステージ幅に対する割合に変換されるので、画面幅が変わっても
     全体が同じ比率で伸び縮みし、重なりやずれが起きない。
   - スマホ幅では、文字が小さくなりすぎるブロックだけ縦並びに組み替える。
   ========================================================= */

:root {
  --col: 1200px;          /* 本文の最大幅 */
  --bg: #0b0610;
  --text: #f3eaf7;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --jp: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- ステージ（共通の仕組み） ---------- */
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--w) / var(--h);
  overflow: hidden;
}
.stage .p {
  position: absolute;
  max-width: none;  /* img の「親より広くしない」を外す（ステージより大きく置くパーツがある） */
  left:  calc(var(--x)  / var(--w) * 100%);
  top:   calc(var(--y)  / var(--h) * 100%);
  width: calc(var(--pw) / var(--w) * 100%);
  margin: 0;
}
.stage .p > img { width: 100%; }

/* ---------- 2枚重ねの画像をホバーで入れ替える（メニュー・バナー共通） ---------- */
.menu a, .swap {
  position: relative;
  display: block;
}
.menu a .on, .swap .on {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.5s;
}
.menu a:hover .on, .menu a:focus-visible .on,
.swap:hover .on, .swap:focus-visible .on { opacity: 1; }

/* =========================================================
   ① TOP
   - 画面いっぱいの高さ。背景は画面全体に敷く。
   - 絵の構成（ステージ）は、下の帯を除いた範囲の上下左右中央に置き、
     どんな画面の比率でも全体が収まる大きさに縮める（はみ出さない）。
   - 範囲が縦長なら縦向けの配置、横長なら横向けの配置を使う。
   ========================================================= */
.top {
  --ub: clamp(56px, 8.5vw, 130px);       /* 下の帯の高さ */
  position: relative;
  height: 100svh;
  min-height: 320px;  /* スマホの横持ち（高さ 360〜430px）でも1画面に収める */
  overflow: hidden;
  isolation: isolate;
  background: url(../assets/top/bg.webp) center 30% / cover no-repeat, var(--bg);
}
.top__area {
  position: absolute;
  inset: 0 0 var(--ub) 0;
  display: grid;
  place-items: center;
  --pad: clamp(8px, 2vmin, 24px);
  padding: var(--pad);
  container-type: size;
  pointer-events: none;
}
.top__area--back  { z-index: 1; }
.top__underbar {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  width: 100%; height: var(--ub);
  object-fit: cover;
}
.top__area--front { z-index: 3; }

/* 横向けの配置（デザイン上 1200×875） */
.top__stage {
  --w: 1200; --h: 875;
  width: min(100cqw, 100cqh * var(--w) / var(--h));
  overflow: visible;
}
.top__stage .p { pointer-events: auto; }
/* シロンは依頼主の差し替え版（2026-11-15）。全身が素材の中に収まるので、元のデザインの位置に戻した。
   耳の先だけ一部のコマで素材の上端に触れるので、上端だけ少しぼかす（右端のぼかしは不要になった） */
.top__shiron { --x: 138;  --y: 21;  --pw: 1200; }
.top__shiron {
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 2%);
  mask-image: linear-gradient(to bottom, transparent, #000 2%);
}
.top__catch  { --x: 2;    --y: 30;  --pw: 760; }
.top__genre  { --x: 1048; --y: 88;  --pw: 125; }
.top__logo   { --x: -110; --y: 178; --pw: 820; }
.top__mao    { --x: -26;  --y: 566; --pw: 401; }
.top__fao    { --x: 806;  --y: 608; --pw: 385; }
.top__tags   { --x: 428;  --y: 804; --pw: 613; }
.top__voice  { --x: 667;  --y: 327; --pw: 470; --ph: 440; }

/* 縦向けの配置（デザイン上 800×1450）：上から キャッチ → ロゴ → シロン → デフォルメ2体 → ジャンル。
   シロンの絵は下端で途切れているので、ステージを下の帯に接して置き、途切れ目を帯の裏に隠す */
@container (aspect-ratio < 1.05) {
  .top__stage  { --w: 800; --h: 1450; align-self: end; margin-bottom: calc(-1 * var(--pad)); }
  .top__catch  { --x: 10;   --y: 40;   --pw: 640; }
  .top__genre  { --x: 680;  --y: 30;   --pw: 100; }
  .top__logo   { --x: -70;  --y: 200;  --pw: 780; }
  .top__shiron { --x: -170; --y: 610;  --pw: 1040; }
  .top__mao    { --x: 6;    --y: 1050; --pw: 330; }
  .top__fao    { --x: 530;  --y: 1060; --pw: 270; }
  .top__tags   { --x: 40;   --y: 1350; --pw: 720; }
  .top__voice  { --x: 330;  --y: 700;  --pw: 420; --ph: 420; }
}

.top__voice {
  height: calc(var(--ph) / var(--h) * 100%);
  background: none; border: 0; padding: 0;
  cursor: pointer;
}
.top__voice:focus-visible { outline: 2px solid #6ff; outline-offset: -2px; }

/* ---- 導入アニメーション ----
   番号順にフェード＋スライド。シロンだけ3秒かけて重く止まる。 */
.top .p { animation: fade-slide 0.6s var(--ease-out) both; }
.top .top__shiron   { animation: shiron-in 3s cubic-bezier(0.33, 1, 0.68, 1) 0.2s both; --from: 18%; }
.top__underbar      { animation: fade 0.6s ease both; }
.top .top__catch    { animation-delay: 2.6s; --dx: -24px; }
.top .top__genre    { animation-delay: 3.1s; --dy: -24px; }
.top .top__logo     { animation-delay: 3.6s; --dx: -32px; }
.top .top__mao      { animation: bounce-in 0.8s linear 4.3s both; }
.top .top__fao      { animation-delay: 4.9s; --dx: 32px; }
.top .top__tags     { animation-delay: 5.4s; --dy: 16px; }
.top .top__voice    { animation: none; }

/* デフォルメ2体のゆらゆら（周期をずらして同じ揺れに見えないように） */
.top__mao > img { transform-origin: 50% 95%; animation: sway 2.4s ease-in-out 5.1s infinite; }
.top__fao > img { transform-origin: 50% 95%; animation: sway 3.3s ease-in-out 5.5s infinite; }

@keyframes fade { from { opacity: 0; } }
@keyframes fade-slide {
  from { opacity: 0; translate: var(--dx, 0) var(--dy, 0); }
}
@keyframes shiron-in {
  from { opacity: 0; translate: var(--from) 0; }
  30%  { opacity: 1; }
}
/* 下から飛び出して、着地で小さく弾む */
@keyframes bounce-in {
  0%   { opacity: 0; translate: 0 18%;  animation-timing-function: cubic-bezier(0.2, 0.8, 0.4, 1); }
  15%  { opacity: 1; }
  45%  { translate: 0 -9%;  animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  70%  { translate: 0 0;    animation-timing-function: cubic-bezier(0.2, 0.8, 0.4, 1); }
  85%  { translate: 0 -2.5%; animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  100% { translate: 0 0; }
}
@keyframes sway {
  0%, 100% { rotate: -2.5deg; }
  50%      { rotate: 2.5deg; }
}

/* =========================================================
   メニュー
   ========================================================= */
.menu {
  background: url(../assets/menu/bar.webp) center / 100% 100% no-repeat, #0c1f3a;
  padding: clamp(10px, 1.6vw, 26px) 16px;
}
.menu__list {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 0.8vw, 12px);
  max-width: 1200px;
  margin-inline: auto;
}
.menu__list li { flex: 0 1 233px; }
/* タッチ端末では、ボタンの見た目より上下に広く反応させる（指で押しやすく） */
@media (pointer: coarse) {
  .menu a::after { content: ""; position: absolute; inset: -8px -2px; }
}

/* =========================================================
   コンテンツ部分と、付いてくる背景
   ========================================================= */
.content { position: relative; }
.slide-bg {
  position: sticky;
  top: 0;
  height: 100vh;
  margin-bottom: -100vh;
  background: url(../assets/slide-bg.webp) center top / cover no-repeat;
  z-index: -1;
}
.content > section { position: relative; }

/* =========================================================
   PV・お知らせ
   ========================================================= */
.info {
  width: min(100% - 32px, var(--col));
  margin: clamp(16px, 3vw, 40px) auto;
}
.info__panel {
  --w: 1503; --h: 1165;
  position: relative;
  aspect-ratio: var(--w) / var(--h);
  background: url(../assets/info/panel.webp) center / 100% 100% no-repeat;
  container-type: inline-size;
}
.info__panel > *, .info__banners > li {
  position: absolute;
  left:  calc(var(--x) / var(--w) * 100%);
  top:   calc(var(--y) / var(--h) * 100%);
  width: calc(var(--pw) / var(--w) * 100%);
}
.info__banners { position: static; }
.info__pv   { --x: 65;  --y: 30;  --pw: 717; }
.info__news { --x: 34;  --y: 515; --pw: 779; }
.info__banners > li:nth-child(1) { --x: 947; --y: 44;  --pw: 517; }
.info__banners > li:nth-child(2) { --x: 947; --y: 290; --pw: 509; }
.info__banners > li:nth-child(3) { --x: 925; --y: 545; --pw: 536; }
.info__banners > li:nth-child(4) { --x: 936; --y: 760; --pw: 501; }

.info__log {
  position: absolute;
  left: 9%; right: 9%;
  top: 22%; bottom: 10%;
  overflow-y: auto;
  color: #3a2020;
  font-size: clamp(12px, 1.45cqw, 18px);
}
.info__log li { padding: 0.35em 0; border-bottom: 1px dashed rgba(80, 40, 40, 0.35); }
.info__log time { margin-right: 1em; font-weight: 700; }

/* =========================================================
   ②〜⑦ 各ブロック（共通）
   - ブロックは画面幅いっぱい。絵の構成（ステージ）は最大 1200px で中央に置く
   - ブロックの幅が 640px 以下（スマホ）のときは、縦向けの配置に切り替える（座標はブロックごと）
   ========================================================= */
.sec {
  position: relative;
  container: sec / inline-size;   /* 名前つき：説明文の枠（.tbox）も入れ物なので、中から見るときに区別する */
  overflow: hidden;
  isolation: isolate;
}
.sec > .stage {
  width: min(100%, var(--col));
  margin-inline: auto;
  overflow: visible;
}
.sec .p { z-index: 1; }
/* ボタンの当たり判定（見た目なし） */
.concept__hit, .character__hit, .gallery__hit {
  height: calc(var(--ph) / var(--h) * 100%);
  background: none; border: 0; padding: 0;
  cursor: pointer;
  z-index: 3 !important;
}
.concept__hit:focus-visible, .character__hit:focus-visible, .gallery__hit:focus-visible { outline: 2px solid #6ff; outline-offset: -2px; }
/* もっと詳しく！：押せる範囲を少し広げる */
.character__more, .monster__more { z-index: 3 !important; }

/* ---------- 説明文の枠（Concept・Story・Monster）----------
   枠は絵（文字なしの素材）、文字は HTML で重ねる（依頼主の案A。スマホでも読める大きさにするため）。
   位置と大きさは枠の絵の座標（--fw × --fh の中の --bx, --by, --bw、文字の大きさ --fs）で決め、
   枠と同じ比率で伸び縮みさせる。ただし --min より小さくはしない */
.tbox { container-type: inline-size; }
.tbox__frame { width: 100%; }
.tbox__body {
  position: absolute;
  left:  calc(var(--bx) / var(--fw) * 100%);
  top:   calc(var(--by) / var(--fh) * 100%);
  width: calc(var(--bw) / var(--fw) * 100%);
  font-size: max(var(--min), calc(var(--fs) / var(--fw) * 100cqi));
  line-height: var(--lh);
  word-break: auto-phrase;   /* 行が折り返すときは言葉の切れ目で（対応していないブラウザはふつうに折り返す） */
  line-break: strict;
}
.tbox__body p { margin: 0; }
.tbox__body p > span { display: block; }   /* 1行ずつ（元の絵と同じ改行） */
.tbox--concept, .tbox--story {
  --fw: 938; --fh: 515; --bx: 70; --by: 226; --bw: 798; --min: 12px; --lh: 1.5;
  color: #fff; text-align: center;
  text-shadow: 0 0 2px #2a0808, 0 1px 3px rgba(0, 0, 0, 0.75);
}
.tbox--concept { --fs: 25; font-family: "M PLUS Rounded 1c", var(--jp); font-weight: 800; }
.tbox--story   { --fs: 24; font-family: "Noto Sans JP", var(--jp); font-weight: 700; }
.tbox--monster {
  --fw: 998; --fh: 1076; --bx: 175; --by: 385; --bw: 720; --fs: 33; --min: 12px; --lh: 1.42;
  color: #2b1a20; font-family: "Noto Sans JP", var(--jp); font-weight: 700;
}

/* 幅が足りないとき（スマホ・タブレット）の Concept と Story：
   文字を読める大きさにすると元の枠に収まらないので、枠を縦に伸ばす。
   枠の絵を「四隅と見出しはそのまま、間だけ伸ばす」形（border-image）で描き、ブロックの高さも文字に合わせる。
   --u は枠の絵の 1px がいま何 px か（枠の幅 ÷ 938）。
   枠の中のもの（.tbox__frame など）は、いちばん近い入れ物が枠そのものになるので、セクション（sec）の幅で判定する */
@container sec (max-width: 1040px) {
  .concept__stage, .story__stage {
    aspect-ratio: auto;
    padding-top: calc(var(--ty) / var(--w) * 100%);
    padding-bottom: calc(40 / var(--w) * 100%);
  }
  .concept__stage { --ty: 470; }
  .story__stage   { --ty: 500; }
  /* ステージの高さが決まっていないので、ほかのパーツの上下位置は幅をもとに計算する（ステージの幅＝セクションの幅） */
  .concept__stage > .p, .story__stage > .p { top: calc(var(--y) / var(--w) * 100cqw); }
  .stage .tbox--concept, .stage .tbox--story {
    --u: calc(100cqw * var(--pw) / var(--w) / 938);
    position: relative; top: 0;
    min-height: calc(515 * var(--u));
    padding: calc(226 * var(--u)) calc(90 * var(--u)) calc(105 * var(--u));
    border-image-slice: 218 120 120 120 fill;
    border-image-width: calc(218 * var(--u)) calc(120 * var(--u)) calc(120 * var(--u)) calc(120 * var(--u));
    border-image-repeat: stretch;
  }
  .tbox--concept { border-image-source: url(../assets/concept/frame.webp); --min: 13px; }
  .tbox--story   { border-image-source: url(../assets/story/frame.webp);   --min: 13px; }
  .tbox--concept .tbox__frame, .tbox--story .tbox__frame { display: none; }
  .tbox--concept .tbox__body, .tbox--story .tbox__body { position: static; width: auto; }
}

/* ---------- ② Concept ---------- */
.concept { background: url(../assets/concept/bg.webp) center / cover no-repeat, #0b0610; }
.concept__stage { --w: 1200; --h: 360; }
.concept__sd   { --x: 150; --y: -20; --pw: 380; }
.concept__hit  { --x: 220; --y: 40;  --pw: 240; --ph: 300; }
.concept__text { --x: 610; --y: 51;  --pw: 470; }
/* 説明文が読める大きさに収まらない幅では、縦向けの配置にする（以前は 640px） */
@container (max-width: 1040px) {
  .concept__stage { --w: 800; --h: 900; }
  .concept__sd   { --x: 160; --y: 0;   --pw: 480; }
  .concept__hit  { --x: 250; --y: 60;  --pw: 300; --ph: 380; }
  .concept__text { --x: 30;  --y: 470; --pw: 740; }
}

/* ---------- ③ Story ---------- */
.story { margin-top: clamp(16px, 3vw, 40px); }   /* Concept との間を少し空ける（仕様） */
.story::before {   /* 左右の余白は背景の絵をぼかしてつなげる */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(../assets/story/bg.webp) center / cover no-repeat;
  filter: blur(24px) brightness(0.95);
  transform: scale(1.1);
}
.story__stage { --w: 1200; --h: 424; }
.story__bg    { --x: 0;  --y: 0;  --pw: 1200; }
.story__text  { --x: 95; --y: 70; --pw: 570; z-index: 2 !important; }
@container (max-width: 1040px) {
  .story__stage { --w: 800; --h: 940; }
  .story__bg    { --x: -640; --y: 0;   --pw: 1520; }
  .story__text  { --x: 30;   --y: 500; --pw: 740; }
}

/* ---------- ④ Character ---------- */
.character { background: url(../assets/character/bg.webp) center / cover no-repeat, #0b0610; }
.character__stage   { --w: 1641; --h: 1033; }
.character__catch   { --x: 70;   --y: 40;  --pw: 236; z-index: 2 !important; }
.character__shiron  { --x: -40;  --y: 233; --pw: 1000; }
.character__hit--up   { --x: 300; --y: 280; --pw: 420; --ph: 300; }
.character__hit--down { --x: 300; --y: 580; --pw: 420; --ph: 450; }
.character__text    { --x: 860;  --y: 40;  --pw: 740; }
.character__more    { --x: 1040; --y: 860; --pw: 360; }
@container (max-width: 640px) {
  .character__stage   { --w: 800; --h: 1620; }
  .character__catch   { --x: 10;  --y: 20;  --pw: 150; }
  .character__shiron  { --x: 30;  --y: 40;  --pw: 820; }
  .character__hit--up   { --x: 260; --y: 80;  --pw: 400; --ph: 260; }
  .character__hit--down { --x: 260; --y: 340; --pw: 400; --ph: 340; }
  .character__text    { --x: 40;  --y: 700; --pw: 720; }
  .character__more    { --x: 215; --y: 1500; --pw: 350; }
}

/* ---------- ⑤ Monster ---------- */
.monster { background: url(../assets/monster/bg.webp) center / cover no-repeat, #0b0610; }
.monster__stage  { --w: 2053; --h: 1172; }
/* モンスターの帯：画面幅いっぱいに流す（上は右から、下は左から） */
.stage .monster__strip {
  left: 50%; width: 100vw; translate: -50% 0;
  height: calc(var(--ph) / var(--h) * 100%);
  overflow: hidden;
  z-index: 0;
}
.monster__strip--top    { --x: 0; --y: 0;   --pw: 2053; --ph: 576; }
.monster__strip--bottom { --x: 0; --y: 590; --pw: 2053; --ph: 576; }
.monster__track { display: flex; height: 100%; width: max-content; }
.monster__track img { height: 100%; width: auto; max-width: none; }
.monster__strip--top .monster__track    { animation: strip-left 120s linear infinite; }
.monster__strip--bottom .monster__track { animation: strip-right 110s linear infinite; }
@keyframes strip-left  { from { translate: 0 0; } to { translate: -50% 0; } }
@keyframes strip-right { from { translate: -50% 0; } to { translate: 0 0; } }
.monster__text   { --x: 185;  --y: 152; --pw: 880; }
.monster__more   { --x: 390;  --y: 895; --pw: 410; }
.monster__lamia  { --x: 1110; --y: 40;  --pw: 900; }
.monster__lamia > img { transform-origin: 50% 85%; animation: sway 3.2s ease-in-out infinite; }
/* 説明文が読める大きさで枠に収まらない幅では、縦向けの配置にする（以前は 640px） */
@container (max-width: 800px) {
  .monster__stage  { --w: 800; --h: 1380; }
  .monster__strip--top    { --y: 0;    --ph: 300; }
  .monster__strip--bottom { --y: 1070; --ph: 300; }
  .monster__text   { --x: 60;  --y: 100; --pw: 680; }
  .monster__more   { --x: 218; --y: 677; --pw: 317; }
  .monster__lamia  { --x: 330; --y: 780; --pw: 470; }
}
/* とても狭い画面（320px など）：説明文が折り返して「もっと詳しく！」に重なるので、枠を広げてボタンを下げる */
@container (max-width: 360px) {
  .monster__text   { --x: 30;  --pw: 740; }
  .monster__more   { --y: 745; }
}

/* ---------- ⑥ Gallery ---------- */
.gallery__stage { --w: 2050; --h: 1540; }
.gallery__drain { --x: -10; --y: 0;   --pw: 620; }
.gallery__hit   { --x: 95;  --y: 320; --pw: 285; --ph: 580; }
.gallery__panel { --x: 392; --y: 90;  --pw: 1531; }
/* アイコンはパネルの中の位置（パネルの絵 1531×1362 での座標） */
.gallery__icons > li {
  position: absolute;
  left: calc(var(--ix) / 1531 * 100%);
  top:  calc(var(--iy) / 1362 * 100%);
  width: calc(320 / 1531 * 100%);
}
.gallery__icons button { padding: 0; border: 0; background: none; cursor: pointer; width: 100%; }
.gallery__icons > li:nth-child(3n+1) { --ix: 90; }
.gallery__icons > li:nth-child(3n+2) { --ix: 539; }
.gallery__icons > li:nth-child(3n+3) { --ix: 978; }
.gallery__icons > li:nth-child(-n+3) { --iy: 404; }
.gallery__icons > li:nth-child(n+4):nth-child(-n+6) { --iy: 730; }
.gallery__icons > li:nth-child(n+7) { --iy: 1056; }
@container (max-width: 640px) {
  .gallery__stage { --w: 800; --h: 1270; }
  .gallery__drain { --x: -20; --y: 0;   --pw: 260; }
  .gallery__hit   { --x: 15;  --y: 130; --pw: 140; --ph: 300; }
  .gallery__panel { --x: 10;  --y: 560; --pw: 780; }
}

/* 拡大表示 */
.gmodal {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.9);   /* 仕様：黒 透明度90% */
}
.gmodal[hidden] { display: none; }
.gmodal__inner { width: min(100%, 1100px, calc((100svh - 120px) * 16 / 9)); }
.gmodal__video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.gmodal__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.gmodal__nav button { padding: 8px; border: 0; background: none; cursor: pointer; transition: filter 0.2s; }
.gmodal__nav button:hover, .gmodal__nav button:focus-visible { filter: brightness(1.3); }
.gmodal__back img, .gmodal__next img { height: clamp(26px, 4vw, 37px); width: auto; }
.gmodal__close img { height: clamp(36px, 5vw, 56px); width: auto; }

/* ---------- ⑦ 購入 ---------- */
.shop { padding-block: clamp(16px, 3vw, 40px); }
.shop__stage  { --w: 1371; --h: 752; }
.shop__bg     { --x: 0;   --y: 0;   --pw: 1371; }
.shop__fanza  { --x: 170; --y: 120; --pw: 470; }
.shop__dlsite { --x: 720; --y: 200; --pw: 520; }
.shop .is-soon { filter: brightness(0.35); cursor: default; }

/* ---------- Spec（文字は HTML） ---------- */
.spec { padding: clamp(16px, 3vw, 40px) 16px; }
.spec__box {
  position: relative;
  max-width: 1100px;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 56px) clamp(120px, 14vw, 170px);
  background: #b3bcf6;
  color: #fff;
  overflow: hidden;
}
.spec__title { margin: 0 0 0.4em; text-align: center; font-size: clamp(36px, 6vw, 72px); line-height: 1; letter-spacing: 0.02em; }
.spec__cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(16px, 4vw, 48px); }
.spec h3 { margin: 1.1em 0 0.4em; font-size: clamp(16px, 1.6vw, 20px); }
.spec h3:first-child { margin-top: 0; }
.spec dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25em 1.2em; margin: 0; font-size: clamp(13px, 1.25vw, 16px); }
.spec dt { white-space: nowrap; }
.spec dd { margin: 0; }
.spec__note { margin: 1em 0 0; font-weight: 700; }
.spec__logo { position: absolute; right: clamp(12px, 3vw, 40px); bottom: clamp(8px, 1.5vw, 16px); width: clamp(160px, 22vw, 260px); }
@media (max-width: 640px) {
  .spec__cols { grid-template-columns: 1fr; }
}
.footer {
  padding: 18px 16px;
  background: #18245e;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-size: 12px;
}

/* =========================================================
   スマホ幅
   ========================================================= */
@media (max-width: 640px) {
  /* メニュー：4つ＋3つの2段にして、押しやすい大きさにする */
  .menu { aspect-ratio: auto; padding: 10px 8px; }
  .menu__list {
    flex-wrap: wrap;
    gap: 16px 6px;  /* 上下の段の押せる範囲が重ならないよう、段の間を空ける */
    padding: 0;
  }
  .menu__list li { flex: 0 0 calc((100% - 18px) / 4); }
  .menu { padding-block: 16px; }

  /* お知らせ：縦に並べる */
  .info__panel {
    aspect-ratio: auto;
    padding: 16px;
    display: grid;
    gap: 14px;
    background: rgba(70, 60, 70, 0.92);
    border-radius: 10px;
  }
  .info__panel > *, .info__banners > li { position: relative; left: auto; top: auto; width: 100%; }
  .info__banners { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
  .info__log { font-size: 12px; top: 21%; }
}

/* =========================================================
   年齢確認
   ========================================================= */
.age-gate {
  position: fixed; inset: 0; z-index: 100;
  overflow: hidden;
  display: grid; place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 40%, #2a1030 0%, #0b0610 70%);
  transition: opacity 0.4s, visibility 0s 0.4s;
}
.age-gate__stage {
  --w: 800; --h: 800;
  translate: -5.6% 0;
  width: min(100%, 720px, calc(100svh - 32px));
  overflow: visible;
  animation: fade 0.5s ease both;
}
.age-gate__card {
  width: 100%;
  /* 耳の先が素材の上端・左端で途切れるコマがあるので、端を少しずつ透明にして途切れ目を見せない */
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 4%), linear-gradient(to right, transparent, #000 4%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to bottom, transparent, #000 4%), linear-gradient(to right, transparent, #000 4%);
  mask-composite: intersect;
}
/* スマホ幅：文言が読めるよう、ピンクのカードが画面幅いっぱいになるまで大きくする。
   カードは絵の中で右寄りにあるので、そのぶん左へずらして中央に合わせる（耳の先は少し切れる） */
@media (max-width: 600px) {
  /* 画面より広い要素は中央寄せされず左に寄るので、位置を数値で決める */
  .age-gate { padding-inline: 0; justify-items: start; }
  .age-gate__stage { width: 118vw; margin-left: -9vw; }
}
/* 文言（絵ではなく文字。絵の大きさに合わせて伸び縮みするが、スマホでも読める大きさより小さくしない） */
.age-gate__stage { container-type: inline-size; }
.age-gate__text {
  --x: 110; --y: 506; --pw: 580;
  text-align: center;
  font-family: "M PLUS Rounded 1c", var(--jp);
  line-height: 1.3;
  pointer-events: none;
}
.age-gate__small, .age-gate__q {
  --o: 0.1em;   /* 白いふち（文字の大きさに合わせるので、それぞれの行で指定する） */
  text-shadow: var(--o) 0 #fff, calc(-1 * var(--o)) 0 #fff, 0 var(--o) #fff, 0 calc(-1 * var(--o)) #fff,
    calc(0.7 * var(--o)) calc(0.7 * var(--o)) #fff, calc(-0.7 * var(--o)) calc(0.7 * var(--o)) #fff,
    calc(0.7 * var(--o)) calc(-0.7 * var(--o)) #fff, calc(-0.7 * var(--o)) calc(-0.7 * var(--o)) #fff;
}
.age-gate__small {
  display: block;
  font-size: max(11px, calc(16 / 800 * 100cqi));
  font-weight: 800; color: #1d1320;
}
.age-gate__q {
  display: block;
  margin-top: 0.15em;
  font-size: max(17px, calc(30 / 800 * 100cqi));
  font-weight: 900; color: #e30fc6;
  --o: 0.09em;
}
.age-gate__yes { --x: 269; --y: 612; --pw: 156; }
.age-gate__no  { --x: 467; --y: 612; --pw: 156; }
.age-gate__yes, .age-gate__no {
  padding: 0; border: 0; background: none; cursor: pointer;
  transition: filter 0.2s, scale 0.2s;
}
.age-gate__yes:hover, .age-gate__no:hover,
.age-gate__yes:focus-visible, .age-gate__no:focus-visible { filter: brightness(1.15); scale: 1.04; }
.age-gate__yes:focus-visible, .age-gate__no:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
/* 指で押しやすいよう、見た目より上下に広く反応させる */
.age-gate__yes::after, .age-gate__no::after { content: ""; position: absolute; inset: -10px -4px; }

/* 確認が済んだら閉じる */
.age-ok .age-gate { opacity: 0; visibility: hidden; }
/* 確認中は後ろをスクロールさせず、TOPの導入アニメも止めておく（閉じたところから始まる） */
html:not(.age-ok) body { overflow: hidden; }
html:not(.age-ok) .top, html:not(.age-ok) .top * { animation-play-state: paused; }

/* 動きを減らす設定の人には、最初から完成形を見せる */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 準備中のページ（キャラクター紹介・モンスター紹介） */
.soon { min-height: 100svh; display: grid; place-content: center; gap: 24px; text-align: center; padding: 24px; }
.soon__text { margin: 0; font-size: clamp(16px, 2.4vw, 22px); }
.soon__back { color: #f3eaf7; }

/* =========================================================
   キャラクター紹介ページ
   ========================================================= */
.chara {
  container-type: inline-size;
  background: url(../assets/chara/bg.webp) center / cover no-repeat, #1a0b24;
  padding-bottom: 24px;
}
.chara > .stage { width: min(100%, var(--col)); margin-inline: auto; overflow: visible; }
.chara { overflow: hidden; }
.chara__stage { --w: 1000; --h: 820; }
.chara .p { margin: 0; }
.chara__head  { --x: 35;  --y: 14;  --pw: 965; }
.chara__name  { --x: 236; --y: 78;  --pw: 112; }
.chara__icon--1 { --x: 120; --y: 140; --pw: 92; }
.chara__icon--2 { --x: 222; --y: 140; --pw: 155; }
.chara__icon--3 { --x: 362; --y: 140; --pw: 101; }
.chara__mic--1  { --x: 197; --y: 303; --pw: 44; }
.chara__mic--2  { --x: 268; --y: 303; --pw: 44; }
.chara__mic--3  { --x: 338; --y: 303; --pw: 44; }
.chara__text  { --x: 92;  --y: 360; --pw: 402; z-index: 2; }
.chara__pose  { --x: 455; --y: 80;  --pw: 545; --ph: 740; height: calc(var(--ph) / var(--h) * 100%); }
.chara__pose img { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; }

/* ポーズのアイコン：カーソルを合わせると左から右へ白に変わる。選んでいるポーズは白のまま */
.chara__icon, .chara__mic { padding: 0; border: 0; background: none; cursor: pointer; }
.chara__icon img.on {
  position: absolute; inset: 0; width: 100%; height: 100%;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.4s var(--ease-out);
}
.chara__icon:hover img.on, .chara__icon:focus-visible img.on,
.chara__icon[aria-pressed="true"] img.on { clip-path: inset(0 0 0 0); }
/* マイク：鳴っている間は黄色 */
.chara__mic img.on { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 0.2s; }
.chara__mic.is-playing img.on { opacity: 1; }
.chara__mic:hover, .chara__mic:focus-visible { filter: brightness(1.15); }
/* 指で押しやすく */
.chara__mic::after { content: ""; position: absolute; inset: -6px; }

/* スマホ幅：上から 見出し → 名前 → ポーズのアイコン → マイク → 立ち絵 → 説明 */
@container (max-width: 640px) {
  .chara__stage { --w: 800; --h: 2020; }
  .chara__head  { --x: 0;   --y: 14;  --pw: 800; }
  .chara__name  { --x: 316; --y: 90;  --pw: 168; }
  .chara__icon--1 { --x: 150; --y: 190; --pw: 125; }
  .chara__icon--2 { --x: 290; --y: 190; --pw: 210; }
  .chara__icon--3 { --x: 480; --y: 190; --pw: 137; }
  .chara__mic--1  { --x: 245; --y: 390; --pw: 80; }
  .chara__mic--2  { --x: 360; --y: 390; --pw: 80; }
  .chara__mic--3  { --x: 475; --y: 390; --pw: 80; }
  .chara__pose  { --x: 80;  --y: 490; --pw: 640; --ph: 760; }
  .chara__text  { --x: 30;  --y: 1270; --pw: 740; }
}

/* =========================================================
   モンスター紹介ページ
   ========================================================= */
.mon {
  position: relative;
  height: max(560px, 100svh);
  overflow: hidden;
  isolation: isolate;
  background: url(../assets/mon/bg.webp) center / cover no-repeat, #1a0b24;
}
/* シロン：右から左へすべって、ゆっくり止まる */
.mon__shiron {
  position: absolute; z-index: -1;
  right: -6%; bottom: 0;
  height: 104%; width: auto; max-width: none;
  animation: mon-shiron 2.6s cubic-bezier(0.33, 1, 0.68, 1) 0.2s both;
}
@keyframes mon-shiron { from { opacity: 0; translate: 30% 0; } 40% { opacity: 1; } }

.mon__view {
  position: absolute;
  left: clamp(16px, 6vw, 110px);
  top: clamp(16px, 6vh, 70px);
  bottom: clamp(16px, 4vh, 40px);
  width: min(36vw, 470px);
}
.mon__view ul { display: grid; gap: clamp(12px, 2.4vh, 28px); }
/* ステージ選択：少しずつ表示される。カーソルを合わせると白に変わる */
.mon__stage { animation: fade 1.2s ease both; animation-delay: calc(0.3s + var(--i) * 0.25s); }

/* モンスター一覧：上からすべって出てくる。多いときは上下にスクロール */
.mon__list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 6px; }
.mon__icons { padding-bottom: 8px; }
.mon__icons li { animation: mon-drop 0.6s var(--ease-out) both; animation-delay: calc(var(--i) * 0.07s); }
@keyframes mon-drop { from { opacity: 0; translate: 0 -60px; } }
.mon__icons button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }

.mon__close {
  position: absolute; z-index: 2;
  right: clamp(12px, 3vw, 40px); top: clamp(12px, 3vh, 32px);
  width: clamp(64px, 8vw, 120px);
  transition: filter 0.2s, scale 0.2s;
}
.mon__close:hover, .mon__close:focus-visible { filter: brightness(1.2); scale: 1.05; }

/* モンスターを大きく表示 */
.mondetail {
  position: fixed; inset: 0; z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 32%);
  align-items: center;
  gap: clamp(12px, 3vw, 40px);
  padding: clamp(16px, 4vw, 56px);
  background: rgba(0, 0, 0, 0.7);   /* 仕様：黒 透明度70% */
  cursor: pointer;
  animation: fade 0.3s ease both;
}
.mondetail[hidden] { display: none; }
.mondetail__anim { height: 100%; display: grid; place-items: center; min-height: 0; }
.mondetail__anim img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; animation: fade 0.4s ease both; }
.mondetail__info { width: 100%; max-height: calc(100svh - 2 * clamp(16px, 4vw, 56px)); object-fit: contain; object-position: top; align-self: start; animation: fade-slide 0.4s var(--ease-out) both; --dx: 24px; }

/* スマホ幅：ボタンと一覧は画面幅いっぱい、シロンは後ろで暗く */
@media (max-width: 640px) {
  .mon__view { left: 16px; right: 16px; width: auto; top: 76px; }
  .mon__shiron { right: -40%; height: 92%; filter: brightness(0.55); }
  .mon__close { width: 56px; }
  .mondetail { grid-template-columns: 1fr; grid-template-rows: minmax(0, 45svh) auto; align-content: start; overflow-y: auto; }
  .mondetail__info { max-height: none; }
}
