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

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

header {
  background: #e8734a;
  color: #fff;
  padding: 16px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

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

/* 登録フォーム */
.register-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.register-section h2,
.cards-section h2 {
  font-size: 1rem;
  color: #e8734a;
  margin-bottom: 12px;
  font-weight: 700;
}

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

.register-form input[type="text"] {
  flex: 1 1 160px;
  padding: 10px 12px;
  border: 2px solid #e0d5cb;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.register-form input[type="text"]:focus {
  border-color: #e8734a;
}

.register-form input[type="number"] {
  width: 100px;
  padding: 10px 8px;
  border: 2px solid #e0d5cb;
  border-radius: 8px;
  font-size: 0.95rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

.register-form input[type="number"]:focus {
  border-color: #e8734a;
}

.register-form button {
  padding: 10px 20px;
  background: #e8734a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.register-form button:hover {
  background: #d45f38;
}

/* 顧客一覧 */
.cards-section {
  margin-bottom: 16px;
}

.customer-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.empty-msg {
  color: #aaa;
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0;
  grid-column: 1 / -1;
}

/* 顧客カード */
.customer-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 2px solid #ffe5d5;
  transition: transform 0.1s;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #333;
}

.card-count {
  font-size: 0.8rem;
  color: #aaa;
}

.card-count span {
  color: #e8734a;
  font-weight: 700;
}

/* スタンプグリッド */
.stamp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.stamp {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: #f0e8e0;
  transition: transform 0.15s, background 0.15s;
}

.stamp.filled {
  background: #e8734a;
  animation: stampPop 0.2s ease;
}

@keyframes stampPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 達成バー */
.progress-bar {
  height: 6px;
  background: #f0e8e0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: #e8734a;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* カードアクション */
.card-actions {
  display: flex;
  gap: 8px;
}

.btn-stamp {
  flex: 1;
  padding: 10px;
  background: #e8734a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn-stamp:hover {
  background: #d45f38;
}

.btn-stamp:active {
  transform: scale(0.97);
}

.btn-stamp:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-delete {
  padding: 10px 12px;
  background: #f5f5f5;
  color: #999;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-delete:hover {
  background: #ffe0e0;
  color: #e55;
}

/* 達成済みカード */
.customer-card.achieved {
  border-color: #ffd700;
  background: #fffbea;
}

.customer-card.achieved .btn-stamp {
  background: #ffd700;
  color: #333;
}

/* モーダル */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.modal-stamp {
  font-size: 3rem;
  margin-bottom: 12px;
}

.modal-content h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: #333;
}

.modal-content p {
  color: #888;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 8px;
}

.btn-reset {
  flex: 1;
  padding: 12px;
  background: #e8734a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-close {
  flex: 1;
  padding: 12px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

/* レスポンシブ */
@media (max-width: 400px) {
  .register-form input[type="text"] {
    flex: 1 1 100%;
  }
  .register-form input[type="number"] {
    width: 80px;
  }
  .stamp {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
}
