/* ゲーム全体のスタイル */
body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
}

/* ゲームコンテナ */
#game-container {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: black;
}

/* 背景 */
#background {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 1s ease;
}

/* キャラクター表示領域 */
#characters {
  position: absolute;
  width: 100%;
  height: 60%;  /* 70%から60%に調整 */
  bottom: 20%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.character {
  height: auto;  /* 固定高さから自動調整に変更 */
  max-height: 80%;  /* 90%から80%に調整 */
  width: auto;
  max-width: 300px;  /* 最大幅を指定 */
  position: absolute;
  bottom: 0;
  transition: opacity 0.5s, transform 0.5s;
}

.character.left {
  left: 10%;
  transform: translateX(-50%);
}

.character.center {
  left: 50%;
  transform: translateX(-50%);
}

.character.right {
  right: 10%;
  transform: translateX(50%);
}

/* ダイアログボックス */
#dialog-box {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 25%;  /* 20%から25%に拡大 */
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;  /* スクロール可能に */
}

#character-name {
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 5px;  /* 10pxから5pxに縮小 */
  color: #4fc3f7;
}

#dialog-text {
  font-size: 1em;  /* 1.1emから1emに調整 */
  line-height: 1.4;  /* 1.5から1.4に調整 */
  margin-bottom: 5px;  /* 10pxから5pxに縮小 */
  min-height: 40px;  /* 60pxから40pxに縮小 */
}

#next-button {
  position: absolute;
  right: 20px;
  bottom: 10px;  /* 20pxから10pxに調整 */
  cursor: pointer;
  font-size: 20px;  /* 24pxから20pxに縮小 */
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* 選択肢 */
#choices {
  display: flex;
  flex-direction: column;
  gap: 8px;  /* 10pxから8pxに縮小 */
  margin-top: 5px;  /* 10pxから5pxに縮小 */
  max-height: 70%;  /* ダイアログボックス内での最大高さ */
  overflow-y: auto;  /* スクロール可能に */
}

.choice {
  background-color: rgba(79, 195, 247, 0.3);
  border: 1px solid #4fc3f7;
  padding: 6px 10px;  /* 8px 15pxから6px 10pxに縮小 */
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 0.95em;  /* フォントサイズを少し小さく */
}

.choice:hover {
  background-color: rgba(79, 195, 247, 0.6);
}

/* スタート画面 */
#start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0c2340 0%, #2c5282 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 100;
}

#start-screen h1 {
  font-size: 2.5em;  /* 3emから2.5emに調整 */
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.7);
  text-align: center;  /* テキスト中央揃え */
  padding: 0 15px;  /* 左右に余白 */
}

#start-screen h2 {
  font-size: 1.3em;  /* 1.5emから1.3emに調整 */
  margin-bottom: 40px;
  text-shadow: 0 0 5px rgba(79, 195, 247, 0.7);
  text-align: center;  /* テキスト中央揃え */
  padding: 0 15px;  /* 左右に余白 */
}

#start-button, #pv-button {
  background-color: #ff9800;
  border: none;
  color: white;
  padding: 12px 25px;  /* 15px 30pxから12px 25pxに縮小 */
  font-size: 1.1em;  /* 1.2emから1.1emに調整 */
  border-radius: 30px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  margin: 5px;
}

#start-button:hover, #pv-button:hover {
  background-color: #f57c00;
  transform: scale(1.05);
}

#pv-button {
  background-color: #3f51b5;
  margin-top: 10px;
}

#pv-button:hover {
  background-color: #5c6bc0;
}

/* レスポンシブ対応 - 小さな画面用 */
@media (max-height: 700px) {
  .character {
    max-height: 70%;  /* さらに高さを調整 */
  }
  
  #dialog-box {
    height: 30%;  /* ダイアログボックスを拡大 */
  }
  
  #dialog-text {
    font-size: 0.95em;  /* フォントサイズをさらに小さく */
    line-height: 1.3;
  }
  
  .choice {
    padding: 5px 8px;
    font-size: 0.9em;
  }
}

/* 横向き用調整 */
@media (max-width: 768px) {
  #characters {
    height: 50%;  /* キャラ表示エリアをさらに縮小 */
  }
  
  .character {
    max-width: 200px;  /* 幅を制限 */
  }
}

/* キャラクターの配置調整 */
.character[data-position="left"] {
  left: 15%;
  transform: translateX(-25%);
}

.character[data-position="center"] {
  left: 50%;
  transform: translateX(-50%);
}

.character[data-position="right"] {
  right: 15%;
  transform: translateX(25%);
}
