:root {
  /* Layout: one left-aligned column on a green game table; the checked word lies as tiles on an ivory score sheet. */
  --felt: #17463a;
  --felt-deep: #0f3229;
  --felt-line: #1e5445;
  --sheet: #f8f4e8;
  --sheet-line: #ddd5bd;
  --tile: #efdfb8;
  --tile-edge: #c4b07c;
  --ink: #1a231f;
  --ink-soft: #55615b;
  --on-felt: #eef3ee;
  --on-felt-soft: #b9cdc4;
  --accent: #a3d3ea;
  --accent-ink: #0d2b3a;
  --ok: #1b7443;
  --maybe: #96580a;
  --no: #ab2a20;
  --font-ui: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-read: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--felt);
  background-image:
    linear-gradient(var(--felt-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--felt-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: 16px 12px;
  color: var(--on-felt);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
}
main {
  max-width: 35rem;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 20px;
}
h1 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.05;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.lead { margin: 6px 0 0; color: var(--on-felt-soft); max-width: 30rem; }

form { display: flex; gap: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#mot {
  flex: 1 1 auto;
  min-width: 0;
  height: 56px;
  padding: 0 14px;
  border: 2px solid var(--felt-deep);
  border-radius: 6px;
  background: var(--sheet);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.35rem;
  font-weight: 700;
  font-stretch: 110%;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#mot::placeholder { color: #8b9189; font-weight: 500; letter-spacing: 0; text-transform: none; font-stretch: 100%; }
#go {
  flex: 0 0 auto;
  height: 56px;
  padding: 0 18px;
  border: 2px solid var(--felt-deep);
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
#go:active { transform: translateY(1px); }
#mot:focus-visible, #go:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.sheet {
  background: var(--sheet);
  color: var(--ink);
  border-radius: 6px;
  border: 2px solid var(--felt-deep);
  box-shadow: 0 6px 0 var(--felt-deep);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sample { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.tiles { display: flex; flex-wrap: wrap; gap: 4px; --s: 40px; }
.tile {
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: calc(var(--s) * 0.12);
  background: var(--tile);
  box-shadow: inset 0 calc(var(--s) * -0.07) 0 var(--tile-edge);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-stretch: 100%;
  font-size: calc(var(--s) * 0.56);
  line-height: 1;
  padding-bottom: calc(var(--s) * 0.07);
}
.tile sub {
  position: absolute;
  right: calc(var(--s) * 0.1);
  bottom: calc(var(--s) * 0.12);
  font-size: calc(var(--s) * 0.22);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tiles.small .tile sub { display: none; }

.verdict { display: flex; align-items: center; gap: 10px; }
.verdict svg { flex: 0 0 auto; width: 38px; height: 38px; }
.verdict strong {
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
.sheet[data-status="valid"] .verdict { color: var(--ok); }
.sheet[data-status="rare"] .verdict { color: var(--maybe); }
.sheet[data-status="no"] .verdict { color: var(--no); }
.sheet[data-status="wait"] .verdict { color: var(--ink-soft); }
.why { margin: -6px 0 0; color: var(--ink-soft); max-width: 32rem; }
.official { align-self: flex-start; display: inline-block; padding: 11px 16px; border: 2px solid var(--felt-deep); border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; }

.defs { display: flex; flex-direction: column; gap: 16px; border-top: 1px solid var(--sheet-line); padding-top: 14px; }
.lemma { display: flex; flex-direction: column; gap: 6px; }
.lemma + .lemma { border-top: 1px solid var(--sheet-line); padding-top: 14px; }
.lemma h2 {
  margin: 0;
  font-family: var(--font-read);
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.formnote { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }
.pos { margin: 2px 0 0; font-family: var(--font-read); font-style: italic; font-size: 0.98rem; color: var(--ink-soft); }
.lemma ol, .lemma ul {
  margin: 0;
  padding-left: 1.4em;
  font-family: var(--font-read);
  font-size: 1.04rem;
  line-height: 1.55;
  max-width: 34rem;
}
.lemma ul { list-style: none; padding-left: 0; }
.lemma li + li { margin-top: 4px; }
.lemma li { overflow-wrap: anywhere; }
.none { margin: 0; font-family: var(--font-read); color: var(--ink-soft); }
.src { align-self: flex-start; font-size: 0.9rem; color: #1d4f6b; text-underline-offset: 2px; }

footer { color: var(--on-felt-soft); font-size: 0.86rem; line-height: 1.5; max-width: 34rem; }
footer p { margin: 0; }
footer p + p { margin-top: 8px; }
footer a { color: var(--on-felt); text-underline-offset: 2px; }

@media (min-width: 480px) {
  main { padding-top: 44px; }
  h1 { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet.in .tile { animation: drop 0.22s cubic-bezier(.2,.8,.3,1.2) both; animation-delay: calc(var(--i) * 22ms); }
  @keyframes drop { from { transform: translateY(-9px); opacity: 0.2; } to { transform: none; opacity: 1; } }
}
.home-links { color: var(--on-felt-soft); font-size: 0.95rem; }
.home-links p { margin: 0 0 8px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.letters a { display: inline-grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 6px; background: var(--tile); color: var(--ink); text-decoration: none; font-weight: 700; }
.intro .lemma p { margin: 0; font-family: var(--font-read); line-height: 1.55; }

.wordnav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.95rem; }
.wordnav a, .crumbs a, .letters a, .pager a, .wordlist a, .lemma h2 a, .formnote a { color: inherit; }
.crumbs { font-size: 0.9rem; color: var(--on-felt-soft); margin: 0; }
.crumbs a { color: var(--on-felt); }
.points { margin: 0; color: var(--ink-soft); }
.letters { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.letters a { display: inline-grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 6px; background: var(--tile); color: var(--ink); text-decoration: none; font-weight: 700; }
.letters a[aria-current] { outline: 2px solid var(--accent); }
.wordlist { columns: 3 9rem; column-gap: 18px; padding: 0; margin: 0; list-style: none; }
.wordlist li { break-inside: avoid; padding: 2px 0; }
.pager { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.95rem; }
.pager span { font-weight: 700; }
.home-links { color: var(--on-felt-soft); font-size: 0.95rem; }
.home-links a { color: var(--on-felt); }
