.word-search-dialog{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;overflow:hidden;color:#42260f;background:#9a5626}
.word-search-dialog::backdrop{background:#39220fbb}
.ws-screen{position:relative;box-sizing:border-box;width:100%;height:100%;display:grid;place-items:center;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:var(--ws-scene) center/cover no-repeat}
.ws-window{position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:8px;width:100%;height:100%;min-height:0;padding:clamp(8px,2vmin,20px);overflow:hidden;touch-action:manipulation}
.ws-header{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:none;min-height:44px;color:#fff3d4;text-shadow:0 1px 3px #4b2511}
.ws-header h1{font:700 clamp(20px,3vmin,30px)/1.05 Georgia,serif;margin:0}.ws-header small{font-size:10px;font-weight:800;letter-spacing:.1em}
.ws-close,.ws-help{box-sizing:border-box;min-width:44px;min-height:44px;border:1px solid #b88845;border-radius:9px;background:#fff1d4f5;color:#513118;font:700 14px/1.1 system-ui;cursor:pointer;touch-action:manipulation}
.ws-close{font-size:27px;padding:0;width:44px;height:44px}.ws-header-actions{display:flex;align-items:center;gap:5px;flex:none}.ws-icon{width:44px;padding:0;font-size:25px}.ws-icon img{width:42px;height:42px;object-fit:contain}.ws-words-toggle{padding:4px 8px}
.ws-game-heading{min-width:0}.ws-game-heading h1{font-size:23px}.ws-mini-status{display:flex;gap:12px;font:700 12px/1.2 system-ui;font-variant-numeric:tabular-nums;margin-top:2px}
.ws-playing .ws-play-header{min-height:46px;padding-inline:2px}
.ws-board-wrap{display:grid;place-items:center;flex:1;min-height:0;min-width:0;width:100%;overflow:visible}
.ws-grid{position:relative;isolation:isolate;display:grid;grid-template-columns:repeat(var(--ws-cols,16),minmax(0,1fr));grid-template-rows:repeat(var(--ws-cols,16),minmax(0,1fr));box-sizing:border-box;width:var(--ws-board-width,100%);height:var(--ws-board-height,100%);max-width:100%;max-height:100%;min-width:0;min-height:0;padding:6px;border:1px solid #c4a16a;border-radius:3px;gap:0;background:radial-gradient(ellipse at 30% 20%,#fff9e9aa,transparent 70%),linear-gradient(105deg,#f4dba9,#fff1cd 45%,#f0d299);box-shadow:0 3px 8px #47240c77,inset 0 0 0 3px #f8e4bc,inset 0 0 28px #b8863b22;touch-action:none;user-select:none;-webkit-user-select:none}
.ws-cell{position:relative;z-index:1;box-sizing:border-box;display:grid;place-items:center;min-width:0;min-height:0;width:100%;height:100%;margin:0;padding:0;border:0;border-right:1px solid #90673455;border-bottom:1px solid #90673455;border-radius:0;background:transparent;color:#3d220d;font:700 clamp(12px,calc(var(--ws-cell,22px)*.72),30px)/1 Georgia,'Times New Roman',serif;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;text-shadow:0 1px #fff5d744}
.ws-cell.is-found,.ws-cell.is-selecting{background:transparent;box-shadow:none;transform:none;color:#3d220d}
.ws-ink{position:absolute;z-index:0;inset:6px;width:calc(100% - 12px);height:calc(100% - 12px);overflow:visible;pointer-events:none}.ws-ink line{opacity:.47;mix-blend-mode:multiply}
.ws-word-strip{flex:none;min-height:36px;height:36px;min-width:0}.ws-word-list{display:flex;flex-wrap:nowrap;align-items:center;gap:5px;min-height:0;height:100%;max-width:100%;overflow:auto;scrollbar-width:thin;touch-action:pan-x;padding:0}
.ws-word{flex:none;min-height:32px;padding:4px 9px;border:1px solid #d0ad72;border-radius:5px;background:#fff0cfe8;color:#51351b;font:700 13px/1.1 system-ui;cursor:pointer;white-space:nowrap}.ws-word.is-found{text-decoration:line-through;color:#775d3f;opacity:.65;background:#e9d5af}
.ws-playing.ws-words-open .ws-word-list{position:absolute;z-index:7;top:60px;left:8px;right:8px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;height:auto;max-height:calc(100% - 70px);overflow:auto;padding:10px;border:1px solid #ba8c4f;border-radius:8px;background:#fff1d5;box-shadow:0 4px 18px #3c200c77;touch-action:pan-y}.ws-words-open .ws-word{min-width:0;white-space:normal;min-height:40px}.ws-word-hide{grid-column:1/-1}
.ws-live{color:#fff3d9;font:600 13px/1.3 system-ui;text-align:center;flex:none;min-height:18px}.ws-play-live{position:absolute!important;width:1px;height:1px;min-height:0;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ws-options{position:absolute;z-index:8;right:8px;top:60px;display:flex;flex-direction:column;gap:8px;width:min(260px,calc(100% - 16px));max-height:calc(100% - 70px);box-sizing:border-box;overflow:auto;padding:14px;background:#fff1d5;border:1px solid #ba8c4f;border-radius:8px;box-shadow:0 4px 18px #3c200c77}
.ws-found-pop{position:absolute;z-index:5;top:60px;left:50%;transform:translateX(-50%);max-width:80%;padding:6px 14px;border:1px solid #b9873c;border-radius:20px;background:#fff0cfe8;color:#513019;font:700 14px system-ui;box-shadow:0 2px 8px #4c290d44;pointer-events:none}.ws-found-pop img,.ws-found-pop .ws-object-emoji{display:none}
.ws-star-layer{position:absolute;z-index:5;inset:0;overflow:hidden;pointer-events:none}.ws-star-layer span{position:absolute;left:var(--star-x);top:45%;color:#ffe28a;font-size:28px;animation:ws-star-fly .9s ease-out both;animation-delay:var(--star-delay)}@keyframes ws-star-fly{to{translate:0 -85px;opacity:0}}
.ws-intro{display:flex;flex:1;min-height:0;flex-direction:column;align-items:center;gap:8px;overflow:auto;padding:12px;background:#fff1d5ed;border:1px solid #bd9458;border-radius:8px;text-align:center}.ws-intro-art,.ws-counts{display:none}.ws-intro h2{font:700 clamp(21px,3vmin,30px) Georgia,serif;margin:0}.ws-intro h3{margin:2px;font-size:13px}.ws-intro p{max-width:46ch;margin:0;font-size:14px;line-height:1.4}
.ws-topics{display:grid;grid-template-columns:repeat(auto-fit,minmax(115px,1fr));gap:7px;width:100%;min-height:100px;overflow:auto;flex:1}.ws-topic{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:60px;padding:8px;border:1px solid #d1b47c;border-radius:6px;background:#fffaed;color:#4d351d;font:700 12px system-ui;cursor:pointer}.ws-topic>span{font-size:25px}.ws-topic.selected{border:2px solid #a66a24;background:#f7dfaa}
.ws-start,.ws-again,.ws-thanks{min-height:46px;padding:10px 22px;border:1px solid #8f5a2a;border-radius:8px;background:#a56e36;color:#fff8e8;font:700 17px system-ui;cursor:pointer}.ws-thanks{background:#fff0d2;color:#553a1c}.ws-win{display:flex;flex:1;min-height:0;overflow:auto;flex-direction:column;justify-content:center;align-items:center;gap:12px;margin:auto;padding:24px;max-width:660px;box-sizing:border-box;background:#fff1d5ed;border:1px solid #bd9458;border-radius:8px;text-align:center}.ws-win h2{margin:0;font:700 30px Georgia,serif}.ws-win p{margin:0;line-height:1.4}.ws-win-stars{font-size:35px;color:#b98322}.ws-win-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.ws-window [hidden]{display:none!important}.ws-window button:focus-visible{outline:3px solid #db9f3a;outline-offset:1px}
@media(orientation:landscape) and (min-width:620px){.word-search-dialog .ws-playing{display:grid;grid-template-columns:minmax(0,1fr) clamp(175px,28vw,290px);grid-template-rows:46px minmax(0,1fr);column-gap:16px}.ws-playing .ws-play-header{grid-column:1/-1;grid-row:1}.ws-playing .ws-board-wrap{grid-column:1;grid-row:2;align-self:stretch}.ws-playing .ws-word-strip{grid-column:2;grid-row:2;height:100%;min-height:0;padding:10px;box-sizing:border-box;border:1px solid #c09b61;border-radius:5px;background:#fff1d5ee}.ws-playing .ws-word-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:5px;overflow:auto;touch-action:pan-y}.ws-playing .ws-word{min-width:0;min-height:32px;font-size:12px;padding-inline:3px}.ws-playing .ws-words-toggle{display:none}.ws-playing .ws-game-heading{display:flex;align-items:center;gap:20px}.ws-mini-status{margin:0}.ws-topics{grid-template-columns:repeat(5,minmax(0,1fr))}.ws-intro h2,.ws-intro>h3{display:none}}
@media(max-width:370px){.ws-window{padding:5px;gap:5px}.ws-game-heading h1{font-size:18px}.ws-mini-status{font-size:11px;gap:6px}.ws-header-actions{gap:3px}.ws-words-toggle{font-size:11px;min-width:48px;padding-inline:4px}}
@media(prefers-reduced-motion:reduce){.ws-star-layer span{animation:none}}
