/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.link-card {
  display: block;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  max-width: 400px;

}

.link-card img {
  width: 120px;
  object-fit: cover;
}

.link-card div {
  padding: 8px;
  white-space: pre-line;
}
.card-body {
  display: flex;

}

/* メッセージ入力欄 */
.sendtext {
    width: 40%;
    height: 4.5em;                 /* 3行風 */
    display: block;
    margin: 10px auto;

    padding: 10px 14px;
    font-size: 16px;
    line-height: 1.5;

    border: 1px solid #ccc;
    border-radius: 12px;
    outline: none;

    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

/* フォーカス時 */
.sendtext:focus {
    border-color: #06c755;
    box-shadow: 0 0 0 2px rgba(6,199,85,0.2);
}
.message {
    display: flex;
    align-items: flex-start;
    margin: 10px;
}

.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.message-body {
    max-width: 70%;
}

.username {
    font-size: 12px;
    color: #666;
}

.content {
    background: #f1f1f1;
    border-radius: 12px;
    padding: 8px 12px;
    margin-top: 4px;
}
.message {
  display: flex;
  align-items: flex-start;
  margin: 8px 0;
}

/* 相手 */
.message:not(.self) {
  justify-content: flex-start;
}

/* 自分 */
.message.self {
  justify-content: flex-end;
}

/* アイコン */
.user-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 8px;
}

/* 自分はアイコン非表示 */
.message.self .user-icon {
  display: none;
}

/* 吹き出し */
.message-body {
  max-width: 65%;
  padding: 10px 14px;
  border-radius: 16px;
}

/* 自分の吹き出し */
.message.self .message-body {
  border-bottom-right-radius: 4px;
}

/* 相手 */
.message:not(.self) .message-body {
  border-bottom-left-radius: 4px;
}
.chat-image {
  max-width: 200px;
  border-radius: 12px;
  cursor: pointer;
}
/* 画像拡大用モーダル */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

.image-modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: white;
  cursor: pointer;
}
#chat {
    height: 500px; /* 適切な高さに */
    overflow-y: auto;
}

/* ポップオーバー（popover） */
.user-popover {
  position: fixed;
  width:240px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  padding: 12px;
  z-index: 1000;
}

.user-popover img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-bottom: 8px;
}

.pop-name {
  font-weight: bold;
}

.pop-id {
  font-size: 12px;
  color: #666;
}

.hidden {
  display: none;
}
.user-popover.admin {
  border: 2px solid gold;
}
.user-popover {
  position: absolute;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  width: 260px;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  font-size: 14px;
  z-index: 1000;
}

.user-popover.hidden {
  display: none;
}

/* 上段：写真＋ボタン */
.pop-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

#popAvatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ボタンエリア */
.pop-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;

}

.pop-actions button {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #6afaff;
  cursor: pointer;

}

.pop-actions button:hover {
  background: #eee;
  color: #84f88d;
}
/*絵文字ピッカー*/
.emoji-picker {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 1000;
}

.hidden {
  display: none;
}

.emoji-picker span {
  cursor: pointer;
  font-size: 20px;
  margin: 2px;
}
.subinput {
  width: 100%;
  height: 2.5em;
  display: flex;              /* ← 超重要 */
  justify-content: center;    /* 横中央 */
  align-items: center;        /* 縦中央 */
  gap: 8px;                   /* ボタン間隔 */
}
.emoji-wrapper {
  position: relative;
}

#emojiPicker {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #ccc;
  padding: 6px;
  border-radius: 8px;
  white-space: nowrap;
}
/*フレンド申請済*/
.user-icon.friend {
  border: 3.5px solid #fa5584; /* 緑 */
  border-radius: 50%;         /* 丸いアイコンなら丸く */
}
.user-icon.friend {
  position: relative;
}
.user-icon.friend::after {
  content: "✔";
  position: absolute;
  right: -2px;
  bottom: -2px;
  background: #4caf50;
  color: white;
  font-size: 10px;
  border-radius: 50%;
  padding: 2px;
}
.dm-notice {
  background: #ffe9c7;
  border: 1px solid #f0b35a;
  padding: 8px 14px;
  border-radius: 10px;
  margin: 8px auto;        /* ← 左右中央 */
  width: fit-content;      /* 中身に合わせる */
  max-width: 90%;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}
.sendtext_mention {
  border: 2px solid #4CAF50;
  border-radius: 8px;
  padding: 8px;
  min-height: 40px;
  outline: none;
  background: #fff;
}

/* メンション部分 */
#msgView {
  border: 1px solid #ccc;
  padding: 8px;
  min-height: 40px;
}

.mention {
  color: #e53935;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 4px;
}
/*メッセージメンション*/
.replying {
  background-color: #e9c1ce;
  border-radius: 8px;
}
.mention-box {
    position: absolute;       /* 親に対して浮く */
    top: 0;                   /* JSで位置調整 */
    left: 0;                  /* JSで位置調整 */
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;            /* 他の要素より前面に */
    padding: 4px 0;
    width: 120px;
    max-height: 150px;
    overflow-y: auto;
    display: none;            /* 初期は非表示 */
}

.mention-box div {
    padding: 6px 10px;
    cursor: pointer;
}

.mention-box div:hover {
    background-color: #f0f0f0;
}

.imgbtn {
  font-size: 36px;        /* 少し大きめ */
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.imgbtn:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

.imgbtn:active {
  transform: scale(1.05);
}
#emojiBtn {
  font-size: 36px;        /* imgbtn と揃える */
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

#emojiBtn:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

#emojiBtn:active {
  transform: scale(1.05);
}
.imgbtn,
#emojiBtn {
  border-radius: 50%;
}

.imgbtn:hover,
#emojiBtn:hover {
  background: rgba(0,0,0,0.05);
}
.emojikouho {
  font-size: 26px;        /* 候補はボタンより少し大きく */
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease;
  border-radius: 6px;
}

.emojikouho:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.2);
}

.emojikouho:active {
  transform: scale(1.1);
}
/*ルームセレクト*/
.room-select-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
}

.room-select-wrapper label {
  font-size: 13px;
  color: #555;
}


#biko1 {
  white-space: pre-line;
}

.hero-overlay {
   /* position: absolute; */
  inset: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
}
.hero-overlay h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  color: hsl(26, 30%, 22%);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.room-select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 8px 36px 8px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;

  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'>\
<path d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='2'/>\
</svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.room-select-wrapper select:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74,144,226,0.2);
} 
