* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP",
    sans-serif;
  background-color: #fafafa;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

nav .brand-logo {
  color: #2196f3 !important;
  font-weight: bold;
}

main {
  padding-bottom: 80px;
}

/* コンテナ - モバイルで余白0 */
.container-fluid {
  width: 100%;
  padding: 0;
  margin: 0;
}

@media only screen and (min-width: 601px) {
  .container-fluid {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
  }
}

/* ビュー切替 */
.view-section {
  min-height: calc(100vh - 200px);
}

/* 連絡先リスト */
.collection {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.collection-item.host-header {
  border-left: 1px solid #333 !important;
}

/* ニックネームとコード部分 */
/* 名前表示に最適な黒色（高可読性のニュートラルブラック） */
.nickname {
  color: #111111;
  letter-spacing: 0.02em;
}

/* アイコンスタイル */
.delete-guest-icon {
  cursor: pointer;
  color: #757575;
  transition: color 0.2s;
}

.delete-guest-icon:hover {
  color: #e53935;
}

.collection-item .material-icons {
  cursor: pointer;
  color: #757575;
}

.collection-item .material-icons:hover {
  color: #f44336;
}

.guest-list {
  margin-top: 2rem;
}

/* チャット画面 */
.chat-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 64px;
  z-index: 100;
  background-color: white;
}

#chat-title {
  font-size: 1.2rem;
  font-weight: bold;
}

.messages-wrapper {
  padding: 1rem;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.message.own {
  align-items: flex-end;
}

.message.other {
  align-items: flex-start;
}

.message-bubble {
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  max-width: 70%;
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message.own .message-bubble {
  background-color: #bbdefb;
  border-bottom-right-radius: 0.25rem;
}

.message.other .message-bubble {
  background-color: #eeeeee;
  border-bottom-left-radius: 0.25rem;
}

.message-time {
  font-size: 0.75rem;
  color: #9e9e9e;
  margin-top: 0.25rem;
}

.chat-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  display: flex;
  justify-content: center;
  border-top: 1px solid #e0e0e0;
  background-color: white;
  z-index: 100;
}

/* フッターアクションボタン */
.footer-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-top: 1px solid #e0e0e0;
  padding: 0.5rem 0;
  z-index: 999;
}

.action-buttons {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
}

.action-buttons .btn-flat {
  margin: 0;
  padding: 0 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.action-buttons .btn-flat i.material-icons {
  font-size: 1.5rem;
  color: #757575;
}

.action-buttons .btn-flat:hover i.material-icons {
  color: #2196f3;
}

@media only screen and (max-width: 600px) {
  .action-buttons .btn-flat {
    padding: 0 0.25rem;
  }

  .action-buttons .btn-flat i.material-icons {
    font-size: 1.3rem;
  }
}

/* コード表示 - システムモノスペースフォント優先 */
.code-display {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo,
    Monaco, "Courier New", monospace;
  font-size: 4rem;
  font-weight: 900;
  color: #2196f3;
  letter-spacing: 1rem;
  margin: 2rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

/* モーダルのメッセージボタン */
.modal .btn-large {
  margin-bottom: 0.5rem;
  width: 100%;
  text-align: left;
  padding-left: 1rem;
}

/* トースト */
.toast {
  background-color: #323232;
}

/* レスポンシブ */
@media only screen and (max-width: 600px) {
  .message-bubble {
    max-width: 85%;
  }

  .code-display {
    font-size: 2.5rem;
    letter-spacing: 0.5rem;
  }
}

/* ▼ ドロップダウン全体：マテリアル3調 */
.dropdown-content {
  min-width: 220px;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  padding: 0.25rem 0;
  animation: fadeInScale 0.15s ease-out;
  backdrop-filter: blur(8px);
}

/* ▼ メニュー項目ベース */
.dropdown-content li {
  list-style: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* ▼ 各リンク */
.dropdown-content li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.75rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.87);
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* ▼ アイコン */
.dropdown-content li > a > i {
  font-size: 1.4rem;
  color: #5f6368;
  transition: color 0.2s ease;
}

/* ▼ ホバー時：淡いグレー＋アイコンの色変化 */
.dropdown-content li:hover > a {
  background-color: rgba(32, 33, 36, 0.06);
}

.dropdown-content li:hover > a > i {
  color: #1a73e8;
}

/* ▼ アクティブ時：押し込み感 */
.dropdown-content li:active > a {
  background-color: rgba(26, 115, 232, 0.1);
}

/* ▼ 区切り線 */
.dropdown-content li.divider {
  height: 1px;
  margin: 0.4rem 0;
  background-color: rgba(0, 0, 0, 0.08);
}

/* ▼ モバイル対応 */
@media only screen and (max-width: 600px) {
  .dropdown-content {
    min-width: 180px;
  }
  .dropdown-content li > a {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }
  .dropdown-content li > a > i {
    font-size: 1.2rem;
  }
}

/* ▼ 開くときのアニメーション */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* public/css/style.css または適切なCSSファイル */

/* 連絡先アイテムの長押しメニュー対策 */
.contact-item {
  /* ブラウザのデフォルト長押しメニューを無効化 */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE/Edge */
  user-select: none; /* 標準 */

  /* タップハイライトを無効化 */
  -webkit-tap-highlight-color: transparent;

  /* トランジション追加（視覚フィードバック用） */
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

/* 長押しメニュー */
.long-press-menu {
  /* 選択を無効化 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.long-press-menu .menu-item:active {
  background-color: #f5f5f5;
}
