* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

.app {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
}

/* ヘッダー */
header {
  background: #2c3e50;
  color: white;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.summary {
  font-size: 0.85rem;
  opacity: 0.85;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 6px 12px;
  display: inline-block;
}

/* 追加フォーム */
.add-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.add-section h2 {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 10px;
}

.add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.add-form input {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.add-form input:focus {
  border-color: #2c3e50;
}

.add-form button {
  padding: 10px 18px;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.add-form button:hover {
  background: #3d5166;
}

/* フィルターボタン */
.filter-section {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 14px;
  border: 1.5px solid #ccc;
  border-radius: 20px;
  background: white;
  font-size: 0.85rem;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: #2c3e50;
  color: #2c3e50;
}

.filter-btn.active {
  background: #2c3e50;
  border-color: #2c3e50;
  color: white;
}

/* 部屋一覧 */
.rooms-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* 部屋カード */
.room-card {
  background: white;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-left: 5px solid #ccc;
  transition: transform 0.1s, box-shadow 0.1s;
  cursor: pointer;
  user-select: none;
}

.room-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}

.room-card:active {
  transform: scale(0.98);
}

/* ステータス別カラー */
.room-card.未清掃 {
  border-left-color: #aaa;
  background: #fafafa;
}

.room-card.清掃中 {
  border-left-color: #f0a500;
  background: #fffbf0;
}

.room-card.完了 {
  border-left-color: #27ae60;
  background: #f0fff5;
}

.room-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.room-memo {
  font-size: 0.78rem;
  color: #888;
  margin-bottom: 10px;
  min-height: 16px;
  word-break: break-all;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.未清掃 .status-badge {
  background: #e8e8e8;
  color: #666;
}

.清掃中 .status-badge {
  background: #fde8a0;
  color: #b07800;
}

.完了 .status-badge {
  background: #b8f0cc;
  color: #1a7a40;
}

.tap-hint {
  font-size: 0.72rem;
  color: #bbb;
}

.delete-btn {
  float: right;
  background: none;
  border: none;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin-top: -2px;
}

.delete-btn:hover {
  color: #e74c3c;
}

/* 空メッセージ */
.empty-msg {
  text-align: center;
  color: #aaa;
  padding: 40px 0;
  font-size: 0.95rem;
}

@media (max-width: 375px) {
  .rooms-section {
    grid-template-columns: 1fr 1fr;
  }
}
