/* リセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  padding: 16px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

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

/* ローディング */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: white;
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

/* ヘッダー */
.header {
  background: white;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.header h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #667eea;
}

.user-name {
  font-size: 14px;
  color: #666;
}

/* カード */
.card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 16px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
  border-bottom: 2px solid #667eea;
  padding-bottom: 8px;
}

/* バーコード */
.barcode-container {
  text-align: center;
  padding: 20px 0;
}

#barcode {
  max-width: 100%;
  height: auto;
  margin-bottom: 12px;
}

.member-number {
  font-size: 14px;
  color: #666;
  font-weight: bold;
}

/* ポイント */
.points-display {
  text-align: center;
  padding: 32px 0;
}

.points-value {
  font-size: 56px;
  font-weight: bold;
  color: #667eea;
  line-height: 1;
}

.points-label {
  font-size: 16px;
  color: #666;
  margin-top: 8px;
}

.membership-level {
  text-align: center;
  margin: 16px 0;
}

.badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  background: linear-gradient(135deg, #cd7f32 0%, #b8732c 100%);
  color: white;
}

.badge.silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
}

.badge.gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
}

/* ボタン */
.refresh-btn, .retry-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:active, .retry-btn:active {
  transform: scale(0.98);
}

.refresh-btn:hover, .retry-btn:hover {
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* エラー */
.error-message {
  background: white;
  padding: 40px 24px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.error-message p {
  margin-bottom: 16px;
  color: #d32f2f;
}

#error-text {
  font-size: 14px;
  color: #666;
}

/* デバッグ */
.debug-section {
  margin-top: 32px;
}

.debug-section details {
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  border-radius: 8px;
  font-size: 12px;
}

.debug-section summary {
  cursor: pointer;
  font-weight: bold;
  margin-bottom: 8px;
  color: #667eea;
}

#debug-info {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #333;
}
