:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --border:   #2e3347;
  --gold:     #c9a84c;
  --gold-dim: #8a6f32;
  --text:     #e4e6f0;
  --muted:    #7a7f99;
  --hover:    #21253a;
  --radius:   6px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

header {
  background: linear-gradient(180deg, #1a1528 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.25rem 1.5rem 1.75rem;
  text-align: center;
}

.header-inner { max-width: 960px; margin: 0 auto; }

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(201, 168, 76, 0.25);
}

.subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-top: 0.3rem;
  text-transform: uppercase;
}

.stats {
  color: var(--gold-dim);
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

/* ── Main ───────────────────────────────────────────────────────────────── */

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

/* ── Search bar ─────────────────────────────────────────────────────────── */

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.search-bar input,
.search-bar select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.15s;
}

.search-bar input         { flex: 1; min-width: 200px; }
.search-bar select        { cursor: pointer; min-width: 190px; }
.search-bar input:focus,
.search-bar select:focus  { border-color: var(--gold-dim); }

.search-bar button {
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  color: #1a1200;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1.4rem;
  transition: background 0.15s;
  white-space: nowrap;
}

.search-bar button:hover { background: #dfc070; }

/* ── Results info ───────────────────────────────────────────────────────── */

.results-info {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 0.6rem;
  min-height: 1.1em;
}

/* ── Table ──────────────────────────────────────────────────────────────── */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

thead th {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  padding: 0.6rem 0.75rem;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--hover); }

tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: top;
}

.col-char    { color: var(--gold-dim); font-size: 0.8rem; white-space: nowrap; }
.col-noun    { color: var(--muted);    white-space: nowrap; }
.col-name    { color: var(--text); }
.col-loc     { color: var(--muted);    font-size: 0.8rem; white-space: nowrap; }
.col-notes   { color: var(--gold-dim); font-size: 0.82rem; max-width: 200px; }
.col-updated { color: var(--muted);    font-size: 0.78rem; white-space: nowrap; }

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 2.5rem !important;
  text-align: center;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */

.pagination {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.1rem;
}

.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.4rem 1.1rem;
  transition: border-color 0.15s, background 0.15s;
}

.pagination button:hover:not(:disabled) {
  background: var(--hover);
  border-color: var(--gold-dim);
}

.pagination button:disabled { cursor: default; opacity: 0.35; }
.pagination .page-info      { color: var(--muted); font-size: 0.8rem; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  padding: 1rem 1.5rem;
  text-align: center;
}

footer a             { color: var(--gold-dim); text-decoration: none; }
footer a:hover       { color: var(--gold); }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .col-loc, .col-char { font-size: 0.72rem; }
}
