:root {
  --bg: #f7f9ff;
  --surface: #ffffff;
  --text: #24252c;
  --muted: #6e6a7c;
  --primary: #06165e;
  --primary-soft: #edf1fc;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
/* Dark: the device's choice unless `?theme=light|dark` pins one — the app
   passes its own setting, which need not match the phone's. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11131c;
    --surface: #1b1e2c;
    --text: #f1f2f7;
    --muted: #a3a0b3;
    --primary: #c3cdff;
    --primary-soft: #232a45;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #11131c;
  --surface: #1b1e2c;
  --text: #f1f2f7;
  --muted: #a3a0b3;
  --primary: #c3cdff;
  --primary-soft: #232a45;
  --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend Deca", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
header a.brand {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 18px;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 16px;
  font-size: 14px;
  font-weight: 500;
}
nav a[aria-current] { color: var(--primary); }
article {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}
h1 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 4px;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 6px;
}
p { margin: 0 0 10px; }
p.meta { color: var(--muted); font-size: 12px; margin: 0 0 16px; }
ul { padding-left: 18px; margin: 0 0 10px; }
li { margin: 4px 0; }
strong { font-weight: 600; }
a { color: var(--primary); }
footer { color: var(--muted); font-size: 12px; text-align: center; margin-top: 20px; }
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 12px;
  font-size: 13px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 8px 10px;
  border-bottom: 1px solid var(--primary-soft);
}
th { color: var(--primary); font-weight: 600; }
tr:last-child td { border-bottom: none; }

/* Opened inside the ScoreMate app (`?embed=1`): the app draws the backdrop
   and the page title, so the document only contributes its body. */
.embed body { background: transparent; }
.embed main { padding: 8px 16px 32px; }
.embed h1 { display: none; }
