:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #16181d;
  --text-muted: #5b6270;
  --border: #e3e5ea;
  --accent: #2f6fed;
  --accent-contrast: #ffffff;
  --success: #1a9e5c;
  --error: #d1453b;
  --shadow: 0 1px 2px rgba(16, 20, 27, 0.04), 0 8px 24px rgba(16, 20, 27, 0.06);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

.picker {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px;
  text-align: center;
}

.picker h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.subtitle {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  text-align: left;
}

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease;
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(47, 111, 237, 0.15);
  outline: none;
}

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

.card-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.card-name {
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
}

.state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 32px;
  text-align: center;
}

.state h2 {
  margin: 0 0 8px;
}

.state p {
  margin: 0;
  color: var(--text-muted);
}

.state-error h2 {
  color: var(--error);
}

.state-success .success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.retry-button {
  margin-top: 20px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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