@charset "utf-8";


body{
  margin: 0;
  padding: 0;

  background-color: black;
  min-height: 100vh;
  display: flex;
  justify-content: center; /* 横中央寄せ */
  z-index: 0;
}

/* loader */

#loader{
  position:fixed;
  inset:0;                            /* top:0; right:0; bottom:0; left:0 */
  background: linear-gradient(
    to bottom,
    #cfefff 0%,
    #ffffff 50%,
    #ffd6e7 100%
  );
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:20px;
  z-index:10000;                      /* ページ内で最前面に */
  transition:opacity .6s ease;        /* 後で JS で fadeOut */
}

@keyframes logoZoom {
  /* 0%   { transform: scale(0.6); opacity: 0.0; }
  0%   { transform: scale(0.9); opacity: 1.0; }
  80%  { transform: scale(1.2); opacity: 1.0; }
  100% { transform: scale(0.6); opacity: 1.0; } */
  0%   { transform:scale(1.0);   opacity:1; }
  75%  { transform:scale(1.2); opacity:1; }  /* ズーム最大 */
  100% { transform:scale(0.8); opacity:0; }  /* フェードアウト */
}

/* ローディング文字の1文字ずつ落下 */
.loading-text{
  font-family: "Times New Roman", serif;
  font-weight: 700;
  font-size: 30px;
  /* font-size: calc(1cqw * 6); */
  color: rgb(122, 16, 16);
  display: inline-block;
  white-space: pre;  /* スペースも表示 */
  overflow: hidden;
}
.loading-text span{
  display: inline-block;
  opacity: 0;
  transform: translateY(-40px);
  animation: dropIn .6s cubic-bezier(.2,.8,.2,1) forwards;
  /* JSでanimation-delayを個々に付与 */
}
@keyframes dropIn{
  0%   { opacity: 0; transform: translateY(-40px); }
  70%  { opacity: 1; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* フェードアウト時に透明＋クリック不可にする */
#loader.hide{
  pointer-events:none;
  opacity:0;
}

.loader-logo > img{
  max-width: 400px;
  max-height: 400px;

  animation:logoZoom 3s ease forwards;
}

@media (max-width: 640px) {
  .loader-logo > img{
    max-width: calc(1cqw * 60);
    max-height: calc(1cqw * 60);
  }
  .loading-text {
    font-size: 25px;
  }
}

.container {
  /* container-type: inline-size; */
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0;       /* 横の余白は好みで調整 */
  /* box-sizing: border-box; */
  position: relative;

}

/* @media (max-width: 640px) {
  .container {
    max-width: 100%;
  }
} */



/* ----- top ------ */

.top{
  width: 100%;
  /* height: 130px; */
  position: relative;
  /* background-color: red; */

  display: flex;
  justify-content: center; 
  align-items: center; 

  margin-top: 50px;
}


.top-title{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%
}
.top-title > img{
  width: 70%;
  height: auto;
  scale: 1.2;
}


/* ----- background ------- */

.background{
  position: fixed;
  top: 0;
  /* left: 50%;                  */
  width: 640px;             
  height: 100%;
  /* transform: translateX(-50%);  */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

.halloween-background{
  background-image: url('../../../assets/image/background/halloween-background.png');
  /* background-color: #343434; */
}

#halloween-canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.canvas-flash{
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
}


/* ----- play ------ */

.play{
  background-color: rgba(0, 0, 0, 0.7);

  margin: 50px 0;
  padding: 50px 1rem;

  position: relative;
}
.play::before,
.play::after{
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 1.0);
}
.play::before{
  top: 0;
  box-shadow: 0 4px rgba(255, 255, 255, 1.0);
}
.play::after{
  bottom: 0;
  box-shadow: 0 -4px rgba(255, 255, 255, 1.0);
}


/* タブボタンのデザイン */
.tab-buttons {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  gap: 5px;
}

.tab-btn {
  padding: 8px 16px;
  border: none;
  background-color: #a4a4a47d;
  color: white;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px;
  transition: background-color 0.3s;

  font-family:"Times New Roman",serif;
  font-weight: 1000;
  font-size: 16px;
  /* font-size: calc(1cqw * 3.5); */
}

