:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --accent: #ec4899;
  --danger: #ef4444;
  --success: #22c55e;
}

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* コンテナ共通 */
#app, #lobby-ui, #quiz-ui {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
  text-align: center;
}

h1, h2 {
  margin-top: 0;
  color: var(--primary);
  letter-spacing: -0.025em;
}

/* ボタン */
button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  width: 100%;
  margin: 0.5rem 0;
}

button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

#copy-url-btn {
  background-color: var(--text-light);
  font-size: 0.8rem;
  padding: 0.5rem;
}

/* 入力欄 */
input[type="text"], input[type="number"] {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-sizing: border-box;
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

/* 参加者リスト */
.user-list {
  background: #f1f5f9;
  border-radius: 0.75rem;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: left;
}

.user-list h3 {
  margin-top: 0;
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}

ul#user-list-ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

ul#user-list-ul li {
  padding: 0.5rem;
  background: white;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid var(--primary);
}

/* ホスト設定エリア */
#host-controls {
  border: 2px dashed var(--primary);
  padding: 1rem;
  border-radius: 0.75rem;
  margin-top: 1.5rem;
  background: #f5f3ff;
}

#host-controls label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  font-weight: bold;
  margin-top: 0.5rem;
}

/* ユーティリティ */
.hidden {
  display: none !important;
}

#room-url-display {
  display: block;
  background: #eee;
  padding: 0.5rem;
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-text {
  font-size: 1.5rem;
  line-height: 1.6;
  min-height: 150px;
  background: #f8fafc;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid var(--primary);
}

#buzz-btn {
  background-color: var(--accent);
  height: 80px;
  font-size: 1.5rem;
}

/* AI生成中のぐるぐるアニメーション */
.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 通知トースト */
.quiz-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  z-index: 1000;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { top: -50px; opacity: 0; }
  to { top: 20px; opacity: 1; }
}

.fade-out {
  opacity: 0;
  transition: opacity 0.5s;
}

#answer-input-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

#answer-input {
  width: 100%;
  height: 120px; /* 大きく！ */
  font-size: 2rem;
  text-align: center;
  border: 4px solid var(--primary);
  border-radius: 15px;
  background-color: #fff;
}

#timer-display {
  font-size: 1.5rem;
  color: #e11d48; /* 赤系 */
  font-weight: bold;
}

/* モーダルの簡易スタイル */
#result-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
}
.modal-content {
  background: white; padding: 30px; border-radius: 20px; text-align: center;
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.btn-buzz {
  background-color: #ef4444; /* 情熱の赤 */
  box-shadow: 0 6px 0 #b91c1c;
  border-radius: 50px;
  color: white;
  padding: 20px;
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: all 0.1s;
}

.btn-buzz:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b91c1c;
}

.score-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: bold;
}