:root {
  --bg: #f6f5f1;
  --fg: #1d2433;
  --muted: #6b7280;
  --line: #ddd8ce;
  --tile: #ffffff;
  --accent: #c2410c;
  --accent-soft: #fde4d4;
  --in: #1d4ed8;
  --in-soft: #dbe6ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141820;
    --fg: #e8e6df;
    --muted: #9aa0a8;
    --line: #353b46;
    --tile: #1c212b;
    --accent: #fb923c;
    --accent-soft: #4a2a17;
    --in: #93b4ff;
    --in-soft: #1e2a4a;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 440px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
h1 {
  font-size: 22px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 16px 0 4px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.primary {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 22px;
}
#intro .primary {
  display: block;
  margin: 16px auto;
  font-size: 18px;
}
#game {
  display: flex;
  flex-direction: column;
  flex: 1;
}
[hidden] {
  display: none !important;
}

/* The board: a row per guess, five letters and the two counts. Letters are never coloured by the answer. */
#rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 10px 0 4px;
}
.row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 84px;
  gap: 5px;
  align-items: center;
}
.t {
  height: 40px;
  border: 1.5px solid var(--line);
  background: var(--tile);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  text-transform: uppercase;
  user-select: none;
}
.row.cur .t {
  border-color: var(--muted);
}
/* Notepad marks, shown as the letter's text only (never the tile): out is struck through, in is underlined. */
.x {
  text-decoration: line-through;
  color: var(--muted);
}
.k {
  color: var(--in);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.score {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.pill {
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
  font-weight: 600;
}
.pill.here {
  background: var(--accent);
  color: #fff;
}
.pill.near {
  background: var(--accent-soft);
  color: var(--fg);
}
.score .count {
  color: var(--muted);
  font-size: 13px;
}
.row.shake {
  animation: shake 0.3s;
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.example {
  margin: 12px 0;
}
.example figcaption {
  font-size: 14px;
  margin-top: 6px;
}
#msg {
  min-height: 22px;
  margin: 2px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
#done {
  border: 1px solid var(--line);
  background: var(--tile);
  border-radius: 10px;
  padding: 12px;
  margin: 4px 0 8px;
}
#done pre {
  margin: 8px 0;
  font: 15px/1.25 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
}
#done p {
  margin: 6px 0 0;
  font-size: 14px;
}
.buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#next {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 8px 16px;
}

/* The notepad and keyboard, kept at the bottom of the screen on a phone. */
#pad {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: var(--bg);
  padding: 6px 0 max(8px, env(safe-area-inset-bottom));
}
.pad-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
#mode {
  border: 1px solid var(--line);
  background: var(--tile);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  white-space: nowrap;
}
#mode[aria-pressed="true"] {
  background: var(--in-soft);
  color: var(--in);
  border-color: var(--in);
}
#kb {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kr {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.key {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--line);
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  touch-action: manipulation;
  padding: 0;
}
.key.wide {
  flex: 1.5;
  font-size: 13px;
  text-transform: none;
}
.key.x {
  background: transparent;
  outline: 1px dashed var(--line);
}
.key.k {
  background: var(--in-soft);
}
/* The maker line under the game (game-kiln#144): small, the same on every sketch. */
.kiln-maker {
  margin: 0;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.kiln-maker a {
  color: inherit;
}
