:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --link: #6ee7b7;
  --border: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--panel);
}

header a {
  color: var(--link);
  text-decoration: none;
}

header a:hover {
  text-decoration: underline;
}

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

a {
  color: var(--link);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

pre {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
}

pre.code-with-playground {
  position: relative;
  padding-right: 2.5rem;
}

a.load-in-playground,
button.load-in-playground {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--panel);
  color: var(--link);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
}

a.load-in-playground:hover,
button.load-in-playground:hover {
  border-color: var(--link);
  background: #0f172a;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

th {
  background: var(--panel);
}

.lesson-list {
  list-style: none;
  padding: 0;
}

.lesson-list li {
  margin: 0.5rem 0;
}

.lesson-list a {
  display: block;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--panel);
  text-decoration: none;
}

.lesson-list a:hover {
  border-color: var(--link);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

#error {
  color: #fca5a5;
}

body.dice-literate-report main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem;
}

body.dice-literate-report .dice-output-chart:not(:empty) {
  margin-bottom: 0.75rem;
}

body.dice-literate-report .dice-output-chart:empty {
  display: none;
}

body.dice-literate-report .dice-output {
  margin: 1rem 0;
}

body.dice-literate-report .dice-output table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

body.dice-literate-report .dice-output th,
body.dice-literate-report .dice-output td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

body.dice-literate-report .dice-output th {
  background: var(--panel);
}

body.dice-literate-report .dice-output pre {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  overflow-x: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.875rem;
}
