* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: #f4f4f4;
  color: #333;
  min-height: 100vh;
}

/* ヘッダー */
.header {
  background: #4a90d9;
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.header h1 {
  font-size: 1.2em;
  font-weight: bold;
}

/* 合言葉画面 */
#auth-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 52px);
  padding: 20px;
}
.auth-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: center;
}
.auth-box .hint {
  font-size: 1.1em;
  margin-bottom: 20px;
  color: #555;
  line-height: 1.6;
}
.auth-box input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 1.1em;
  border: 2px solid #ddd;
  border-radius: 8px;
  text-align: center;
  outline: none;
}
.auth-box input[type="text"]:focus {
  border-color: #4a90d9;
}
.auth-box .auth-btn {
  margin-top: 16px;
  padding: 12px 40px;
  font-size: 1.05em;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.auth-box .auth-btn:hover {
  background: #3a7bc8;
}
.auth-box .auth-error {
  color: #e74c3c;
  margin-top: 12px;
  display: none;
  font-size: 0.95em;
}

/* メイン画面 */
#main-screen {
  display: none;
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

/* 投稿フォーム */
.post-form {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.post-form h2 {
  font-size: 1em;
  color: #4a90d9;
  margin-bottom: 12px;
}
.post-form .form-row {
  margin-bottom: 12px;
}
.post-form label {
  display: block;
  font-size: 0.85em;
  color: #777;
  margin-bottom: 4px;
}
.post-form input[type="text"] {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
}
.post-form input[type="text"]:focus {
  border-color: #4a90d9;
}
.post-form textarea {
  width: 100%;
  padding: 10px;
  font-size: 1em;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}
.post-form textarea:focus {
  border-color: #4a90d9;
}
.post-form .submit-btn {
  padding: 10px 32px;
  font-size: 1em;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.post-form .submit-btn:hover {
  background: #3a7bc8;
}
.post-form .submit-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}
.post-status {
  margin-top: 8px;
  font-size: 0.9em;
  color: #27ae60;
  display: none;
}

/* メッセージ一覧 */
.messages-section h2 {
  font-size: 1em;
  color: #4a90d9;
  margin-bottom: 12px;
}
.message-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}
.message-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.message-card .name {
  font-weight: bold;
  color: #4a90d9;
  font-size: 0.95em;
}
.message-card .time {
  font-size: 0.8em;
  color: #999;
}
.message-card .body {
  font-size: 0.95em;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.no-messages {
  text-align: center;
  color: #999;
  padding: 40px 0;
}
.loading {
  text-align: center;
  color: #999;
  padding: 40px 0;
}
.refresh-btn {
  display: block;
  margin: 0 auto 20px;
  padding: 8px 24px;
  font-size: 0.9em;
  background: #fff;
  color: #4a90d9;
  border: 1px solid #4a90d9;
  border-radius: 6px;
  cursor: pointer;
}
.refresh-btn:hover {
  background: #f0f6ff;
}
