/* 共通フォントと配色システム */
@import url('https://fonts.googleapis.com/css2?family=Kosugi+Maru&display=swap');

:root {
  --bg-color: #faf6ee; /* 優しい生成り色 */
  --text-color: #4a3e3d; /* 柔らかい焦げ茶色 */
  --accent-color: #e5989b; /* 優しいピンクベージュ */
  --sub-accent: #b5838d; /* くすみパープルブラウン */
  --shadow-color: rgba(74, 62, 61, 0.08);
  --button-hover-scale: 1.02;
  --button-active-scale: 0.98;
}

/* 全体のリセットと誤操作防止 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html {
  background-color: var(--bg-color);
  font-family: 'Kosugi Maru', system-ui, sans-serif;
  color: var(--text-color);
}

body {
  width: 100%;
  /* LP用に縦スクロールを許容する（ただしゲーム画面では hidden に固定） */
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--bg-color);
}

/* ゲーム画面での縦スクロール無効化（ゲーム側はgame-containerで覆う） */
.game-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  touch-action: none;
  z-index: 1000;
}

/* ホーム画面のファーストビュー */
.home-firstview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  padding: 2vw;
  background: radial-gradient(circle, #fffbee 0%, #faf6ee 100%);
  position: relative;
}

/* 音量ボタン */
.volume-btn {
  position: absolute;
  top: 3vh;
  right: 3vw;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e2dacb;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 15px var(--shadow-color);
  transition: transform 0.2s, background-color 0.2s;
  z-index: 100;
}

.volume-btn:active {
  transform: scale(var(--button-active-scale));
}

.volume-btn svg {
  width: 36px;
  height: 36px;
  fill: var(--text-color);
  transition: fill 0.2s;
}

.volume-btn.muted svg {
  fill: #b5a6a5;
}

/* 日替わりの一言 */
.daily-tip {
  margin-bottom: 2vh;
  background-color: rgba(255, 255, 255, 0.7);
  border: 2px dashed var(--accent-color);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: clamp(16px, 2.5vw, 24px);
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 8px var(--shadow-color);
  z-index: 10;
}

/* メニューボタンコンテナ */
.menu-grid {
  display: flex;
  gap: 4vw;
  width: 90%;
  max-width: 1000px;
  height: 60vh;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

/* 各メニューカード */
.menu-card {
  flex: 1;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: white;
  border: 6px solid #fff;
  box-shadow: 0 16px 40px rgba(74, 62, 61, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
  text-decoration: none;
}

.menu-card:active {
  transform: scale(var(--button-active-scale));
  box-shadow: 0 8px 20px var(--shadow-color);
}

/* カード背景画像 */
.menu-card-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 78%;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease-out;
}

.menu-card:active .menu-card-bg {
  transform: scale(1.03);
}

/* カードテキスト領域 */
.menu-card-label {
  width: 100%;
  height: 22%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(32px, 4.5vw, 48px);
  font-weight: bold;
  color: var(--text-color);
  border-top: 3px solid #f4ede0;
  z-index: 10;
}

/* 下スクロールを促すアロー */
.scroll-hint {
  position: absolute;
  bottom: 2.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  color: #a29190;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-hint svg {
  width: 24px;
  height: 24px;
  fill: #a29190;
  margin-top: 5px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
  60% { transform: translateY(-4px); }
}

/* 隠し「きろく」長押しボタン */
.hidden-record-btn {
  position: absolute;
  bottom: 2vh;
  right: 2vw;
  width: 100px;
  height: 50px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(74, 62, 61, 0.05);
  border-radius: 12px;
  color: rgba(74, 62, 61, 0.15); /* 非常に薄く表示して目立たせない */
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  z-index: 20;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
  overflow: hidden;
}

.hidden-record-btn:active {
  background: rgba(229, 152, 155, 0.15);
  color: rgba(74, 62, 61, 0.4);
  border-color: rgba(229, 152, 155, 0.3);
}

/* 長押しプログレスバー */
.record-btn-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: var(--accent-color);
  width: 0%;
  transition: width 0.1s linear;
}


/* --- LPセクション（選ぶ人向けの紹介コンテンツ） --- */
.lp-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 8vh 6vw;
  background-color: var(--bg-color);
}

/* キャッチコピー */
.lp-hero {
  text-align: center;
  margin-bottom: 8vh;
}

.lp-hero h2 {
  font-size: clamp(32px, 5vw, 56px);
  color: var(--text-color);
  margin-bottom: 20px;
  line-height: 1.3;
}

.lp-hero p {
  font-size: clamp(16px, 2.2vw, 22px);
  color: #6a5655;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* 特徴カード3つ */
.lp-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-bottom: 10vh;
}

.feature-card {
  background: white;
  padding: 40px 30px;
  border-radius: 28px;
  box-shadow: 0 10px 25px rgba(74, 62, 61, 0.04);
  border: 1px solid rgba(74, 62, 61, 0.05);
  text-align: center;
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #faf6ee;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
}

.feature-icon svg {
  width: 36px;
  height: 36px;
  fill: var(--sub-accent);
}

.feature-card h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--text-color);
}

