/* 共通フォント */
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(to bottom, #66a6ff, #89f7fe); /* XP風青グラデーション */
  margin: 0;
  padding: 0;
  text-align: center; 
} 

html,body {
  min-height:100vh; 
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}


/* タイトル */
h1 {
  text-align: center;
  margin-top: 20px;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

/* 文字 */
p {
  font-size: 18px;
  color: #0044aa;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.difficulty {
  display: flex;
  flex-direction: column; /* ← 縦並び */
  align-items: center;
}

/* パズルボード */
#board {
  width: min(90vw, 420px);
  aspect-ratio: 1 / 1;
}


/* パズル全体のラッパー */
#puzzleWrapper {
  width: min(90vw, 360px);
  aspect-ratio: 1 / 1;
  margin: 20px auto;
  position: relative; /* これが基準！ */
}
/* パズルテーブル */
#board {
  width: 100%;
  height: 100%;
  display: grid;
}

/* タイル */
.tile {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid #0044aa;
  background-color: #fff;
  box-shadow: 5px 5px 10px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}


.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 空白タイル */
.tile.empty {
  background: white;
  box-shadow: none;
}

/* タイル移動アニメーション（未来的な爽快感） */
.tile.moving {
  transform: translate(0,0);
  transition: transform 0.15s cubic-bezier(0.25, 1.25, 0.5, 1);
}

/* ボタン */
button {
  margin: 10px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background:linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
  backdrop-filter: blur(6px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  color: #0044aa;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  background: linear-gradient(to bottom, rgba(255,255,255,1), rgba(255,255,255,0.6));
  transform: translateY(-2px);
}

#how-to-play {
  text-align: center;
  margin: 30px auto;
  padding: 15px;
  background: #f7f7f7;
  border-radius: 10px;
  width: 90%;
  max-width: 350px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  opacity: 0.90;
}

#how-to-play h2 {
  margin-bottom: 8px;
  font-size: 20px;
  color: #2d87b0;
}

#how-to-play ul {
  text-align: left;
  display: inline-block;
  font-size: 14px;
  font-weight: bold;
  color: #0044aa;
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.6;
  margin: 10px 0;
  padding-left: 20px;
}

#how-to-play .example img {
  width: 80%;
  margin-top: 6px;
  border-radius: 6px;
  border: solid 2px #fff;
}


/* ヒント画像表示用 */
#hintImage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 350px;      /* 画像の見やすい大きさ。必要に応じて調整 */
  height: 350px;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none; /* 押せないように */
  transition: opacity 0.4s ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 15px;
  box-shadow: 0 0 15px rgba(0,0,0,0.4);
  display: none; /* 初期状態では非表示 */
}

#hintImage.show {
  opacity: 0.9;
  pointer-events: auto;
}

/* クリア表示用 */
#clearMessage {
  margin-top: 20px;
  font-size: 24px;
  color: #fff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.5s ease;
}

#clearMessage.show {
  opacity: 1;
}

/* ⭐ひらひら落下＋強い3D回転 */
@keyframes confetti-fall-slow {
  0%   { transform: translate3d(0, -10vh, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  50%  { transform: translate3d(20px, 50vh, 0) rotateX(180deg) rotateY(360deg) rotateZ(90deg); }
  100% { transform: translate3d(-40px, 105vh, 0) rotateX(720deg) rotateY(540deg) rotateZ(300deg); }
}

@keyframes confetti-fall-medium {
  0%   { transform: translate3d(0, -10vh, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  50%  { transform: translate3d(-30px, 50vh, 0) rotateX(300deg) rotateY(360deg) rotateZ(200deg); }
  100% { transform: translate3d(50px, 105vh, 0) rotateX(900deg) rotateY(720deg) rotateZ(480deg); }
}

@keyframes confetti-fall-fast {
  0%   { transform: translate3d(0, -10vh, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  50%  { transform: translate3d(50px, 50vh, 0) rotateX(360deg) rotateY(200deg) rotateZ(300deg); }
  100% { transform: translate3d(-80px, 105vh, 0) rotateX(1200deg) rotateY(800deg) rotateZ(540deg); }
}


.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  perspective: 800px;
  overflow: hidden;
  z-index: 999;
}

/* 紙吹雪の共通スタイル */
.confetti {
  position: absolute;
  top: -10px;
  transform-style: preserve-3d;
  border-radius: 2px;
}

/* Sassの & 記法をやめて普通のクラスに */
.confetti--animation-slow {
  animation: confetti-fall-slow 2.8s linear forwards;
}

.confetti--animation-medium {
  animation: confetti-fall-medium 2.2s linear forwards;
}

.confetti--animation-fast {
  animation: confetti-fall-fast 1.7s linear forwards;
}

.bubble-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.bubble {
  position: fixed;
  bottom: -20vh;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #ffffffcc 0%, #ffffff55 35%, #00000011 70%, transparent 100%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.25), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(150,200,255,0.15), transparent 70%);

  backdrop-filter: blur(2px); /* 屈折感 */
  mix-blend-mode: screen;
  animation: floatUp var(--duration) linear infinite;
  filter: drop-shadow(0 0px 10px rgba(255, 255, 255, 0.4));
  opacity: 0.9;
}

/* シャボン玉がゆらゆら上昇するアニメーション */
@keyframes floatUp {
  0% {
    transform: translateX(0) translateY(0) scale(1);
  }
  50% {
    transform: translateX(var(--drift)) translateY(-50vh) scale(1.2);
  }
  100% {
    transform: translateX(calc(var(--drift) * 2)) translateY(-100vh) scale(0.8);
    opacity: 0;
  }
}

.mute-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 9999;
  background: white;
  padding: 10px;
  border-radius: 50%;
  border: 2px solid #ccc;
  opacity: 0.8;
}

/* レスポンシブデザイン */
@media (max-width: 600px) {
  h1 {
    font-size: 20px;
    margin-top: 10px;
  }

  button {
    font-size: 14px;
    padding: 12px 14px;
    margin: 8px;
  }

  #hintBtn {
    margin-top: 10px;
  }

  .game-container {
  padding-bottom: 40px;
  }

  mute-btn {
    top: 60px;   /* ← これだけでOK */
    right: 12px;
  }

  h1{
    margin-bottom: 18px;
  }
}
