/* ========================================
   基本設定・全体のスタイル
   ======================================== */

/* ========================================
   カラーテーマシステム
   ======================================== */

/* デフォルトテーマ（青系） */
:root {
  --bg-primary: rgb(20, 50, 85);
  --bg-secondary: rgb(40, 70, 110);
  --bg-accent: rgb(60, 90, 130);
  --bg-accent-hover: rgb(80, 110, 150);
  --text-primary: #ffffff;
  --text-secondary: #ffffff;
}

/* ライトテーマ（白背景シンプル） */
body.theme-light {
  --bg-primary: #f8f9fa;
  --bg-secondary: #e9ecef;
  --bg-accent: #6c757d;
  --bg-accent-hover: #495057;
  --text-primary: #333333;
  --text-secondary: #333333;
}

/* 暖色テーマ */
body.theme-warm {
  --bg-primary: rgb(60, 35, 25);
  --bg-secondary: rgb(80, 45, 35);
  --bg-accent: rgb(140, 80, 60);
  --bg-accent-hover: rgb(160, 100, 80);
  --text-primary: #ffffff;
  --text-secondary: #f8f9fa;
}

/* ページ全体の設定 */
body {
  background-color: var(--bg-primary); /* サイトのメインカラー */
  margin: 0px; /* ブラウザのデフォルトマージンをリセット */
  font-family: "Noto Sans", sans-serif; /* 日本語に対応したフォント */
  font-weight: 400; /* 通常の太さ */
}

/* ========================================
   トップページのキャラクター画像グリッド
   ======================================== */

/* キャラクター画像を4列のグリッドで配置 */
.topimages {
  display: grid; /* CSS Grid レイアウトを使用 */
  grid-template-columns: repeat(4, 1fr); /* 4列に等分割 */
  gap: 0; /* 画像間の隙間なし */
}

.kikanngennteiimg{
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

.imgsquare {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  display: block;
  transition: all 2s ease-in-out; /* ゆっくりとしたトランジション */
}

/* アニメーション用のクラス */
.imgsquare.animating {
  transform: scale(1.05); /* 少し拡大 */
  opacity: 0.8; /* 透明度を変更 */
}

/* ========================================
   レスポンシブデザイン（スマートフォン対応）
   ======================================== */

/* 画面幅が590px以下の時（スマートフォン） */
@media (max-width: 590px) {
  .topimages {
    grid-template-columns: repeat(3, 1fr); /* 3列に変更してスマホで見やすく */
  }
}

.topp {
  display: inline-block;
  letter-spacing: 0.05em;
  line-height: 1.8;
  margin: 20% 10%;
  font-size: 100%;
  color: var(--text-primary);
  text-align: left;
}

/* ========================================
   ヘッダー・ナビゲーション
   ======================================== */

/* ページ上部のヘッダー */
header {
  background-color: var(--bg-secondary); /* テーマカラー */
  width: auto; /* 画面幅いっぱい */
  padding: 5%; /* 内側の余白 */
  margin-bottom: 7%; /* 下の要素との間隔 */
  z-index: 30; /* 他の要素より前面に表示 */
}

/* ハンバーガーメニューのボタン（三本線） */
.hamburger {
  width: 30px; /* ボタンの幅 */
  height: 24px; /* ボタンの高さ */
  display: flex; /* フレックスボックスで線を縦に配置 */
  flex-direction: column; /* 縦方向に配置 */
  justify-content: space-between; /* 線を等間隔で配置 */
  cursor: pointer; /* マウスカーソルがポインターに変わる */
}

/* ハンバーガーメニューの各線 */
.hamburger span {
  height: 4px; /* 線の太さ */
  background: #ffffff; /* 白色の線 */
}

/* スライドメニュー本体（初期状態は非表示） */
.menu-list {
  display: none; /* 初期状態では非表示 */
  position: fixed; /* 画面に固定表示 */
  background-color: var(--bg-secondary); /* ヘッダーと同じテーマカラー */
  width: 70vw; /* 画面幅の70% */
  height: 100vh; /* 画面の高さいっぱい */
  top: 0px; /* 画面上端から */
  left: 0px; /* 画面左端から */
  margin: 0; /* マージンなし */
  padding: 0; /* パディングなし */
  z-index: 20;
}

/* メニューリンクのスタイル */
.menu-list a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 20px;
  margin: 1%;
  padding: 1%;
  cursor: pointer; /* リンクであることを明確にするポインター */
}

/* メニューリンクのホバー効果 */
.menu-list a:hover {
  background-color: rgba(255, 255, 255, 0.1); /* マウスオーバー時の背景色 */
}

/* メニューが開かれた時の表示設定 */
.menu.open .menu-list {
  display: block; /* JavaScriptで.openクラスが追加された時にメニューを表示 */
}

