:root {
  color-scheme: light;
  --paper: #f5f6f2;
  --ink: #202a26;
  --muted: #8b9690;
  --line: #e4e8e1;
  --green: #2e745b;
  --lime: #d7ed9f;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app {
  width: min(100% - 64px, 1056px);
  margin: 0 auto;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font: 800 14px Manrope, sans-serif;
  letter-spacing: 1.1px;
  text-decoration: none;
}

.brand-light { color: #89928c; font-weight: 500; }
.brand-mark { width: 23px; display: flex; gap: 3px; align-items: end; }
.brand-mark i { width: 5px; height: 19px; background: var(--green); border-radius: 2px; transform: skew(-18deg); }
.brand-mark i:nth-child(2) { height: 14px; background: #8cb27b; }
.brand-mark i:nth-child(3) { height: 10px; background: #c1dba0; }

.dictionary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #dfe4dc;
  border-radius: 8px;
  color: #52615a;
  background: transparent;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}

.dictionary-button:hover { background: white; border-color: #b6c5b9; }
.dictionary-button span { font-size: 18px; }

.intro { padding: 61px 0 42px; }
.eyebrow { margin: 0 0 11px; color: var(--green); font: 500 16px "DM Mono", monospace; letter-spacing: 1.8px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 11px; font: 700 clamp(38px, 5vw, 52px)/1.12 Manrope, sans-serif; letter-spacing: -2.4px; }
h1 span { color: var(--green); }
.subtitle { margin: 0; color: #7d8881; font-size: 16px; }

.finder {
  padding: 23px 24px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.55);
}

.section-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading { margin-bottom: 17px; }
.section-heading h2 { margin: 0; font: 700 16px Manrope, sans-serif; letter-spacing: -.3px; }
.text-button { padding: 4px 0; color: #88948d; border: 0; background: none; font-size: 14px; cursor: pointer; }
.text-button:hover { color: var(--green); }
.text-button span { margin-left: 4px; font-size: 13px; }

.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.filter-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 9px 10px;
  border: 1px solid #e8ebe5;
  border-radius: 8px;
  background: var(--white);
  cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.filter-card:focus-within { border-color: #7ca891; box-shadow: 0 0 0 2px rgba(46,116,91,.09); }
.filter-label { display: flex; align-items: center; gap: 7px; color: #717e76; font-size: 11px; font-weight: 600; white-space: nowrap; }
.filter-icon { display: inline-grid; width: 16px; height: 16px; place-items: center; border-radius: 5px; font-size: 12px; font-weight: 700; }
.pattern-icon { color: #398263; background: #e6f3e7; }
.contains-icon { color: #7572a7; background: #eeedf9; font-size: 15px; }
.excludes-icon { color: #b16a59; background: #f8e9e4; font-size: 15px; }
.filter-input { width: 100%; min-width: 0; margin-top: 5px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 16px/1.2 "DM Mono", monospace; letter-spacing: 2px; text-transform: uppercase; }
.filter-input::placeholder { color: #c5cbc6; font: 400 12px "DM Sans", sans-serif; letter-spacing: 0; text-transform: none; }

.keyboard-area { margin-top: 23px; }
.keyboard-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.keyboard-topline p { margin: 0; color: #77837c; font-size: 11px; }
.focus-hint { display: flex; align-items: center; gap: 6px; color: #95a098; font-size: 10px; }
.focus-dot { width: 6px; height: 6px; border-radius: 50%; background: #bad483; }
.keyboard { display: grid; gap: 6px; }
.key-row { display: flex; justify-content: center; gap: 5px; }
.key {
  display: grid;
  flex: 1;
  max-width: 66px;
  min-width: 0;
  height: 42px;
  place-items: center;
  border: 1px solid #e6e9e3;
  border-radius: 6px;
  background: #fff;
  color: #3b4841;
  font: 500 16px "DM Mono", monospace;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition: transform .08s, background .1s, border-color .1s;
}
.key:hover { border-color: #b9cbbd; background: #f9fcf7; }
.key:active { transform: translateY(1px); background: #e9f2e7; }
.key.utility { max-width: 78px; color: #698075; background: #f3f5f0; font: 600 16px "DM Sans", sans-serif; }
.key.wildcard-key { max-width: 38px; font: 500 15px "DM Mono", monospace; }
.key.space-key { flex: 1.3; max-width: 84px; font-size: 16px; }

.results { padding: 37px 0 18px; }
.results-heading { margin-bottom: 15px; }
.results-heading .eyebrow { margin-bottom: 7px; }
.results-heading h2 { display: flex; align-items: center; gap: 9px; margin: 0; font: 700 18px Manrope, sans-serif; letter-spacing: -.5px; }
.count { display: inline-grid; min-width: 23px; height: 21px; padding: 0 6px; place-items: center; border-radius: 20px; background: #e8eee4; color: #5b7d63; font: 500 10px "DM Mono", monospace; letter-spacing: 0; }
.dictionary-label { padding: 6px 9px; border: 1px solid #e4e9e1; border-radius: 20px; color: #87948b; font-size: 16px; }
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word-tile { min-width: 92px; padding: 11px 14px 10px; border: 1px solid #e5e9e3; border-radius: 7px; background: rgba(255,255,255,.68); color: #34443b; text-align: center; font: 500 16px "DM Mono", monospace; letter-spacing: 1.5px; }
.show-more { display: block; margin: 14px auto 0; padding: 9px 14px; border: 1px solid #dfe6dc; border-radius: 7px; background: white; color: var(--green); font-size: 11px; font-weight: 600; cursor: pointer; }
.show-more[hidden] { display: none; }
.show-more:hover { border-color: #9bb9a5; background: #f9fcf7; }
.empty-state { margin: 0; padding: 23px; border: 1px dashed #dce3db; border-radius: 8px; color: #7d8881; font-size:large; text-align: center; }
footer { display: flex; justify-content: space-between; margin-top: 25px; padding: 15px 0 22px; border-top: 1px solid var(--line); color: #a0aaa3; font-size: 10px; }

@media (max-width: 720px) {
  .app { width: min(100% - 36px, 560px); }
  .topbar { height: 72px; }
  .intro { padding: 42px 0 29px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .finder { padding: 18px; }
  .key { height: 43px; }
}

@media (max-width: 380px) {
  .app { width: calc(100% - 24px); }
  .finder { padding: 14px; }
  .key-row { gap: 3px; }
  .key { height: 39px; font-size: 12px; }
  .key.utility { max-width: 58px; }
  .word-tile { min-width: 82px; }
}
