:root {
  color-scheme: dark;
  --bg: #121418;
  --panel: #1c2028;
  --line: #2d3340;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --accent: #7c9cff;
  --accent-ink: #0e1220;
  --danger: #ffb4b4;
  --warn: #f0d48a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, Segoe UI, sans-serif;
}

main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

header h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

header p {
  margin: 0 0 22px;
  color: var(--muted);
  max-width: 42rem;
}

form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 10px;
}

input, button {
  font: inherit;
}

input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button {
  padding: 12px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.error, .status, .empty, .notes {
  margin: 12px 0 0;
}

.error { color: var(--danger); }
.status { color: var(--muted); }
.empty { color: var(--text); }

.notes {
  padding: 0;
  list-style: none;
}

.notes li {
  margin-top: 8px;
  color: var(--warn);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.thumb {
  aspect-ratio: 1;
  background: #0d0f13;
  display: grid;
  place-items: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.placeholder {
  color: var(--muted);
  font-size: 0.85rem;
}

.meta {
  padding: 12px;
}

.name {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.collection {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.chain {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2a3142;
  color: #d5def8;
  font-size: 0.75rem;
}

@media (max-width: 560px) {
  .row { flex-direction: column; }
  button { width: 100%; }
  main { width: min(1080px, calc(100% - 24px)); }
}
