/* デバッグ用 */
.session-clear-btn {
    background: #ddd;
    color: white;
    border: none;
    padding: 0.3em 0.6em;
    margin-left: 10px;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: background 0.3s;
}

.session-clear-btn:hover {
    background: #333;
}

/* デバッグ用ここまで */
html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, sans-serif;
    background: #f9f9f9;
    color: #333;
}

/* 共通レイアウト */
.chat-container,
.chat-room {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ==== トークリスト画面 ==== */
.user-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5em 1em;
    background: #333;
    color: white;
    border-bottom: 1px solid #ddd;
}

.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 0.75em;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    background: #fdfdfd;
}

/* .chat-item {
    display: flex;
    align-items: center;
    padding: 0.75em;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-item:hover {
    background: #f3f3f3;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-right: 0.75em;
}

.name {
    font-size: 1rem;
    font-weight: 500;
} */


.chat-item {
    position: relative;
    height: 80px;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    padding-left: 100px;
    /* ← ここだけでOK */
    font-family: "Noto Sans JP", "Helvetica Neue", sans-serif;
    color: white;
    font-weight: bold;
    /* text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8); */
}

/* 背景ぼかしを加えるオーバーレイ */
.chat-item::before {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(7px);
    /* ←ここでぼかし */
    background-color: rgba(255, 255, 255, 0.3);
    /* ←暗くする */
    z-index: 0;
}

.chat-item .avatar {
    position: absolute;
    left: 10px;
    z-index: 1;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin-right: 0.75em;
    object-fit: cover;
    border: 2px solid white;
}

.chat-item .name {
    z-index: 1;
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item .badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #FF6F91;
    color: white;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 50%;
    z-index: 1;
}

@keyframes moveToTop {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-item.move-up {
    animation: moveToTop 0.3s ease-out;
}


/* ==== チャットルーム画面 ==== */
.chat-header {
    display: flex;
    align-items: center;
    padding: 0.75em;
    background: #333;
    color: white;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.back-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    margin-right: 0.5em;
    color: white;
    cursor: pointer;
}

.chat-header .avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-right: 0.75em;
}

.chat-header .info .name {
    font-weight: 600;
    font-size: 1rem;
}

.chat-header .info .status {
    font-size: 0.75rem;
    color: #777;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1em;
    background: #f5f5f5;
}

.message {
    max-width: 70%;
    padding: 0.6em 1em;
    border-radius: 16px;
    margin-bottom: 0.5em;
    line-height: 1.4;
}

.message.me {
    background: #008ec8;
    color: white;
    margin-left: auto;
}

.message.other {
    background: #ffffff;
    color: #333;
    margin-right: auto;
}

.chat-input {
    display: flex;
    padding: 0.5em;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    padding: 0.6em;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
}

.chat-input button {
    margin-left: 0.5em;
    padding: 0 1em;
    border: none;
    border-radius: 20px;
    background: #FF6F91;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
}

.floating-back-button {
    position: fixed;
    bottom: 80px;
    /* 送信欄より少し上に調整 */
    right: 10px;
    padding: 12px 16px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    transition: background-color 0.3s;
}

.floating-back-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.scenario-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
}

.scenario-option-button {
  border: none;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  background: #f0f0f0;
}

.scenario-option-button:hover {
  opacity: 0.8;
}

.message.other.typing-indicator {
    opacity: 0.7;
    font-size: 0.9em;
}

.typing-dot {
    display: inline-block;
    margin-right: 2px;
    animation: typingBlink 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBlink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}


.status-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.status {
  font-size: 0.75rem;
  color: #8f8f8f;
}

.wifi-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
}

.wifi-toggle.online {
  opacity: 1;
}

.wifi-toggle.offline {
  opacity: 0.3;
}

/* 一覧ヘッダをオフライン時ちょっとだけ強調したい場合 */
.user-section.offline .status {
  color: #c44;
}
