:root {
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --ink: #2b2320;
  --muted: #6e625a;
  --paper: #f6f1e7;
  --line: #b9aa98;
  --accent: #5e3352;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
}

.site-header, main, .site-footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header { padding-top: 32px; }
h1 { font-size: 2rem; font-weight: 600; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 12px; }
.tagline { margin: 0; color: var(--muted); font-style: italic; }

section {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  margin-top: 24px;
}

button {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 20px;
  cursor: pointer;
}
button:hover { background: var(--ink); color: var(--paper); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.difficulty-buttons, .actions { display: flex; flex-wrap: wrap; gap: 12px; }
.difficulty-buttons button { flex: 1 1 0; min-width: 88px; }
.actions { margin-top: 16px; }

canvas {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  border: 1px solid var(--line);
}

.badge { margin: 0 0 12px; color: var(--muted); }
.hint, .status { color: var(--muted); margin: 0; }
.status:empty { display: none; }
.status { margin-top: 12px; }
.broken p { margin: 0 0 12px; }
.field { display: block; margin: 16px 0 0; }
.field span { display: block; margin-bottom: 4px; }
.field input[type=text] {
  font: inherit;
  width: 100%;
  max-width: 360px;
  padding: 6px 8px;
  border: 1px solid var(--ink);
  background: #fffdf8;
  color: var(--ink);
}
.field input[type=file] { font: inherit; max-width: 100%; }
#compare { margin-top: 16px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:disabled:hover { background: transparent; color: var(--ink); }
[hidden] { display: none !important; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  padding-bottom: 40px;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer a { color: inherit; }
