:root {
  --wood: #2a1a10;
  --wood-dark: #1a0f08;
  --wood-light: #4a2e1a;
  --candle: #f3c66b;
  --parchment: #efe3c8;
  --ink: #2b1d12;
  --velvet: #7a1c24;
  --muted: #b9a37f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at top, #3a2414 0%, var(--wood-dark) 70%);
  color: var(--parchment);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.55;
}
header { text-align: center; padding: 2rem 1rem 1rem; }
.cross { font-size: 2.2rem; color: var(--candle); text-shadow: 0 0 18px rgba(243,198,107,.6); }
h1 { margin: .2rem 0; font-size: 2.4rem; letter-spacing: .08em; font-variant: small-caps; color: var(--candle); }
.sub { margin: 0 0 1.2rem; font-style: italic; color: var(--muted); }
nav { display: flex; justify-content: center; gap: .5rem; }
nav a {
  padding: .5rem 1.2rem; color: var(--parchment); text-decoration: none;
  border: 1px solid var(--wood-light); border-bottom: none; border-radius: 8px 8px 0 0;
  background: var(--wood);
}
nav a.active { background: var(--velvet); border-color: var(--velvet); }
main { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; border-top: 2px solid var(--velvet); }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 1rem 2rem; font-style: italic; }
a { color: var(--candle); }

.intro { color: var(--muted); font-style: italic; }
.lattice {
  display: flex; flex-direction: column; gap: .8rem;
  padding: 1.5rem; border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.18) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.18) 0 2px, transparent 2px 22px),
    var(--wood-light);
  border: 6px solid var(--wood);
  box-shadow: inset 0 0 30px rgba(0,0,0,.5), 0 10px 30px rgba(0,0,0,.5);
}
.lattice.narrow { max-width: 360px; margin: 2rem auto; }
label { font-weight: bold; color: var(--candle); font-size: 1.1rem; }
textarea, input {
  width: 100%; padding: .7rem; border-radius: 6px; border: 1px solid var(--wood);
  background: var(--parchment); color: var(--ink); font: inherit; font-size: 1rem;
}
textarea { resize: vertical; }
fieldset.section {
  display: flex; flex-direction: column; gap: .5rem; margin: 0 0 .8rem;
  border: 1px dashed var(--muted); border-radius: 8px; padding: .8rem;
}
legend { color: var(--muted); padding: 0 .4rem; }
button {
  padding: .65rem 1.2rem; border: none; border-radius: 6px; cursor: pointer;
  background: var(--velvet); color: var(--parchment); font: inherit; font-weight: bold;
}
button:hover { filter: brightness(1.15); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.secondary { background: var(--wood); border: 1px solid var(--muted); }
button.remove { align-self: flex-end; background: transparent; color: var(--muted); padding: .2rem .5rem; font-weight: normal; }
button.danger { background: #a3242e; padding: .25rem .7rem; font-size: .85rem; }

.error, .notice { padding: .7rem 1rem; border-radius: 6px; }
.error { background: rgba(163,36,46,.3); border: 1px solid #a3242e; }
.notice { background: rgba(243,198,107,.12); border: 1px solid var(--candle); }

.card {
  background: var(--parchment); color: var(--ink); border-radius: 6px;
  padding: 1rem 1.2rem; margin: 0 0 1rem; box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
.meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: #7a6248; font-variant: small-caps; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; margin: .4rem 0; }
.chal { border-left: 3px solid var(--velvet); padding-left: .8rem; margin-top: .8rem; }
.chal h3 { margin: 0; font-size: 1rem; color: var(--velvet); }
.empty { text-align: center; color: var(--muted); }
.pager { justify-content: space-between; margin-top: 1rem; }
.pager a { border: none; background: none; }

.absolved { text-align: center; }
.candle { font-size: 3rem; }
.absolved h2 { color: var(--candle); font-style: italic; font-size: 2rem; margin: .3rem 0; }
.flag code {
  display: inline-block; padding: .6rem 1rem; border-radius: 6px; font-size: 1.15rem;
  background: var(--wood-dark); border: 1px solid var(--candle); color: var(--candle);
  user-select: all; overflow-wrap: anywhere;
}
.admin-bar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
form.inline, .admin-bar form { display: inline; margin: 0; }
