/* ベース設定 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Kiwi Maru", serif;
  display: flex;
  flex-direction: column;
}

body {
  background-image: url("img/forest.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* ヘッダー */
header {
  height: 100px;
  background-image: url("img/wood.jpg");
  background-size: cover;
  background-position: center;
  color: #F1C580;
  text-align: center;
  line-height: 100px;
  font-size: 150%;
}

/* コンテナ */
#your_container {
    min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 70%;
  margin: 0 auto;
  padding: 8px 30px;
  box-sizing: border-box;
  background:
    url("img/wood3.jpg") left center / cover no-repeat,
    url("img/wood3.jpg") right center / cover no-repeat,
    url("img/wood3.jpg") top center / cover no-repeat,
    url("img/wood3.jpg") bottom center / cover no-repeat;
  background-color: transparent;
}

/* チャット全体 */
#bms_messages_container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: auto; /* ← fixed height は消す */
  min-height: 0; /* ← flex内のoverflow対応 */
  /*background:
    url("img/wood3.jpg") left center / cover no-repeat,
    url("img/wood3.jpg") right center / cover no-repeat;*/
  background-color: transparent;
}

/* チャットヘッダー */
#bms_chat_header {
  background-color:transparent;
  background-size: cover;
  background-position: center;
  padding: 6px;
  font-size: 16px;
  height: 34px;
  border: none;
}

#bms_chat_user_status { float: left; }
#bms_status_icon { float: left; line-height: 2em; }
#bms_chat_user_name { float: left; line-height: 2em; padding-left: 8px; }

/* チャットエリア */
#bms_messages {
min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid #C49F65;
  border-left: 1px solid #C49F65;
  background-image: url("img/cork.jpg");
  background-size: cover;
  background-position: center;
  box-sizing: border-box;
  box-shadow:
    inset 10px 0 20px rgba(0, 0, 0, 0.2),
    inset -10px 0 20px rgba(0, 0, 0, 0.2),
    inset 0 10px 20px rgba(0, 0, 0, 0.1),
    inset 0 -10px 20px rgba(0, 0, 0, 0.2);
}
.bms_message_box {
  margin-top: 20px;
  max-width: 80%;
  display: inline-block;
  font-size: 16px;
  padding: 12px 18px; /* 吹き出し内の余白追加 */
  word-break: break-word;
}

.bms_left {
  float: left;
  clear: both;
}

.bms_right {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  clear: both;
}

.bms_left .bms_message_box {
  color: #D3B382;
  background: #592C00;
  border: 2px solid #D3B382;
  border-radius: 30px 30px 30px 0px;
  margin-right: 50px;
}

.bms_right .bms_message_box {
  color: #592C00;
  background: #D3B382;
  border: 2px solid #592C00;
  border-radius: 30px 30px 0px 30px;
  text-align: left;
}

.bms_clear { clear: both; }

.donguri_inline {
  color: #ffe2a8;
  font-weight: bold;
  text-decoration: underline;
}

.donate {
  color: #ffe2a8;
  text-decoration: underline;
}

#bms_send {
  background-image: url("img/wood2.jpg");
  background-size: cover;
  background-position: center;
  border: none;
  display: flex;
  align-items: center;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

#bms_send_message {
  width: calc(100% - 75px);
  height: 48px;
  padding: 14px 6px 0px 6px;
  border: 1px solid #592C00;
  border-radius: 20px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2) inset;
  background-color: #D3B382;
  color: #592C00;
  font-size: 15px;
  box-sizing: border-box;
}

#bms_send_btn {
  position: relative;
  width: 60px;
  height: 60px;
  margin-left: 8px;
  background-image: url("img/donguri.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  cursor: pointer;
  padding: 0;
}

#bms_send_btn .send-text {
  position: absolute;
  bottom: 5px;
  right: 5px;
  color: #3F2C1B;
  font-size: 12px;
  pointer-events: none;
}

#bms_send_btn:hover { transform: scale(1.1); }

#footer_links {
  background-image: url("img/wood.jpg");
  background-size: cover;
  background-position: center;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  color: #F1C580;
}

#footer_links a {
  color: #F1C580;
  text-decoration: none;
  margin: 0 10px;
}

#footer_links a:hover { text-decoration: underline; }

#footer_links button {
  background: none;
  border: none;
  color: #F1C580;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

#footer_links button:hover {
  text-decoration: underline;
}

#header_links a {
  color: #F1C580;
  text-decoration: none;
  margin: 0 10px;
}

#money a{
  color:#ECD2A9;
text-decoration: none;


}
#money a:hover { text-decoration: underline; }


/*.bms_typing::after {
  content: '';
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1s steps(3, end) infinite;
}

@keyframes dots {
  0%   { content: '・'; }
  33%  { content: '・・'; }
  66%  { content: '・・・'; }
  100% { content: '・'; }
}*/



@media screen and (max-width: 768px) {
  html, body {
    height: 100vh;
    overflow: hidden;
  }

  #your_container {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
  }

  #bms_messages_container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #bms_messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    height: auto;
  }

  #bms_send {
    display: flex;
    padding: 6px;
    background-color: #f5f5f5;
    border-top: 1px solid #ccc;

  }

  #bms_send_message {
    flex: 1;
    height: 40px;
    padding: 8px;
    font-size: 16px;
    border-radius: 12px;
  }

  #bms_send_btn {
    width: 48px;
    height: 40px;
    margin-left: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }

  .send-text {
    font-size: 10px;
  }

  .bms_message_box {
    padding: 12px 16px;
    font-size: 15px;
    max-width: 85%;
  }

  .bms_left {
    float: left;
    clear: both;
  }

  .bms_right {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    clear: both;
  }

  .bms_left .bms_message_box {
    color: #D3B382;
    background: #592C00;
    border: 2px solid #D3B382;
    border-radius: 30px 30px 30px 0px;
    margin-right: 30px;
  }

  .bms_right .bms_message_box {
    color: #592C00;
    background: #D3B382;
    border: 2px solid #592C00;
    border-radius: 30px 30px 0px 30px;
    text-align: left;
  }
}


.pwa-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #c49f65;
  border-top: 1px solid #592c00;
  display: flex;
  justify-content: space-around;
  padding: 10px;
  font-size: 0.9em;
  z-index: 999;
}

.pwa-footer a,
.pwa-footer button {
  flex: 1;
  text-align: center;
  margin: 0 5px;
}


/* style.css に追加 */

.pwa #bms_send {
  margin-bottom: 70px; /* フッターの高さに応じて調整 */
}
