/* Meester Robbe: calm, warm and readable. One accent colour (the olive green of the word lists),
   a classic serif for Latin, the system font for everything else. No external resources. */
:root {
  --bg: #f5f3ec;
  --card: #ffffff;
  --text: #23271f;
  --muted: #71766a;
  --line: #e5e1d5;
  --accent: #5e7f2d;
  --accent-dark: #49651f;
  --accent-soft: #eef3e2;
  --ok: #2f7d43;
  --ok-bg: #e7f3ea;
  --wrong: #b4412f;
  --wrong-bg: #fbece8;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(35, 39, 31, .05), 0 6px 20px rgba(35, 39, 31, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--sans); }
a { color: var(--accent-dark); }
sup { font-size: .6em; line-height: 0; }

/* Header */
header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.25rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--accent-dark); text-decoration: none; letter-spacing: .01em; }
.brand::before { content: "M"; display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; margin-right: .5rem;
  border-radius: 50%; background: var(--accent); color: #fff; font-size: 1rem; vertical-align: .1rem; }
header nav { display: flex; gap: 1rem; align-items: center; color: var(--muted); font-size: .95rem; }
header nav a { color: var(--muted); text-decoration: none; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line); }
header nav a:hover { color: var(--accent-dark); border-color: var(--accent); }
header nav form { margin: 0; }

