/* The game's fonts and colours (../style.css), and its Clair / Sombre setting (data-theme, from /storage.js). */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(/fonts/bricolage-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url(/fonts/bricolage-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/instrument-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/instrument-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --bg: #f4eee2;
  --card: #fffdf8;
  --ink: #1f3a5f;
  --muted: #5d6a7d;
  --line: rgba(31, 58, 95, .2);
  --accent: #1f3a5f;
  --accent-ink: #ffffff;
  --accent-soft: #eef2f8;
  --fill: #1f3a5f;
  --good: #3c7a34;
  --good-soft: #e4efda;
  --bad: #a8302a;
  --bad-soft: #f8dcd8;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f1823;
  --card: #172230;
  --ink: #dbe5f2;
  --muted: #98a6b9;
  --line: rgba(200, 215, 235, .2);
  --accent: #a9c1e8;
  --accent-ink: #0f1823;
  --accent-soft: #22364f;
  --fill: #2f5585;
  --good: #8acb7d;
  --good-soft: #1d3421;
  --bad: #f2897b;
  --bad-soft: #3d2222;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1823;
    --card: #172230;
    --ink: #dbe5f2;
    --muted: #98a6b9;
    --line: rgba(200, 215, 235, .2);
    --accent: #a9c1e8;
    --accent-ink: #0f1823;
    --accent-soft: #22364f;
    --fill: #2f5585;
    --good: #8acb7d;
    --good-soft: #1d3421;
    --bad: #f2897b;
    --bad-soft: #3d2222;
    color-scheme: dark;
}
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--body);
}
h1, h2, .prompt, .score { font-family: var(--display); }
header.site, footer.site { max-width: 680px; margin: 0 auto; padding: 12px 16px 0; }
footer.site { padding: 0 16px 32px; }
header.site .home { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 600; text-decoration: none; }
header.site .home:hover { color: var(--ink); text-decoration: underline; }
footer.site a { color: inherit; }
main { padding-top: 8px; }
main { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 4px; }
h2 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { padding: 0; font-weight: 600; margin-bottom: 8px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choices span { display: block; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.choices input:checked + span { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.choices input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.primary, .secondary { min-height: 46px; padding: 10px 18px; border-radius: 8px; font-weight: 600; }
.primary { background: var(--fill); color: #fff; border: 1px solid var(--fill); }
.secondary { background: var(--card); border: 1px solid var(--line); }
.primary:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.link { background: none; border: 0; padding: 10px 0; color: var(--muted); text-decoration: underline; min-height: 44px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 20px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.tag { display: inline-block; font-size: .8125rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 6px; margin-right: 4px; }

.prompt { font-size: 1.375rem; line-height: 1.35; font-weight: 600; margin: 12px 0; }
.passage { font-size: 1.0625rem; border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin: 12px 0; }
.audio { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.play { min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.play.quiet { border-color: var(--line); background: transparent; color: var(--ink); font-weight: 500; }
.play[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.options { display: grid; gap: 8px; margin: 16px 0; }
.option { display: flex; gap: 12px; align-items: flex-start; width: 100%; min-height: 48px; padding: 11px 14px; text-align: left; border-radius: 8px; border: 1px solid var(--line); background: var(--card); }
.option:not(:disabled):hover { border-color: var(--accent); }
.option:disabled { cursor: default; color: var(--ink); }
.option kbd { font: inherit; font-size: .875rem; color: var(--muted); min-width: 1ch; }
.option.right { background: var(--good-soft); border-color: var(--good); font-weight: 600; }
.option.wrong { background: var(--bad-soft); border-color: var(--bad); }

.feedback { border-radius: 12px; padding: 14px 16px; margin: 16px 0; background: var(--card); border: 1px solid var(--line); }
.verdict { font-weight: 700; margin-bottom: 4px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.french { font-size: 1.125rem; font-weight: 600; margin-bottom: 0; }
.next { width: 100%; }

.score { font-size: 3rem; line-height: 1; font-weight: 700; margin: 8px 0 20px; font-variant-numeric: tabular-nums; }
.review { list-style: none; padding: 0; margin: 0; }
.review li { padding: 12px 0; border-top: 1px solid var(--line); }
.stat { font-variant-numeric: tabular-nums; }
.hint { margin-top: 16px; }
@media (max-width: 480px) { .hint { display: none; } .prompt { font-size: 1.25rem; } }

/* Topic drill, typed answers and dictation */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; margin-bottom: 8px; }
select { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 8px; min-height: 44px; padding: 8px 10px; width: 100%; max-width: 100%; }
select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.typed { margin: 16px 0; }
.typed input[type="text"] { font: inherit; font-size: 1.125rem; color: inherit; background: var(--card); width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.typed input[type="text"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.typed input.right { background: var(--good-soft); border-color: var(--good); }
.typed input.wrong { background: var(--bad-soft); border-color: var(--bad); }
.accents { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 12px; }
.accents button { min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.instruction { margin: 0 0 4px; }
mark { background: var(--bad-soft); color: var(--bad); border-radius: 3px; padding: 0 2px; font-weight: 700; }
.lines p { margin: 0 0 4px; }
.override { margin-top: 4px; }
.lines .turn { padding: 2px 0; }
.lines .turn { display: flex; gap: 8px; align-items: baseline; }
.speaker { flex: none; font-size: .75rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; }

/* Conjugation tables in the explanations */
.conj { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.conj table { border-collapse: collapse; width: 100%; max-width: 420px; }
.conj caption { text-align: left; padding-bottom: 6px; }
.conj td { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.conj td.who { color: var(--muted); width: 1%; white-space: nowrap; padding-left: 0; }
.conj tr.hi td { background: var(--accent-soft); font-weight: 700; color: var(--ink); }
.conj tr.hi td.who { padding-left: 8px; border-radius: 6px 0 0 6px; }
.conj tr.hi td:last-child { border-radius: 0 6px 6px 0; }
.conj p { margin: 8px 0 0; }
