@font-face {
  font-family: 'YDWaosagiR'; 
  src: url('fonts/YDWaosagi.otf') format('opentype');
}

body {
  background: #f5f5f5;
  background-image: url("./img/background02.png");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative; /* ← 擬似要素を重ねるため */
  z-index: 0; /* ← 子要素より後ろに */
}
body::before {
  content: "";
  position: fixed; /* スクロールしても背景に追従 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85); /* 半透明の白 */
  z-index: -1; /* ← 背景より下に配置 */
}

body {
  font-family: "YDWaosagiR",sans-serif;
  margin: 0;
  padding: 0;
}

/* ヘッダー */
.header {
  background: #58a0a9;
  padding: 1em;
  text-align: center;
  white-space: nowrap;
}

.header ul {
  font-size: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 1.5em;
}

.header a {
  color: white;
  text-decoration: none;
}

/* キャラクターページ */
.character-page {
  display: flex;
  justify-content: center; /* 横方向の中央寄せ */
  gap: 2em; /* キャラ画像と説明文の間隔 */
  flex-wrap: wrap; /* 小さい画面で折り返し可能に */
  padding: 200px; /* 上下に余白 */

  max-width: 1000px;
  margin: 50px auto;
  padding: 30px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.portrait img {
  width: auto;
  max-height: 700px;
}

.description img {
  margin-top: 30px;
  max-width: 500px;
  height: auto;
}

.profile-text {
  max-width: 560px;
  margin-top: 30px;
  color: #474747;
  font-size: 18px;
  line-height: 1.45;
  text-align: left;
}

.profile-text p {
  margin: 0 0 0.65em;
}

.profile-text dl {
  margin: 0;
}

.profile-text div {
  display: flex;
  gap: 0.35em;
  margin: 0.28em 0;
}

.profile-text dt {
  flex: 0 0 auto;
}

.profile-text dd {
  margin: 0;
  min-width: 0;
}

/* ポーズ切り替えボタン1 */
.pose-buttons {
  margin-top: 1em;
}

.pose-buttons button {
  margin: 0.3em;
  padding: 0.4em 0.8em;
  background: #555;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.pose-buttons button.active {
  background: #ff7f50;
}

/* ポーズ切り替えボタン2 */
.pose-buttons2 {
  margin-top: 1em;
}

.pose-buttons2 button {
  margin: 0.3em;
  padding: 0.4em 0.8em;
  background: #555;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.pose-buttons2 button.active {
  background: #20b2aa;
}

/* 音声再生ボタン1 */
.voice-samples button {
  margin: 0.5em;
  padding: 0.5em 1em;
  background: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.voice-samples button:hover {
  background: #666;
}

.voice-samples button.playing {
  background: #ff7f50;
}

/* 音声再生ボタン2 */
.voice-samples2 button {
  margin: 0.5em;
  padding: 0.5em 1em;
  background: #444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.voice-samples2 button:hover {
  background: #666;
}

.voice-samples2 button.playing {
  background: #20b2aa;
}

/* 埋め込み */

.contents {
 
  font-size: 30px;
  color: #474747;

  max-width: 730px;
  margin: 130px auto;
  padding: 20px;
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.haihudouga {
  margin-top: 20px;
}

.contents iframe {
  margin: 35px;
}


/* タグ誘導 */

.tag img{
  margin-bottom: -65px;
  width: auto;
  max-height: 280px;
}

.mini img{
  width: auto;
  max-height: 450px;
}


/* 4コマ */
.illust {

  margin: 100px;
}

.illust img {
  width: auto;
  max-height: 850px;
}

/* フッター */
footer {
    text-align: center;
    padding: 10px;
    background-color: #ddd;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

.header {
  white-space: normal;
}

.header ul {
  flex-wrap: wrap;
  gap: 0.6em 1.5em;
}

.header a {
  display: inline-block;
  padding: 0.2em 0;
}

.character-page {
  align-items: flex-start;
  width: min(1000px, calc(100% - 32px));
}

.portrait img {
  width: min(100%, 360px);
  object-fit: contain;
}

.info {
  flex: 1 1 320px;
  min-width: 0;
}

.contents {
  width: min(730px, calc(100% - 32px));
}

.contents iframe,
.contents object,
.contents embed {
  display: block;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 35px auto;
}

.illust {
  width: min(900px, calc(100% - 32px));
  margin-right: auto;
  margin-left: auto;
}

@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  .header {
    padding: 0.75em;
  }

  .header ul {
    font-size: 16px;
    gap: 0.5em 1em;
  }

  .character-page {
    width: min(620px, calc(100% - 24px));
    gap: 1em;
    margin: 28px auto;
    padding: 18px;
    border-radius: 14px;
  }

  .portrait,
  .info {
    flex-basis: 100%;
    text-align: center;
  }

  .portrait img {
    width: auto;
    max-width: 100%;
    max-height: 68vh;
  }

  .info font[size="7"] {
    font-size: 32px;
  }

  .profile-text {
    max-width: 100%;
    font-size: 16px;
    line-height: 1.45;
    text-align: left;
  }

  .profile-text div {
    display: block;
    margin: 0.45em 0;
  }

  .profile-text dt,
  .profile-text dd {
    display: inline;
  }

  .voice-samples,
  .voice-samples2,
  .pose-buttons,
  .pose-buttons2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5em;
  }

  .voice-samples br,
  .voice-samples2 br {
    display: none;
  }

  .voice-samples button,
  .voice-samples2 button,
  .pose-buttons button,
  .pose-buttons2 button {
    margin: 0;
  }

  .contents {
    font-size: 22px;
    margin: 48px auto;
    padding: 16px;
  }

  .contents iframe {
    margin: 20px auto;
  }

  .tag img {
    max-height: 180px;
    margin-bottom: -38px;
  }

  .mini img {
    max-height: 300px;
  }

  .illust {
    margin-top: 48px;
    margin-bottom: 48px;
  }
}

@media (max-width: 480px) {
  .header ul {
    font-size: 14px;
  }

  .character-page {
    width: calc(100% - 16px);
    padding: 12px;
  }

  .info font[size="7"] {
    font-size: 26px;
  }

  .contents {
    width: calc(100% - 16px);
    font-size: 18px;
    border-radius: 12px;
  }
}