.tab-btn.active {
  background-color: white;
  color: black;
}

/* タブコンテンツの共通設定 */
.tab-contents {
  padding: 20px;
  /* border: 1px solid white; */
  border-radius: 10px;

  background-color: white;
  color: black;
  
  
}

/* 非表示タブ */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}




/* ----- step1 ------ */

/* サムネイル枠 */
.story-video-container {
  position: relative;
  width: 300px;
  /* aspect-ratio: 9/16; */
  height: 170px;

  background-color: black;
  border: 2px solid white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 20px auto;
}

/* サムネイル内の文字 */
.video-thumbnail-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  color: white;
  font-size: 24px;
  font-family: 'Times New Roman', Times, serif;
  font-weight: bold;
  z-index: 1;
}


/* ========== STEP1：モンスタータブ & 質問カード ========== */
.step1-questions { 
  margin-top: 28px; 
  --qa-size: clamp(40px, calc(1cqw * 7), 54px);
}

/* アイコンタブ行 */
.monster-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  align-items: center;
  justify-items: center;
  margin-bottom: 16px;
}
.monster-tab {
  width: 75px; height: 75px;
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  display: grid; place-items: center;
  cursor: pointer; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, border-color .2s ease;
}
.monster-tab img { width: 44px; height: 44px; object-fit: contain; }
.monster-tab:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0,0,0,0.16); }
.monster-tab.active { border-color: #8dd1ff; }

/* タイトル */
.monster-title {
  text-align: center;
  font-weight: 900;
  font-family: "Times New Roman", serif;
  font-size: clamp(16px, calc(1cqw * 6), 28px);
  letter-spacing: .06em;
  margin: 6px 0 14px;
}

/* 質問カード */
.q-list { display: grid; gap: 14px; }
.q-card {
  background: #f7f7f7;
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.q-image {
  width: 100%;
  border-radius: 10px;
  background:#000;
  overflow: hidden;
  display:block;
}
.q-image img {
  width: 100%; height: auto; display:block;
  filter: contrast(1.05) saturate(1.02);
}

/* 解答行：入力とボタン横並び */
.q-answer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px; margin-top: 10px; 
  align-items: stretch;
}
.q-answer input[type="text"]{
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,.15);
  background:#fff;
  font-size: 16px;
}
.q-answer button{
  /* padding: 10px 16px; */
  padding: 0 16px; 
  border: none; border-radius: 6px;
  background: #ff8a34; /* オレンジ */
  font-size: 16px;
  color: #fff; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,138,52,.36);
  transition: transform .08s ease, filter .12s ease;
}
.q-answer input[type="text"],
.q-answer button{
  box-sizing: border-box;
  block-size: var(--qa-size);     /* ← 高さを変数で統一 */
  line-height: 1;
  font-size: 16px;                /* iOSでの拡大防止も兼ねる */
  white-space: nowrap;               /* 改行禁止 */
  writing-mode: horizontal-tb;       /* 横書きを明示 */
  -webkit-writing-mode: horizontal-tb;
  text-align: center;
}
.q-answer button:active{ transform: translateY(1px) scale(0.98); }
.q-answer button:disabled{ opacity:.4; cursor:not-allowed; box-shadow:none; }

