/* ===== 基本設定 ===== */
body {
  font-family: 'Meiryo UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: #EFEBDD;
  color: #004970;
  margin: 0;
  padding: 0;
}

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1em;
  box-sizing: border-box;
  overflow-x: auto;
}

/* ===== タイトル（バナー風） ===== */
h1 {
  font-size: 2em;
  margin: 0;
  padding: 1em 0;
  width: 100%;
  text-align: center;
  background-color: #004970;
  color: #EFEBDD;
}


#drawer-toggle {
  position: absolute;
  opacity: 0;
}

#drawer-toggle-label {
  position: fixed;
  top: 0;
  left: 0;
  height: 50px;
  width: 50px;
  z-index: 2000;
  background: transparent;
  cursor: pointer;
}
#drawer-toggle-label:before {
  content: '';
  position: absolute;
  top: 18px;
  left: 13px;
  width: 24px;
  height: 2px;
  background: #8d8d8d;
  box-shadow: 0 6px 0 #8d8d8d, 0 12px 0 #8d8d8d;
  transition: all 0.3s ease;
  z-index: 2001;
}
#drawer-toggle:checked ~ #drawer-toggle-label {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1400;
}

/* 開いてるときでも ☰ は左上に */
#drawer-toggle:checked ~ #drawer-toggle-label:before {
  left: 13px;
  top: 18px;
}

#drawer {
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: -250px;
  height: 100%;
  width: 250px;
  background: #004970;
  color: #EFEBDD;
  overflow-y: auto;
  transition: left 0.3s ease;
  padding: 60px 20px 20px;
  z-index: 1500;
}

#drawer a {
  color: #EFEBDD;
  text-decoration: none;
  display: block;
  padding: 10px 0;
}
#drawer a:hover {
  color: white;
}

#drawer-toggle:checked ~ #drawer {
  left: 0;
}

#drawer-toggle:checked ~ #page-content {
  margin-left: 250px;
  transition: margin-left 0.3s ease;
}

/* ===== セクション見出し ===== */
h2 {
  font-size: 1.2em;
  margin: 1.5em auto 1em auto;
  padding: 1em;
  background-color: #004970;
  color: #EFEBDD;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.toggle-icon {
  margin-right: 0.5em;
}
.toggle-section {
  max-width: 100%;
  width: 100%;
  margin: 0 auto 2em auto;
  box-sizing: border-box;
  padding: 0 1em; /* 余白を維持したい場合 */
}

/* ===== 基本情報の分割対応 ===== */
.basic-info-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5em;
}
.basic-info-left,
.basic-info-image {
  flex: 1 1 300px;
}

/* ===== ラベル行（整列） ===== */
.label-row {
  display: flex;
  margin-bottom: 6px;
}
.label {
  font-weight: bold;
  color: #004970;
  padding: 4px 10px;
  min-width: 9em;
  box-sizing: border-box;
  border-radius: 9999px;
  width: 15em;
  background-image: linear-gradient(90deg, rgba(187, 181, 196, 1), rgba(255, 255, 255, 0) 90%);
}
.value {
  padding-left: 0.5em;
  padding: 4px 10px;
  flex-grow: 1;
}

/* ===== 箇条書き ===== */
ul {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

/* ===== フッター ===== */
footer {
  background-color: #A59EB1;
  color: #EFEBDD;
  padding: 1em 0 1em 0;
  text-align: center;
  width: 100%;
  margin-top: 2em;
}

/* ===== リンク ===== */
a {
  color: #004970;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===== キャラ一覧テーブル用（index.html向け） ===== */
.table-container {
  width: 100%;
  overflow-x: auto;
  margin: 1em 0;
  padding: 0 1em;
  box-sizing: border-box;
}
#data-table {
  width: max-content;
  min-width: 100%; /* または必要に応じて調整 */
  border-collapse: collapse;
  margin: 0;
  background: #fff;
}
#data-table th,
#data-table td {
  padding: 0.5em 1em;
  border: 1px solid #A59EB1;
  text-align: left;
  white-space: nowrap;
}
#data-table th {
  background-color: #A59EB1;
  color: #004970;
  cursor: pointer;
}
#data-table tr:nth-child(even) {
  background-color: #f5f2ec;
}

.search-box {
  margin: 1em 0;
  text-align: center;
}
.search-box input {
  font-size: 1em;
  padding: 0.5em;
  width: 200px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* ===== イラストギャラリー ===== */
.illustration-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1em;
}
.thumbnail {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 1px solid #A59EB1;
  background: #fff;
  cursor: pointer;
  transition: transform 0.2s;
}
.thumbnail:hover {
  transform: scale(1.1);
}

