:root {
  color-scheme: light;
  --text: #1f2328;
  --background: #ffffff;
  --button: #eef1f4;
  --button-picked: #1f2328;
  /* R41: each at least 4.5:1 against the background. */
  --right: #1a7f37;
  --wrong: #cf222e;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 18px;
}

/* The whole screen, so a tap anywhere lands in it (R36), with the content
   centered at most 32rem wide. */
#app {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px max(12px, calc((100% - 32rem) / 2)) 32px;
}

#app.tap-anywhere {
  cursor: pointer;
}

h1 {
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}

pre,
.prefix,
.question,
.answer,
.settings {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* R37: the feedback and results keep every space, and the widest line
   (33 characters) fits on one line on a screen 320 CSS pixels wide. */
pre {
  margin: 1em 0;
  white-space: pre;
  font-size: clamp(12px, 4vw, 16px);
  line-height: 1.4;
}

button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c9d1d9;
  border-radius: 8px;
  background: var(--button);
  color: var(--text);
  font: inherit;
  touch-action: manipulation;
}

button[aria-pressed="true"] {
  background: var(--button-picked);
  color: var(--background);
}

button:disabled {
  opacity: 0.5;
}

.menu-buttons,
.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 16rem;
}

.actions {
  flex-direction: row;
}

.option-row {
  margin: 0 0 16px;
}

.option-row h2 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.error {
  color: var(--text);
  font-weight: 600;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}

.question {
  margin: 24px 0 4px;
  text-align: center;
  font-size: 1.6rem;
}

.answer {
  min-height: 1.4em;
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.6rem;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 20rem;
  margin: 0 auto;
}

.keypad button {
  min-height: 56px;
  font-size: 1.4rem;
}

.confirm {
  text-align: center;
}

.confirm .actions {
  justify-content: center;
}

.right {
  color: var(--right);
}

.wrong {
  color: var(--wrong);
}

table {
  border-collapse: collapse;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: clamp(12px, 4vw, 16px);
}

th,
td {
  padding: 4px 10px;
  border: 1px solid #c9d1d9;
  text-align: left;
}

/* R44: the tap-anywhere prompt is a button, for screen readers and Tab, styled as a line of text. */
button.prompt {
  display: block;
  margin-top: 1.5em;
  padding: 0;
  border: none;
  background: none;
  font-weight: 600;
  text-align: left;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* R45: the error's type and message, as Python wrote them. */
.crash-error {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* R46: the privacy page, laid out like the game's screens. */
#privacy {
  max-width: 32rem;
  margin: 0 auto;
  padding: 16px 12px 32px;
}
