/* ----------------------------
   全体レイアウト
----------------------------- */
body {
  margin: 0;
  font-family: sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 上部エリア（気球・雲） */
.top {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #cceeff;
}
.top-bar.left {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
}
.top-bar.right {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

/* 週目標（高度の下） */
.weekly-goal {
  margin-top: 8px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 6px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
@media (max-width: 600px) {
  .weekly-goal {
    font-size: 0.9rem;
    max-width: 90%;
    text-align: center;
  }
}

/* 気球 */
.balloon {
  width: 200px;
  animation: float 3s ease-in-out infinite;
  transition: transform 0.3s ease-out;
}
.altimeter {
  font-size: 1.5rem;
  margin-top: 10px;
}

/* 下部エリア（ボタン・質問） */
.bottom {
  flex: 1;
  background: #f0f0f0;
  padding: 10px;
  text-align: center;
}
.button-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
button {
  padding: 16px;
  font-size: 1.1rem;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: white;
  cursor: pointer;
}
button:disabled {
  background-color: #cccccc;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.7;
}
.question {
  font-size: 1.2rem;
  margin-bottom: 15px;
}

/* アニメーション */
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
  100% { transform: translateY(0); }
}
.floating {
  animation: float 3s ease-in-out infinite;
}

/* 雲 */
#cloudContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}
.cloud {
  position: absolute;
  width: 280px;
  height: auto;
  opacity: 0.8;
  pointer-events: none;
  z-index: 1;
  transition: transform 0.5s linear;
}

/* ポップアップ共通 */
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.popup .popup-content {
  position: relative;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  text-align: left;
  overflow-x: auto;
}
.hidden { display: none; }

/* 閉じるボタン（×） */
.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 20px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  z-index: 10;
}
.close-btn:hover {
  color: #000;
}

/* スマホ時のポップアップ位置調整 */
@media (max-width: 600px) {
  .popup {
    align-items: flex-start;
    padding-top: 80px;
  }
}

/* 1週間サマリーポップアップ（スクロール対応＋余白確保） */
#weekPopup .popup-content {
  position: relative;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  text-align: left;
}

/* 下にダミーの余白領域を追加 */
#weekPopup .popup-content::after {
  content: "";
  display: block;
  height: 60px;   /* ← 最下部の余白（ここで調整） */
}

/* スマホ最適化 */
@media (max-width: 600px) {
  #weekPopup .popup-content {
    max-height: 85vh;
    padding: 15px;
  }
  #weekPopup .popup-content::after {
    height: 120px; /* ← スマホではさらに余白を広げる */
  }
}


