:root {
  --pokedex-red: #cc0000;
  --pokedex-red-dark: #a10000;
  --pokedex-cream: #f5f5f0;
  --card-bg: #ffffff;
  --border: #ddd;
  --text: #222;
  --muted: #888;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, sans-serif;
  background: var(--pokedex-cream);
  color: var(--text);
}

.topbar {
  background: var(--pokedex-red);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 1.4rem; flex: 1; }
.admin-link {
  color: white;
  text-decoration: none;
  background: rgba(0,0,0,0.15);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.admin-link:hover { background: rgba(0,0,0,0.3); }

.progress { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.progress-bar { width: 160px; height: 10px; background: rgba(255,255,255,0.3); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: #ffd23f; }

.filters {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  flex-wrap: wrap;
  background: white;
  border-bottom: 1px solid var(--border);
}
.filters input, .filters select, .filters button {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.filters button { background: var(--pokedex-red); color: white; border: none; cursor: pointer; }
.filters button:hover { background: var(--pokedex-red-dark); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.empty-state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 2rem; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s ease;
}
.card.owned { border-color: #2e9e4e; }
.card.missing { opacity: 0.75; }
.card:hover { transform: translateY(-2px); }

.dex-number { font-size: 0.75rem; color: var(--muted); font-weight: 600; align-self: flex-start; }
.card img { width: 100%; max-width: 120px; height: 120px; object-fit: contain; }
.card img.placeholder { filter: grayscale(1) brightness(0.9); opacity: 0.6; }
.card-name { font-weight: 600; font-size: 0.95rem; }
.card-types { display: flex; gap: 0.3rem; flex-wrap: wrap; justify-content: center; }
.type {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #eee;
  color: #333;
  text-transform: uppercase;
}
.card-note { font-size: 0.75rem; color: var(--muted); font-style: italic; }

.admin-card { gap: 0.5rem; }
.admin-card input[type="file"], .admin-card input[type="text"] { width: 100%; font-size: 0.8rem; padding: 0.3rem; }
.admin-card button {
  width: 100%;
  padding: 0.4rem;
  background: var(--pokedex-red);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.admin-card button:hover { background: var(--pokedex-red-dark); }
.owned-toggle { font-size: 0.85rem; display: flex; align-items: center; gap: 0.3rem; }

.login-page { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-form {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 280px;
}
.login-form input { padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; }
.login-form button { padding: 0.6rem; background: var(--pokedex-red); color: white; border: none; border-radius: 6px; cursor: pointer; }
.login-form .error { color: var(--pokedex-red); font-size: 0.85rem; }
.login-form a { font-size: 0.85rem; color: var(--muted); text-align: center; text-decoration: none; }

.flash { margin: 0.8rem 1.5rem; padding: 0.6rem 1rem; border-radius: 6px; }
.flash.success { background: #e3f7e6; color: #2e9e4e; }
.flash.error { background: #fde3e3; color: var(--pokedex-red); }