main { max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
main:has(.card.wide) { max-width: 62rem; }

/* Cards and text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem; margin-bottom: 1.25rem; }
.card.narrow { max-width: 24rem; margin: 3rem auto; }
.card.notice { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.card.notice p { margin-top: 0; }
h1 { margin: 0 0 .25rem; font-family: var(--serif); font-size: 1.7rem; line-height: 1.2; }
h2 { margin: 0 0 .5rem; font-family: var(--serif); font-size: 1.3rem; }
.muted { color: var(--muted); font-size: .92rem; }
.center { text-align: center; }
a.back { display: inline-block; margin-bottom: .25rem; color: var(--muted); text-decoration: none; font-size: .95rem; }
a.back:hover { color: var(--accent-dark); }
.flash { background: var(--wrong-bg); color: var(--wrong); padding: .7rem 1rem; border-radius: 12px; }
/* Above a narrow card (the login page): as wide as that card, and close to it */
main:has(.card.narrow) .flash { max-width: 24rem; margin: 3rem auto 0; }
.flash + .card.narrow { margin-top: 1rem; }

/* Forms */
label { display: block; margin: 1rem 0; font-weight: 600; font-size: .95rem; }
label small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; margin-top: .35rem; }
input, select { display: block; width: 100%; margin-top: .35rem; padding: .75rem .9rem; font: inherit; font-weight: 400;
  color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder { color: #a6a99f; }

/* Buttons */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .75rem 1.35rem;
  font: inherit; font-weight: 600; color: var(--text); background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; }
button:hover, .button:hover { border-color: var(--accent); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
form > button.primary { width: 100%; margin-top: .5rem; padding: .9rem; font-size: 1.05rem; }
form > button.block { width: 100%; margin-top: .6rem; }
form > small.hint { display: block; margin-top: .4rem; color: var(--muted); font-size: .85rem; text-align: center; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 400; text-decoration: underline; }
.buttons { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.buttons form { margin: 0; }

/* Subjects */
.subjects { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .9rem; margin-top: 1.25rem; }
.button.subject { flex-direction: column; align-items: flex-start; padding: 1.25rem 1.25rem 1.1rem; border-radius: var(--radius);
  font-family: var(--serif); font-size: 1.35rem; text-align: left; position: relative; overflow: hidden; }
.button.subject::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--accent); }
.button.subject::after { content: "Oefenen →"; font-family: var(--sans); font-size: .85rem; font-weight: 500; color: var(--muted); }
.button.subject:hover { background: var(--accent-soft); }

/* Quiz */
.quizbar { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; }
.progress { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.pill { font-size: .85rem; font-weight: 600; padding: .25rem .7rem; border-radius: 999px; background: #fff; border: 1px solid var(--line); white-space: nowrap; }
.pill.score { color: var(--ok); }
.prompt-meta { margin: 0; text-align: center; color: var(--muted); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.prompt { font-family: var(--serif); font-size: 2.6rem; font-weight: 600; text-align: center; margin: .25rem 0 1rem; line-height: 1.15; }
.verdict { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; padding: .75rem 1rem; border-radius: 12px; margin: 0 0 .5rem; }
.verdict::before { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; color: #fff; font-size: 1rem; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.ok::before { content: "✓"; background: var(--ok); }
.verdict.wrong { background: var(--wrong-bg); color: var(--wrong); }
.verdict.wrong::before { content: "✗"; background: var(--wrong); }
.results { margin: 0; }
.results dt { font-weight: 600; font-size: .8rem; color: var(--muted); margin-top: 1rem; text-transform: uppercase; letter-spacing: .04em; }
.results dd { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; font-size: 1.05rem; }
.results .mark { font-weight: 700; }
.results .ok .mark { color: var(--ok); }
.results .wrong .mark { color: var(--wrong); }
.results .wrong .given { text-decoration: line-through; color: var(--muted); }
.results .wrong.partial .given { text-decoration: none; }
.results .expected { font-weight: 600; }
.results .wrong .expected::before { content: "→ "; color: var(--muted); font-weight: 400; }
.results .ok .expected { color: var(--muted); font-weight: 400; }
.results .ok .expected::before { content: "("; } .results .ok .expected::after { content: ")"; }
.results .note { flex-basis: 100%; font-size: .88rem; color: var(--muted); }
.notes { margin: 1rem 0 0; padding: .7rem 1rem; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; font-size: .92rem; }

/* Result of a series */
.score-hero { text-align: center; padding: .5rem 0 1rem; }
.score-hero .big { font-family: var(--serif); font-size: 3.2rem; font-weight: 700; line-height: 1; }
.score-hero .big small { font-size: 1.6rem; color: var(--muted); }
.meter { height: 10px; background: var(--wrong-bg); border-radius: 999px; overflow: hidden; margin: 1rem auto .5rem; max-width: 20rem; }
.meter div { height: 100%; background: var(--ok); border-radius: 999px; }
table.words { width: 100%; border-collapse: collapse; margin-top: .75rem; }
table.words th, table.words td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid var(--line); }
table.words th { font-family: var(--serif); font-size: 1.05rem; }

/* Admin */
.statcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .9rem; margin: 0 0 1.25rem; }
.statcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); }
.statcard .value { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.statcard .label { color: var(--muted); font-size: .85rem; }
table.stats { width: 100%; border-collapse: collapse; margin-top: .75rem; font-size: .95rem; }
table.stats th, table.stats td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.stats thead th { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
table.stats tbody tr:hover { background: #faf9f5; }
table.stats tbody th { font-family: var(--serif); font-weight: 600; }
table.stats .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.stats .mark { font-weight: 700; }
table.stats .ok .mark { color: var(--ok); }
table.stats .wrong .mark { color: var(--wrong); }
.scorebar { display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.scorebar span { display: inline-block; width: 4.5rem; height: 6px; border-radius: 999px; background: var(--wrong-bg); overflow: hidden; }
.scorebar span i { display: block; height: 100%; background: var(--ok); }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; margin-right: .6rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .9rem; vertical-align: middle; }

@media (max-width: 30rem) {
  main { padding: 1rem .9rem 2rem; }
  .card { padding: 1.2rem; }
  .prompt { font-size: 2.1rem; }
  header nav span { display: none; }
}
button:focus-visible, .button:focus-visible, a:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1.5px var(--accent); }
table.stats thead th { line-height: 1.25; }
table.stats thead th.num { max-width: 9rem; white-space: normal; }
