* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

body {
  background-color: #f0f2f5;
  color: #333;
  padding: 16px;
  padding-bottom: 80px;
}

.screen {
  display: none;
  max-width: 800px;
  margin: 0 auto;
}

.screen.active {
  display: block;
}

.hidden {
  display: none !important;
}

h1, h2, h3 {
  margin-bottom: 12px;
  text-align: center;
}

.card {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.input-group, .setting-item {
  margin-bottom: 12px;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 4px;
}

input[type="text"], select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

button {
  padding: 8px 16px;
  border: none;
  background-color: #007bff;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

button:hover {
  background-color: #0056b3;
}

.primary-btn {
  width: 100%;
  padding: 12px;
  font-size: 18px;
  background-color: #28a745;
}

.primary-btn:hover {
  background-color: #218838;
}

.warning-btn {
  background-color: #dc3545;
}

.warning-btn:hover {
  background-color: #c82333;
}

/* タイトル画面・ロビーのグリッド (横3列) */
.member-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

/* ゲーム画面のプレイヤー一覧 (スマホ: 1列 / PC: 3列) */
.member-grid-responsive {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 600px) {
  .member-grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
}

.member-card {
  background: #fff;
  border: 2px solid #ddd;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  position: relative;
}

.member-card.speaking {
  border-color: #28a745;
  box-shadow: 0 0 8px rgba(40, 167, 69, 0.6);
}

.member-card.voted {
  background-color: #e2e3e5;
}

.member-card .badge {
  display: inline-block;
  font-size: 12px;
  padding: 2px 6px;
  background: #6c757d;
  color: #fff;
  border-radius: 4px;
  margin-top: 4px;
}

.host-controls {
  margin-top: 8px;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.host-controls button {
  font-size: 10px;
  padding: 4px 6px;
}

/* お題・タイマー表示 */
.topic-card, .timer-card {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.topic-label, .timer-label {
  font-size: 14px;
  color: #666;
}

.topic-value {
  font-size: 24px;
  font-weight: bold;
  color: #d9534f;
  white-space: pre-wrap;
}

.timer-value {
  font-size: 32px;
  font-weight: bold;
  font-family: monospace;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 40px;
  font-size: 20px;
}

/* フローティング チャット */
.chat-fab {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 100;
}

.chat-window {
  position: fixed;
  bottom: 80px;
  right: 16px;
  width: 300px;
  height: 400px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 100;
}

.chat-header {
  background: #007bff;
  color: #fff;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.chat-messages {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  font-size: 14px;
}

.chat-message-item {
  margin-bottom: 6px;
}

.chat-message-item .sender {
  font-weight: bold;
  font-size: 12px;
  color: #555;
}

.chat-input-area {
  display: flex;
  padding: 8px;
  border-top: 1px solid #eee;
}

.chat-input-area input {
  flex: 1;
  margin-right: 4px;
}

/* 右下コントロールエリア (マイク切替 ＋ チャット) */
.floating-controls {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.control-fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 18px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-on {
  background-color: #28a745;
}

.mic-on:hover {
  background-color: #218838;
}

.mic-off {
  background-color: #dc3545;
}

.mic-off:hover {
  background-color: #c82333;
}