.feature-card p {
  font-size: 16px;
  line-height: 1.6;
  color: #726261;
}

/* つかいかた3ステップ */
.lp-steps-section {
  background: white;
  padding: 60px 40px;
  border-radius: 32px;
  box-shadow: 0 10px 25px rgba(74, 62, 61, 0.04);
  margin-bottom: 10vh;
}

.lp-steps-section h3 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 40px;
  position: relative;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-num {
  width: 50px;
  height: 50px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(229, 152, 155, 0.3);
}

.step-item h4 {
  font-size: 20px;
  margin-bottom: 10px;
}

.step-item p {
  font-size: 15px;
  color: #726261;
  line-height: 1.5;
}

/* よくある質問 (FAQ) */
.lp-faq {
  margin-bottom: 10vh;
}

.lp-faq h3 {
  font-size: 28px;
  text-align: center;
  margin-bottom: 45px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: white;
  border-radius: 20px;
  padding: 24px 30px;
  box-shadow: 0 8px 20px rgba(74, 62, 61, 0.03);
}

.faq-q {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-color);
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.faq-q span {
  color: var(--accent-color);
}

.faq-a {
  font-size: 15px;
  color: #726261;
  line-height: 1.6;
  padding-left: 26px;
}

/* フッター・製品案内 */
.lp-footer {
  border-top: 2px solid #f2ebdd;
  padding-top: 60px;
  text-align: center;
}

.feedback-box {
  background: #fdfaf5;
  border: 2px solid #ebdcb9;
  border-radius: 24px;
  padding: 40px 30px;
  max-width: 700px;
  margin: 0 auto 30px;
}

.feedback-box h4 {
  font-size: 22px;
  margin-bottom: 15px;
}

.feedback-box p {
  font-size: 15px;
  color: #726261;
  line-height: 1.6;
  margin-bottom: 24px;
}

.feedback-link {
  display: inline-block;
  background-color: var(--text-color);
  color: white;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 30px;
  font-weight: bold;
  font-size: 16px;
  transition: transform 0.2s, background-color 0.2s;
  box-shadow: 0 6px 15px rgba(74, 62, 61, 0.15);
}

.feedback-link:active {
  transform: scale(var(--button-active-scale));
}

.future-banner {
  font-size: 14px;
  color: #928180;
  margin-top: 40px;
}


/* --- きろく画面（モーダル） --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(45, 38, 38, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-color);
  width: 92%;
  max-width: 900px;
  max-height: 90vh;
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  border: 4px solid white;
  padding: 30px;
  position: relative;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: white;
  border: 1px solid #ebdcb9;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--shadow-color);
}

.modal-close svg {
  width: 24px;
  height: 24px;
  fill: var(--text-color);
}

.modal-title {
  font-size: 26px;
  font-weight: bold;
  margin-bottom: 24px;
  text-align: center;
}

/* きろくの概要表示 */
.record-summary {
  background: white;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 6px 15px var(--shadow-color);
  border: 1px solid rgba(74, 62, 61, 0.04);
}

.record-summary-title {
  font-size: 16px;
  color: #8c7b7a;
  margin-bottom: 8px;
}

.record-summary-text {
  font-size: 20px;
  font-weight: bold;
  line-height: 1.6;
}

.record-summary-text span {
  color: var(--accent-color);
  font-size: 24px;
}

/* きろくの中央グリッド（カレンダーとグラフ） */
.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 30px;
}

.record-section-box {
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 6px 15px var(--shadow-color);
  border: 1px solid rgba(74, 62, 61, 0.04);
}

.record-section-box h4 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-color);
  border-left: 4px solid var(--accent-color);
  padding-left: 10px;
}

/* カレンダー描画 */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: bold;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.calendar-day-label {
  font-size: 12px;
  color: #a29190;
  font-weight: bold;
  padding-bottom: 6px;
}

.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  border-radius: 8px;
  background-color: #faf8f5;
  position: relative;
}

.calendar-cell.active-day {
  background-color: #fdf0f0;
  font-weight: bold;
}

.calendar-cell .leaf-marker {
  width: 14px;
  height: 14px;
  fill: #81b29a; /* 優しいグリーンの葉っぱマーク */
  position: absolute;
  bottom: 2px;
}

/* 棒グラフ用 Canvas */
#chart-canvas {
  width: 100%;
  height: 180px;
  display: block;
}

/* 下部アクションエリア */
.record-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.save-card-btn {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 14px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(229, 152, 155, 0.3);
  transition: transform 0.2s, background-color 0.2s;
}

.save-card-btn:active {
  transform: scale(var(--button-active-scale));
}

.record-notice {
  font-size: 12px;
  color: #928180;
  text-align: center;
}

/* 各種ゲーム画面の描画調整 */
#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.exit-btn {
  position: absolute;
  top: 3vh;
  left: 3vw;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #e2dacb;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 6px 15px var(--shadow-color);
  transition: transform 0.2s, background-color 0.2s;
  z-index: 1100;
}
.exit-btn:active {
  transform: scale(var(--button-active-scale));
}
.exit-btn svg {
  width: 32px;
  height: 32px;
  fill: var(--text-color);
}
