/* 基本スタイルのリセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'DotGothic16', sans-serif;
  letter-spacing: 0.08em; /* 8%広げる */
}

body {
  background: url('../images/haikei.png') no-repeat center center fixed;
  background-size: cover;
  font-family: "Helvetica Neue", sans-serif;
  color: #fefefe;
  line-height: 1.6;;
  font-family: 'DotGothic16', sans-serif;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: rgba(255, 255, 255, 0.8); /* うすい白背景 */
  backdrop-filter: blur(5px); /* 背景をぼかしてオシャレに */
  z-index: 1000; /* 最前面に */
  padding: 10px 0;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* 下に薄い影 */
}

.game-title {
  text-align: left;  /* 左寄せ */
}

.game-title img {
  width: auto; /* ロゴの幅。お好みで調整！ */
  height: 70px; /* 縦横比は自動で保つ */
  display: block;
  margin-left: 20px;
}

.game-title a {
  display: inline-block;
}

.tagline {
  font-size: 1.2em;
  color: #5e5e5e;
  margin-top: 10px;
}

main {
  max-width: 60%;
  margin: 7em auto 10px; /* 上90px、左右auto、下0px */
  padding: 30px 5% 15px;
  background: rgba(39, 39, 39, 0.95);
  border-style: solid;
  border-width: 5px;
  border-color: #fefefe;
  border-radius: 15px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3); /* ちょっと影を付ける */
}


section {
  margin-bottom: 40px;
}

h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  padding-bottom: 5px;
}

h2 {
  font-size: 2em;
  margin-bottom: 15px;
  border-bottom: 2px solid #ffffff;
  padding-bottom: 5px;
}

ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 20px;
}

li{
  margin-top: 5px;
}

section.rules ul {
  margin-bottom: 16px;
  font-size: 1em;
  color: #ffffff;
  list-style: none;
  padding-left: 20px;
}

section.rules li {
  margin-top: 16px;
  font-weight: bold;
  font-size: 1.2em;
  position: relative;
}

a {
  color:#00ff08;
  text-decoration: none;   /* アンダーラインなし */
}

a:visited {
  color: #00ff08;          /* 訪問後の色も同じに */
}

a:hover,
a:active {
  text-decoration: none;   /* ホバー・クリック時もアンダーラインなし */
  color: inherit;
}


/*キャラリスト*/
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #000000;
}
th, td {
  border: 2px solid #fefefe;
  padding: 10px;
  text-align: center;
}

img.icon {
  width: 60px;
  height: 60px;
  object-fit: cover;
}


/*キャラビュー　フキダシ*/

.comment-box {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
}

.comment-icon {
  width: 60px;
  height: 60px;
  border: 2px solid #aaa;
}

.bio-box {
  color:#000000;
  background-color: #f9f9f9; /* やや灰色で柔らかく */
  border: 2px solid #ccc;    /* グレーの枠線 */
  border-radius: 10px;       /* 角を丸く */
  padding: 10px 20px;        /* 内側余白 */
  font-size: 1em;          /* 少し大きな文字 */
  line-height: 1.6;          /* 行間広めで読みやすく */
  font-weight: 500;
}

.pl-comment-box {
  color:#000000;
  background-color: #f9f9f9; /* やや灰色で柔らかく */
  border: 2px solid #ccc;    /* グレーの枠線 */
  border-radius: 10px;       /* 角を丸く */
  padding: 10px 20px;        /* 内側余白 */
  margin-bottom: 20px;          /* 上に余白 */
  font-size: 1em;          /* 少し大きな文字 */
  line-height: 1.6;          /* 行間広めで読みやすく */
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
}



/*マイページ*/

.character-info {
  display: flex;
  justify-content: center;  /* 横方向中央揃え */
  align-items: center;      /* 縦方向中央揃え（必要なら） */
  flex-direction: column;   /* 子要素を縦並びに */
  margin-top: 30px;
}


.inventory {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
}

.portrait {
  text-align: center;         /* 横方向中央揃え */
  margin: 20px 0;             /* 上下に少し余白を追加 */
}

.portrait img {
  max-width: 600px;
  max-height: 600px;
  width: auto; /* 必要に応じて */
  height: auto; /* 必要に応じて */
  display: inline-block;      /* 中央揃えのためにinline-block */
  margin: 0 auto;  /* これも中央寄せの補強 */
}

.character-portrait{
max-width: 600px;
max-height: 600px;
width: auto; /* 必要に応じて */
height: auto; /* 必要に応じて */
display: inline-block;      /* 中央揃えのためにinline-block */
margin: 0 auto;  /* これも中央寄せの補強 */
}

