/* ================================
   全ページ共通スタイル
=============================== */
/* 共通スタイル */
body {
  font-family: 'Rounded M PLUS 1c', sans-serif;
  background: #fafafa;
  margin: 0;
  line-height: 1.6;
  color: #333;
  padding: 0;
}

header h1 {
  text-align: center;
  font-size: 2rem; /* 好きなサイズに調整 */
  margin: 1rem 0;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 16px;
  line-height: 1.7;
}
/* ------------------------------
   ナビゲーション
------------------------------ */

/* メニュー共通 */
nav.main-menu {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem; /* メニュー間のスペース */
  flex-wrap: wrap; /* 画面が狭いときに折り返す */
  margin: 0 auto;
}

nav.main-menu a {
  text-decoration: none;
  color: #333;
  font-weight: normal; /* 全デバイスで同じ太さに */
  white-space: nowrap; /* 折り返さない文字列 */
}

body.index-page a[href="index.html"],
body.about-page a[href="about.html"],
body.diary-page a[href="diary.html"],
body.residents-page a[href="residents.html"],
body.drawing-page a[href="drawing.html"] {
  border-bottom: 2px solid #333;
  padding-bottom: 4px;
}


/* PC用 (幅769px以上) */
@media (min-width: 769px) {
  nav.main-menu a {
    font-size: 16px;
  }
}

/* タブレット用 (481px～768px) */
@media (max-width: 768px) and (min-width: 481px) {
  nav.main-menu a {
    font-size: 14px;
  }
}

/* スマホ用 (480px以下) */
@media (max-width: 480px) {
  nav.main-menu a {
    font-size: 12px;
  }
}
/* ------------------------------
   メイン領域
------------------------------ */
main {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 15px;
  font-size: 12px;
}

/* 見出し */
h2 {
  border-left: 3px solid #333;
  padding-left: 10px;
  font-size: 22px;
  font-weight: 500;
  margin: 15px 0;
  line-height: 1.4;
}

/* ------------------------------
   controls（フォームやボタン）
------------------------------ */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
  align-items: center;
}

.controls input,
.controls select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 13px;
}

/* ------------------------------
   共通ボタン
------------------------------ */
button {
  padding: 6px 12px;
  margin: 5px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  cursor: pointer;
  border-radius: 4px;
  transition: 0.2s;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button:hover {
  background: #f2f2f2;
}

/* ------------------------------
   リンク
------------------------------ */
a {
  color: #333;
  text-decoration: none;
}

a:hover {
  opacity: 0.6;
}

/* ------------------------------
   日記系スタイル
------------------------------ */
.entry {
  margin-bottom: 25px;
  border: 1px solid #000;
  padding: 30px;
  position: relative;
  background: #fff;
  border-radius: 4px;
}

.entry p {
  white-space: pre-line;
  line-height: 1.5;
  margin: 5px 0 15px 0;
}

.entry img {
  width: 200px;
  height: 150px;
  object-fit: contain;
  display: block;
  margin: 5px auto;
  border: 1px solid #ccc;
  background: #f9f9f9;
}

.entry-date {
  position: absolute;
  top: 0px;
  left: 10px;
  background: #fff;
  padding: 2px 6px;
  font-weight: bold;
  font-size: 20px;
}

.entry-content p {
  margin: 0 0 10px;
  line-height: 1.4;
}

/* ------------------------------
   トモコレ日記専用
------------------------------ */
body.game-page .game-entry {
  border: 1px solid #0077cc;
  border-radius: 5px;
  padding: 12px;
  margin-bottom: 30px;
  background: #f9faff;
  position: relative;
}

body.game-page .game-entry-date {
  position: absolute;
  top: -20px;
  left: 10px;
  background: #0077cc;
  color: #fff;
  padding: 2px 6px;
  font-weight: bold;
  font-size: 18px;
  border-radius: 3px;
}

body.game-page .game-entry-content p {
  margin: 0 0 10px;
  line-height: 1.4;
}

body.game-page .game-entry-content img {
  width: 200px;
  height: 150px;
  object-fit: contain;
  display: block;
  margin: 5px auto;
  border: 1px solid #0077cc;
  background: #eef6ff;
}

/* トモコレ日記用メニュー */
.menu {
  max-width: 600px;
  margin: 20px auto;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.menu a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #222;
  border: 1px solid #e5e5e5;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: 0.2s;
}

.menu a:hover {
  background: #f2f2f2;
}

/* ------------------------------
   residents.html専用
------------------------------ */
body.residents-page #cardsContainer {
  display: block; /* 縦並び */
}

body.residents-page .card {
  width: 100%;
  max-width: 600px;
  margin: 10px auto;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  background: #f9f9f9;
  box-sizing: border-box;
}

body.residents-page .card .name {
  font-weight: bold;
  margin-bottom: 5px;
}

body.residents-page .card .info {
  margin-top: 2px;
  font-size: 13px;
  color: #666;
}

/* ------------------------------
   ページネーション
------------------------------ */
#pagination {
  margin-top: 20px;
  text-align: center;
}

