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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#app {
  width: 100%;
  max-width: 400px;
}

/* Loading */
.loading {
  text-align: center;
  color: white;
  padding: 2rem;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error */
.error {
  text-align: center;
  color: white;
  padding: 2rem;
}

.error button {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: #764ba2;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

/* Card Container */
.card-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Card */
.card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: white;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-info h1 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 0.25rem;
}

.card-info .title {
  color: #666;
  font-size: 0.95rem;
}

/* Stats */
.card-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

.stat {
  text-align: center;
}

.stat span:first-child {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
}

.stat-label {
  font-size: 0.85rem;
  color: #999;
}

/* Share Button */
.share-btn {
  width: 100%;
  padding: 1rem;
  background: #06C755;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.share-btn:hover {
  background: #05a648;
}

.share-btn:active {
  transform: scale(0.98);
}

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

/* User ID Display */
.user-id-display {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  word-break: break-all;
}

/* Card Expiry */
.card-expiry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 0.9rem;
}

.expiry-icon {
  font-size: 1rem;
}

.expiry-text {
  color: #666;
}

.expiry-text.expiry-normal {
  color: #06C755;
}

.expiry-text.expiry-warning {
  color: #FF9800;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 360px) {
  .card {
    padding: 1.5rem;
  }

  .avatar {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .card-info h1 {
    font-size: 1.25rem;
  }
}
