/* Colours are set once here so dark mode and the dyslexia font are easy to change */
:root {
  --bg: #f7f9fb;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #55606e;
  --accent: #1f7a4d;     /* pitch green */
  --accent-text: #ffffff;
  --line: #d5dde6;
  --code-bg: #f0f4f8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #15191f;
  --card: #1f262f;
  --text: #f1f4f8;
  --muted: #b5c0cc;
  --accent: #4fc78a;
  --accent-text: #0f1418;
  --line: #3a4550;
  --code-bg: #111619;
}

:root[data-font="dyslexia"] {
  --font: "Comic Sans MS", "Trebuchet MS", Verdana, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.6;
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}
.top h1 { margin: 0; font-size: 1.6rem; }
.top-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }

main { max-width: 760px; margin: 0 auto; padding: 1rem; }

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; }

button {
  font: inherit;
  padding: 0.5rem 0.9rem;
  border: 2px solid var(--accent);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}
button:hover { background: var(--line); }
button:focus-visible, textarea:focus-visible, label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
button.big { background: var(--accent); color: var(--accent-text); font-weight: bold; }
button.link { border: none; background: none; padding: 0.25rem 0; color: var(--accent); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}

.bar {
  height: 14px;
  background: var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.4s; }

.mission-list { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.mission-list li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.mission-list .status { font-size: 0.95rem; color: var(--muted); }

.briefing { background: var(--card); border-left: 6px solid var(--accent); padding: 0.75rem 1rem; border-radius: 8px; }

.steps li { margin-bottom: 0.4rem; }
.steps li.done { color: var(--muted); text-decoration: line-through; }

textarea {
  width: 100%;
  min-height: 260px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1rem;
  padding: 0.75rem;
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
}
#learned { min-height: 0; font-family: var(--font); font-size: 1.05rem; }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.result { font-weight: bold; min-height: 1.5em; }
.result.ok { color: var(--accent); }
.result.nope { color: #b5472b; }

iframe {
  width: 100%;
  height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
