/* ===== ベースレイアウト ===== */
#braves-wrap {
  display: flex;
  min-height: 100vh;
  font-family: 'Noto Serif JP', serif;
  background-color: #ECC576;
  background-image: url(https://gigaplus.makeshop.jp/shinobiya/ver2024/asset/images/braves/bg-brave.jpg);
  background-repeat: no-repeat;
}

/* ===== 左ペイン ===== */
#braves-left {
  width: 40%;
  position: relative;
}

#braves-left-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
}

#braves-title {
  color: #fff;
  font-size: clamp(2rem, 6vw, 6.2rem);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 2rem;
  text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.05em;
}

/* ===== タブ ===== */
#braves-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.braves-tab {
  border-radius: 999px;
  padding: 0.45rem 1.3rem;
  border: none;
  cursor: pointer;
  font-size: 1.26rem;
  font-weight: 600;
  color: #fff;
  background: rgb(109 82 20 / 25%);
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.05em;
}

.braves-tab:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* タブごとのアクティブ色 */
.braves-tab[data-tab="warlord"].active {
  background: #d4601a;
}

.braves-tab[data-tab="bakumatsu"].active {
  background: #3a72b0;
}

.braves-tab[data-tab="swordmaster"].active {
  background: #b8990a;
}

.braves-tab[data-tab="swordsmith"].active {
  background: #7c4fa0;
}

#brave-Notice {
background-color: #fff;
  margin-block: 1rem;
  border-radius: 6px;
  padding: 0.64rem;
  opacity: 0.94;
  font-size: 0.8rem;
  color: #696363;
  font-family: 'Noto Sans JP';
  font-weight: 600;
}

/* ===== 右ペイン ===== */
#braves-right {
  width: 60%;
  overflow-y: auto;
}

/* ===== リスト ===== */
#braves-list {
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* ===== リスト行 ===== */
.braves-row {
  background: #fdf6e8;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(100, 70, 20, 0.12);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s;
  overflow: hidden;
}

.braves-row.visible {
  opacity: 0.93;
  transform: translateY(0);
}

.braves-row:hover {
  box-shadow: 0 4px 14px rgba(100, 70, 20, 0.22);
}

/* 行ヘッダー（アバター＋テキスト＋アイコン） */
.braves-row>img.braves-row-avatar,
.braves-row>.braves-row-body,
.braves-row>i {
  /* flex子要素はliに直接置く */
}

/* liをflexにするが、アコーディオンは下に折り返す */
.braves-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.braves-row-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(160, 120, 60, 0.3);
}

.braves-row-body {
  flex: 1;
  min-width: 0;
}

.braves-row-name {
  font-size: 2rem;
  font-weight: 600;
  color: #2a1a00;
  letter-spacing: 0.03em;
}

.braves-row-years {
  font-size: 0.8rem;
  font-weight: 900;
  color: #8a6a30;
  margin-top: -8px;
  margin-left: 2px;
}

.braves-row-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.braves-kw {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(139, 37, 0, 0.08);
  border: 1px solid rgba(139, 37, 0, 0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: #6a3a10;
  font-weight: 500;
}

/* アイコン */
.braves-row .chevron-icon,
.braves-row .search-icon {
  font-size: 1.1rem;
  color: #8a6a30;
  flex-shrink: 0;
}

/* ===== アコーディオン ===== */
.braves-accordion {
  display: none;
  width: 100%;
  flex-basis: 100%;
  padding: 0 0.25rem;
}

.braves-accordion.open {
  display: block;
  border-top: 1px solid rgba(160, 120, 60, 0.2);
  margin-top: 0.25rem;
  padding-top: 1rem;
}

/* 商品ボタン */
.braves-search-btn {
  border: 1px solid #8b2500;
  text-align: center;
  display: block;
  /* width: fit-content; */
  margin: 0 auto 1.25rem;
  padding: 0.55rem 2rem;
  background: #ffcfbd;
  color: #fff;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}

.braves-search-btn:hover {
  background: #a83000;
  color: #fff;
}

/* セクション */
.braves-section {
  margin: 1rem 0;
}

.braves-section>h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #8b2500;
  border-left: 3px solid #8b2500;
  padding-left: 0.5rem;
  margin-block: 2rem;
  letter-spacing: 0.06em;
}

/* キーワードタグ */
.braves-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.braves-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid #b8960a;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #5a3a00;
  text-decoration: none;
  background: #fff9e8;
  transition: background 0.15s;
}

.braves-tag:hover {
  background: #fff0c0;
  color: #3a1a00;
}

/* 年表 */
.braves-timeline {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 1rem;
  margin: 0;
}

.braves-timeline dt {
  font-size: 0.8rem;
  font-weight: 700;
  color: #6a4a10;
  white-space: nowrap;
  padding-top: 2px;
}

.braves-timeline dd {
  font-size: 0.85rem;
  color: #3a2a00;
  margin: 0;
  line-height: 1.7;
  border-bottom: 1px dotted rgba(160, 120, 60, 0.25);
  padding-bottom: 0.25rem;
}

/* ゆかりの地 */
.braves-locations {
  font-size: 1rem;
  color: #1a5a9a;
  text-decoration: none;
}

.braves-locations li {
  font-size: 1rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted rgba(160, 120, 60, 0.25);
}

.braves-locations a {
  color: #1a5a9a;
  text-decoration: none;
}

.braves-locations a:hover {
  text-decoration: underline;
}

/* 名前の遍歴/別名（アコーディオン内） */
.braves-name-history {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.braves-name-history li {
  font-size: 0.85rem;
  color: #5a3a00;
  background: rgba(160,120,60,0.1);
  border: 1px solid rgba(160,120,60,0.3);
  padding: 0.2rem 0.8rem;
  border-radius: 4px;
}

/* 名前遍歴 */
.braves-aliases {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.braves-aliases li {
  font-size: 0.85rem;
  color: #3a2a00;
  background: rgba(160, 120, 60, 0.08);
  padding: 0.2rem 0.7rem;
  border-radius: 4px;
}

/* エピソード */
.braves-episode {
  margin-bottom: 1rem;
}

.braves-episode h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #3a2a00;
  margin-block: 2rem;
  line-height: 1.4;
}

.braves-episode p {
  font-size: 1rem;
  color: #444;
  line-height: 1.8;
  margin: 0 0 0.4rem;
}

/* 閉じるボタン */
.braves-close-btn {
  display: block;
  margin: 1rem auto 0.5rem;
  background: none;
  border: 1px solid #b0906a;
  border-radius: 999px;
  padding: 0.35rem 1.5rem;
  font-size: 0.82rem;
  color: #7a5030;
  cursor: pointer;
  transition: background 0.15s;
}

.braves-close-btn:hover {
  background: rgba(160, 120, 60, 0.1);
}

/* ===== ローディング ===== */
#braves-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
}

.braves-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(139, 37, 0, 0.2);
  border-top-color: #8b2500;
  border-radius: 50%;
  animation: braves-spin 0.8s linear infinite;
}

@keyframes braves-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== スマホ ===== */
@media (max-width: 767px) {
  #braves-wrap {
    flex-direction: column;
    margin: 0;
  }

  .braves-tab {
    font-size: 0.7rem;
  }

  #braves-left {
    width: 100%;
  }

  #braves-left-inner {
    position: static;
    height: auto;
    padding: 1.5rem;
  }

  #braves-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #fff;
  }

  #braves-title br {
    display: none;
  }

  #braves-right {
    width: 100%;
  }

  .braves-row-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2a1a00;
    letter-spacing: 0.03em;
  }

  .braves-row-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(160, 120, 60, 0.3);
  }
}