/* Layout: one centred column — letter rack input up top, results as tile-words grouped by length below */
:root{
  --bg:#eef1f4; --surface:#ffffff; --ink:#18232e; --muted:#5d6b78; --line:#d6dde4;
  --accent:#1f7a6d; --accent-ink:#ffffff; --accent-soft:#dff0ec;
  --tile:#f3e3c3; --tile-edge:#d8c095; --tile-ink:#2a2116;
  --f-display:"Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body:"Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-tile:"DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#10171d; --surface:#18222b; --ink:#e7edf2; --muted:#93a3b1; --line:#2a3743;
  --accent:#3fb7a4; --accent-ink:#06201c; --accent-soft:#16332f;
  --tile:#e6d2a8; --tile-edge:#b39a6a; --tile-ink:#231b10; color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#10171d; --surface:#18222b; --ink:#e7edf2; --muted:#93a3b1; --line:#2a3743;
  --accent:#3fb7a4; --accent-ink:#06201c; --accent-soft:#16332f;
  --tile:#e6d2a8; --tile-edge:#b39a6a; --tile-ink:#231b10; color-scheme:dark;
}
*{box-sizing:border-box}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.5}
.wrap{max-width:760px;margin:0 auto;padding-inline:16px;padding-block:40px 64px;display:flex;flex-direction:column;gap:28px}
header{display:flex;flex-direction:column;gap:10px}
.brand{display:flex;gap:6px}
.brand .tile{width:30px;height:30px;font-size:16px}
h1{font-family:var(--f-display);font-weight:800;font-size:clamp(2rem,6vw,2.9rem);line-height:1.05;letter-spacing:-.02em;margin:0;text-wrap:balance}
.lede{margin:0;color:var(--muted);max-width:60ch}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:20px;display:flex;flex-direction:column;gap:14px;box-shadow:0 10px 30px -18px rgba(10,30,40,.35)}
label.lbl{font-size:.78rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.row{display:flex;gap:10px;flex-wrap:wrap}
#letters{flex:1 1 240px;min-width:0;font-family:var(--f-tile);font-size:1.4rem;letter-spacing:.18em;text-transform:uppercase;padding:14px 16px;border-radius:12px;border:2px solid var(--line);background:var(--bg);color:var(--ink);outline:none;transition:border-color .15s}
#letters:focus{border-color:var(--accent)}
#letters::placeholder{letter-spacing:.04em;font-size:1rem;text-transform:none;font-family:var(--f-body);color:var(--muted)}
button{font-family:var(--f-body);font-weight:600;font-size:1rem;cursor:pointer;border-radius:12px;border:0}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.go{flex:0 0 auto;background:var(--accent);color:var(--accent-ink);padding:14px 26px;transition:transform .1s,filter .15s}
.go:hover{filter:brightness(1.08)}.go:active{transform:translateY(1px)}
.rack{display:flex;flex-wrap:wrap;gap:6px;min-height:44px;align-items:center}
.rack .empty{color:var(--muted);font-size:.9rem}
.tile{display:inline-flex;align-items:center;justify-content:center;position:relative;width:40px;height:40px;border-radius:7px;background:var(--tile);color:var(--tile-ink);font-family:var(--f-tile);font-size:1.25rem;text-transform:uppercase;box-shadow:inset 0 -3px 0 var(--tile-edge),0 1px 2px rgba(0,0,0,.18)}
.tile sub{position:absolute;right:4px;bottom:3px;font-size:.5rem;line-height:1}
.tile.blank{background:transparent;border:2px dashed var(--tile-edge);box-shadow:none;color:var(--muted)}
.controls{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center;font-size:.92rem;color:var(--muted)}
.controls select{font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:5px 8px}
.check{display:inline-flex;gap:8px;align-items:center;cursor:pointer}
.check input{accent-color:var(--accent);width:17px;height:17px}
.filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding-top:14px;border-top:1px solid var(--line)}
.fld{display:flex;flex-direction:column;gap:5px;min-width:0}
.fld .lbl{font-size:.7rem}
.fin{width:100%;min-width:0;font:inherit;font-family:var(--f-tile);text-transform:uppercase;letter-spacing:.08em;font-size:.95rem;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:9px;padding:8px 10px;outline:none}
.fin::placeholder{text-transform:none;letter-spacing:0;font-family:var(--f-body);color:var(--muted)}
.fin:focus{border-color:var(--accent)}
.fin.on{border-color:var(--accent);background:var(--accent-soft)}
.reset{align-self:flex-start;background:none;color:var(--accent);padding:0;font-size:.9rem;text-decoration:underline;text-underline-offset:3px}
@media (max-width:600px){.filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
.hint{font-size:.85rem;color:var(--muted);margin:0}
.hint kbd{font-family:var(--f-tile);background:var(--bg);border:1px solid var(--line);border-radius:5px;padding:0 5px}

.summary{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:baseline;gap:4px 12px}
.summary h2{font-family:var(--f-display);font-weight:600;font-size:1.35rem;margin:0}
.summary .meta{color:var(--muted);font-size:.9rem}
.groups{display:flex;flex-direction:column;gap:22px}
.group h3{display:flex;align-items:center;gap:10px;margin:0 0 10px;font-size:.85rem;font-weight:600;letter-spacing:.02em;color:var(--muted)}
.group h3::after{content:"";flex:1;height:1px;background:var(--line)}
.words{display:flex;flex-wrap:wrap;gap:8px}
.word{display:inline-flex;align-items:baseline;gap:8px;padding:7px 12px;border-radius:999px;background:var(--surface);border:1px solid var(--line);color:var(--ink);font-family:var(--f-tile);font-size:1rem;letter-spacing:.04em;cursor:pointer;transition:background .12s,border-color .12s}
.word:hover{border-color:var(--accent);background:var(--accent-soft)}
.word .pts{font-family:var(--f-body);font-size:.72rem;color:var(--muted)}
.word.rare{color:var(--muted)}
.word.copied{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.word.copied .pts{color:var(--accent-ink)}
.none{padding:28px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:14px}
footer{font-size:.82rem;color:var(--muted)}
/* site chrome */
.site{display:flex;flex-direction:column;gap:14px}
.sitebar{display:flex;align-items:center;gap:12px}
.sitename{font-family:var(--f-display);font-weight:800;font-size:1.05rem;letter-spacing:-.01em}
.nav{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin-inline:-16px;padding-inline:16px;padding-block:2px}
.nav::-webkit-scrollbar{display:none}
.nav a{flex:0 0 auto;background:transparent;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:8px 14px;font-size:.92rem;font-weight:500;white-space:nowrap}
.nav a:hover{color:var(--ink);border-color:var(--muted)}
.nav a[aria-current="page"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.view{display:flex;flex-direction:column;gap:28px}
.vhead{display:flex;flex-direction:column;gap:8px}
textarea.box{width:100%;min-width:0;font:inherit;font-size:1rem;color:var(--ink);background:var(--bg);border:2px solid var(--line);border-radius:12px;padding:12px 14px;outline:none;resize:vertical;line-height:1.5}
textarea.box:focus{border-color:var(--accent)}
.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.fldcol{display:flex;flex-direction:column;gap:6px;min-width:0}
.outlist{display:flex;flex-direction:column;gap:8px}
.outitem{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 16px;border-radius:12px;background:var(--surface);border:1px solid var(--line);font-family:var(--f-tile);font-size:1.1rem;letter-spacing:.06em;cursor:pointer;text-align:left;color:var(--ink);width:100%;overflow-wrap:anywhere}
.outitem:hover{border-color:var(--accent);background:var(--accent-soft)}
.outitem .cp{font-family:var(--f-body);font-size:.75rem;letter-spacing:0;color:var(--muted);flex:0 0 auto}
.outitem.copied{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.outitem.copied .cp{color:var(--accent-ink)}
.ghost{background:transparent;color:var(--accent);border:1px solid var(--accent);padding:8px 14px;font-size:.9rem}
.ghost:hover{background:var(--accent-soft)}
.prose{display:flex;flex-direction:column;gap:22px;max-width:65ch}
.prose h2{font-family:var(--f-display);font-weight:600;font-size:1.3rem;margin:0 0 6px}
.prose h3{font-size:1rem;margin:0 0 4px}
.prose p,.prose ol,.prose ul{margin:0;color:var(--ink)}
.prose ol,.prose ul{padding-left:1.3em;display:flex;flex-direction:column;gap:6px}
.prose .muted{color:var(--muted);font-size:.9rem}
.steps{display:grid;gap:12px}
.step{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;align-items:start}
.step .tile{width:34px;height:34px;font-size:1rem;grid-row:span 2}
.faq details{border-bottom:1px solid var(--line);padding-block:14px}
.faq details:first-child{border-top:1px solid var(--line)}
.faq summary{cursor:pointer;font-weight:600;list-style:none;display:flex;justify-content:space-between;gap:14px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";font-family:var(--f-tile);color:var(--accent);font-size:1.2rem;line-height:1}
.faq details[open] summary::after{content:"−"}
.faq details p{margin:10px 0 0;color:var(--muted)}
.inlink{background:none;color:var(--accent);padding:0;font-size:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;border-radius:0}
.ad{display:flex;flex-direction:column;gap:6px;padding-top:12px;border-top:1px solid var(--line);min-width:0}
.adlabel{font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.ad ins{min-height:100px;width:100%}
.ad:has(ins[data-ad-status="unfilled"]){display:none}
@media (max-width:600px){.two{grid-template-columns:1fr}}
@media (max-width:480px){.go{flex:1 1 100%}.tile{width:34px;height:34px;font-size:1.05rem}.wrap{padding-block:24px 48px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

.nav a{text-decoration:none;display:inline-flex;align-items:center}
.sitebar a.home{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none}
a{color:var(--accent)}
a:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:4px}
.crumbs{font-size:.85rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px}
.crumbs a{color:var(--muted)}
.about{display:flex;flex-direction:column;gap:18px;max-width:65ch}
.about h2{font-family:var(--f-display);font-weight:600;font-size:1.3rem;margin:0 0 4px}
.about p{margin:0}
.linkgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px;max-width:none}
.linkgrid a{display:block;padding:10px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);text-decoration:none;font-weight:500}
.linkgrid a:hover{border-color:var(--accent);background:var(--accent-soft)}
.linkgrid a small{display:block;color:var(--muted);font-weight:400;font-size:.8rem}
.wl-jump{display:flex;flex-wrap:wrap;gap:6px}
.wl-jump a{font-family:var(--f-tile);text-transform:uppercase;text-decoration:none;min-width:34px;text-align:center;padding:5px 8px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--surface)}
.wl-jump a:hover{border-color:var(--accent)}
.wl-group{scroll-margin-top:16px}
.wl-group h2{display:flex;align-items:center;gap:10px;font-size:.95rem;font-weight:600;color:var(--muted);margin:0 0 10px}
.wl-group h2::after{content:"";flex:1;height:1px;background:var(--line)}
.wl{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 8px}
.wl li{font-family:var(--f-tile);font-size:.95rem;letter-spacing:.03em;padding:4px 10px;border-radius:999px;background:var(--surface);border:1px solid var(--line)}
.wl li span{font-family:var(--f-body);font-size:.7rem;color:var(--muted);margin-left:6px}
.stats{display:flex;flex-wrap:wrap;gap:8px 20px;color:var(--muted);font-size:.9rem}
.stats strong{color:var(--ink);font-variant-numeric:tabular-nums}
.cta{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-radius:14px;background:var(--accent-soft);border:1px solid var(--line)}
.cta p{margin:0}
.cta a.go{display:inline-block;text-decoration:none;border-radius:12px}
@media (min-width:700px){.nav{flex-wrap:wrap;overflow:visible;margin-inline:0;padding-inline:0}}
footer{display:flex;flex-wrap:wrap;gap:6px 14px}
footer a{color:var(--muted)}