/* ========================================
   カラーテーマ選択ボタン
   ======================================== */

/* テーマ選択セクション */
.theme-selector {
  padding: 20px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 20px;
}

.theme-selector-title {
  color: var(--text-primary);
  font-size: 16px;
  margin-bottom: 15px;
  text-align: center;
}

/* テーマボタンコンテナ */
.theme-buttons {
  display: flex;
  justify-content: space-around;
  gap: 10px;
}

/* 各テーマボタン */
.theme-btn {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.theme-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.theme-btn.active {
  border-color: #fff;
  border-width: 3px;
}

/* 各テーマの色見本 */
.theme-btn.dark {
  background: linear-gradient(45deg, rgb(20, 50, 85), rgb(60, 90, 130));
}

.theme-btn.light {
  background: linear-gradient(45deg, #f8f9fa, #6c757d);
}

.theme-btn.warm {
  background: linear-gradient(45deg, rgb(60, 35, 25), rgb(140, 80, 60));
}

/* テーマボタンのラベル */
.theme-btn::after {
  content: attr(data-label);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-primary);
  white-space: nowrap;
}

.topgazou {
  width: 100%;
  margin-bottom: 100px;
}

/* ========================================
   ナビゲーションボタン
   ======================================== */

/* メインページのナビゲーションボタン */
.square {
  position: relative;
  width: 80%;
  height: 100px;
  background: var(--bg-accent); /* 統一感のあるテーマカラー */
  border-radius: 20px; /* 角を丸く */
  margin-bottom: 30px; /* ボタン間の間隔 */
  border: none; /* ボーダーなし */
  cursor: pointer; /* クリックできることを示すポインター */
  z-index: 10;
}

/* ボタンのホバー効果 */
.square:hover {
  background: var(--bg-accent-hover); /* マウスオーバー時に少し明るく */
  transform: translateY(-2px); /* 少し浮き上がるエフェクト */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* 影を追加 */
}

.buttonp {
  z-index: 20;
  position: absolute;
  font-size: 160%;
  top: 30%;
  left: 0%;
  padding: 0 10%;
  color: var(--text-primary);
}

.buttonimg {
  position: absolute;
  height: 100%;
  top: 0px;
  right: 0px;
}

.deka {
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.chibi {
  display: inline-block;
}

.gazoutate {
  width: 30%;
  margin-top: 5%;
}

.gazouyoko {
  width: 75%;
  margin-top: 5%;
}

.gazounarabe {
  display: inline-block;
  width: 75%;
}

.defop {
  display: inline-block;
  text-align: left;
  letter-spacing: 0.05em;
  line-height: 1.8;
  width: 75%;
  font-size: 100%;
  color: var(--text-primary);
  margin: 5% 0% 8% 0%;
}

h1 {
  margin: 5% 12% 0% 12%;
  width: 70%;
  background-color: var(--bg-accent-hover);
  box-sizing: content-box;
  padding: 3% 5% 3% 5%;
  text-align: left;
  font-size: 150%;
  color: var(--text-primary);
}

h2 {
  margin: 5% 12% 0% 12%;
  background-color: var(--bg-accent-hover);
  text-align: left;
  width: 70%;
  padding: 3% 5% 3% 5%;
  text-align: left;
  font-size: 120%;
  color: var(--text-primary);
}

h3 {
  margin: 5% 12% 0% 12%;
  background-color: var(--bg-accent-hover);
  text-align: left;
  width: 70%;
  padding: 3% 5% 3% 5%;
  font-size: 110%;
  color: var(--text-primary);
}

footer {
  position: relative;
  width: auto;
  padding: 0% 5%;
  height: 250px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  z-index: -10;
}

.footerul {
  position: relative;
  top: 40px;
  left: 10px;
  width: 75%;
  font-size: 80%;
  list-style: circle;
  color: var(--text-primary);
}

.footerp {
  position: relative;
  top: 60px;
  left: 40px;
  width: 75%;
  font-size: 80%;
  color: var(--text-primary);
}

/* 
ページ移動のボタン 
*/

.pagemove{
  position: relative;
  display: flex;
  gap: 10%;
  justify-content: center;
  margin-bottom: 10%;
}

.move{
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-primary);
  color: var(--bg-accent);
}


/* ========================================
   上へ戻るフローティングボタン
   ======================================== */

/* 上へ戻るボタン */
.scroll-to-top {
  position: fixed;
  bottom: 3rem;
  right: 3rem;
  width: 60px;
  height: 60px;
  background-color: var(--bg-accent);
  color: var(--text-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: none; /* 初期状態では非表示 */
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.scroll-to-top:hover {
  background-color: var(--bg-accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.scroll-to-top.visible {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
