:root{--paper:#f6f5ee;--ink:#283d34;--muted:#606b5e;--line:#dedfd5;--green:#52795a;--yellow:#907026;--gray:#cbd0c7}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.app{max-width:720px;margin:auto;padding:0 8px}
button,select{font:inherit;color:inherit;touch-action:manipulation}
button{cursor:pointer}
button:focus,a:focus,select:focus{outline:2px solid var(--yellow);outline-offset:2px}
button:disabled{opacity:.5;cursor:default}
[hidden]{display:none!important}
header{height:52px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;text-decoration:none;color:var(--ink);font-size:25px;font-weight:750;letter-spacing:-1px}
.brand b{display:flex;align-items:center;justify-content:center;background:var(--green);color:white;width:28px;height:30px;font-family:Georgia,serif;font-size:25px;border-radius:4px;margin-right:6px}
.brand span{color:var(--green)}
nav{display:flex;align-items:flex-start}
nav>*+*{margin-left:4px}
nav button,.dialog-head button{border:1px solid var(--line);background:transparent;min-width:44px;height:44px;border-radius:2px}
nav select,#modal select,#word-length{border:1px solid var(--line);background-color:var(--paper);color:var(--ink)}
nav select,#modal select{font-size:20px;width:74px}
main{max-width:486px;margin:6px auto 0;text-align:center}
/* The board is the play screen's title; decorative copy stays out of its height budget. */
.eyebrow,h1{display:none}
.play-options{display:flex;align-items:flex-start}
.modes{display:flex;flex:1;min-width:0;background:#e9eae1;border-radius:4px;padding:0}
.modes button{flex:1;min-width:0;border:1px solid transparent;background:transparent;font-size:12px;font-weight:600}
.modes .active{background:var(--paper);border-color:var(--line);font-weight:750}
.lengths{margin-left:6px;flex:none}
#word-length{width:100px;font-size:13px}
.meta{display:flex;justify-content:space-between;text-align:left;font-size:11px;line-height:16px;color:var(--muted);margin:6px 0}
.meta span+span{margin-left:6px;text-align:right}
#board{display:grid;gap:2px;width:100%;margin:0 auto}
.tile{height:32px;min-width:0;min-height:0;padding:0;border:1px solid #d8dbcf;border-radius:2px;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;line-height:1;position:relative}
.tile.current{border-color:#b2bdab}.tile.filled{border-color:#81927c}
.correct{background:var(--green)!important;color:#fff!important;border-color:var(--green)!important}
.present{background:var(--yellow)!important;color:#fff!important;border-color:var(--yellow)!important}
.absent{background:var(--gray)!important;color:var(--ink)!important;border-color:var(--gray)!important}
.tile.correct:after{content:'●';position:absolute;bottom:1px;right:2px;font-size:5px}
.tile.present:after{content:'↔';position:absolute;bottom:0;right:1px;font-size:8px}
.tile.absent:after{content:'×';position:absolute;bottom:0;right:1px;font-size:8px}
#message{font-family:'Arial Narrow',Arial,sans-serif;font-stretch:condensed;font-size:14px;min-height:34px;line-height:18px;padding:4px 0;color:var(--muted)}
#message.error{color:#8c402b}
#keyboard{display:flex;flex-direction:column;margin:4px auto 0;width:100%;max-width:486px}
.keyrow{display:flex;flex-wrap:nowrap;justify-content:center;width:100%}
.keyrow+.keyrow{margin-top:4px}
/* User-requested narrow-screen QWERTY exception: keys remain 44px tall. */
.key{background:#eef0e9;border:0;border-radius:2px;height:44px;min-height:44px;min-width:0;max-width:44px;flex:1 1 0;padding:0;font-size:15px;font-weight:650;line-height:1}
.key+.key{margin-left:3px}
.key.wide{flex:1.5 1 0;max-width:66px;font-size:11px}
.key:active{background:#c9d1c0}
.legend{display:flex;justify-content:center;flex-wrap:wrap;font-size:10px;line-height:16px;color:var(--muted);margin:8px 0 0}
.legend>span{display:flex;align-items:center;margin:0 4px}
.legend i{width:7px;height:7px;border-radius:2px;margin-right:4px}
.under{display:flex;justify-content:center;margin-top:2px}
.under button{border:0;background:transparent;text-decoration:underline;font-size:13px}
.under button+button{margin-left:8px}
.primary,.secondary{background:var(--green);color:white;border:0;border-radius:2px;font-size:12px;margin:2px}
.secondary{background:#e4e7dd;color:var(--ink)}
footer{border-top:1px solid var(--line);margin-top:6px;display:flex;justify-content:space-between;padding:8px 0;color:var(--muted);font-size:11px;line-height:16px}
footer span+span{margin-left:8px}
#overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#203b3455;display:flex;align-items:center;justify-content:center;z-index:10;padding:16px}
#modal{width:100%;max-width:460px;max-height:calc(100vh - 32px);overflow:auto;background:var(--paper);color:var(--ink);padding:16px;border-radius:4px;border:1px solid var(--line);box-shadow:0 15px 60px #203b3420;text-align:left}
.dialog-head{display:flex;justify-content:space-between;align-items:flex-start;position:sticky;top:-16px;padding-top:8px;background:var(--paper);z-index:1}
.dialog-head h2{margin:0 8px 16px 0;font-family:Georgia,serif;font-size:28px;font-weight:400;overflow-wrap:break-word;min-width:0}
.dialog-head button{flex-shrink:0}
#modal p{font-size:14px;line-height:1.6}
#modal h3{font-size:16px;margin:24px 0 8px}
#modal button:not(#close){min-height:44px;padding:6px 10px;margin:4px 4px 4px 0;border:1px solid var(--line);border-radius:2px;background:#e4e7dd}
#modal label{display:flex;align-items:center;min-height:44px}
#modal input[type=checkbox]{width:22px;height:22px;margin-right:8px;flex:none}
#modal textarea{width:100%;min-height:150px;font:14px monospace}
#modal button svg{vertical-align:middle;margin-right:6px}
#close svg{margin:0!important}
#save-warning{border:1px solid #ad553a;padding:12px;color:#8c402b;line-height:1.5;font-size:13px}
@media(max-height:640px){footer{display:none}.legend{margin-top:4px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Mode controls retain the same compact play frame. */
.boards{display:flex;align-items:flex-start;justify-content:center}
.boards>div:not([hidden]){display:grid;gap:2px;flex:none;margin:0 auto}
#board-two{width:100%}
#games{font-size:13px;background:transparent;border-color:var(--line)}
#fixed-mode{flex:1;min-width:0;min-height:44px;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700}
.meta{align-items:center}.meta span{min-width:0;flex:1;overflow-wrap:break-word}
#board-switch{font-size:12px;max-width:110px;margin:0 4px}
.tile.revealed{box-shadow:inset 0 0 0 1px var(--ink)}
.tile.path-step{background:#e9eae1}
#modal .challenge-label{display:block}
#challenge-word{display:block;width:100%;min-width:0;min-height:44px;margin-top:6px;border:1px solid var(--line);border-radius:2px;background:var(--paper);color:var(--ink);font-size:20px;padding:4px 8px}
#modal-body button[aria-pressed=true]{background:var(--ink);color:var(--paper)}
/* Both puzzles remain visible; long words stack without shrinking letters. */
.boards.dual>div{margin:0}
.boards.dual>div+div{margin-left:12px}
.boards.stacked{flex-direction:column;align-items:center}
.boards.stacked>div+div{margin:12px 0 0}
.boards.dual .keyboard-source{outline:2px solid var(--ink);outline-offset:2px}
#modal-body.picker{text-align:center}
.stats-table{width:100%;border-collapse:collapse;font-size:13px;font-variant-numeric:tabular-nums}
.stats-table caption{text-align:left;font-weight:700;padding:8px 0 12px}
.stats-table th,.stats-table td{padding:10px 5px;border-bottom:1px solid var(--line);text-align:right}
.stats-table th:first-child{text-align:left}
.stats-table thead{background:#e4e7dd}
.stats-table tbody th{font-weight:500}
.stats-table tbody tr:nth-child(even){background:#eceee5}

/* Vocabulary is independent of interface language; keep controls on one row. */
#word-language{width:74px;flex:none;margin-left:6px;font-size:20px;background-color:var(--paper);border:1px solid var(--line)}
#word-length{width:80px;font-size:12px}
.modes button{font-size:11px;padding-left:2px;padding-right:2px}
#modal #settings-words{width:74px;font-size:20px}

.tile.editable{cursor:text}.tile.selected{outline:2px solid var(--ink);outline-offset:-2px;background:#e9eae1}