#pagination button {
  margin: 2px;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
  transition: 0.2s;
}

#pagination button:hover {
  background: #f2f2f2;
}

/* ------------------------------
   フッター
------------------------------ */
footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #ddd;
  margin-top: 40px;
  font-size: 12px;
  color: #666;
}

/* indexページ画像専用 */
body.index-page main img.index-banner {
  display: block;      /* 中央寄せ */
  max-width: 400px;    /* 上限サイズ */
  width: 80%;          /* 画面幅に応じて縮小 */
  height: auto;        /* 比率維持 */
  margin: 20px auto;   /* 上下に余白 + 中央寄せ */
}

/* プロフィールや About 用カード */
.profile-card, .about-card {
  border: 1px solid #000;   /* 黒い枠 */
  border-radius: 8px;       /* 角丸 */
  padding: 20px;            /* 内側の余白 */
  background: #fff;         /* 背景白 */
  margin-bottom: 20px;      /* 下に余白 */
  box-shadow: 3px 3px 0 rgba(0,0,0,0.15); /* 少し立体感を出す場合 */
}

.diary-banner {
  width: 80%;      /* 好きな幅に調整（%でもpxでもOK） */
  max-width: 600px; /* 最大幅を制限 */
  height: auto;     /* 高さは自動で比率維持 */
  display: block;
  margin: 10px auto; /* 上下に余白、中央寄せ */
  border-radius: 6px; /* お好みで角丸 */
}

/* ===============================
   indexページトップ画像（バナー）専用
=============================== */
body.index-page main img.index-banner {
  display: block;           /* 中央寄せ */
  max-width: 400px;         /* 画像の最大幅 */
  width: 80%;               /* 画面幅に応じて縮小 */
  height: auto;             /* 縦横比を維持 */
  margin: 20px auto;        /* 上下余白 + 中央寄せ */
  border-radius: 6px;       /* 角丸にしたい場合 */
  object-fit: contain;      /* 画像比率維持 */
}



/* ===============================
   カード 改良版
=============================== */

.card {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}

/* ホバー */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

/* 名前 */
.card .name {
  font-weight: bold;
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee; /* ←区切りライン */
}

/* 情報全体 */
.card .info {
  font-size: 0.85rem;
  color: #444;
  margin: 6px 0;
  line-height: 1.5;
  border-bottom: 1px solid #eee;
}

/* ラベル（性格・誕生日とか） */
.card .info strong {
  display: inline-block;
  width: 70px; /* ←揃えるポイント */
  color: #888;
  font-weight: normal;
}

/* サブタイプ */
.subtype {
  display: block;
  font-size: 0.8rem;
  color: #777;
  margin-top: 2px;
}

/* 横並び */
.card-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* テキスト側 */
.card-text {
  flex: 1;
}

/* 画像側 */
.card-image {
  width: 100px;
  flex-shrink: 0;
  margin-top: 10px; /* ←これで下にずらす */
}

.card-image img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.card.nagomi { border-left: 5px solid #ffe599; }
.card.cool   { border-left: 5px solid #9fc5e8; }
.card.nori   { border-left: 5px solid #f4a6a6; }
.card.dry    { border-left: 5px solid #b6d7a8; }

.card-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.char-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px; /* ← 少し下げる */
}

.text-area {
  flex: 1;
  text-align: left;
}

.drawing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.drawing-card {
  width: 100%;
  aspect-ratio: 1 / 1; /* 正方形サムネイル */
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid #ccc;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.drawing-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 四角に合わせて中央をトリミング */
  display: block;
}

.drawing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}


.lightbox {
  display: none; /* 最初は非表示 */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.8);
  z-index: 9999;
}

.lightbox-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-img {
  width: auto;
  height: auto;

  max-width: 95vw;  /* 画面の95%まで */
  max-height: 95vh; /* 画面の95%まで */

  min-width: 50vw;  /* 画面の半分くらいは常に表示 */
  min-height: 50vh;

  object-fit: contain;
  border-radius: 6px;
}

.caption {
  margin-top: 10px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  word-break: break-word;
}

.lightbox .close,
.lightbox .prev,
.lightbox .next {
  position: absolute;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  user-select: none;
}

.lightbox .close { top: 20px; right: 30px; }
.lightbox .prev { top: 50%; left: 30px; transform: translateY(-50%); }
.lightbox .next { top: 50%; right: 30px; transform: translateY(-50%); }


.fancy-divider.sleek {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
  color: #aaa; /* モノトーン系 */
}

.fancy-divider.sleek .line {
  flex: 1;
  height: 1px;
  background: #ccc; /* 薄めのグレーで洗練感 */
  border-radius: 0.5px;
}

.fancy-divider.sleek .material-icons {
  font-size: 16px; /* 小さめ */
}

/* ヘッダー */
header {
  text-align: center;
}

/* ナビ */
nav.main-menu {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 10px 0;
}

nav.main-menu a {
  text-decoration: none;
  color: #333;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
}

header {
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
}

.main-menu {
  display: flex;
  gap: 12px;
}

.main-menu a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}

