

.mainvisual-inner::before {
  content: "";
  position: absolute;
  inset: 0;               /* 親いっぱいにフィット（width/heightは書かなくてOK） */

  background-image: url(../images/bg/secret.png);
  background-size: 100% 100%;   /* 画像とぴったり合わせたいならこれ */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;

  mix-blend-mode: multiply;
  opacity: 0.9;
  pointer-events: none;
  z-index: 3;
}


/* ==============================
   secret game layout
============================== */

.main--secret {
  padding: 64px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.secret-game__device {
  position: relative;
  width: min(95vw, 500px, 54vh);
  margin: 4vw auto 2vw;
}

/* 本体フレームを前に */
.secret-game__frame {
  position: relative;
  width: 100%;
  z-index: 2; /* ★ フレームを手前へ */
  pointer-events: none; /* ★ クリックを透過させる！！ */
}

.secret-game__screen {
  position: absolute;
  inset: 5% 7% 39% 7%;
  border-radius: 6px;
  padding: 0 12px;
  box-sizing: border-box;

  background: #5da544;
  overflow: hidden;   /* フィルムはみ出し防止 */

  z-index: 1;

  display: flex;
  align-items: stretch;
}

/* 中身は相対配置で一段前に */
.secret-game__screen-inner {
  position: relative;
  z-index: 2; /* ← フィルムより前に置く */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* ここに液晶のフィルムを 1 枚だけ乗せる */
.secret-game__screen::before {
  content: "";
  position: absolute;
  inset: 0;

  background: #5A7C5A;          /* ← フィルムの色 */
  mix-blend-mode: hard-light;   /* ← ハードライト合成 */
  opacity: 1;                    /* 必要なら 0.5 くらいに調整 */

  z-index: 3;                    /* ← 手前に固定（チエさんが調整した値） */
  pointer-events: none;         /* ← クリックを通す */
}

/* テキスト */

.secret-game__title {
  font-size: 2rem;
  margin-bottom: 8px;
  text-align: center;
}

.secret-game__desc {
  font-size: 1.2rem;
  margin-bottom: 8px;
  text-align: center;
}

/* 「もう一回遊ぶ？」のときの見た目 */
.secret-game__desc.is-retry {
  cursor: pointer;
  text-decoration: underline;
}

.secret-game__desc.is-retry:hover {
  text-decoration: none;
}

/* グリッド（3×3の真ん中抜きでも8個ならOKだけど、ここでは2行×4列） */

.secret-game__grid {
  width: 100%;
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  justify-items: center;
}

.secret-game__box {
  position: relative;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.secret-game__box img {
  display: block;
  width: 100%;
  height: auto;
}

/* ▼ ランダム揺れ用のアニメクラス */
.secret-box-idle img {
  animation: boxIdle 0.35s ease-in-out;
  animation-iteration-count: 1; /* 1回だけ揺れる */
  transform-origin: center center;
}

/* ▼ 控えめぷるぷる（自然＆かわいい） */
@keyframes boxIdle {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-1.5px); }
  75%  { transform: translateX(1.5px); }
  100% { transform: translateX(0); }
}
/* クリック後の簡単な揺れエフェクト（お好み） */

.secret-game__box.is-miss img {
  animation: boxMiss 0.25s ease-out;
}

.secret-game__box.is-hit img {
  animation: boxHit 0.35s ease-out;
}

@keyframes boxMiss {
  0%   { transform: translateX(0); }
  30%  { transform: translateX(-3px); }
  60%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes boxHit {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-2px) scale(1.05); }
  100% { transform: translateY(0) scale(1); }
}

/* もう一回ボタン */

.secret-game__retry {
  margin-top: 8px;
  padding: 4px 10px;
  font-size: 1.1rem;
  border-radius: 999px;
  border: 1px solid #0b1b06;
  background: rgba(10, 40, 10, 0.15);
  cursor: pointer;
}

.secret-game__retry:hover {
  background: rgba(10, 40, 10, 0.25);
}

/* ホバー */

.cursor-circle {
  position: fixed;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;

  /* 円の色（var(--orange) = #E85200 相当） */
  background: rgba(232, 82, 0, 0.3); /* 不透明度80% */

  /* 真ん中をカーソル位置に合わせる */
  transform: translate(-50%, -50%) scale(0.8);

  opacity: 0;
  transition: opacity 0.15s ease;  /* transform には transition かけない */
}

/* ホバー中：表示＋鼓動アニメーション */
.cursor-circle.is-active {
  opacity: 1;
  animation: cursorPulse 0.8s ease-in-out infinite;
}

/* 鼓動アニメーション（小→大→小） */
@keyframes cursorPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.0);
  }
  100% {
    transform: translate(-50%, -50%) scale(0.5);
  }
}



/* ////////////////////////////
    pc 769px～
//////////////////////////// */

@media screen and (min-width: 769px) {

  .main--secret {
  padding: 120px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  }


  .secret-game__device {
  position: relative;
  width: min(95vw, 600px, 55vh);
  margin: 0 auto;
  }

  /* テキスト */

  .secret-game__title {
    font-size: 3rem;
    margin-bottom: 16px;
    text-align: center;
  }

  .secret-game__desc {
    font-size: 1.6rem;
    margin-bottom: 16px;
    text-align: center;
  }
}

/* ==============================
   secret-game 入場アニメ
============================== */

/* 初期状態：ちょっと下＆透明 */
.secret-game {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 黒バーが開いたあとに付けるクラス */
.secret-game.is-enter {
  opacity: 1;
  transform: translateY(0);
}

/* 液晶の中身：あとからふわっと出す用 */
.secret-game__screen-inner {
  opacity: 0;
  transform: scale(0.96);
  transition:
    opacity 0.45s ease 0.15s,
    transform 0.45s ease 0.15s;
}

/* 黒バー → 本体 → のあとに付与するクラス */
.secret-game__screen-inner.is-enter {
  opacity: 1;
  transform: scale(1);
}