.icon {
  width: 60px;
  height: 60px;
}

.icon-item {
  display: inline-block;
  text-align: center;
  margin: 10px;/* ここで間隔を狭める(htmlに直書きの為現在作動せず) */
  vertical-align: top;
}

.profile-icon {
  border: 2px solid #9e9e9e;       /* 枠線 */
  margin: 4px;                  /* 外側余白 */
}



form {
  margin-top: 20px;
}

input[type="text"], textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1em;
}

button {
  margin-top: 10px;
  padding: 10px 20px;
  background: #000000;
  color: white;
  border: none;
  cursor: pointer;
  border-style: solid;
  border-color: #fefefe;
  border-radius: 5px;
  font-size: 1em;
  font-family: inherit; /* body の指定を継承させる */
}

.delete-button {
  background-color: #e74c3c;  /* 赤色 */
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  margin-top: 0px;
}

.delete-button:hover {
  background-color: #c0392b;  /* 濃い赤（ホバー時） */
}


.logout {
  text-align: right;
  margin-bottom: 20px;
}


/* ハンバーガーボタン */
.menu-toggle {
  position: fixed;
  top: 3%;
  right: 3%;
  width: 60px;
  height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 3000;
}

.menu-toggle span {
  display: block;
  height: 10px;
  background: #6e6e6e;
  border-radius: 5px;
  transition: all 0.3s;
}

/* ナビゲーションメニュー */
.nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100%;
  background: #000000;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top:80px;
  padding-left: 20px;
  transition: right 0.3s;
  z-index: 2000;
  border: 10px solid #ffffff;
  overflow-y: auto;
}

.nav ul {
  list-style: none;
  text-align: left;
}

.nav ul li {
  margin: 15px 0;
}

.nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 2em;
  font-weight: bold;
}

/* メニューが開いたとき */
.nav.active {
  right: 0;
}

/* メニュー開閉時のアニメーション */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(14px, 14px);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(14px, -14px);
}

/* =========================
   レスポンシブ対応（スマホ対応）
   ========================= */
   @media (max-width: 1600px) {

    /* mainコンテンツを広げて余白調整 */
    main {
      max-width: 95%;
      padding: 20px 3%;
      margin-bottom: 20px;
    }
  
    /* ヘッダー高さ調整 */
    header {
      height: 80px;
      padding: 5px 0;
    }
  
    /* h2タイトルのフォントサイズ縮小 */
    h2 {
      font-size: 1.5em;
    }
  
    /* 全体のフォントサイズを少し小さく */
    body {
      font-size: 0.95em;
    }
  
    /* コメントアイコン・プロフィールアイコンを相対サイズに */
    .comment-icon,
    .icon {
      width: 15vw;
      max-width: 60px;
      height: auto;
    }
  
    /* 吹き出しサイズ調整 */
    .speech-bubble {
      max-width: 90%;
      font-size: 0.95em;
    }
  
    /* アイコン並び調整（スマホでは縦並び推奨の場合） */
    .inventory {
      flex-direction: column;
      gap: 15px;
    }
  
    /* 画像を画面幅に合わせる */
    .portrait img {
      max-width: 90%;
    }

    .character-portrait{
      max-width: 90%;
    }
  
    /* フッターのフォントサイズもやや小さく */
    footer {
      font-size: 0.8em;
      padding: 15px 0;
    }
  
    .menu-toggle {
      top: 2.5%;
    }

  }
  
  .speech-container {
    display: flex;
    align-items: center; /* ← 垂直方向の中央揃え */
    margin: 1.5em 0;
    background-color: #000000;
    border-style: solid;
    border-color: #fefefe;
    border-width: 3px;
    border-radius: 8px;
    padding: 12px 12px;
    max-width: 700px;
  }
  
  .speech-icon {
    width: 60px;
    height: 60px;
    margin-right: 12px;
  }
  
  .speech-bubble {
    color: #fefefe;
    font-size: 16px;
    line-height: 1.6;
 
  }


  .inventory-container {
    display: flex;
    height: 60vh;
    gap: 20px;
  }

  .item-detail {
    flex: 2;
    background: #000000;
    border: 2px solid #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
    font-size: 1.2em;
    overflow-y: auto;
  }

  .item-detail img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    border: 2px solid #fefefe;
  }

  .item-list {
    flex: 1;
    background: #000000;
    overflow-y: auto;
    max-height: 100%;
    padding: 10px;
    border: 2px solid #fefefe;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1);
  }

  .item-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #fefefe;
    border-radius: 6px;
    background-color:rgb(0, 0, 0);
    cursor: pointer;
    transition: background-color 0.2s;
  }

  .item-entry:hover {
    background-color: rgb(36, 36, 36);
  }

  .item-entry img {
    width: 40px;
    height: 40px;
    object-fit: contain;
  }

  .item-entry .info {
    flex-grow: 1;
  }

  .item-entry .name {
    font-weight: bold;
  }

  .item-entry .quantity {
    font-size: 0.9em;
    color: #fefefe;
  }

  .item-entry .short-description {
  font-size: 0.9em;
  color: #fefefe; /* 固有の色を指定して他と分離 */
  margin-top: 2px;
  line-height: 1.2em;
  }

  .filter-button{
    display: flex;
    gap: 1em;
  }

  .placeholder {
    text-align: center;
    color: #fefefe;
  }

  .rarity-2 { color: rgb(85, 255, 85); }
  .rarity-3 { color: rgb(43, 230, 255); }
  .rarity-4 { color: rgb(255, 76, 53); }
  .rarity-5 {color: rgb(255, 235, 53);}

  @media (max-width: 768px) {
  .inventory-container {
    flex-direction: column;
    height: 100vh;
  }
  
  .item-detail,
  .item-list {
    width: 100%;
  }
}

