:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --text: #1c1917;
  --muted: #6b6560;
  --border: #e4ddd4;
  --accent: #016b8e;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1f6;
  --tile: #f6e7c8;
  --tile-ink: #3b2a12;
  --tile-edge: #dcc59a;
  --joker: #016b8e;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.06), 0 4px 16px rgba(28, 25, 23, 0.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151311;
    --surface: #1e1b18;
    --surface-2: #28241f;
    --text: #f2eee9;
    --muted: #a39b92;
    --border: #38322b;
    --accent: #3ec1e6;
    --accent-ink: #1c1917;
    --accent-soft: #0f2a33;
    --tile: #3d3222;
    --tile-ink: #f6e7c8;
    --tile-edge: #57472f;
    --joker: #60a5fa;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --bg: #151311;
  --surface: #1e1b18;
  --surface-2: #28241f;
  --text: #f2eee9;
  --muted: #a39b92;
  --border: #38322b;
  --accent: #3ec1e6;
  --accent-ink: #1c1917;
  --accent-soft: #0f2a33;
  --tile: #3d3222;
  --tile-ink: #f6e7c8;
  --tile-edge: #57472f;
  --joker: #60a5fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
}
a {
  color: var(--accent);
}
.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}
header.top {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
header.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  gap: 8px;
  align-items: center;
}
.logo b {
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  padding: 0 7px;
  font-size: 15px;
}
.hero {
  padding: 28px 0 8px;
}
h1 {
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.15;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.sub {
  color: var(--muted);
  margin: 0 0 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.inputrow {
  display: flex;
  gap: 10px;
}
#letters {
  flex: 1;
  min-width: 0;
  font:
    600 22px/1 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  outline: none;
}
#letters:focus {
  border-color: var(--accent);
}
button {
  font: inherit;
  cursor: pointer;
}
.go {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  padding: 0 20px;
  font-weight: 700;
}
.go:disabled {
  opacity: 0.5;
  cursor: wait;
}
.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}
.keys button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 11px;
  font-weight: 600;
}
.keys .hint {
  color: var(--muted);
  font-size: 13px;
  align-self: center;
  margin-left: 4px;
}
.modes {
  display: flex;
  gap: 6px;
  margin: 14px 0 0;
  flex-wrap: wrap;
}
.modes label {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 14px;
  cursor: pointer;
  background: var(--surface);
}
.modes input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.modes label:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
details.filters {
  margin-top: 12px;
}
details.filters summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 14px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.grid label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.grid input[type="text"],
.grid input[type="number"],
.grid select {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
.check {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  color: var(--text) !important;
  font-size: 14px !important;
}
#status {
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0 6px;
  min-height: 22px;
}
.group {
  margin: 0 0 18px;
}
.group h2 {
  font-size: 15px;
  margin: 0 0 8px;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.group h2 span {
  color: var(--muted);
  font-weight: 400;
  font-size: 13px;
}
.words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.w {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}
.w:hover {
  border-color: var(--accent);
}
.w .j {
  color: var(--joker);
  font-weight: 700;
  text-decoration: underline dotted;
}
.w small {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.more {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
}
.tiles {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 4px 0 0;
}
.tile {
  width: 30px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  background: var(--tile);
  color: var(--tile-ink);
  border: 1px solid var(--tile-edge);
  border-bottom-width: 3px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 15px;
  position: relative;
}
.tile sub {
  position: absolute;
  right: 2px;
  bottom: 0;
  font-size: 8px;
  font-weight: 600;
}
article {
  margin: 36px 0 0;
}
article h2 {
  font-size: 22px;
  margin: 30px 0 8px;
  letter-spacing: -0.01em;
}
article h3 {
  font-size: 16px;
  margin: 18px 0 4px;
}
article p,
article li {
  color: var(--text);
}
article .muted {
  color: var(--muted);
}
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.examples a {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  text-decoration: none;
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: 0.06em;
}
footer {
  margin: 48px 0 0;
  padding: 20px 0 32px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
@media (max-width: 520px) {
  .go {
    padding: 0 14px;
  }
  #letters {
    font-size: 19px;
    letter-spacing: 0.08em;
  }
}
