html, body {
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
}

body {
    font-family: 'Noto Serif JP', serif;
    margin: 0;
    padding: 0;
    background-color: #f4f2f8;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

body::-webkit-scrollbar, html::-webkit-scrollbar {
    display: none;
}

.site-banner {
  background: linear-gradient(135deg, #dcd6f7, #e7e9f9, #f0f1f6);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  color: #111;
  font-size: 1rem;
  height: 6%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;      
  justify-content: center; 
  align-items: center;
  text-align: center; 
}

header {
    background-color: transparent;
    color: black;
    height: 35%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width:90%;
    margin: 0 auto;
    box-sizing: border-box;
    padding-top: 6%;
}

h1 {
  width: 100%;              
  text-align: center;     
  font-size: 2.0rem;
  font-weight: 600;      
  margin: 0 0 10px 0;     
  box-sizing: border-box;
}

h4 {
  width: 100%;              
  text-align: right;     
  font-size: 0.8rem;
  font-weight: 400;      
  margin: 0 0 0px 0;     
  box-sizing: border-box;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 80%;
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
}

.container {
  width: 100%;  
}

#characters-list-container {
  width: 100%;      
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 20px 40px;
  box-sizing: border-box;
  align-items: center;
  padding-bottom: 20px;
}

.index-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

.index-title {
  font-size: 1.2rem;
  font-weight: 700;
  width: 100%;
  border-bottom: 1.3px solid black;
  padding-top: 18px;
  padding-bottom: 2px;
  margin-bottom: 10px;
  text-align: left;
}

.character-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  justify-content: flex-start;
}

.character {
  flex: 0 0 calc((100% - 4 * 10px) / 5);
  box-sizing: border-box;
  padding: 0.5px;
  cursor: default;
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  transition: all 0.3s ease;
}

.character:hover {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  background-color: #f4f2f8;
}

footer {
  background: #f9f9f9; 
  color: #444;
  font-size: 0.8rem;
  font-family: 'Noto Serif JP', serif;
  font-weight: 300; 
  height: 5%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: none;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.08); /* 影で自然に区切る */
}

footer .footer-inner {
  opacity: 0.8;
}

a {
    color: inherit;  /* 親要素の色を継承 */
    text-decoration: none;  /* 下線を消す */
}

@media (max-width: 768px) {

#index {
  width: 100%;
}

.index-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

.index-title {
  font-size: 1.2rem;
  font-weight: 700;
  width: 100%;
  border-bottom: 1.3px solid black;
  padding-top: 18px;
  padding-bottom: 2px;
  margin-bottom: 10px;
  text-align: center;
}
  .character-row {
    flex-direction: column;  /* 縦並びに */
    align-items: center;     /* 子要素を中央寄せ */
    gap: 8px;
  }

  .character {
    margin: 0 auto;         /* 左右の余白を自動に */
    text-align: center;     /* テキストも中央 */
    font-size: 1rem;
    width: fit-content;     /* 必要なら幅を内容に合わせる */
  }
}