.filter-container input,
.filter-container select {
  margin-right: 0.5em;
  padding: 0.1em;
  font-size: 1em;
  max-width: 300px;
}

.ap-display {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff0000;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
}

.user-status-panel {
  position: fixed;
  bottom: 0.5em;
  left: 0.5em;
  background-color: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 0.8em 1em;
  border-style: solid;
  border-width: 5px;
  border-color: #fefefe;
  border-radius: 10px;
  font-family: "DotGothic16", sans-serif;
  font-size: 0.9em;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.);
  z-index: 1000;
  min-width: 220px;

  display: flex;
  align-items: center;  /* 縦中央揃え */
  gap: 0.8em;           /* アイコンとテキストの間隔 */
}

.user-status-panel img {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

.user-status-texts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3em;
}

.user-status-panel.hidden {
  display: none;
}


.map-container {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  aspect-ratio: 1 / 2;
}

.map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 2; /* 800x1600の比率 */
}

.map-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  border: 4px solid #fefefe;
}

.map-icon {
  position: absolute;
  width: 40%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease;
}

.map-icon:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: bold;
  font-size: clamp(1.5em, 2.5vw, 2em);
  text-shadow: 2px 2px #000;
  z-index: 3;
  pointer-events: none;
}

.progress-display {
  max-width: 800px;
  margin: 0 auto 1em auto;
  background: #000000;
  border: 4px solid #fefefe;
  padding: 1em;
  border-radius: 8px;
}

/* モーダル全体のオーバーレイ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* モーダルの中身 */
.modal-content {
  background: rgb(0, 0, 0);
  padding: 1.5em;
  border: 4px solid #fefefe;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  font-size: 1rem;
}

.modal-button {
  display: block;
  margin: 3px auto; /* 中央揃えに必要な指定 */
}

.item-result {
  margin-bottom: 1.5em;
  padding: 1em;
  border: 4px solid #fefefe;
  border-radius: 8px;
  background-color: #000000;
}

.rarity-uncommon {
  border-color: rgb(85, 255, 85); 
}

.rarity-rare {
  border-color: rgb(43, 230, 255);
}

.rarity-legendary {
  border-color: rgb(255, 76, 53);
}

.rarity-shop {
  border-color: rgb(255, 235, 53);
}

.item-result > p:first-child {
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 0.5em;
  color: #fefefe;
}

.item-result-content {
  display: flex;
  align-items: flex-start;
}

.item-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin-right: 1em;
  flex-shrink: 0;
}

.item-info {
  flex: 1;
}

.item-info strong {
  display: block;
  font-size: 1.1em;
  margin-bottom: 0.3em;
  color: #fefefe;
}

.item-info p {
  margin: 0;
  color: #fefefe;
  font-size: 0.95em;
}

 /* ページ送り */
.pagination {
  margin: 20px 0;
  text-align: center;
}
    
.pagination a,.pagination span.current {
  display: inline-block;
  padding: 6px 12px;
  margin: 0 3px;
  border: 3px solid #fefefe;
  text-decoration: none;
  color: #ffffff;
  border-radius: 4px;
  background-color: #000000
}
    
