/* Wine's free Tahoma clone (LGPL-2.1+), so every device gets the same font. */
@font-face { font-family: "Mielie Tahoma"; src: url("/fonts/tahoma.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --font: "Mielie Tahoma", Tahoma, Verdana, sans-serif;
  --ink: #1c1c1c;
  --muted: #5a5a5a;
  --frame: #ece9d8;
  --luna-edge: #0831d9;
  --field: #7f9db9;
  --navy: #0d2350;
  --gold: #f2c230;
  --blue: #1747a6;
  --green: #2a6a1c;
  --rule: #e2d8b8;
  --tip: #ffffe1;
  --error: #b00020;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.5 var(--font);
  background: #1d5bbd;
}
/* Farm wallpaper on its own fixed layer, since background-attachment: fixed fails on iOS. */
body::before {
  content: "";
  position: fixed; inset: 0;
  z-index: -1;
  background: #1d5bbd url("/bg.svg") center bottom / max(100%, 1200px) auto no-repeat;
}
button, input, textarea { font: inherit; }
.page { display: flex; flex-direction: column; align-items: center; gap: 32px; padding: 40px 16px 56px; }

/* ---------- window ---------- */
.window {
  width: 100%;
  background: var(--frame);
  border: 3px solid var(--luna-edge);
  border-top: 0;
  border-radius: 9px 9px 0 0;
  box-shadow: 0 10px 30px rgba(10, 20, 60, 0.45);
}
.window.game { max-width: 760px; }
.window.guestbook { max-width: 620px; }
.titlebar {
  display: flex; align-items: center; gap: 8px;
  min-height: 32px;
  margin: 0 -3px;
  padding: 6px 6px 6px 10px;
  color: #fff;
  font-size: 14px; font-weight: 700;
  text-shadow: 1px 1px 0 #0f1089;
  background: linear-gradient(180deg, #3d95ff 0%, #0a64e8 9%, #0058e6 42%, #0055dd 88%, #0048c8 100%);
  border: 1px solid var(--luna-edge);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}
.titlebar .name { flex-grow: 1; }
.titlebar .btns { display: flex; gap: 2px; }
.titlebar .btns span {
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border: 1px solid #fff;
  border-radius: 3px;
  background: linear-gradient(135deg, #5f9bff, #1d5fe0 60%, #1f4fc0);
}
.titlebar .btns span:last-child { background: linear-gradient(135deg, #f0a48c, #e0572c 50%, #c13d14); }
.pane { margin: 4px; background: #fff; border: 1px solid #8a8a8a; }

/* ---------- Encarta header ---------- */
.masthead {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 24px;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
}
.masthead svg { flex: none; }
.masthead h1 { margin: 0; font-size: 30px; line-height: 1.05; color: var(--gold); }
.masthead p { margin: 2px 0 0; font-size: 14px; font-style: italic; color: #b9c8e6; }

/* ---------- Woordraai ---------- */
.wr { padding: 28px 24px 22px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.wr-cluebox {
  width: 100%;
  text-align: left;
  background: var(--tip);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 14px 18px;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.18);
}
.wr-cluebox small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.wr-clue { margin: 0; font-size: 22px; line-height: 1.3; font-style: italic; text-wrap: pretty; }
.wr-tiles { width: 100%; display: flex; justify-content: center; gap: 6px; }
.wr-tile {
  flex: 0 1 56px; min-width: 0;
  aspect-ratio: 6 / 7;
  display: grid; place-items: center;
  font-size: clamp(15px, 4.6vw, 26px); font-weight: 700;
  text-transform: uppercase;
  background: #fff;
  border: 1px solid var(--field);
  border-radius: 3px;
  box-shadow: inset 0 -4px 0 #e3ebf6;
}
.wr-tile[data-state="hint"] { background: linear-gradient(180deg, #ffe39a, #f8b33e); border-color: #c98a17; box-shadow: none; }
.wr-tile[data-state="correct"] { background: linear-gradient(180deg, #6cc458, #2f7d22); border-color: #1f5c16; color: #fff; box-shadow: none; }
.wr-tile[data-state="lost"] { background: linear-gradient(180deg, #8d96aa, #5d6578); border-color: #454c5c; color: #fff; box-shadow: none; }
.wr-tile.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.15); } }
.wr-tiles.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.wr-lives { display: flex; justify-content: center; gap: 8px; }
.wr-lives span { width: 14px; height: 14px; border-radius: 50%; border: 1px solid #2a6e1e; background: radial-gradient(circle at 35% 30%, #c9f5b8, #3c9a2c 70%); }
.wr-lives .used { border-color: #8a1a0a; background: radial-gradient(circle at 35% 30%, #ffb3a0, #d0391c 70%); }
.wr-lives .won { border-color: #a8740c; background: radial-gradient(circle at 35% 30%, #fff3b8, var(--gold) 70%); }
.wr-form { display: flex; gap: 8px; width: 100%; max-width: 460px; }
.wr-form[hidden] { display: none; }
.wr-input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; font-size: 18px; border: 1px solid var(--field); border-radius: 0; background: #fff; }
.wr-msg { margin: -8px 0 0; font-weight: 700; color: var(--error); }
.wr-msg:empty { display: none; }
.wr-history { list-style: none; padding: 0; margin: -6px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 14px; }
.wr-history:empty { display: none; }
.wr-history s { color: var(--error); }
.wr-end { width: 100%; padding: 14px; background: #f4f7fc; border: 1px solid var(--field); }
.wr-end p { margin: 4px 0; }
.wr-result { font-size: 22px; font-weight: 700; color: var(--blue); }
.wr-answer { font-size: 17px; }
.wr-stats { font-size: 13px; color: var(--muted); }
.wr-end button { margin-top: 10px; }
.wr-help { margin: 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  padding: 10px 24px;
  font-size: 13px; color: #444;
  background: #faf8ef;
  border-top: 1px solid var(--rule);
}
.wr-crowd b { color: var(--green); }
.wr-crowd:empty { display: none; }

/* ---------- buttons ---------- */
.go {
  height: 46px;
  padding: 0 26px 0 22px;
  font-size: 17px; font-weight: 700; font-style: italic;
  color: #fff;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.45);
  background: linear-gradient(180deg, #4fae3c, #2f7d22 50%, #276b1c);
  border: 1px solid #1f5c16;
  border-radius: 3px 14px 14px 3px;
  cursor: pointer;
}
.go:hover:not(:disabled) { background: linear-gradient(180deg, #5cbd48, #348a26 50%, #2b7520); }
.go:active:not(:disabled) { background: linear-gradient(180deg, #276b1c, #2f7d22); }
.go:focus-visible, .wr-input:focus, textarea:focus, input:focus { outline: 2px solid #f8b33e; outline-offset: 1px; }
.go:disabled { opacity: 0.6; cursor: default; }

/* ---------- gasteboek ---------- */
.gb { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
.gb h2 { margin: 0; font-size: 20px; color: var(--blue); }
.gb h3 { margin: 0; font-size: 16px; color: var(--blue); }
.gb .lead { margin: 4px 0 0; color: #444; text-wrap: pretty; }
.gb form { display: flex; flex-direction: column; gap: 10px; }
.gb label { font-weight: 700; }
.gb label small { font-size: 15px; font-weight: 400; color: var(--muted); }
.gb textarea, .gb input { width: 100%; padding: 8px 10px; border: 1px solid var(--field); border-radius: 0; background: #fff; }
.gb textarea { min-height: 96px; resize: vertical; }
.gb input { height: 44px; }
.gb .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.gb .row > div { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.gb .go { height: 44px; font-size: 16px; }
.count { margin-top: -4px; font-size: 13px; color: var(--muted); }
.msg { margin: 0; font-weight: 700; }
.msg:empty { display: none; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--green); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ideas { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px solid var(--rule); }
.ideas ul { list-style: none; padding: 0; margin: 0; display: grid; }
.ideas li { padding: 8px 0; border-bottom: 1px solid #efeadb; }
.ideas li:last-child { border-bottom: 0; }
.ideas li p { margin: 0 0 2px; overflow-wrap: anywhere; }
.ideas .meta { font-size: 12px; color: var(--muted); }
.ideas li.empty { color: var(--muted); font-style: italic; border: 0; padding: 0; }
.note { margin: 0; font-size: 12px; color: #6a6a6a; }

@media (max-width: 480px) {
  .page { padding-top: 24px; gap: 24px; }
  .masthead { padding: 16px 18px; }
  .wr, .gb { padding-left: 18px; padding-right: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .wr-tile.pop, .wr-tiles.shake { animation: none; }
}

/* ---------- share ---------- */
.wr-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.wr-end .wr-share button { margin-top: 0; }
a.go { display: inline-flex; align-items: center; text-decoration: none; }
.go.wa { background: linear-gradient(180deg, #4fd27a, #1fa855 50%, #178f47); border-color: #11733a; }
.go.wa:hover { background: linear-gradient(180deg, #5ee089, #22b85d 50%, #1a9c4e); }
.go.plain {
  padding: 0 18px;
  font-style: normal;
  color: var(--ink);
  text-shadow: none;
  background: linear-gradient(180deg, #fff, #ece9d8);
  border-color: #8a8a8a;
  border-radius: 3px;
}
.go.plain:hover:not(:disabled) { background: linear-gradient(180deg, #fff, #f6f3e6); }
.go.plain:active:not(:disabled) { background: #e3dfcc; }

/* ---------- archive ---------- */
.strip a { color: var(--blue); }
.masthead a { color: inherit; text-decoration: none; }
.masthead .home { display: flex; }
.masthead .brand { display: block; font-size: 30px; font-weight: 700; line-height: 1.05; color: var(--gold); }
.masthead h1.sub { margin: 2px 0 0; font-size: 14px; font-weight: 400; font-style: italic; line-height: 1.5; color: #b9c8e6; }
.archive-nav { justify-content: space-between; }
.answer summary { cursor: pointer; font-weight: 700; color: var(--blue); }
.answer h2 { margin: 14px 0 4px; font-size: 26px; color: var(--green); }
.answer p { margin: 0; text-wrap: pretty; }
.archive li a { font-weight: 700; color: var(--blue); }
.archive li p { margin: 2px 0 0; font-style: italic; color: #444; }
.gb a { color: var(--blue); }
