:root {
  color-scheme: light;
  --paper: #faf5ec;
  --surface: #fffaf2;
  --ink: #2b2024;
  --muted: #66545a;
  --red: #a02a3c;
  --dark-red: #772230;
  --line: #ddcabb;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.6 system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--dark-red); text-underline-offset: .19em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--red); outline-offset: 3px;
}
.top, main, footer { width: min(65rem, calc(100% - 2.5rem)); margin-inline: auto; }
.top {
  min-height: 5rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1.25rem; border-bottom: 1px solid var(--line); padding: .8rem 0;
}
.brand { font: bold 1.35rem var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.seal {
  display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: .2rem;
  color: #fffaf2; background: var(--red); border-radius: .35rem;
}
nav { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; font-size: .9rem; }
nav a { color: var(--ink); text-decoration: none; }
nav a:hover, .card:hover strong { text-decoration: underline; }
main { min-height: 65vh; padding: 3.5rem 0; }
h1, h2, p { margin-block-start: 0; }
h1, h2 { font-family: var(--serif); line-height: 1.08; }
h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); margin-bottom: 1rem; letter-spacing: -.045em; }
h2 { margin-bottom: .8rem; font-size: 1.66rem; }
.kicker { color: var(--dark-red); font-weight: 750; }
.lead { max-width: 44ch; color: var(--muted); font-size: 1.17rem; }
.hero {
  display: grid; grid-template-columns: 1.2fr 1fr; min-height: 25rem;
  border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; background: var(--surface);
}
.hero-copy { align-self: center; padding: clamp(1.5rem, 5vw, 4.25rem); }
.hero h1 { font-size: clamp(4rem, 10vw, 7.5rem); line-height: .85; }
.emblem {
  display: grid; place-items: center; overflow: hidden; position: relative; min-height: 13rem;
  background: radial-gradient(circle, #b63d50, #812534 78%); color: #fff3e5;
}
.emblem::before, .emblem::after { content: ""; position: absolute; border: 1px solid #fff3e57a; border-radius: 50%; }
.emblem::before { width: 72%; aspect-ratio: 1; }
.emblem::after { width: 90%; aspect-ratio: 1; }
.emblem span { font: clamp(2.75rem, 6vw, 5rem) var(--serif); letter-spacing: .11em; }
.button, button {
  font: 700 .95rem/1.35 system-ui, sans-serif; display: inline-block; text-decoration: none;
  color: #fffaf2; background: var(--red); border: 1px solid var(--red); cursor: pointer;
  border-radius: .45rem; padding: .72rem 1.12rem;
}
.button:hover, button:hover { background: var(--dark-red); }
.button span { margin-left: .45rem; }
button:disabled { opacity: .65; cursor: wait; }
button.secondary { color: var(--dark-red); border-color: var(--line); background: var(--surface); }
.links { margin-top: 1rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card {
  display: block; padding: 1.35rem 1.5rem; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: .6rem;
}
.card strong { display: block; font: bold 1.33rem var(--serif); margin-bottom: .4rem; }
.card span, .date, .help { color: var(--muted); }
.reading, .panel { max-width: 49rem; margin: auto; }
.reading section { border-top: 1px solid var(--line); margin-top: 1.65rem; padding-top: 1.6rem; }
.reading li { padding: .24rem 0; }
.panel { padding: clamp(1.15rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: .8rem; background: var(--surface); }
#status { min-height: 1.65rem; color: var(--dark-red); overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: .7rem; flex-wrap: wrap; }
.toolbar label { flex: 1 1 11rem; }
label { font-weight: 700; }
select, input:not([type="checkbox"]) {
  display: block; margin-top: .35rem; border: 1px solid var(--line); border-radius: .35rem;
  background: white; color: var(--ink); padding: .45rem .65rem; font: inherit;
}
select { width: 100%; }
#config { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1.3rem; }
#config fieldset { border: 1px solid var(--line); border-radius: .45rem; margin: 1.3rem 0; padding: .8rem 1rem; }
#config .help { font-size: .91rem; margin-bottom: .35rem; }
legend { color: var(--dark-red); font-weight: 750; padding-inline: .4rem; }
details { border-top: 1px solid var(--line); padding: .58rem 0; }
summary { cursor: pointer; font-weight: 700; display: list-item; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem; padding: .5rem 0; }
.checks label { background: var(--paper); border-radius: .3rem; padding: .25rem .6rem; font-weight: 500; overflow-wrap: anywhere; }
footer { padding: 1.2rem 0 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .87rem; }
@media (max-width: 36rem) {
  .hero, .links { grid-template-columns: 1fr; }
  .top { gap: .65rem; align-items: flex-start; flex-direction: column; justify-content: center; }
  main { padding-block: 2rem; }
}

.dashboard { max-width: 100%; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
#config .dashboard-grid fieldset { margin: 0; min-width: 0; }
.dashboard-grid label { display: block; margin-bottom: .45rem; }
.dashboard-grid input[type="number"] { width: min(12rem, 100%); }
.dashboard-grid .toggle { display: flex; gap: .45rem; align-items: baseline; font-weight: 500; }
.dashboard-grid .toggle input { margin-inline: 0; }
.reward-row { display: grid; grid-template-columns: 4.7rem minmax(0, 1fr) auto; gap: .45rem; align-items: end; margin-bottom: .5rem; }
#add-reward { margin-top: .5rem; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.actions p { margin: 0; color: var(--dark-red); }
@media (max-width: 44rem) { .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 24rem) { .reward-row { grid-template-columns: 1fr; } }