.pagination span.current {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.pagination-form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
    
.form-left,.form-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
    
.pagination-limit-form {
  float: right;
}

.shop-item-header {
  display: flex;
  align-items: center;
  gap: 10px; /* アイコンと名前の間の余白 */
}

.shop-item-image {
    width: 60px;   /* 横幅を100pxに固定 */
    height: 60px;  /* 縦幅も100pxに固定 */
    object-fit: contain; /* 縦横比を崩さず収める */
    margin-bottom: 8px;
}

.shop-item-name {
  margin: 0;
  border-bottom: none;
}

/* Chrome, Safari, Edge */
::-webkit-scrollbar {
  display: none;
}

.story-content {
  display: none; /* ← これで最初は閉じておく */
  margin: 0;
}

.story-entry{
  max-width: 800px;
  min-height: 100px;
  margin: 20px;
  padding: 10px;
  background: rgba(0, 0, 0);
  border-style: solid;
  border-width: 5px;
  border-color: #fefefe;
  border-radius: 15px;
}

.story-title{
  font-size: 1.5em;
  text-align: center;
}

.story-dialogue {
  display: flex;
    align-items: center; /* ← 垂直方向の中央揃え */
    margin: 1em 0;
    background-color: #000000;
    border-style: solid;
    border-color: #fefefe;
    border-width: 3px;
    border-radius: 8px;
    padding: 10px 10px;
    max-width: 700px;
}

.dialogue-icon {
  width: 60px;
  height: 60px;
  margin-right: 10px;
}

.dialogue-text {
  background: #000000;
  border-radius: 12px;
  padding: 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  max-width: 80%;
}

.story-narration {
  font-style: italic;
  margin: 10px 0;
  color: #fefefe;
}

  .identified-item {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 8px;
    margin: 10px auto 10px;
    border: 4px solid #fefefe;
    border-radius: 6px;
    background-color:rgb(0, 0, 0);
    max-width: 600px;
  }

  .identified-item img {
    width: 60px;
    height: 60px;
    margin: 5px;
    object-fit: contain;
  }

  .dice-roll {
    color: #00ff08;  /* 好きな色に変更 */
    font-weight: bold;
}

.chat-image {
    max-width: 800px;    /* 最大幅 */
    max-height: 600px;   /* 最大高さ */
    width: auto;         /* 横幅自動調整 */
    height: auto;        /* 高さ自動調整 */
    display: block;      /* ブロック要素化 */
    margin: 5px auto;    /* 上下5px、左右自動で中央揃え */
}

@media (max-width: 1600px) {
.chat-image {
    max-width: 80%;    /* 最大幅 */
    max-height: 600px;   /* 最大高さ */
    width: auto;         /* 横幅自動調整 */
    height: auto;        /* 高さ自動調整 */
    display: block;      /* ブロック要素化 */
    margin: 5px auto;    /* 上下5px、左右自動で中央揃え */
}
}

.send-button {
  background-color: #1aa81f;
  display: block;      /* ボタンを横幅いっぱいのブロック要素に */
  margin-left: auto;
  padding:10px 30px 10px;
}

.S-button{
  padding: 5px 10px;
  font-size: 0.9em;
}

.chat-button-group {
    display: flex;              /* 横並び */
    justify-content: space-between; /* 左グループと右ボタンを両端に配置 */
    align-items: center;        /* 縦位置を揃える */
    gap: 8px;                   /* ボタン間の余白 */
}

/* アイテム使用ログ用 */
.item-use-log {
    background-color: #fff8e1;
    border-left: 4px solid #ff9900;
}

.item-use-text {
    font-weight: bold;
}

.main-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2em;
  margin: 2em 0;
}
.main-menu a {
  display: inline-block;
  padding: 1em 2em;
  background: #000000;
  color: #fff;
  font-weight: bold;
  border: 4px solid #fefefe;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
}
.main-menu a:hover {
  background: #414141;
}

.notice-box {
  max-width: 600px;
  margin: 2em auto;
  padding: 1.5em;
  border: 4px solid #ffffff;
  border-radius: 10px;
  background: #000000;
}
.notice-box h2 {
  margin-top: 0;
  font-weight: bold;
  font-size: 1.2em;
  text-align: center;
}
.notice-list {
  height: 18em;
  overflow-y: auto;
}
.notice-title{
  font-size:1.2em;
  font-weight: bold;
}
.notice-date{
  font-size:0.8em;
}
.notice-entry {
  margin: 0.5em 0;
  padding: 0.5em;
  border-bottom: 1px solid #ddd;
}
.notice-entry:last-child {
  border-bottom: none;
}

.shop-button.disabled {
    font-weight: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.google-form{
  margin-left: 20px;
  font-weight: bold;
  font-size: 1.2em;
}

.status-link{
  font-size: 1.5em;
  margin-top: 10px;
}