:root {
  --parchment: #f3ead7;
  --ink: #2b2419;
  --accent: #7a1f1f;
  --gold: #a87f2c;
  --card-bg: #fdf8ec;
  --border: #c9b98f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--parchment);
  color: var(--ink);
}

header {
  background: var(--ink);
  color: var(--parchment);
  padding: 1.2rem 2rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

header nav a {
  color: var(--gold);
  text-decoration: none;
  margin-left: 1.2rem;
  font-size: 0.95rem;
}
header nav a:hover { text-decoration: underline; }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

h2 {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.3rem;
  letter-spacing: 0.05em;
}

/* Forms */
form.card-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid .full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.25rem;
  letter-spacing: 0.03em;
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

textarea { resize: vertical; min-height: 60px; }

input[type="file"] { font-size: 0.9rem; }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.05em;
}
button:hover { background: #942828; }
button.secondary { background: #6b6152; }
button.danger { background: #555; font-size: 0.8rem; padding: 0.3rem 0.7rem; }
button.danger:hover { background: var(--accent); }

.status {
  margin: 0.8rem 0 0;
  font-style: italic;
  min-height: 1.2em;
}
.status.ok { color: #1e6b32; }
.status.err { color: var(--accent); }

/* Card grid */
.deck-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.deck-tabs button {
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--border);
}
.deck-tabs button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 1px 2px 5px rgba(43, 36, 25, 0.15);
}

.game-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #ddd2b8;
}

.game-card .no-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ddd2b8;
  color: #8a7d63;
  font-style: italic;
  font-size: 0.85rem;
}

.game-card .body {
  padding: 0.7rem 0.8rem;
  flex: 1;
}

.game-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.game-card .meta {
  font-size: 0.8rem;
  color: #6b6152;
  margin: 0.15rem 0;
}

.game-card .stats {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--accent);
  margin: 0.2rem 0;
}

.game-card .blurb {
  font-size: 0.82rem;
  font-style: italic;
  margin: 0.4rem 0 0;
}

.game-card .actions {
  padding: 0.5rem 0.8rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
}

.empty-note {
  font-style: italic;
  color: #6b6152;
  padding: 2rem 0;
}
