* {
  box-sizing: border-box;
}


body {
  margin: 0;
  background: #05040A;
  color: white;
  font-family: sans-serif;
}

/* --- レイアウト --- */
.layout {
  display: flex;
  height: 100vh;
}

/* --- サイドバー --- */
.sidebar {
  position: fixed;
  /* 画面に固定 */
  top: 0;
  /* 上端に固定 */
  left: 0;
  /* 左端に固定 */
  width: 220px;
  height: 100vh;
  /* 画面の高さいっぱい */
  background: #0D0A21;
  padding: 20px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 20px;

  overflow-y: auto;
  /* サイドバー内が長くてもスクロール可能 */
}

/* メニュー全体 */
.menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

/* 各ボタン */
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 14px;
  border-radius: 12px;

  text-decoration: none;
  color: white;

  transition: 0.2s ease;
}

/* 画像サイズ */
.menu-item img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

/* ホバー時 */
.menu-item:hover {
  background-color: #5752EC;
}

/* サイドバーロゴ全体 */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  /* 下線消す */
}

/* ロゴ画像サイズ */
.logo img {
  width: 45px;
  /* ←ここで大きさ調整 */
  height: 45px;
}

/* LUNABASE文字 */
.logo span {
  font-size: 20px;
  font-weight: bold;

  /* シルバーグラデーション */
  background: linear-gradient(135deg,
      #f5f5f5 0%,
      #d6d6d6 30%,
      #a8b0b8 50%,
      #eaeaea 70%,
      #c2c8cf 100%);

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  background-clip: text;
  color: transparent;
}

.menu-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #ccc;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.menu-btn.active {
  color: white;
  background: #222;
}

/* --- メインエリア --- */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 20px;
  overflow-y: auto;
  background-color: #05040A;
}

/* --- キャラクターグリッド --- */
.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  /* キャラカード間の余白 */
  justify-content: flex-start;
  padding-left: 10px;
  /* 左右余白 */
  padding-right: 10px;
  align-items: stretch; /* 同じ行の高さを揃える */
}

/* --- キャラカード --- */
.character-card {
  width: 120px;
  flex-shrink: 0;
  margin: 10px;
  text-align: center;
  position: relative;
  text-decoration: none;
  color: white;
  display: flex;           /* 追加 */
  flex-direction: column;  /* 追加 */
}

.character-img-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* 星背景 */
.five-star {
  background: #9D632E;
}

.four-star {
  background: #78649C;
}

.character-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

/* 元素アイコン */
.element-icon {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
}

/* キャラ名 */
.character-name {
  text-align: center;
  padding: 8px 4px;
  margin: 0;          /* 追加 */
  font-size: 14px;
  line-height: 1.2;   /* 追加 */
  background: white;
  color: black;
  border-radius: 0 0 8px 8px;
}

/* フィルターのボタンを横並びに */
#filters {
  display: flex;
  /* 横並び */
  flex-wrap: wrap;
  /* 画面が狭いときは折り返す */
  gap: 8px;
  /* ボタン間の隙間を少し広げる */
  margin-bottom: 20px;
  /* 下に余白 */
  align-items: center;
  /* ボタンを縦方向中央揃え */
  padding-left: 20px;
  /* 左に余白を追加 */
}

.filter-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background-color: #111;
  /* 透明ではなく暗めの背景 */
  cursor: pointer;
  padding: 4px;
  /* 画像とボタン端の隙間 */
  border-radius: 6px;
  /* 角丸で違和感なく */
  transition: all 0.15s ease-in-out;
}

.filter-btn img {
  width: 40px;
  height: 40px;
  display: block;
}

.filter-btn.active {
  background-color: #333;
  /* 選択中は少し明るめ */
}

.filter-btn.active img {
  outline: 2px solid #ffffff;
  border-radius: 5px;
  transform: scale(1.15);
}

