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

html {
  background: #f1e4c8;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: transparent;
  color: #161010;
  line-height: 1.5;
}

.site-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: #100000;
  border-bottom: 1px solid rgba(98, 18, 18, 0.45);
}

/* Navigation */
.site-nav {
  padding: 0.9rem 1.5rem;
}
.site-nav .nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  flex: 0 0 auto;
}
.site-nav .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-nav a {
  color: #b89088;
  text-decoration: none;
}
.site-nav a:hover {
  color: #f0b8ae;
}
.site-nav .nav-title {
  color: #b89088;
  font-weight: bold;
}

.page-paths {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.5rem 1rem 0;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  color: #8f5a50;
  font-size: 0.85rem;
}
.page-paths a,
.page-paths a:visited {
  color: #b89088;
  text-decoration: none;
  padding: 0.3rem 0.5rem;
}
.page-paths a:hover {
  color: #f0b8ae;
  text-decoration: underline;
}
.page-paths span {
  color: #5a3535;
}

.metadata-header {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 0.75rem;
}
.edit-button,
.edit-button:visited {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(98, 18, 18, 0.3);
  border-radius: 0.3rem;
  background: rgba(255, 247, 243, 0.92);
  color: #2e1111;
  text-decoration: none;
}
.edit-button:hover {
  background: rgba(255, 237, 231, 0.98);
}

.character-link,
.character-link:visited {
  color: #7a2222;
  text-decoration: underline;
  text-decoration-color: rgba(122, 34, 34, 0.55);
  text-underline-offset: 2px;
}

main a {
  color: #7a2222;
  text-decoration: underline;
  text-decoration-color: rgba(122, 34, 34, 0.55);
  text-underline-offset: 2px;
}
main a:visited {
  color: #9d4949;
  text-decoration-color: rgba(122, 34, 34, 0.44);
}
main a:hover {
  color: #4a1717;
  text-decoration-color: #4a1717;
}

/* Main content area */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  color: #161010;
}
main ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  background: rgba(255, 250, 247, 0.84);
}
table, th, td {
  border: 1px solid rgba(98, 18, 18, 0.18);
}
th, td {
  padding: 0.3rem 0.6rem;
  text-align: left;
}
tr:nth-child(even) {
  background-color: rgba(122, 34, 34, 0.07);
}

tr.inactive,
table.inactive {
  color: #7d6a66;
}

table.inactive a {
  color: inherit;
}

/* Stat/power/influence name–value tables: pin the value column to a fixed
   width so the split aligns across adjacent tables on the same page. */
table.stat-table td:first-child,
table.stat-table th:first-child {
  width: 18em;
}
table.stat-table td:last-child,
table.stat-table th:last-child {
  width: 4.5em;
  text-align: center;
}
table.stat-table.char-meta td:last-child,
table.stat-table.char-meta th:last-child {
  width: auto;
}

/* Button column in XP editor tables */
table.stat-table td:nth-child(4),
table.stat-table th:nth-child(4) {
  width: 2.5em;
  text-align: center;
}

/* Raise/lower buttons in XP editor */
.raise-btn, .lower-btn {
  font-size: 0.7rem;
  padding: 0 0.35rem;
  line-height: 1.2;
  min-width: 1.6em;
  border: 1px solid rgba(98, 18, 18, 0.25);
  border-radius: 0.2rem;
  background: rgba(255, 250, 247, 0.9);
  color: #2e1111;
  cursor: pointer;
  display: block;
  width: 100%;
}
.raise-btn:hover, .lower-btn:hover {
  background: rgba(255, 237, 231, 0.98);
}
.raise-btn:disabled, .lower-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.lower-btn {
  margin-top: 1px;
}

/* Wiki styles */
.wiki-section h2 {
  font-size: 1.1rem;
}

.wiki-section ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.wiki-section li {
  margin: 0.2rem 0;
}