/* 判定メッセージ */
.q-msg{ 
  margin-top:6px; font-size: 16px; min-height: 1.2em; 
  font-family: 'Times New Roman', Times, serif;
  font-weight: 900;
}
.q-msg.ok{ color:#0a8f3b; }
.q-msg.ng{ color:#c62828; }

/* クリア状態の見た目 */
.q-card.solved{
  background: #eefcf2;
  box-shadow: inset 0 0 0 1px rgba(10,143,59,.25);
}
.q-card.solved .q-answer input{ background:#fff; border-color: rgba(10,143,59,.35); }
.q-card.solved .q-answer button{ background:#12b35b; box-shadow:0 6px 16px rgba(18,179,91,.28); }

/* 最後の謎 */
.step1-final {
  /* margin-top: 22px; padding-top: 16px;
  border-top: 2px dashed rgba(0,0,0,.2); */
  margin: 0 0 18px 0;
  padding-bottom: 60px;
  border-bottom: 2px dashed rgba(0, 0, 0, 0.8);
}
.final-title{
  font-weight: 900; text-align:center;
  font-family:"Times New Roman",serif;
  font-size: clamp(16px, calc(1cqw * 6), 28px);
  margin-bottom: 10px;
}
.final-sheet{
  background:#fafafa; border-radius:12px; padding:12px; margin-bottom: 10px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.final-sheet img{ width:100%; height:auto; display:block; border-radius:8px; }
.final-answer .q-answer{ margin-top: 8px; }
.final-note{
  text-align:center; font-size:15px; color:#666; margin-top:8px;
}
.final-locked{
  text-align:center; font-size:14px; color:#444; margin-top:8px;
  background: #fff2d6; border:1px solid #ffd999; padding:8px 10px; border-radius:10px;
}


/* 最初は非表示。動画を閉じたら is-visible を付与して表示 */
.step1-questions { display: none; }
.step1-questions.is-visible { display: block; }

/* 動画オーバーレイ */
.video-overlay{
  position: fixed; inset: 0; z-index: 10001;
  background: rgba(0,0,0,.85);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s ease;
}
.video-overlay.show{ opacity: 1; }

.video-dialog{
  width: min(960px, 92vw);
  aspect-ratio: 16 / 9;
  background: #000; border-radius: 12px;
  box-shadow: 0 10px 32px rgba(0,0,0,.5);
  position: relative; overflow: hidden;
}
.video-dialog video{
  width: 100%; height: 100%; display: block;
  background: #000;
}


/* 閉じるボタン：SVGの白バツ */
.video-close{
  position: absolute; top: 8px; right: 8px;
  inline-size: 44px; block-size: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 2px solid white;
  cursor: pointer; outline: none;
  z-index: 2;                       /* 動画コントロールより上 */
  touch-action: manipulation;       /* モバイルでの反応改善 */
}
.video-close:hover{ filter: brightness(1.08); }
.video-close:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }

/* 中のSVG（クリックは親ボタンに渡す） */
.video-close svg{
  width: 22px; height: 22px; display: block;
  pointer-events: none;             /* ← これで確実にボタンにクリックが届く */
}
.video-close svg line{
  stroke: #fff; stroke-width: 2.5; stroke-linecap: round;
}

.video-close:hover{ filter: brightness(1.1); }

/* 全画面ボタン（閉じるの左） */
.video-fs{
  position: absolute; top: 8px; right: 60px;   /* ← close(右8px)の左に配置 */
  inline-size: 44px; block-size: 44px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 2px solid white;
  cursor: pointer; outline: none;
  z-index: 2;
  touch-action: manipulation;
}
.video-fs:hover{ filter: brightness(1.08); }
.video-fs:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
.video-fs svg{ width: 22px; height: 22px; display: block; pointer-events: none; }
.video-fs svg path{ stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }




/* オーバーレイ中はスクロール固定 */
body.modal-open{ overflow: hidden; }




/* STEP2 の表示制御 */
.s2-block{ display:none; }
.s2-block.is-visible{ display:block; }

/* STEP2 の見出しと説明 */
.s2-title{
  font-weight: 900; text-align:center;
  font-family:"Times New Roman",serif;
  font-size: clamp(16px, calc(1cqw * 6), 28px);
  margin: 8px 0 6px;
}
.s2-desc{
  text-align:center; color:#444; font-size: 15px;
  margin: 0 0 10px;
}

/* 注文ボタン（見た目は既存ボタンと同じ・文言だけ違う） */
.q-answer .order-btn{
  padding: 0 16px;
  border: none; border-radius: 6px;
  background: #ff8a34; color:#fff; font-weight:800; cursor:pointer;
  box-shadow: 0 6px 16px rgba(255,138,52,.36);
  transition: transform .08s ease, filter .12s ease;
  box-sizing: border-box;
  block-size: var(--qa-size);
  line-height: 1;
  font-size: 16px;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  -webkit-writing-mode: horizontal-tb;
}
.q-answer .order-btn:active{ transform: translateY(1px) scale(.98); }
.q-answer .order-btn:disabled{ opacity:.4; cursor:not-allowed; box-shadow:none; }




/* STEP3 の表示制御（STEP2 と同じ思想） */
.s3-block{ display:none; }
.s3-block.is-visible{ display:block; }

/* 既存の .s2-title / .s2-desc を STEP3 でも流用します */

/* ===== STEP3 余白調整 ===== */
/* 可変の大きめ余白（端末に応じて 16〜28px） */
:root { --gap-lg: clamp(56px, 6vmin, 68px); }

/* 「おかしな森から脱出せよ」ブロックの上に余白 */
.tab-panel.step3 .s3-q2 {
  margin-top: var(--gap-lg);
}

/* STORY 5 サムネの上に余白 */
/* .tab-panel.step3 .s3-story5 {
  margin-top: var(--gap-lg);
} */




/* --- Next Arrow Button (continue) --- */
.next-wrap{
  display:flex;
  justify-content:flex-end;  /* 右寄せ */
  margin: 14px 35px 120px;
}
.next-arrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:64px; height:64px;
  border-radius:999px;
  border:2px solid #fff;
  background: rgba(0,0,0,.35);
  color:#fff; text-decoration:none;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  backdrop-filter: blur(6px);
  transition: transform .12s ease, filter .12s ease, opacity .2s ease;
  opacity:0;                 /* 最初は非表示 */
  pointer-events:none;

  position: relative;
  overflow: visible;
  z-index: 1;
}
.next-arrow.show{            /* 表示トグル用 */
  opacity:1;
  pointer-events:auto;

  animation: neonPulse 1.35s ease-in-out infinite,
             gentleNudge 7s ease-in-out infinite;
}
.next-arrow:hover{
  filter: brightness(1.18);
  transform: translateY(-1px) scale(1.18);
}
.next-arrow svg{
  width:70%; height:70%; display:block;
}


/* ★ 外周ハロー（光のにじみ） */
.next-arrow.show::before{
  content:"";
  position:absolute;
  inset:-8px;
  border-radius:inherit;
  box-shadow:
    0 0 24px rgba(18,179,91,.45),
    0 0 48px rgba(18,179,91,.30);
  opacity:.85;
  pointer-events:none;
  animation: haloBlink 1.35s ease-in-out infinite;
}

/* ★ 「ピンッ」と広がるリング（ゆっくり） */
.next-arrow.show::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:inherit;
  border:2px solid rgba(82,255,173,.50);
  opacity:.7;
  transform: scale(1);
  pointer-events:none;
  animation: ping 2.2s ease-out infinite;
}

/* === Animations (3Hz未満・目に優しい速度) === */
@keyframes neonPulse{
  0%,100%{
    box-shadow:
      0 0 0 rgba(0,0,0,0),
      0 8px 24px rgba(0,0,0,.35);
    border-color: rgba(255,255,255,.95);
    background:
      radial-gradient(circle at 50% 50%, rgba(18,179,91,.12) 0%, rgba(0,0,0,.35) 70%);
  }
  50%{
    box-shadow:
      0 0 22px rgba(18,179,91,.55),
      0 0 44px rgba(18,179,91,.35),
      0 10px 28px rgba(0,0,0,.45);
    border-color: rgba(82,255,173,1);
    background:
      radial-gradient(circle at 50% 50%, rgba(18,179,91,.22) 0%, rgba(0,0,0,.35) 70%);
  }
}

@keyframes haloBlink{
  0%,100%{ opacity:.6; filter: blur(2px); }
  50%    { opacity:1;  filter: blur(3px); }
}

@keyframes ping{
  0%  { transform: scale(1);   opacity:.65; }
  70% { transform: scale(1.9); opacity:0;   }
  100%{ transform: scale(2.1); opacity:0;   }
}

/* たまに右へコツンと促す（過度に動かない範囲） */
@keyframes gentleNudge{
  0%,94%,100% { transform: translateX(0); }
  96%         { transform: translateX(2px); }
  98%         { transform: translateX(0); }
}

/* Reduced Motion 配慮：アニメを抑制 */
@media (prefers-reduced-motion: reduce){
  .next-arrow.show{
    animation: none;
  }
  .next-arrow.show::before,
  .next-arrow.show::after{
    animation: none;
  }
}