/* ===== モーダル ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
}
.modal img {
  max-width: 90%;
  max-height: 90%;
  border: 5px solid white;
  background: #fff;
  border-radius: 10px;
}

/* ===== キャラ名バナー ===== */
.character-banner {
  background-color: #004970;
  color: #EFEBDD;
  padding: 1em;
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 1em;
}

.character-icon {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.character-banner h1 {
  margin: 0;
  font-size: 1.8em;
  line-height: 1.3;
}

.character-banner h1 .sub {
  font-size: 0.6em;
  display: block;
  opacity: 0.9;
}

/* ===== キャラクター表内のリンク強調 ===== */
#data-table a {
  text-decoration: underline;
}

/* ===== 50Q ===== */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
  }

  .chat-row {
    display: flex;
  }

  .chat-row.left {
    justify-content: flex-start;
  }

  .chat-row.right {
    justify-content: flex-end;
  }

  .bubble {
    max-width: 70%;
    padding: 0.8em 1.2em;
    border-radius: 1.2em;
    line-height: 1.5;
    position: relative;
    background: #f0f0f0;
    word-break: break-word;
    box-sizing: border-box;
  }

  .bubble.left {
    background-color: #e3f4e0;
    border-top-left-radius: 0;
  }

  .bubble.right {
    background-color: #eeeeee;
    border-top-right-radius: 0;
  }

  .name {
    font-weight: bold;
    display: block;
    margin-bottom: 0.2em;
  }

/* ===== レスポンシブ対応 ===== */
@media screen and (max-width: 600px) {
  h1 {
    font-size: 1.5em;
    width: 100%;
  }
  h2 {
    font-size: 1.2em;
  }
  .label {
    min-width: 6em;
    font-size: 0.95em;
  }
  .value {
    font-size: 0.95em;
  }
  .thumbnail {
    width: 50px;
    height: 50px;
  }
  .label-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .label,
  .value {
    width: 100%;
  }

  .value {
    padding-left: 5px;
  }
  #drawer-toggle:checked ~ #page-content {
    margin-left: 0;
  }
  .bubble {
    max-width: 90%;
    font-size: 1.3em;
  }
  .chat-container {
    gap: 0.3em;
  }

  .name {
    font-size: 1.05em;
  }
}

/* ===== キャラクターカード（茶系デザイン） ===== */
.character-card {
  background: #ffffff;
  border: 2px solid #A59EB1;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(165, 158, 177, 0.2);
  transition: all 0.3s ease;
  overflow: hidden;
  margin-bottom: 1em;
}

.character-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(165, 158, 177, 0.3);
  border-color: #8d8d8d;
}

.character-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f2ec, #EFEBDD);
  border-bottom: 1px solid #A59EB1;
  cursor: pointer;
  transition: background-color 0.2s;
}

.character-header:hover {
  background: linear-gradient(135deg, #EFEBDD, #e8e4d8);
}

.character-basic {
  display: flex;
  align-items: center;
  gap: 15px;
}

.character-no {
  background: linear-gradient(135deg, #004970, #2d5a7a);
  color: #EFEBDD;
  padding: 8px 15px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9em;
  box-shadow: 0 2px 8px rgba(0, 73, 112, 0.3);
}

.character-name {
  font-size: 1.3em;
  font-weight: 700;
  color: #004970;
}

.character-header .toggle-icon {
  cursor: pointer;
  font-size: 1.2em;
  color: #8d8d8d;
  transition: transform 0.3s ease;
}

.character-header:hover .toggle-icon {
  transform: scale(1.1);
}

/* キャラクター詳細 */
.character-details {
  padding: 20px;
  background: #faf8f3;
  border-top: 1px solid #A59EB1;
}

.detail-row {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
}

.field-label {
  font-weight: 600;
  color: #004970;
  font-size: 0.9em;
  background: linear-gradient(135deg, #e8e4d8, #d4cfc4);
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 200px;
  text-align: center;
  margin-right: 15px;
  flex-shrink: 0;
  border: 1px solid #A59EB1;
}

.field-value {
  font-size: 0.95em;
  color: #2d2d2d;
  font-weight: 500;
  flex: 1;
  text-align: left;
  padding: 8px 0;
}

/* ===== キャラクターカードのレスポンシブ対応 ===== */
@media screen and (max-width: 600px) {
  .character-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
  }
  
  .character-basic {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }
  
  .character-no {
    align-self: flex-start;
  }
  
  .character-name {
    font-size: 1.2em;
    word-break: break-word;
  }
  
  .character-header .toggle-icon {
    align-self: flex-end;
    margin-top: -35px;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
  }
  
  .field-label {
    min-width: auto;
    width: 100%;
    text-align: left;
    margin-right: 0;
    margin-bottom: 5px;
    box-sizing: border-box;
    word-break: break-word;
  }
  
  .field-value {
    padding-left: 0;
    word-break: break-word;
  }
}
